diff options
Diffstat (limited to 'Archipelago/load.gd')
-rw-r--r-- | Archipelago/load.gd | 110 |
1 files changed, 99 insertions, 11 deletions
diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 82f8e94..6ce4749 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") |
@@ -353,6 +354,8 @@ func _load(): | |||
353 | victory_condition = "the master" | 354 | victory_condition = "the master" |
354 | elif apclient._victory_condition == apclient.kLEVEL_2: | 355 | elif apclient._victory_condition == apclient.kLEVEL_2: |
355 | victory_condition = "level 2" | 356 | victory_condition = "level 2" |
357 | elif apclient._victory_condition == apclient.kPILGRIMAGE: | ||
358 | victory_condition = "pilgrimage" | ||
356 | 359 | ||
357 | set_static_panel("Entry Room/Panel_this_this", victory_condition) | 360 | set_static_panel("Entry Room/Panel_this_this", victory_condition) |
358 | set_static_panel("Entry Room/Panel_hidden_hidden", "hewwo") | 361 | set_static_panel("Entry Room/Panel_hidden_hidden", "hewwo") |
@@ -584,11 +587,84 @@ func _load(): | |||
584 | level_2.get_node("Viewport/GUI/Panel/TextEdit").connect( | 587 | level_2.get_node("Viewport/GUI/Panel/TextEdit").connect( |
585 | "answer_correct", apclient, "completedGoal" | 588 | "answer_correct", apclient, "completedGoal" |
586 | ) | 589 | ) |
590 | elif apclient._victory_condition == apclient.kPILGRIMAGE: | ||
591 | var pilgrim_panel = self.get_node("Panels/Lingo Room/Panel_pilgrim") | ||
592 | pilgrim_panel.get_node("Viewport/GUI/Panel/TextEdit").connect( | ||
593 | "answer_correct", apclient, "completedGoal" | ||
594 | ) | ||
587 | else: | 595 | else: |
588 | var the_end = self.get_node("Decorations/EndPanel/Panel_end_end") | 596 | var the_end = self.get_node("Decorations/EndPanel/Panel_end_end") |
589 | the_end.get_node("Viewport/GUI/Panel/TextEdit").connect( | 597 | the_end.get_node("Viewport/GUI/Panel/TextEdit").connect( |
590 | "answer_correct", apclient, "completedGoal" | 598 | "answer_correct", apclient, "completedGoal" |
591 | ) | 599 | ) |
600 | |||
601 | # If pilgrimage does not allow roof access, add a node on the Crossroads | ||
602 | # Roof Access stairs that disables it. | ||
603 | if !apclient._pilgrimage_allows_roof_access: | ||
604 | var terminator = apclient.SCRIPT_pilgrimage_terminator.new() | ||
605 | terminator.name = "RoofAccessPilgrimageTerminator" | ||
606 | terminator.translation.x = -36 | ||
607 | terminator.translation.y = 3 | ||
608 | terminator.translation.z = -35 | ||
609 | |||
610 | var terminator_shape = CollisionShape.new() | ||
611 | terminator_shape.shape = BoxShape.new() | ||
612 | terminator_shape.shape.extents.x = 0.1 | ||
613 | |||
614 | terminator.add_child(terminator_shape) | ||
615 | get_node("Decorations").add_child(terminator) | ||
616 | |||
617 | if apclient._sunwarp_shuffle: | ||
618 | # Sunwarps 1 and 6 are rotated differently from the rest, so we have to fix that. | ||
619 | get_node("Decorations/Teleporter Windows/localmap").rotation_degrees.y = 0 | ||
620 | get_node("Decorations/Teleporter Windows/localmap2").rotation_degrees.y = 0 | ||
621 | get_node("Decorations/Teleporter Windows/localmap11").rotation_degrees.y = 0 | ||
622 | get_node("Decorations/Teleporter Windows/localmap12").rotation_degrees.y = 0 | ||
623 | get_node("Decorations/Teleporter Windows/localmap13").rotation_degrees.y = -90 | ||
624 | |||
625 | get_node("Warps/Teleporter Warps/Sunwarp_enter_1").translation.x = 19.5 | ||
626 | get_node("Warps/Teleporter Warps/Sunwarp_exit_1").translation.x = -15.5 | ||
627 | get_node("Warps/Teleporter Warps/Sunwarp_enter_6").translation.x = 4.5 | ||
628 | get_node("Warps/Teleporter Warps/Sunwarp_exit_6").translation.x = -37.5 | ||
629 | get_node("Warps/Teleporter Warps/Sunwarp_exit_7").translation.z = 23.5 | ||
630 | |||
631 | # Change the sunwarps in accordance with the mapping. | ||
632 | var sw_orig_translations = [] | ||
633 | var sw_text_translations = [] | ||
634 | var sw_text_rotations = [] | ||
635 | for i in range(1,7): | ||
636 | sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation) | ||
637 | sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation) | ||
638 | sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees) | ||
639 | for i in range(1,7): | ||
640 | sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation) | ||
641 | sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation) | ||
642 | sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees) | ||
643 | |||
644 | var sw_enter_indicators = [4, 5, 6, 12, 7, 10] | ||
645 | for i in range(1,7): | ||
646 | get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation = sw_orig_translations[apclient._sunwarp_mapping[i-1]] | ||
647 | get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation = sw_orig_translations[apclient._sunwarp_mapping[i+5]] | ||
648 | |||
649 | get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation = sw_text_translations[apclient._sunwarp_mapping[i-1]] | ||
650 | get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees = sw_text_rotations[apclient._sunwarp_mapping[i-1]] | ||
651 | |||
652 | get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation = sw_text_translations[apclient._sunwarp_mapping[i+5]] | ||
653 | get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees = sw_text_rotations[apclient._sunwarp_mapping[i+5]] | ||
654 | |||
655 | var enter_rot = _dir_to_int(gamedata.sunwarps[apclient._sunwarp_mapping[i-1]]["orientation"]) * 90 | ||
656 | var exit_rot = _dir_to_int(gamedata.sunwarps[apclient._sunwarp_mapping[i+5]]["orientation"]) * 90 | ||
657 | var final_rot = enter_rot - exit_rot | ||
658 | if final_rot < 0: | ||
659 | final_rot += 360 | ||
660 | get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).rotate = str(final_rot) | ||
661 | |||
662 | var sw_enter_indicator_pos = gamedata.sunwarps[apclient._sunwarp_mapping[i-1]]["entrance_indicator_pos"] | ||
663 | var sw_enter_indicator = get_node("Decorations/Signs/Welcome Back Signs/Sign%d" % sw_enter_indicators[i-1]) | ||
664 | sw_enter_indicator.translation.x = sw_enter_indicator_pos[0] | ||
665 | sw_enter_indicator.translation.y = sw_enter_indicator_pos[1] | ||
666 | sw_enter_indicator.translation.z = sw_enter_indicator_pos[2] | ||
667 | sw_enter_indicator.rotation_degrees.y = (enter_rot * -1) + 180 | ||
592 | 668 | ||
593 | # Create the effects node. | 669 | # Create the effects node. |
594 | var effects_script = apclient.SCRIPT_effects | 670 | var effects_script = apclient.SCRIPT_effects |
@@ -719,3 +795,15 @@ func set_small_gridmap_tile(x, y, z, tile): | |||
719 | 795 | ||
720 | func archipelago_disconnected(reason): | 796 | func archipelago_disconnected(reason): |
721 | messages.showMessage(reason) | 797 | messages.showMessage(reason) |
798 | |||
799 | |||
800 | func _dir_to_int(dir): | ||
801 | if dir == "north": | ||
802 | return 0 | ||
803 | elif dir == "west": | ||
804 | return 1 | ||
805 | elif dir == "south": | ||
806 | return 2 | ||
807 | elif dir == "east": | ||
808 | return 3 | ||
809 | return 4 | ||