diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-12-12 12:01:29 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-12-12 12:01:29 -0500 |
commit | 231d225fdcf3d11ff83587ac09c145aa7bca0e9a (patch) | |
tree | 0a87a612e0ae8a045a8d95da93b446ba806e8a26 /randomizer/load.gd | |
parent | f0555579cd462b27c71c486bd7456265cc827937 (diff) | |
download | lingo-randomizer-231d225fdcf3d11ff83587ac09c145aa7bca0e9a.tar.gz lingo-randomizer-231d225fdcf3d11ff83587ac09c145aa7bca0e9a.tar.bz2 lingo-randomizer-231d225fdcf3d11ff83587ac09c145aa7bca0e9a.zip |
More panels
Diffstat (limited to 'randomizer/load.gd')
-rw-r--r-- | randomizer/load.gd | 69 |
1 files changed, 64 insertions, 5 deletions
diff --git a/randomizer/load.gd b/randomizer/load.gd index 727e368..9fcd038 100644 --- a/randomizer/load.gd +++ b/randomizer/load.gd | |||
@@ -5,14 +5,73 @@ func _load(): | |||
5 | global._print("Hooked Load Start") | 5 | global._print("Hooked Load Start") |
6 | 6 | ||
7 | var randomizer = global.get_node("Randomizer") | 7 | var randomizer = global.get_node("Randomizer") |
8 | var panels_parent = $Panels | ||
9 | |||
10 | # Hide the countdown true panels. | ||
11 | for child in $CountdownPanels.get_children(): | ||
12 | if child.is_class("Spatial"): | ||
13 | child.get_node(child.replace_with).translation.y -= 100.0 | ||
8 | 14 | ||
9 | # Apply the randomized panels. | 15 | # Apply the randomized panels. |
10 | var panels_parent = $Panels | 16 | randomizer.generator.apply(self) |
11 | for puzzle in randomizer.generator.panel_mapping: | 17 | |
12 | var panel = panels_parent.get_node(puzzle[0]) | 18 | # Write static panels. |
13 | panel.text = puzzle[1] | 19 | set_static_panel("Entry Room/Panel_hi_hi", "hi") |
14 | panel.answer = puzzle[2] | 20 | if randomizer.generator.is_set_seed: |
21 | set_static_panel("Entry Room/Panel_write_write", "set seed") | ||
22 | else: | ||
23 | set_static_panel("Entry Room/Panel_write_write", "random seed") | ||
24 | set_static_panel("Entry Room/Panel_same_same", str(randomizer.generator.gen_seed)) | ||
25 | set_static_panel("Entry Room/Panel_type_type", "version") | ||
26 | set_static_panel("Entry Room/Panel_this_this", randomizer.my_version) | ||
27 | set_static_panel("Entry Room/Panel_hi_high", "goode", "good") | ||
28 | set_static_panel("Entry Room/Panel_low_low", "serendipity", "luck") | ||
29 | set_static_panel("Shuffle Room/Panel_secret_secret", "trans rights", "human rights") | ||
30 | set_static_panel("Color Arrow Room/Panel_me", "me", "hatkirby") | ||
31 | |||
32 | # HOT CRUSTS should be at eye-level, have a yellow block behind it, and | ||
33 | # not vanish when solved. | ||
34 | var hotcrusts = panels_parent.get_node("Shuffle Room/Panel_shortcuts") | ||
35 | hotcrusts.translation.y = 1.5 | ||
36 | hotcrusts.get_node("Viewport/GUI/Panel/TextEdit").disconnect( | ||
37 | "answer_correct", hotcrusts, "handle_correct" | ||
38 | ) | ||
39 | |||
40 | set_gridmap_tile(-20.5, 1.5, -79.5, "MeshInstance9") | ||
41 | |||
42 | # TRANS RIGHTS should be bottom white, like it used to be. | ||
43 | var trans_rights = panels_parent.get_node("Shuffle Room/Panel_secret_secret") | ||
44 | trans_rights.translation.y = 0.5 | ||
45 | |||
46 | # Move LOW/LOW back to where it used to be. | ||
47 | var panel_low = panels_parent.get_node("Entry Room/Panel_low_low") | ||
48 | var sign_low = $Decorations/PanelSign/sign21 | ||
49 | panel_low.translation = sign_low.translation | ||
50 | panel_low.rotation = sign_low.rotation | ||
51 | sign_low.queue_free() | ||
52 | |||
53 | # Require LOW/LOW for opening the second door. | ||
54 | get_node("Doors/Entry Room Area Doors/Door_hi_high").panels.append("../../../Panels/Entry Room/Panel_low_low") | ||
55 | get_node("Doors/Entry Room Area Doors/Door_hi_high")._ready() | ||
15 | 56 | ||
16 | # Proceed with the rest of the load. | 57 | # Proceed with the rest of the load. |
17 | global._print("Hooked Load End") | 58 | global._print("Hooked Load End") |
18 | ._load() | 59 | ._load() |
60 | |||
61 | |||
62 | func set_static_panel(name, question, answer = ""): | ||
63 | if answer == "": | ||
64 | answer = question | ||
65 | |||
66 | var node = self.get_node("Panels").get_node(name) | ||
67 | |||
68 | node.text = question | ||
69 | node.answer = answer | ||
70 | |||
71 | |||
72 | func set_gridmap_tile(x, y, z, tile): | ||
73 | var gridmap = self.get_node("GridMap") | ||
74 | var mesh_library = gridmap.mesh_library | ||
75 | var mapvec = gridmap.world_to_map(gridmap.to_local(Vector3(x, y, z))) | ||
76 | |||
77 | gridmap.set_cell_item(mapvec.x, mapvec.y, mapvec.z, mesh_library.find_item_by_name(tile)) | ||