diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-05-29 13:34:53 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-05-29 13:34:53 -0400 |
commit | eff3dff1142876b70e0336f03b4efb12db4e2bba (patch) | |
tree | d0f19c16094706e9c3a6d4b59d9f4ee44e535ad4 /Archipelago/load.gd | |
parent | 8b97ed0755c8d950f5cc8f9a957636982f33f012 (diff) | |
parent | 2b0fcdde3144213676324163d721150a8641d610 (diff) | |
download | lingo-archipelago-eff3dff1142876b70e0336f03b4efb12db4e2bba.tar.gz lingo-archipelago-eff3dff1142876b70e0336f03b4efb12db4e2bba.tar.bz2 lingo-archipelago-eff3dff1142876b70e0336f03b4efb12db4e2bba.zip |
Merge branch 'main' into color-hallways
Diffstat (limited to 'Archipelago/load.gd')
-rw-r--r-- | Archipelago/load.gd | 113 |
1 files changed, 102 insertions, 11 deletions
diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 1b77c9e..931dfde 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd | |||
@@ -96,18 +96,19 @@ func _load(): | |||
96 | 96 | ||
97 | wanderer_achieve.translation = Vector3(-51, -33, 35) # way under the map | 97 | wanderer_achieve.translation = Vector3(-51, -33, 35) # way under the map |
98 | 98 | ||
99 | # Turn THE COLORFUL into a cdp. | ||
100 | var real_colorful = panels_parent.get_node("Countdown Panels/Panel_colorful_colorful") | ||
101 | var cdp_auto_scene = load("res://nodes/panel_countdown_auto.tscn") | 99 | var cdp_auto_scene = load("res://nodes/panel_countdown_auto.tscn") |
102 | var colorful_cdp = cdp_auto_scene.instance() | 100 | if !apclient.wasGeneratedBeforeVersion(0, 4, 5): |
103 | colorful_cdp.name = "CountdownPanel_colorful" | 101 | # Turn THE COLORFUL into a cdp. |
104 | colorful_cdp.replace_with = "../../Panels/Countdown Panels/Panel_colorful_colorful" | 102 | var real_colorful = panels_parent.get_node("Countdown Panels/Panel_colorful_colorful") |
105 | colorful_cdp.panels = "../../Panels/Doorways Room" | 103 | var colorful_cdp = cdp_auto_scene.instance() |
106 | colorful_cdp.translation = real_colorful.translation | 104 | colorful_cdp.name = "CountdownPanel_colorful" |
107 | colorful_cdp.rotation = real_colorful.rotation | 105 | colorful_cdp.replace_with = "../../Panels/Countdown Panels/Panel_colorful_colorful" |
108 | get_node("CountdownPanels").add_child(colorful_cdp) | 106 | colorful_cdp.panels = "../../Panels/Doorways Room" |
109 | real_colorful.translation = Vector3(-51, -35, 35) # way under the map | 107 | colorful_cdp.translation = real_colorful.translation |
110 | get_node("Doors/Doorway Room Doors/Door_gray2").queue_free() | 108 | colorful_cdp.rotation = real_colorful.rotation |
109 | get_node("CountdownPanels").add_child(colorful_cdp) | ||
110 | real_colorful.translation = Vector3(-51, -35, 35) # way under the map | ||
111 | get_node("Doors/Doorway Room Doors/Door_gray2").queue_free() | ||
111 | 112 | ||
112 | # Set up The Master to be variable. | 113 | # Set up The Master to be variable. |
113 | var old_master_cdp = get_node("CountdownPanels/CountdownPanel_countdown_16") | 114 | var old_master_cdp = get_node("CountdownPanels/CountdownPanel_countdown_16") |
@@ -262,6 +263,9 @@ func _load(): | |||
262 | hidden_parent.get_node("hidden_door_58").translation.x = 48 | 263 | hidden_parent.get_node("hidden_door_58").translation.x = 48 |
263 | hidden_parent.get_node("hidden_door_58")._setReference("whiteBlock") | 264 | hidden_parent.get_node("hidden_door_58")._setReference("whiteBlock") |
264 | 265 | ||
266 | # Remove Fearless entrance indicator. | ||
267 | get_node("Decorations/Signs/Miscellaneous/Sign14").queue_free() | ||
268 | |||
265 | if apclient._panel_shuffle != apclient.kNO_PANEL_SHUFFLE: | 269 | if apclient._panel_shuffle != apclient.kNO_PANEL_SHUFFLE: |
266 | # Make The Wondrous's FIRE solely midred. | 270 | # Make The Wondrous's FIRE solely midred. |
267 | clear_gridmap_tile(-76.5, 1.5, -73.5) | 271 | clear_gridmap_tile(-76.5, 1.5, -73.5) |
@@ -353,6 +357,8 @@ func _load(): | |||
353 | victory_condition = "the master" | 357 | victory_condition = "the master" |
354 | elif apclient._victory_condition == apclient.kLEVEL_2: | 358 | elif apclient._victory_condition == apclient.kLEVEL_2: |
355 | victory_condition = "level 2" | 359 | victory_condition = "level 2" |
360 | elif apclient._victory_condition == apclient.kPILGRIMAGE: | ||
361 | victory_condition = "pilgrimage" | ||
356 | 362 | ||
357 | set_static_panel("Entry Room/Panel_this_this", victory_condition) | 363 | set_static_panel("Entry Room/Panel_this_this", victory_condition) |
358 | set_static_panel("Entry Room/Panel_hidden_hidden", "hewwo") | 364 | set_static_panel("Entry Room/Panel_hidden_hidden", "hewwo") |
@@ -572,11 +578,84 @@ func _load(): | |||
572 | level_2.get_node("Viewport/GUI/Panel/TextEdit").connect( | 578 | level_2.get_node("Viewport/GUI/Panel/TextEdit").connect( |
573 | "answer_correct", apclient, "completedGoal" | 579 | "answer_correct", apclient, "completedGoal" |
574 | ) | 580 | ) |
581 | elif apclient._victory_condition == apclient.kPILGRIMAGE: | ||
582 | var pilgrim_panel = self.get_node("Panels/Lingo Room/Panel_pilgrim") | ||
583 | pilgrim_panel.get_node("Viewport/GUI/Panel/TextEdit").connect( | ||
584 | "answer_correct", apclient, "completedGoal" | ||
585 | ) | ||
575 | else: | 586 | else: |
576 | var the_end = self.get_node("Decorations/EndPanel/Panel_end_end") | 587 | var the_end = self.get_node("Decorations/EndPanel/Panel_end_end") |
577 | the_end.get_node("Viewport/GUI/Panel/TextEdit").connect( | 588 | the_end.get_node("Viewport/GUI/Panel/TextEdit").connect( |
578 | "answer_correct", apclient, "completedGoal" | 589 | "answer_correct", apclient, "completedGoal" |
579 | ) | 590 | ) |
591 | |||
592 | # If pilgrimage does not allow roof access, add a node on the Crossroads | ||
593 | # Roof Access stairs that disables it. | ||
594 | if !apclient._pilgrimage_allows_roof_access: | ||
595 | var terminator = apclient.SCRIPT_pilgrimage_terminator.new() | ||
596 | terminator.name = "RoofAccessPilgrimageTerminator" | ||
597 | terminator.translation.x = -36 | ||
598 | terminator.translation.y = 3 | ||
599 | terminator.translation.z = -35 | ||
600 | |||
601 | var terminator_shape = CollisionShape.new() | ||
602 | terminator_shape.shape = BoxShape.new() | ||
603 | terminator_shape.shape.extents.x = 0.1 | ||
604 | |||
605 | terminator.add_child(terminator_shape) | ||
606 | get_node("Decorations").add_child(terminator) | ||
607 | |||
608 | if apclient._sunwarp_shuffle: | ||
609 | # Sunwarps 1 and 6 are rotated differently from the rest, so we have to fix that. | ||
610 | get_node("Decorations/Teleporter Windows/localmap").rotation_degrees.y = 0 | ||
611 | get_node("Decorations/Teleporter Windows/localmap2").rotation_degrees.y = 0 | ||
612 | get_node("Decorations/Teleporter Windows/localmap11").rotation_degrees.y = 0 | ||
613 | get_node("Decorations/Teleporter Windows/localmap12").rotation_degrees.y = 0 | ||
614 | get_node("Decorations/Teleporter Windows/localmap13").rotation_degrees.y = -90 | ||
615 | |||
616 | get_node("Warps/Teleporter Warps/Sunwarp_enter_1").translation.x = 19.5 | ||
617 | get_node("Warps/Teleporter Warps/Sunwarp_exit_1").translation.x = -15.5 | ||
618 | get_node("Warps/Teleporter Warps/Sunwarp_enter_6").translation.x = 4.5 | ||
619 | get_node("Warps/Teleporter Warps/Sunwarp_exit_6").translation.x = -37.5 | ||
620 | get_node("Warps/Teleporter Warps/Sunwarp_exit_7").translation.z = 23.5 | ||
621 | |||
622 | # Change the sunwarps in accordance with the mapping. | ||
623 | var sw_orig_translations = [] | ||
624 | var sw_text_translations = [] | ||
625 | var sw_text_rotations = [] | ||
626 | for i in range(1,7): | ||
627 | sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation) | ||
628 | sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation) | ||
629 | sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees) | ||
630 | for i in range(1,7): | ||
631 | sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation) | ||
632 | sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation) | ||
633 | sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees) | ||
634 | |||
635 | var sw_enter_indicators = [4, 5, 6, 12, 7, 10] | ||
636 | for i in range(1,7): | ||
637 | get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation = sw_orig_translations[apclient._sunwarp_mapping[i-1]] | ||
638 | get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation = sw_orig_translations[apclient._sunwarp_mapping[i+5]] | ||
639 | |||
640 | get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation = sw_text_translations[apclient._sunwarp_mapping[i-1]] | ||
641 | get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees = sw_text_rotations[apclient._sunwarp_mapping[i-1]] | ||
642 | |||
643 | get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation = sw_text_translations[apclient._sunwarp_mapping[i+5]] | ||
644 | get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees = sw_text_rotations[apclient._sunwarp_mapping[i+5]] | ||
645 | |||
646 | var enter_rot = _dir_to_int(gamedata.sunwarps[apclient._sunwarp_mapping[i-1]]["orientation"]) * 90 | ||
647 | var exit_rot = _dir_to_int(gamedata.sunwarps[apclient._sunwarp_mapping[i+5]]["orientation"]) * 90 | ||
648 | var final_rot = enter_rot - exit_rot | ||
649 | if final_rot < 0: | ||
650 | final_rot += 360 | ||
651 | get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).rotate = str(final_rot) | ||
652 | |||
653 | var sw_enter_indicator_pos = gamedata.sunwarps[apclient._sunwarp_mapping[i-1]]["entrance_indicator_pos"] | ||
654 | var sw_enter_indicator = get_node("Decorations/Signs/Welcome Back Signs/Sign%d" % sw_enter_indicators[i-1]) | ||
655 | sw_enter_indicator.translation.x = sw_enter_indicator_pos[0] | ||
656 | sw_enter_indicator.translation.y = sw_enter_indicator_pos[1] | ||
657 | sw_enter_indicator.translation.z = sw_enter_indicator_pos[2] | ||
658 | sw_enter_indicator.rotation_degrees.y = (enter_rot * -1) + 180 | ||
580 | 659 | ||
581 | # Create the effects node. | 660 | # Create the effects node. |
582 | var effects_script = apclient.SCRIPT_effects | 661 | var effects_script = apclient.SCRIPT_effects |
@@ -707,3 +786,15 @@ func set_small_gridmap_tile(x, y, z, tile): | |||
707 | 786 | ||
708 | func archipelago_disconnected(reason): | 787 | func archipelago_disconnected(reason): |
709 | messages.showMessage(reason) | 788 | messages.showMessage(reason) |
789 | |||
790 | |||
791 | func _dir_to_int(dir): | ||
792 | if dir == "north": | ||
793 | return 0 | ||
794 | elif dir == "west": | ||
795 | return 1 | ||
796 | elif dir == "south": | ||
797 | return 2 | ||
798 | elif dir == "east": | ||
799 | return 3 | ||
800 | return 4 | ||