From ad8243c74c1d718b94a2a4bf4f0fa56d4c9dbb45 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Tue, 6 Feb 2024 13:32:24 -0500 Subject: Randomize sunwarps --- randomizer/load.gd | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'randomizer/load.gd') diff --git a/randomizer/load.gd b/randomizer/load.gd index 55e4efc..456e135 100644 --- a/randomizer/load.gd +++ b/randomizer/load.gd @@ -214,6 +214,47 @@ func _load(): if !randomizer.steady._door_mapping.has(door.name) and door.name != "Door_hint": door.remap(["../../../Panels/Countdown Panels/Panel_steady_steady"]) + # Sunwarps 1 and 6 are rotated differently from the rest, so we have to fix that. + get_node("Decorations/Teleporter Windows/localmap").rotation_degrees.y = 0 + get_node("Decorations/Teleporter Windows/localmap2").rotation_degrees.y = 0 + get_node("Decorations/Teleporter Windows/localmap11").rotation_degrees.y = 0 + get_node("Decorations/Teleporter Windows/localmap12").rotation_degrees.y = 0 + get_node("Decorations/Teleporter Windows/localmap13").rotation_degrees.y = -90 + + get_node("Warps/Teleporter Warps/Sunwarp_enter_1").translation.x = 19.5 + get_node("Warps/Teleporter Warps/Sunwarp_exit_1").translation.x = -15.5 + get_node("Warps/Teleporter Warps/Sunwarp_enter_6").translation.x = 4.5 + get_node("Warps/Teleporter Warps/Sunwarp_exit_6").translation.x = -37.5 + get_node("Warps/Teleporter Warps/Sunwarp_exit_7").translation.z = 23.5 + + # Randomize the sunwarps. + var sw_orig_translations = [] + var sw_rotations = [0, 0, 90, 180, 0, 0, 0, 90, 270, 270, 0, 0] + var sw_text_translations = [] + var sw_text_rotations = [] + for i in range (1,7): + sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation) + sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation) + sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees) + for i in range (1,7): + sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation) + sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation) + sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees) + for i in range (1,7): + get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation = sw_orig_translations[randomizer.sunwarps[i-1]-1] + get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation = sw_orig_translations[randomizer.sunwarps[i+5]-1] + + get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation = sw_text_translations[randomizer.sunwarps[i-1]-1] + get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees = sw_text_rotations[randomizer.sunwarps[i-1]-1] + + get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation = sw_text_translations[randomizer.sunwarps[i+5]-1] + get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees = sw_text_rotations[randomizer.sunwarps[i+5]-1] + + var final_rot = sw_rotations[randomizer.sunwarps[i-1]-1] - sw_rotations[randomizer.sunwarps[i+5]-1] + if final_rot < 0: + final_rot += 360 + get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).rotate = str(final_rot) + # Proceed with the rest of the load. global._print("Hooked Load End") ._load() -- cgit 1.4.1