diff options
-rw-r--r-- | Archipelago/client.gd | 53 | ||||
-rw-r--r-- | Archipelago/load.gd | 87 | ||||
-rw-r--r-- | Archipelago/mypainting.gd | 5 | ||||
-rw-r--r-- | Archipelago/painting.gd | 10 | ||||
-rw-r--r-- | Archipelago/painting_eye.gd | 16 | ||||
-rw-r--r-- | Archipelago/painting_scenery.gd | 10 | ||||
-rw-r--r-- | Archipelago/panel.gd | 2 | ||||
-rw-r--r-- | Archipelago/pilgrimage_terminator.gd | 11 | ||||
-rw-r--r-- | Archipelago/settings_screen.gd | 2 | ||||
-rw-r--r-- | Archipelago/teleport.gd | 19 | ||||
-rw-r--r-- | util/generate_gamedata.rb | 28 |
11 files changed, 223 insertions, 20 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index d93b2ed..2aa4697 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd | |||
@@ -7,6 +7,7 @@ var SCRIPT_multiplayer | |||
7 | var SCRIPT_mypainting | 7 | var SCRIPT_mypainting |
8 | var SCRIPT_notifier | 8 | var SCRIPT_notifier |
9 | var SCRIPT_panel | 9 | var SCRIPT_panel |
10 | var SCRIPT_pilgrimage_terminator | ||
10 | var SCRIPT_uuid | 11 | var SCRIPT_uuid |
11 | 12 | ||
12 | var ap_server = "" | 13 | var ap_server = "" |
@@ -42,7 +43,7 @@ const progressive_items = { | |||
42 | ], | 43 | ], |
43 | "Progressive Hallway Room": | 44 | "Progressive Hallway Room": |
44 | [ | 45 | [ |
45 | {"item": "Outside The Agreeable - Hallway Door", "display": "First Door"}, | 46 | {"item": "Hallway Room (1) - Exit", "display": "First Door"}, |
46 | {"item": "Hallway Room (2) - Exit", "display": "Second Door"}, | 47 | {"item": "Hallway Room (2) - Exit", "display": "Second Door"}, |
47 | {"item": "Hallway Room (3) - Exit", "display": "Third Door"}, | 48 | {"item": "Hallway Room (3) - Exit", "display": "Third Door"}, |
48 | {"item": "Hallway Room (4) - Exit", "display": "Fourth Door"}, | 49 | {"item": "Hallway Room (4) - Exit", "display": "Fourth Door"}, |
@@ -67,18 +68,19 @@ const progressive_items = { | |||
67 | ], | 68 | ], |
68 | "Progressive Pilgrimage": | 69 | "Progressive Pilgrimage": |
69 | [ | 70 | [ |
70 | {"item": "Hub Room - 1 Sunwarp", "display": "1 Sunwarp"}, | 71 | {"item": "1 Sunwarp", "display": "1 Sunwarp"}, |
71 | {"item": "Orange Tower Fourth Floor - 2 Sunwarp", "display": "2 Sunwarp"}, | 72 | {"item": "2 Sunwarp", "display": "2 Sunwarp"}, |
72 | {"item": "Orange Tower Third Floor - 3 Sunwarp", "display": "3 Sunwarp"}, | 73 | {"item": "3 Sunwarp", "display": "3 Sunwarp"}, |
73 | {"item": "Orange Tower First Floor - 4 Sunwarp", "display": "4 Sunwarp"}, | 74 | {"item": "4 Sunwarp", "display": "4 Sunwarp"}, |
74 | {"item": "Orange Tower Fourth Floor - 5 Sunwarp", "display": "5 Sunwarp"}, | 75 | {"item": "5 Sunwarp", "display": "5 Sunwarp"}, |
75 | {"item": "Outside The Agreeable - 6 Sunwarp", "display": "6 Sunwarp"}, | 76 | {"item": "6 Sunwarp", "display": "6 Sunwarp"}, |
76 | ] | 77 | ] |
77 | } | 78 | } |
78 | 79 | ||
79 | const kTHE_END = 0 | 80 | const kTHE_END = 0 |
80 | const kTHE_MASTER = 1 | 81 | const kTHE_MASTER = 1 |
81 | const kLEVEL_2 = 2 | 82 | const kLEVEL_2 = 2 |
83 | const kPILGRIMAGE = 3 | ||
82 | 84 | ||
83 | const kNO_PANEL_SHUFFLE = 0 | 85 | const kNO_PANEL_SHUFFLE = 0 |
84 | const kREARRANGE_PANELS = 1 | 86 | const kREARRANGE_PANELS = 1 |
@@ -94,7 +96,8 @@ const kCLASSIFICATION_REMOTE_INSANITY = 2 | |||
94 | const kSUNWARP_ACCESS_NORMAL = 0 | 96 | const kSUNWARP_ACCESS_NORMAL = 0 |
95 | const kSUNWARP_ACCESS_DISABLED = 1 | 97 | const kSUNWARP_ACCESS_DISABLED = 1 |
96 | const kSUNWARP_ACCESS_UNLOCK = 2 | 98 | const kSUNWARP_ACCESS_UNLOCK = 2 |
97 | const kSUNWARP_ACCESS_PROGRESSIVE = 3 | 99 | const kSUNWARP_ACCESS_INDIVIDUAL = 3 |
100 | const kSUNWARP_ACCESS_PROGRESSIVE = 4 | ||
98 | 101 | ||
99 | var _client = WebSocketClient.new() | 102 | var _client = WebSocketClient.new() |
100 | var _should_process = false | 103 | var _should_process = false |
@@ -133,6 +136,12 @@ var _mastery_achievements = 21 | |||
133 | var _level_2_requirement = 223 | 136 | var _level_2_requirement = 223 |
134 | var _location_classification_bit = 0 | 137 | var _location_classification_bit = 0 |
135 | var _early_color_hallways = false | 138 | var _early_color_hallways = false |
139 | var _pilgrimage_compatibility = false # set to true for pre-0.4.6 | ||
140 | var _pilgrimage_enabled = false | ||
141 | var _pilgrimage_allows_roof_access = false | ||
142 | var _pilgrimage_allows_paintings = false | ||
143 | var _sunwarp_shuffle = false | ||
144 | var _sunwarp_mapping = [] | ||
136 | var _slot_seed = 0 | 145 | var _slot_seed = 0 |
137 | 146 | ||
138 | var _map_loaded = false | 147 | var _map_loaded = false |
@@ -305,6 +314,8 @@ func _on_data(): | |||
305 | _panel_shuffle = _slot_data["shuffle_panels"] | 314 | _panel_shuffle = _slot_data["shuffle_panels"] |
306 | if _slot_data.has("sunwarp_access"): | 315 | if _slot_data.has("sunwarp_access"): |
307 | _sunwarp_access = _slot_data["sunwarp_access"] | 316 | _sunwarp_access = _slot_data["sunwarp_access"] |
317 | else: | ||
318 | _sunwarp_access = kSUNWARP_ACCESS_NORMAL | ||
308 | if _slot_data.has("seed"): | 319 | if _slot_data.has("seed"): |
309 | _slot_seed = _slot_data["seed"] | 320 | _slot_seed = _slot_data["seed"] |
310 | if _slot_data.has("painting_entrance_to_exit"): | 321 | if _slot_data.has("painting_entrance_to_exit"): |
@@ -322,6 +333,25 @@ func _on_data(): | |||
322 | _location_classification_bit = kCLASSIFICATION_LOCAL_INSANITY | 333 | _location_classification_bit = kCLASSIFICATION_LOCAL_INSANITY |
323 | if _slot_data.has("early_color_hallways"): | 334 | if _slot_data.has("early_color_hallways"): |
324 | _early_color_hallways = _slot_data["early_color_hallways"] | 335 | _early_color_hallways = _slot_data["early_color_hallways"] |
336 | if _slot_data.has("enable_pilgrimage"): | ||
337 | _pilgrimage_enabled = _slot_data["enable_pilgrimage"] | ||
338 | else: | ||
339 | _pilgrimage_compatibility = true | ||
340 | _pilgrimage_enabled = true | ||
341 | if _slot_data.has("pilgrimage_allows_roof_access"): | ||
342 | _pilgrimage_allows_roof_access = _slot_data["pilgrimage_allows_roof_access"] | ||
343 | else: | ||
344 | _pilgrimage_allows_roof_access = true | ||
345 | if _slot_data.has("pilgrimage_allows_paintings"): | ||
346 | _pilgrimage_allows_paintings = _slot_data["pilgrimage_allows_paintings"] | ||
347 | else: | ||
348 | _pilgrimage_allows_paintings = true | ||
349 | if _slot_data.has("shuffle_sunwarps"): | ||
350 | _sunwarp_shuffle = _slot_data["shuffle_sunwarps"] | ||
351 | else: | ||
352 | _sunwarp_shuffle = false | ||
353 | if _slot_data.has("sunwarp_permutation"): | ||
354 | _sunwarp_mapping = _slot_data["sunwarp_permutation"] | ||
325 | 355 | ||
326 | if track_player: | 356 | if track_player: |
327 | setValue("PlayerPos", {"x": 0, "z": 0}) | 357 | setValue("PlayerPos", {"x": 0, "z": 0}) |
@@ -704,7 +734,12 @@ func processItem(item, index, from, flags): | |||
704 | painting_node = fake_parent_node.get_node_or_null(painting_id) | 734 | painting_node = fake_parent_node.get_node_or_null(painting_id) |
705 | if painting_node != null: | 735 | if painting_node != null: |
706 | painting_node.get_node("Script").movePainting() | 736 | painting_node.get_node("Script").movePainting() |
707 | 737 | ||
738 | if gamedata.warp_ids_by_item_id.has(int(item)): | ||
739 | var warpsNode = get_tree().get_root().get_node("Spatial/Warps") | ||
740 | for warp_id in gamedata.warp_ids_by_item_id[int(item)]: | ||
741 | warpsNode.get_node(warp_id).unlock_warp() | ||
742 | |||
708 | if gamedata.warp_ids_by_item_id.has(int(item)): | 743 | if gamedata.warp_ids_by_item_id.has(int(item)): |
709 | var warpsNode = get_tree().get_root().get_node("Spatial/Warps") | 744 | var warpsNode = get_tree().get_root().get_node("Spatial/Warps") |
710 | for warp_id in gamedata.warp_ids_by_item_id[int(item)]: | 745 | for warp_id in gamedata.warp_ids_by_item_id[int(item)]: |
diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 27e70b7..0ed978a 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd | |||
@@ -354,6 +354,8 @@ func _load(): | |||
354 | victory_condition = "the master" | 354 | victory_condition = "the master" |
355 | elif apclient._victory_condition == apclient.kLEVEL_2: | 355 | elif apclient._victory_condition == apclient.kLEVEL_2: |
356 | victory_condition = "level 2" | 356 | victory_condition = "level 2" |
357 | elif apclient._victory_condition == apclient.kPILGRIMAGE: | ||
358 | victory_condition = "pilgrimage" | ||
357 | 359 | ||
358 | set_static_panel("Entry Room/Panel_this_this", victory_condition) | 360 | set_static_panel("Entry Room/Panel_this_this", victory_condition) |
359 | set_static_panel("Entry Room/Panel_hidden_hidden", "hewwo") | 361 | set_static_panel("Entry Room/Panel_hidden_hidden", "hewwo") |
@@ -583,11 +585,84 @@ func _load(): | |||
583 | level_2.get_node("Viewport/GUI/Panel/TextEdit").connect( | 585 | level_2.get_node("Viewport/GUI/Panel/TextEdit").connect( |
584 | "answer_correct", apclient, "completedGoal" | 586 | "answer_correct", apclient, "completedGoal" |
585 | ) | 587 | ) |
588 | elif apclient._victory_condition == apclient.kPILGRIMAGE: | ||
589 | var pilgrim_panel = self.get_node("Panels/Lingo Room/Panel_pilgrim") | ||
590 | pilgrim_panel.get_node("Viewport/GUI/Panel/TextEdit").connect( | ||
591 | "answer_correct", apclient, "completedGoal" | ||
592 | ) | ||
586 | else: | 593 | else: |
587 | var the_end = self.get_node("Decorations/EndPanel/Panel_end_end") | 594 | var the_end = self.get_node("Decorations/EndPanel/Panel_end_end") |
588 | the_end.get_node("Viewport/GUI/Panel/TextEdit").connect( | 595 | the_end.get_node("Viewport/GUI/Panel/TextEdit").connect( |
589 | "answer_correct", apclient, "completedGoal" | 596 | "answer_correct", apclient, "completedGoal" |
590 | ) | 597 | ) |
598 | |||
599 | # If pilgrimage does not allow roof access, add a node on the Crossroads | ||
600 | # Roof Access stairs that disables it. | ||
601 | if !apclient._pilgrimage_allows_roof_access: | ||
602 | var terminator = apclient.SCRIPT_pilgrimage_terminator.new() | ||
603 | terminator.name = "RoofAccessPilgrimageTerminator" | ||
604 | terminator.translation.x = -36 | ||
605 | terminator.translation.y = 3 | ||
606 | terminator.translation.z = -35 | ||
607 | |||
608 | var terminator_shape = CollisionShape.new() | ||
609 | terminator_shape.shape = BoxShape.new() | ||
610 | terminator_shape.shape.extents.x = 0.1 | ||
611 | |||
612 | terminator.add_child(terminator_shape) | ||
613 | get_node("Decorations").add_child(terminator) | ||
614 | |||
615 | if apclient._sunwarp_shuffle: | ||
616 | # Sunwarps 1 and 6 are rotated differently from the rest, so we have to fix that. | ||
617 | get_node("Decorations/Teleporter Windows/localmap").rotation_degrees.y = 0 | ||
618 | get_node("Decorations/Teleporter Windows/localmap2").rotation_degrees.y = 0 | ||
619 | get_node("Decorations/Teleporter Windows/localmap11").rotation_degrees.y = 0 | ||
620 | get_node("Decorations/Teleporter Windows/localmap12").rotation_degrees.y = 0 | ||
621 | get_node("Decorations/Teleporter Windows/localmap13").rotation_degrees.y = -90 | ||
622 | |||
623 | get_node("Warps/Teleporter Warps/Sunwarp_enter_1").translation.x = 19.5 | ||
624 | get_node("Warps/Teleporter Warps/Sunwarp_exit_1").translation.x = -15.5 | ||
625 | get_node("Warps/Teleporter Warps/Sunwarp_enter_6").translation.x = 4.5 | ||
626 | get_node("Warps/Teleporter Warps/Sunwarp_exit_6").translation.x = -37.5 | ||
627 | get_node("Warps/Teleporter Warps/Sunwarp_exit_7").translation.z = 23.5 | ||
628 | |||
629 | # Change the sunwarps in accordance with the mapping. | ||
630 | var sw_orig_translations = [] | ||
631 | var sw_text_translations = [] | ||
632 | var sw_text_rotations = [] | ||
633 | for i in range(1,7): | ||
634 | sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation) | ||
635 | sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation) | ||
636 | sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees) | ||
637 | for i in range(1,7): | ||
638 | sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation) | ||
639 | sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation) | ||
640 | sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees) | ||
641 | |||
642 | var sw_enter_indicators = [4, 5, 6, 12, 7, 10] | ||
643 | for i in range(1,7): | ||
644 | get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation = sw_orig_translations[apclient._sunwarp_mapping[i-1]] | ||
645 | get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation = sw_orig_translations[apclient._sunwarp_mapping[i+5]] | ||
646 | |||
647 | get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation = sw_text_translations[apclient._sunwarp_mapping[i-1]] | ||
648 | get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees = sw_text_rotations[apclient._sunwarp_mapping[i-1]] | ||
649 | |||
650 | get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation = sw_text_translations[apclient._sunwarp_mapping[i+5]] | ||
651 | get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees = sw_text_rotations[apclient._sunwarp_mapping[i+5]] | ||
652 | |||
653 | var enter_rot = _dir_to_int(gamedata.sunwarps[apclient._sunwarp_mapping[i-1]]["orientation"]) * 90 | ||
654 | var exit_rot = _dir_to_int(gamedata.sunwarps[apclient._sunwarp_mapping[i+5]]["orientation"]) * 90 | ||
655 | var final_rot = enter_rot - exit_rot | ||
656 | if final_rot < 0: | ||
657 | final_rot += 360 | ||
658 | get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).rotate = str(final_rot) | ||
659 | |||
660 | var sw_enter_indicator_pos = gamedata.sunwarps[apclient._sunwarp_mapping[i-1]]["entrance_indicator_pos"] | ||
661 | var sw_enter_indicator = get_node("Decorations/Signs/Welcome Back Signs/Sign%d" % sw_enter_indicators[i-1]) | ||
662 | sw_enter_indicator.translation.x = sw_enter_indicator_pos[0] | ||
663 | sw_enter_indicator.translation.y = sw_enter_indicator_pos[1] | ||
664 | sw_enter_indicator.translation.z = sw_enter_indicator_pos[2] | ||
665 | sw_enter_indicator.rotation_degrees.y = (enter_rot * -1) + 180 | ||
591 | 666 | ||
592 | # Create the effects node. | 667 | # Create the effects node. |
593 | var effects_script = apclient.SCRIPT_effects | 668 | var effects_script = apclient.SCRIPT_effects |
@@ -718,3 +793,15 @@ func set_small_gridmap_tile(x, y, z, tile): | |||
718 | 793 | ||
719 | func archipelago_disconnected(reason): | 794 | func archipelago_disconnected(reason): |
720 | messages.showMessage(reason) | 795 | messages.showMessage(reason) |
796 | |||
797 | |||
798 | func _dir_to_int(dir): | ||
799 | if dir == "north": | ||
800 | return 0 | ||
801 | elif dir == "west": | ||
802 | return 1 | ||
803 | elif dir == "south": | ||
804 | return 2 | ||
805 | elif dir == "east": | ||
806 | return 3 | ||
807 | return 4 | ||
diff --git a/Archipelago/mypainting.gd b/Archipelago/mypainting.gd index 5e9c703..999b122 100644 --- a/Archipelago/mypainting.gd +++ b/Archipelago/mypainting.gd | |||
@@ -86,6 +86,11 @@ func _looked_at(body, painting): | |||
86 | body.rotate_y(3 * PI / 2) | 86 | body.rotate_y(3 * PI / 2) |
87 | body.velocity = body.velocity.rotated(Vector3(0, 1, 0), 3 * PI / 2) | 87 | body.velocity = body.velocity.rotated(Vector3(0, 1, 0), 3 * PI / 2) |
88 | 88 | ||
89 | var apclient = global.get_node("Archipelago") | ||
90 | if !apclient._pilgrimage_allows_paintings: | ||
91 | global.sunwarp = 1 | ||
92 | body.get_node("pivot/camera/sunwarp_background").visible = false | ||
93 | |||
89 | 94 | ||
90 | func _dir_to_int(dir): | 95 | func _dir_to_int(dir): |
91 | if dir == "north": | 96 | if dir == "north": |
diff --git a/Archipelago/painting.gd b/Archipelago/painting.gd new file mode 100644 index 0000000..adc8337 --- /dev/null +++ b/Archipelago/painting.gd | |||
@@ -0,0 +1,10 @@ | |||
1 | extends "res://scripts/painting.gd" | ||
2 | |||
3 | func _looked_at(var body, var painting): | ||
4 | ._looked_at(body, painting) | ||
5 | |||
6 | if body.is_in_group("player") && (painting.get_name() == self.get_name()): | ||
7 | var apclient = global.get_node("Archipelago") | ||
8 | if !apclient._pilgrimage_allows_paintings: | ||
9 | global.sunwarp = 1 | ||
10 | body.get_node("pivot/camera/sunwarp_background").visible = false | ||
diff --git a/Archipelago/painting_eye.gd b/Archipelago/painting_eye.gd index 53d42b5..b2e6973 100644 --- a/Archipelago/painting_eye.gd +++ b/Archipelago/painting_eye.gd | |||
@@ -3,9 +3,23 @@ extends "res://scripts/painting_eye.gd" | |||
3 | 3 | ||
4 | func _answer_correct(): | 4 | func _answer_correct(): |
5 | var apclient = global.get_node("Archipelago") | 5 | var apclient = global.get_node("Archipelago") |
6 | if not apclient._door_shuffle or apclient.paintingIsVanilla(self.name): | 6 | if !apclient._pilgrimage_compatibility and get_name() == "pilgrim_painting2": |
7 | # When pilgrimage is enabled, the HOT CRUST panel should actually move the sun painting. | ||
8 | if apclient._pilgrimage_enabled: | ||
9 | movePainting() | ||
10 | elif not apclient._door_shuffle or apclient.paintingIsVanilla(self.name): | ||
7 | ._answer_correct() | 11 | ._answer_correct() |
8 | 12 | ||
9 | 13 | ||
10 | func movePainting(): | 14 | func movePainting(): |
11 | ._answer_correct() | 15 | ._answer_correct() |
16 | |||
17 | |||
18 | func _looked_at(var body, var painting): | ||
19 | ._looked_at(body, painting) | ||
20 | |||
21 | if body.is_in_group("player") && (painting.get_name() == self.get_name()): | ||
22 | var apclient = global.get_node("Archipelago") | ||
23 | if !apclient._pilgrimage_allows_paintings: | ||
24 | global.sunwarp = 1 | ||
25 | body.get_node("pivot/camera/sunwarp_background").visible = false | ||
diff --git a/Archipelago/painting_scenery.gd b/Archipelago/painting_scenery.gd index f49d602..1186e2f 100644 --- a/Archipelago/painting_scenery.gd +++ b/Archipelago/painting_scenery.gd | |||
@@ -9,3 +9,13 @@ func _answer_correct(): | |||
9 | 9 | ||
10 | func movePainting(): | 10 | func movePainting(): |
11 | ._answer_correct() | 11 | ._answer_correct() |
12 | |||
13 | |||
14 | func _looked_at(var body, var painting): | ||
15 | ._looked_at(body, painting) | ||
16 | |||
17 | if body.is_in_group("player") && (painting.get_name() == self.get_name()): | ||
18 | var apclient = global.get_node("Archipelago") | ||
19 | if !apclient._pilgrimage_allows_paintings: | ||
20 | global.sunwarp = 1 | ||
21 | body.get_node("pivot/camera/sunwarp_background").visible = false | ||
diff --git a/Archipelago/panel.gd b/Archipelago/panel.gd index aec18e8..fc5963a 100644 --- a/Archipelago/panel.gd +++ b/Archipelago/panel.gd | |||
@@ -22,7 +22,7 @@ func _ready(): | |||
22 | else: | 22 | else: |
23 | atbash_text += old_char | 23 | atbash_text += old_char |
24 | 24 | ||
25 | self.get_parent().get_node("Viewport/GUI/Panel/TextEdit").connect( | 25 | var _ignore = self.get_parent().get_node("Viewport/GUI/Panel/TextEdit").connect( |
26 | "answer_correct", self, "answer_correct" | 26 | "answer_correct", self, "answer_correct" |
27 | ) | 27 | ) |
28 | 28 | ||
diff --git a/Archipelago/pilgrimage_terminator.gd b/Archipelago/pilgrimage_terminator.gd new file mode 100644 index 0000000..29db2ee --- /dev/null +++ b/Archipelago/pilgrimage_terminator.gd | |||
@@ -0,0 +1,11 @@ | |||
1 | extends Area | ||
2 | |||
3 | |||
4 | func _ready(): | ||
5 | var _connected = self.connect("body_entered", self, "_body_entered") | ||
6 | |||
7 | |||
8 | func _body_entered(body): | ||
9 | if body.is_in_group("player"): | ||
10 | global.sunwarp = 1 | ||
11 | body.get_node("pivot/camera/sunwarp_background").visible = false | ||
diff --git a/Archipelago/settings_screen.gd b/Archipelago/settings_screen.gd index dce9b70..bf2c78f 100644 --- a/Archipelago/settings_screen.gd +++ b/Archipelago/settings_screen.gd | |||
@@ -30,6 +30,7 @@ func _ready(): | |||
30 | apclient_instance.SCRIPT_mypainting = load("user://maps/Archipelago/mypainting.gd") | 30 | apclient_instance.SCRIPT_mypainting = load("user://maps/Archipelago/mypainting.gd") |
31 | apclient_instance.SCRIPT_notifier = load("user://maps/Archipelago/notifier.gd") | 31 | apclient_instance.SCRIPT_notifier = load("user://maps/Archipelago/notifier.gd") |
32 | apclient_instance.SCRIPT_panel = load("user://maps/Archipelago/panel.gd") | 32 | apclient_instance.SCRIPT_panel = load("user://maps/Archipelago/panel.gd") |
33 | apclient_instance.SCRIPT_pilgrimage_terminator = load("user://maps/Archipelago/pilgrimage_terminator.gd") | ||
33 | apclient_instance.SCRIPT_uuid = load("user://maps/Archipelago/vendor/uuid.gd") | 34 | apclient_instance.SCRIPT_uuid = load("user://maps/Archipelago/vendor/uuid.gd") |
34 | 35 | ||
35 | var apdata = ResourceLoader.load("user://maps/Archipelago/gamedata.gd") | 36 | var apdata = ResourceLoader.load("user://maps/Archipelago/gamedata.gd") |
@@ -45,6 +46,7 @@ func _ready(): | |||
45 | # Let's also inject any scripts we need to inject now. | 46 | # Let's also inject any scripts we need to inject now. |
46 | installScriptExtension(apclient_instance.SCRIPT_doorControl) | 47 | installScriptExtension(apclient_instance.SCRIPT_doorControl) |
47 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/load.gd")) | 48 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/load.gd")) |
49 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/painting.gd")) | ||
48 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/painting_eye.gd")) | 50 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/painting_eye.gd")) |
49 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/painting_scenery.gd")) | 51 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/painting_scenery.gd")) |
50 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/panelLevelSwitch.gd")) | 52 | installScriptExtension(ResourceLoader.load("user://maps/Archipelago/panelLevelSwitch.gd")) |
diff --git a/Archipelago/teleport.gd b/Archipelago/teleport.gd index d322722..532f081 100644 --- a/Archipelago/teleport.gd +++ b/Archipelago/teleport.gd | |||
@@ -5,20 +5,23 @@ var _unlocked = true | |||
5 | 5 | ||
6 | func _ready(): | 6 | func _ready(): |
7 | var apclient = global.get_node("Archipelago") | 7 | var apclient = global.get_node("Archipelago") |
8 | if apclient._door_shuffle and !apclient.warpIsVanilla(self.get_parent().name + "/" + self.name): | 8 | if self.get_parent().name == "Teleporter Warps": |
9 | if self.get_parent().name == "Teleporter Warps": | 9 | if apclient._sunwarp_access != apclient.kSUNWARP_ACCESS_NORMAL: |
10 | if apclient._sunwarp_access != apclient.kSUNWARP_ACCESS_NORMAL: | ||
11 | _unlocked = false | ||
12 | else: | ||
13 | _unlocked = false | 10 | _unlocked = false |
11 | elif apclient._door_shuffle and !apclient.warpIsVanilla(self.get_parent().name + "/" + self.name): | ||
12 | _unlocked = false | ||
14 | 13 | ||
15 | ._ready() | ||
16 | 14 | ||
17 | 15 | func _body_entered(body): | |
18 | func _body_entered(var body): | ||
19 | if _unlocked: | 16 | if _unlocked: |
20 | ._body_entered(body) | 17 | ._body_entered(body) |
21 | 18 | ||
19 | if body.is_in_group("player"): | ||
20 | var apclient = global.get_node("Archipelago") | ||
21 | if !apclient._pilgrimage_enabled: | ||
22 | global.sunwarp = 1 | ||
23 | body.get_node("pivot/camera/sunwarp_background").visible = false | ||
24 | |||
22 | 25 | ||
23 | func unlock_warp(): | 26 | func unlock_warp(): |
24 | _unlocked = true | 27 | _unlocked = true |
diff --git a/util/generate_gamedata.rb b/util/generate_gamedata.rb index 8275ab7..cf57395 100644 --- a/util/generate_gamedata.rb +++ b/util/generate_gamedata.rb | |||
@@ -11,6 +11,7 @@ CLASSIFICATION_INSANITY = 4 | |||
11 | 11 | ||
12 | panel_to_id = {} | 12 | panel_to_id = {} |
13 | door_groups = {} | 13 | door_groups = {} |
14 | warp_groups = {} | ||
14 | 15 | ||
15 | panel_output = [] | 16 | panel_output = [] |
16 | door_ids_by_item_id = {} | 17 | door_ids_by_item_id = {} |
@@ -18,6 +19,7 @@ painting_ids_by_item_id = {} | |||
18 | warp_ids_by_item_id = {} | 19 | warp_ids_by_item_id = {} |
19 | panel_ids_by_location_id = {} | 20 | panel_ids_by_location_id = {} |
20 | classification_by_location_id = {} | 21 | classification_by_location_id = {} |
22 | sunwarps = Array.new(12) {Hash.new} | ||
21 | mentioned_doors = Set[] | 23 | mentioned_doors = Set[] |
22 | mentioned_paintings = Set[] | 24 | mentioned_paintings = Set[] |
23 | mentioned_warps = Set[] | 25 | mentioned_warps = Set[] |
@@ -90,6 +92,16 @@ config.each do |room_name, room_data| | |||
90 | painting_output[painting["id"]] = painting | 92 | painting_output[painting["id"]] = painting |
91 | end | 93 | end |
92 | end | 94 | end |
95 | |||
96 | if room_data.include? "sunwarps" | ||
97 | room_data["sunwarps"].each do |sunwarp| | ||
98 | index = sunwarp["dots"] - 1 | ||
99 | if sunwarp["direction"] == "exit" then | ||
100 | index += 6 | ||
101 | end | ||
102 | sunwarps[index] = sunwarp | ||
103 | end | ||
104 | end | ||
93 | end | 105 | end |
94 | 106 | ||
95 | config.each do |room_name, room_data| | 107 | config.each do |room_name, room_data| |
@@ -163,6 +175,11 @@ config.each do |room_name, room_data| | |||
163 | internal_warp_ids = door["warp_id"] | 175 | internal_warp_ids = door["warp_id"] |
164 | end | 176 | end |
165 | 177 | ||
178 | if door.include? "door_group" | ||
179 | warp_groups[door["door_group"]] ||= Set[] | ||
180 | warp_groups[door["door_group"]].merge(internal_warp_ids) | ||
181 | end | ||
182 | |||
166 | warp_ids_by_item_id[item_id] = internal_warp_ids | 183 | warp_ids_by_item_id[item_id] = internal_warp_ids |
167 | mentioned_warps.merge(internal_warp_ids) | 184 | mentioned_warps.merge(internal_warp_ids) |
168 | end | 185 | end |
@@ -176,6 +193,11 @@ door_groups.each do |group_name, door_ids| | |||
176 | door_ids_by_item_id[item_id] = door_ids.to_a | 193 | door_ids_by_item_id[item_id] = door_ids.to_a |
177 | end | 194 | end |
178 | 195 | ||
196 | warp_groups.each do |group_name, warp_ids| | ||
197 | item_id = ids_config["door_groups"][group_name] | ||
198 | warp_ids_by_item_id[item_id] = warp_ids.to_a | ||
199 | end | ||
200 | |||
179 | File.open(outputpath, "w") do |f| | 201 | File.open(outputpath, "w") do |f| |
180 | f.write "extends Node\n\nvar panels = [" | 202 | f.write "extends Node\n\nvar panels = [" |
181 | f.write(panel_output.map do |panel| | 203 | f.write(panel_output.map do |panel| |
@@ -227,5 +249,9 @@ File.open(outputpath, "w") do |f| | |||
227 | f.write(classification_by_location_id.map do |location_id, classification| | 249 | f.write(classification_by_location_id.map do |location_id, classification| |
228 | "#{location_id}:#{classification}" | 250 | "#{location_id}:#{classification}" |
229 | end.join(",")) | 251 | end.join(",")) |
230 | f.write "}" | 252 | f.write "}\nvar sunwarps = [" |
253 | f.write(sunwarps.map do |sunwarp| | ||
254 | "{\"orientation\":\"#{sunwarp["orientation"]}\",\"entrance_indicator_pos\":#{sunwarp["entrance_indicator_pos"].to_s}}" | ||
255 | end.join(",")) | ||
256 | f.write "]" | ||
231 | end | 257 | end |