diff options
Diffstat (limited to 'Archipelago/effects.gd')
-rw-r--r-- | Archipelago/effects.gd | 15 |
1 files changed, 15 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") |