about summary refs log tree commit diff stats
path: root/Archipelago/effects.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Archipelago/effects.gd')
-rw-r--r--Archipelago/effects.gd15
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 @@
1extends Node 1extends Node
2 2
3var activated = false
3var effect_running = false 4var effect_running = false
4var slowness_remaining = 0 5var slowness_remaining = 0
5var iceland_remaining = 0 6var iceland_remaining = 0
7var queued_iceland = 0
6 8
7var orig_env 9var orig_env
8var orig_walk 10var orig_walk
@@ -31,6 +33,15 @@ func _ready():
31 add_child(label) 33 add_child(label)
32 34
33 35
36func activate():
37 activated = true
38
39 for _i in range(0, queued_iceland):
40 trigger_iceland_trap()
41
42 queued_iceland = 0
43
44
34func trigger_slowness_trap(): 45func 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
46func trigger_iceland_trap(): 57func 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")