about summary refs log tree commit diff stats
path: root/apworld/client/maps/the_parthenon.gd
blob: 96510da594edad6cb3011cede865665eb06c4ea5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
func on_map_load(root):
	var ap = global.get_node("Archipelago")

	# Add the strict cyan ending validation.
	if ap.strict_cyan_ending:
		var panel_prefab = preload("res://objects/nodes/panel.tscn")
		var tpl_prefab = preload("res://objects/nodes/listeners/teleportListener.tscn")
		var reverse_prefab = preload("res://objects/nodes/listeners/reversingListener.tscn")

		var previous_panel = null
		var next_y = -100
		var words = ["quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"]
		for word in words:
			var panel = panel_prefab.instantiate()
			panel.position = Vector3(0, next_y, 0)
			next_y -= 10
			panel.clue = word
			panel.symbol = "."
			panel.answer = "%s%s" % [word, word]
			panel.name = "EndCheck_%s" % word

			var tpl = tpl_prefab.instantiate()
			tpl.teleport_point = Vector3(0, 1, -11)
			tpl.teleport_rotate = Vector3(-45, 0, 0)
			tpl.target_path = panel
			tpl.name = "Teleport"

			if previous_panel == null:
				tpl.senderGroup.append(NodePath("/root/scene/Panels/Rulers"))
			else:
				tpl.senders.append(NodePath("../../%s" % previous_panel.name))

			var reversing = reverse_prefab.instantiate()
			reversing.senders.append(NodePath(".."))
			reversing.name = "Reversing"
			tpl.senders.append(NodePath("../Reversing"))

			panel.add_child.call_deferred(tpl)
			panel.add_child.call_deferred(reversing)
			root.get_node("/root/scene/Panels").add_child.call_deferred(panel)

			previous_panel = panel

		# Duplicate the door that usually waits on the rulers. We can't set the
		# senders here for some reason so we actually set them in the door ready
		# function.
		var entry1 = root.get_node("/root/scene/Components/Doors/entry_1")
		var entry12 = entry1.duplicate()
		entry12.name = "spe_entry_1"
		entry1.get_parent().add_child.call_deferred(entry12)
		entry1.queue_free()