about summary refs log tree commit diff stats
path: root/Archipelago/load.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Archipelago/load.gd')
-rw-r--r--Archipelago/load.gd87
1 files changed, 87 insertions, 0 deletions
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
719func archipelago_disconnected(reason): 794func archipelago_disconnected(reason):
720 messages.showMessage(reason) 795 messages.showMessage(reason)
796
797
798func _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