diff options
-rw-r--r-- | Archipelago/effects.gd | 15 | ||||
-rw-r--r-- | Archipelago/load.gd | 9 |
2 files changed, 24 insertions, 0 deletions
diff --git a/Archipelago/effects.gd b/Archipelago/effects.gd index 193ece1..a11ab42 100644 --- a/Archipelago/effects.gd +++ b/Archipelago/effects.gd | |||
@@ -1,8 +1,10 @@ | |||
1 | extends Node | 1 | extends Node |
2 | 2 | ||
3 | var activated = false | ||
3 | var effect_running = false | 4 | var effect_running = false |
4 | var slowness_remaining = 0 | 5 | var slowness_remaining = 0 |
5 | var iceland_remaining = 0 | 6 | var iceland_remaining = 0 |
7 | var queued_iceland = 0 | ||
6 | 8 | ||
7 | var orig_env | 9 | var orig_env |
8 | var orig_walk | 10 | var orig_walk |
@@ -31,6 +33,15 @@ func _ready(): | |||
31 | add_child(label) | 33 | add_child(label) |
32 | 34 | ||
33 | 35 | ||
36 | func activate(): | ||
37 | activated = true | ||
38 | |||
39 | for _i in range(0, queued_iceland): | ||
40 | trigger_iceland_trap() | ||
41 | |||
42 | queued_iceland = 0 | ||
43 | |||
44 | |||
34 | func trigger_slowness_trap(): | 45 | func trigger_slowness_trap(): |
35 | if slowness_remaining == 0: | 46 | if slowness_remaining == 0: |
36 | var player = get_tree().get_root().get_node("Spatial/player") | 47 | var player = get_tree().get_root().get_node("Spatial/player") |
@@ -44,6 +55,10 @@ func trigger_slowness_trap(): | |||
44 | 55 | ||
45 | 56 | ||
46 | func trigger_iceland_trap(): | 57 | func trigger_iceland_trap(): |
58 | if not activated: | ||
59 | queued_iceland += 1 | ||
60 | return | ||
61 | |||
47 | if iceland_remaining == 0: | 62 | if iceland_remaining == 0: |
48 | get_tree().get_root().get_node("Spatial/player/pivot/camera").set_environment( | 63 | get_tree().get_root().get_node("Spatial/player/pivot/camera").set_environment( |
49 | load("res://environments/level_iceland.tres") | 64 | load("res://environments/level_iceland.tres") |
diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 052aa84..6860de7 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd | |||
@@ -324,6 +324,15 @@ func _load(): | |||
324 | apclient.mapFinishedLoading() | 324 | apclient.mapFinishedLoading() |
325 | 325 | ||
326 | 326 | ||
327 | func _load_user_textures(): | ||
328 | # We are using this function as a hook to process queued Iceland Traps | ||
329 | # because it happens after the environment gets set. | ||
330 | var effects_node = get_tree().get_root().get_node("Spatial/AP_Effects") | ||
331 | effects_node.activate() | ||
332 | |||
333 | ._load_user_textures() | ||
334 | |||
335 | |||
327 | func sort_by_link(a, b): | 336 | func sort_by_link(a, b): |
328 | return a["link"] < b["link"] | 337 | return a["link"] < b["link"] |
329 | 338 | ||