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.gd34
1 files changed, 27 insertions, 7 deletions
diff --git a/Archipelago/effects.gd b/Archipelago/effects.gd index e6d2dcd..1e2e311 100644 --- a/Archipelago/effects.gd +++ b/Archipelago/effects.gd
@@ -58,13 +58,13 @@ func _ready():
58func activate(): 58func activate():
59 activated = true 59 activated = true
60 60
61 for _i in range(0, queued_iceland): 61 if queued_iceland > 0:
62 trigger_iceland_trap() 62 trigger_iceland_trap(queued_iceland)
63 63
64 queued_iceland = 0 64 queued_iceland = 0
65 65
66 66
67func trigger_slowness_trap(): 67func trigger_slowness_trap(length = 30):
68 if slowness_remaining == 0: 68 if slowness_remaining == 0:
69 var player = get_tree().get_root().get_node("Spatial/player") 69 var player = get_tree().get_root().get_node("Spatial/player")
70 player.walk_speed = orig_walk / 2.0 70 player.walk_speed = orig_walk / 2.0
@@ -72,13 +72,16 @@ func trigger_slowness_trap():
72 72
73 $SlownessTimer.start() 73 $SlownessTimer.start()
74 74
75 slowness_remaining += 30 75 slowness_remaining += length
76 text_dirty = true 76 text_dirty = true
77 77
78 var apclient = global.get_node("Archipelago")
79 apclient.saveLocaldata()
78 80
79func trigger_iceland_trap(): 81
82func trigger_iceland_trap(length = 60):
80 if not activated: 83 if not activated:
81 queued_iceland += 1 84 queued_iceland += length
82 return 85 return
83 86
84 if iceland_remaining == 0: 87 if iceland_remaining == 0:
@@ -88,9 +91,12 @@ func trigger_iceland_trap():
88 91
89 $IcelandTimer.start() 92 $IcelandTimer.start()
90 93
91 iceland_remaining += 60 94 iceland_remaining += length
92 text_dirty = true 95 text_dirty = true
93 96
97 var apclient = global.get_node("Archipelago")
98 apclient.saveLocaldata()
99
94 100
95func trigger_atbash_trap(): 101func trigger_atbash_trap():
96 var newly_atbash = (atbash_remaining == 0) 102 var newly_atbash = (atbash_remaining == 0)
@@ -102,6 +108,9 @@ func trigger_atbash_trap():
102 108
103 text_dirty = true 109 text_dirty = true
104 110
111 var apclient = global.get_node("Archipelago")
112 apclient.saveLocaldata()
113
105 114
106func deactivate_atbash_trap(): 115func deactivate_atbash_trap():
107 if atbash_remaining > 0: 116 if atbash_remaining > 0:
@@ -112,6 +121,9 @@ func deactivate_atbash_trap():
112 apclient.evaluateSolvability() 121 apclient.evaluateSolvability()
113 122
114 text_dirty = true 123 text_dirty = true
124
125 var apclient = global.get_node("Archipelago")
126 apclient.saveLocaldata()
115 127
116 128
117func show_puzzle_skip_message(node_path): 129func show_puzzle_skip_message(node_path):
@@ -180,6 +192,10 @@ func _tick_slowness():
180 player.run_speed = orig_run 192 player.run_speed = orig_run
181 193
182 $SlownessTimer.stop() 194 $SlownessTimer.stop()
195
196 if slowness_remaining % 5 == 0:
197 var apclient = global.get_node("Archipelago")
198 apclient.saveLocaldata()
183 199
184 200
185func _tick_iceland(): 201func _tick_iceland():
@@ -192,6 +208,10 @@ func _tick_iceland():
192 ) 208 )
193 209
194 $IcelandTimer.stop() 210 $IcelandTimer.stop()
211
212 if iceland_remaining % 5 == 0:
213 var apclient = global.get_node("Archipelago")
214 apclient.saveLocaldata()
195 215
196 216
197func _process(_delta): 217func _process(_delta):