diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-03-02 13:18:33 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-03-02 13:18:33 -0500 |
commit | c45ca7725a9d77f29e8675182c3aff7b661b5c40 (patch) | |
tree | 80c4739a1912511586d409e7828bb12d1a952159 /Archipelago/load.gd | |
parent | 4d2da5afe6a3ffad50ca5560c1dcceaddde2b9b0 (diff) | |
download | lingo-archipelago-c45ca7725a9d77f29e8675182c3aff7b661b5c40.tar.gz lingo-archipelago-c45ca7725a9d77f29e8675182c3aff7b661b5c40.tar.bz2 lingo-archipelago-c45ca7725a9d77f29e8675182c3aff7b661b5c40.zip |
Added sunwarp shuffling
Diffstat (limited to 'Archipelago/load.gd')
-rw-r--r-- | Archipelago/load.gd | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/Archipelago/load.gd b/Archipelago/load.gd index bca0742..0750247 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd | |||
@@ -566,6 +566,58 @@ func _load(): | |||
566 | 566 | ||
567 | terminator.add_child(terminator_shape) | 567 | terminator.add_child(terminator_shape) |
568 | get_node("Decorations").add_child(terminator) | 568 | get_node("Decorations").add_child(terminator) |
569 | |||
570 | if apclient._sunwarp_shuffle: | ||
571 | # Sunwarps 1 and 6 are rotated differently from the rest, so we have to fix that. | ||
572 | get_node("Decorations/Teleporter Windows/localmap").rotation_degrees.y = 0 | ||
573 | get_node("Decorations/Teleporter Windows/localmap2").rotation_degrees.y = 0 | ||
574 | get_node("Decorations/Teleporter Windows/localmap11").rotation_degrees.y = 0 | ||
575 | get_node("Decorations/Teleporter Windows/localmap12").rotation_degrees.y = 0 | ||
576 | get_node("Decorations/Teleporter Windows/localmap13").rotation_degrees.y = -90 | ||
577 | |||
578 | get_node("Warps/Teleporter Warps/Sunwarp_enter_1").translation.x = 19.5 | ||
579 | get_node("Warps/Teleporter Warps/Sunwarp_exit_1").translation.x = -15.5 | ||
580 | get_node("Warps/Teleporter Warps/Sunwarp_enter_6").translation.x = 4.5 | ||
581 | get_node("Warps/Teleporter Warps/Sunwarp_exit_6").translation.x = -37.5 | ||
582 | get_node("Warps/Teleporter Warps/Sunwarp_exit_7").translation.z = 23.5 | ||
583 | |||
584 | # Change the sunwarps in accordance with the mapping. | ||
585 | var sw_orig_translations = [] | ||
586 | var sw_text_translations = [] | ||
587 | var sw_text_rotations = [] | ||
588 | for i in range(1,7): | ||
589 | sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation) | ||
590 | sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation) | ||
591 | sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees) | ||
592 | for i in range(1,7): | ||
593 | sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation) | ||
594 | sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation) | ||
595 | sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees) | ||
596 | |||
597 | var sw_enter_indicators = [4, 5, 6, 12, 7, 10] | ||
598 | for i in range(1,7): | ||
599 | get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation = sw_orig_translations[apclient._sunwarp_mapping[i-1]] | ||
600 | get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation = sw_orig_translations[apclient._sunwarp_mapping[i+5]] | ||
601 | |||
602 | get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation = sw_text_translations[apclient._sunwarp_mapping[i-1]] | ||
603 | get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees = sw_text_rotations[apclient._sunwarp_mapping[i-1]] | ||
604 | |||
605 | get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation = sw_text_translations[apclient._sunwarp_mapping[i+5]] | ||
606 | get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees = sw_text_rotations[apclient._sunwarp_mapping[i+5]] | ||
607 | |||
608 | var enter_rot = _dir_to_int(gamedata.sunwarps[apclient._sunwarp_mapping[i-1]]["orientation"]) * 90 | ||
609 | var exit_rot = _dir_to_int(gamedata.sunwarps[apclient._sunwarp_mapping[i+5]]["orientation"]) * 90 | ||
610 | var final_rot = enter_rot - exit_rot | ||
611 | if final_rot < 0: | ||
612 | final_rot += 360 | ||
613 | get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).rotate = str(final_rot) | ||
614 | |||
615 | var sw_enter_indicator_pos = gamedata.sunwarps[apclient._sunwarp_mapping[i-1]]["entrance_indicator_pos"] | ||
616 | var sw_enter_indicator = get_node("Decorations/Signs/Welcome Back Signs/Sign%d" % sw_enter_indicators[i-1]) | ||
617 | sw_enter_indicator.translation.x = sw_enter_indicator_pos[0] | ||
618 | sw_enter_indicator.translation.y = sw_enter_indicator_pos[1] | ||
619 | sw_enter_indicator.translation.z = sw_enter_indicator_pos[2] | ||
620 | sw_enter_indicator.rotation_degrees.y = (enter_rot * -1) + 180 | ||
569 | 621 | ||
570 | # Create the effects node. | 622 | # Create the effects node. |
571 | var effects_script = apclient.SCRIPT_effects | 623 | var effects_script = apclient.SCRIPT_effects |
@@ -666,3 +718,15 @@ func set_small_gridmap_tile(x, y, z, tile): | |||
666 | 718 | ||
667 | func archipelago_disconnected(reason): | 719 | func archipelago_disconnected(reason): |
668 | messages.showMessage(reason) | 720 | messages.showMessage(reason) |
721 | |||
722 | |||
723 | func _dir_to_int(dir): | ||
724 | if dir == "north": | ||
725 | return 0 | ||
726 | elif dir == "west": | ||
727 | return 1 | ||
728 | elif dir == "south": | ||
729 | return 2 | ||
730 | elif dir == "east": | ||
731 | return 3 | ||
732 | return 4 | ||