summary refs log tree commit diff stats
path: root/randomizer
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-02-06 13:32:24 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2024-02-06 13:32:24 -0500
commitad8243c74c1d718b94a2a4bf4f0fa56d4c9dbb45 (patch)
treeca03e7a2f780e38cdcc338308d329a6dc279e35a /randomizer
parent6e04dbb1ebb811429bbfdb53bd8c4c079ef63732 (diff)
downloadlingo-randomizer-ad8243c74c1d718b94a2a4bf4f0fa56d4c9dbb45.tar.gz
lingo-randomizer-ad8243c74c1d718b94a2a4bf4f0fa56d4c9dbb45.tar.bz2
lingo-randomizer-ad8243c74c1d718b94a2a4bf4f0fa56d4c9dbb45.zip
Randomize sunwarps rewrite
Diffstat (limited to 'randomizer')
-rw-r--r--randomizer/load.gd41
-rw-r--r--randomizer/randomizer.gd9
2 files changed, 50 insertions, 0 deletions
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():
214 if !randomizer.steady._door_mapping.has(door.name) and door.name != "Door_hint": 214 if !randomizer.steady._door_mapping.has(door.name) and door.name != "Door_hint":
215 door.remap(["../../../Panels/Countdown Panels/Panel_steady_steady"]) 215 door.remap(["../../../Panels/Countdown Panels/Panel_steady_steady"])
216 216
217 # Sunwarps 1 and 6 are rotated differently from the rest, so we have to fix that.
218 get_node("Decorations/Teleporter Windows/localmap").rotation_degrees.y = 0
219 get_node("Decorations/Teleporter Windows/localmap2").rotation_degrees.y = 0
220 get_node("Decorations/Teleporter Windows/localmap11").rotation_degrees.y = 0
221 get_node("Decorations/Teleporter Windows/localmap12").rotation_degrees.y = 0
222 get_node("Decorations/Teleporter Windows/localmap13").rotation_degrees.y = -90
223
224 get_node("Warps/Teleporter Warps/Sunwarp_enter_1").translation.x = 19.5
225 get_node("Warps/Teleporter Warps/Sunwarp_exit_1").translation.x = -15.5
226 get_node("Warps/Teleporter Warps/Sunwarp_enter_6").translation.x = 4.5
227 get_node("Warps/Teleporter Warps/Sunwarp_exit_6").translation.x = -37.5
228 get_node("Warps/Teleporter Warps/Sunwarp_exit_7").translation.z = 23.5
229
230 # Randomize the sunwarps.
231 var sw_orig_translations = []
232 var sw_rotations = [0, 0, 90, 180, 0, 0, 0, 90, 270, 270, 0, 0]
233 var sw_text_translations = []
234 var sw_text_rotations = []
235 for i in range (1,7):
236 sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation)
237 sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation)
238 sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees)
239 for i in range (1,7):
240 sw_orig_translations.append(get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation)
241 sw_text_translations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation)
242 sw_text_rotations.append(get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees)
243 for i in range (1,7):
244 get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).translation = sw_orig_translations[randomizer.sunwarps[i-1]-1]
245 get_node("Warps/Teleporter Warps/Sunwarp_exit_%d" % i).translation = sw_orig_translations[randomizer.sunwarps[i+5]-1]
246
247 get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).translation = sw_text_translations[randomizer.sunwarps[i-1]-1]
248 get_node("Decorations/Signs/Sunwarp Numbers/enter_%d" % i).rotation_degrees = sw_text_rotations[randomizer.sunwarps[i-1]-1]
249
250 get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).translation = sw_text_translations[randomizer.sunwarps[i+5]-1]
251 get_node("Decorations/Signs/Sunwarp Numbers/exit_%d" % i).rotation_degrees = sw_text_rotations[randomizer.sunwarps[i+5]-1]
252
253 var final_rot = sw_rotations[randomizer.sunwarps[i-1]-1] - sw_rotations[randomizer.sunwarps[i+5]-1]
254 if final_rot < 0:
255 final_rot += 360
256 get_node("Warps/Teleporter Warps/Sunwarp_enter_%d" % i).rotate = str(final_rot)
257
217 # Proceed with the rest of the load. 258 # Proceed with the rest of the load.
218 global._print("Hooked Load End") 259 global._print("Hooked Load End")
219 ._load() 260 ._load()
diff --git a/randomizer/randomizer.gd b/randomizer/randomizer.gd index 681567d..2d26208 100644 --- a/randomizer/randomizer.gd +++ b/randomizer/randomizer.gd
@@ -7,6 +7,8 @@ var SCRIPT_steady
7 7
8var generator 8var generator
9var steady 9var steady
10var sunwarps
11
10var thread = Thread.new() 12var thread = Thread.new()
11 13
12signal finished_randomizing 14signal finished_randomizing
@@ -29,6 +31,13 @@ func _thread_func(gen_seed):
29 steady = SCRIPT_steady.new() 31 steady = SCRIPT_steady.new()
30 steady.generate(rng) 32 steady.generate(rng)
31 33
34 var iota = range(1, 13)
35 sunwarps = []
36 while not iota.empty():
37 var i = rng.randi_range(0, iota.size() - 1)
38 sunwarps.append(iota[i])
39 iota.remove(i)
40
32 emit_signal("finished_randomizing") 41 emit_signal("finished_randomizing")
33 42
34 43