diff options
Diffstat (limited to 'Archipelago/load.gd')
-rw-r--r-- | Archipelago/load.gd | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 59d2ac2..673c762 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd | |||
@@ -348,6 +348,8 @@ func _load(): | |||
348 | victory_condition = "the master" | 348 | victory_condition = "the master" |
349 | elif apclient._victory_condition == apclient.kLEVEL_2: | 349 | elif apclient._victory_condition == apclient.kLEVEL_2: |
350 | victory_condition = "level 2" | 350 | victory_condition = "level 2" |
351 | elif apclient._victory_condition == apclient.kPILGRIMAGE: | ||
352 | victory_condition = "pilgrimage" | ||
351 | 353 | ||
352 | set_static_panel("Entry Room/Panel_this_this", victory_condition) | 354 | set_static_panel("Entry Room/Panel_this_this", victory_condition) |
353 | set_static_panel("Entry Room/Panel_hidden_hidden", "hewwo") | 355 | set_static_panel("Entry Room/Panel_hidden_hidden", "hewwo") |
@@ -552,11 +554,84 @@ func _load(): | |||
552 | level_2.get_node("Viewport/GUI/Panel/TextEdit").connect( | 554 | level_2.get_node("Viewport/GUI/Panel/TextEdit").connect( |
553 | "answer_correct", apclient, "completedGoal" | 555 | "answer_correct", apclient, "completedGoal" |
554 | ) | 556 | ) |
557 | elif apclient._victory_condition == apclient.kPILGRIMAGE: | ||
558 | var pilgrim_panel = self.get_node("Panels/Lingo Room/Panel_pilgrim") | ||
559 | pilgrim_panel.get_node("Viewport/GUI/Panel/TextEdit").connect( | ||
560 | "answer_correct", apclient, "completedGoal" | ||
561 | ) | ||
555 | else: | 562 | else: |
556 | var the_end = self.get_node("Decorations/EndPanel/Panel_end_end") | 563 | var the_end = self.get_node("Decorations/EndPanel/Panel_end_end") |
557 | the_end.get_node("Viewport/GUI/Panel/TextEdit").connect( | 564 | the_end.get_node("Viewport/GUI/Panel/TextEdit").connect( |
558 | "answer_correct", apclient, "completedGoal" | 565 | "answer_correct", apclient, "completedGoal" |
559 | ) | 566 | ) |
567 | |||
568 | # If pilgrimage does not allow roof access, add a node on the Crossroads | ||
569 | # Roof Access stairs that disables it. | ||
570 | if !apclient._pilgrimage_allows_roof_access: | ||
571 | var terminator = apclient.SCRIPT_pilgrimage_terminator.new() | ||
572 | terminator.name = "RoofAccessPilgrimageTerminator" | ||
573 | terminator.translation.x = -36 | ||
574 | terminator.translation.y = 3 | ||
575 | terminator.translation.z = -35 | ||
576 | |||
577 | var terminator_shape = CollisionShape.new() | ||
578 | terminator_shape.shape = BoxShape.new() | ||
579 | terminator_shape.shape.extents.x = 0.1 | ||
580 | |||
581 | terminator.add_child(terminator_shape) | ||
582 | get_node("Decorations").add_child(terminator) | ||
583 | |||
584 | if apclient._sunwarp_shuffle: | ||
585 | # Sunwarps 1 and 6 are rotated differently from the rest, so we have to fix that. | ||
586 | get_node("Decorations/Teleporter Windows/localmap").rotation_degrees.y = 0 | ||
587 | get_node("Decorations/Teleporter Windows/localmap2").rotation_degrees.y = 0 | ||
588 | get_node("Decorations/Teleporter Windows/localmap11").rotation_degrees.y = 0 | ||
589 | get_node("Decorations/Teleporter Windows/localmap12").rotation_degrees.y = 0 | ||
590 | get_node("Decorations/Teleporter Windows/localmap13").rotation_degrees.y = -90 | ||
591 | |||
592 | get_node("Warps/Teleporter Warps/Sunwarp_enter_1").translation.x = 19.5 | ||
593 | get_node("Warps/Teleporter Warps/Sunwarp_exit_1").translation.x = -15.5 | ||
594 | get_node("Warps/Teleporter Warps/Sunwarp_enter_6").translation.x = 4.5 | ||
595 | get_node("Warps/Teleporter Warps/Sunwarp_exit_6").translation.x = -37.5 | ||
596 | get_node("Warps/Teleporter Warps/Sunwarp_exit_7").translation.z = 23.5 | ||
597 | |||
598 | # Change the sunwarps in accordance with the mapping. | ||
599 | var sw_orig_translations = [] | ||
600 | var sw_text_translations = [] | ||
601 | var sw_text_rotations = [] | ||
602 | for i in range(1,7): | ||
603 | sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation) | ||
604 | sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation) | ||
605 | sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees) | ||
606 | for i in range(1,7): | ||
607 | sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation) | ||
608 | sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation) | ||
609 | sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees) | ||
610 | |||
611 | var sw_enter_indicators = [4, 5, 6, 12, 7, 10] | ||
612 | for i in range(1,7): | ||
613 | get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation = sw_orig_translations[apclient._sunwarp_mapping[i-1]] | ||
614 | get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation = sw_orig_translations[apclient._sunwarp_mapping[i+5]] | ||
615 | |||
616 | get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation = sw_text_translations[apclient._sunwarp_mapping[i-1]] | ||
617 | get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees = sw_text_rotations[apclient._sunwarp_mapping[i-1]] | ||
618 | |||
619 | get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation = sw_text_translations[apclient._sunwarp_mapping[i+5]] | ||
620 | get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees = sw_text_rotations[apclient._sunwarp_mapping[i+5]] | ||
621 | |||
622 | var enter_rot = _dir_to_int(gamedata.sunwarps[apclient._sunwarp_mapping[i-1]]["orientation"]) * 90 | ||
623 | var exit_rot = _dir_to_int(gamedata.sunwarps[apclient._sunwarp_mapping[i+5]]["orientation"]) * 90 | ||
624 | var final_rot = enter_rot - exit_rot | ||
625 | if final_rot < 0: | ||
626 | final_rot += 360 | ||
627 | get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).rotate = str(final_rot) | ||
628 | |||
629 | var sw_enter_indicator_pos = gamedata.sunwarps[apclient._sunwarp_mapping[i-1]]["entrance_indicator_pos"] | ||
630 | var sw_enter_indicator = get_node("Decorations/Signs/Welcome Back Signs/Sign%d" % sw_enter_indicators[i-1]) | ||
631 | sw_enter_indicator.translation.x = sw_enter_indicator_pos[0] | ||
632 | sw_enter_indicator.translation.y = sw_enter_indicator_pos[1] | ||
633 | sw_enter_indicator.translation.z = sw_enter_indicator_pos[2] | ||
634 | sw_enter_indicator.rotation_degrees.y = (enter_rot * -1) + 180 | ||
560 | 635 | ||
561 | # Create the effects node. | 636 | # Create the effects node. |
562 | var effects_script = apclient.SCRIPT_effects | 637 | var effects_script = apclient.SCRIPT_effects |
@@ -674,3 +749,15 @@ func set_small_gridmap_tile(x, y, z, tile): | |||
674 | 749 | ||
675 | func archipelago_disconnected(reason): | 750 | func archipelago_disconnected(reason): |
676 | messages.showMessage(reason) | 751 | messages.showMessage(reason) |
752 | |||
753 | |||
754 | func _dir_to_int(dir): | ||
755 | if dir == "north": | ||
756 | return 0 | ||
757 | elif dir == "west": | ||
758 | return 1 | ||
759 | elif dir == "south": | ||
760 | return 2 | ||
761 | elif dir == "east": | ||
762 | return 3 | ||
763 | return 4 | ||