diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-09-20 16:15:56 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-09-20 16:15:56 -0400 |
commit | ed3247cd00cde86026379aebba200fee673cdba0 (patch) | |
tree | 6bf98fff60137d986e2237a9dbaadd65466b2c95 /Archipelago/effects.gd | |
parent | 15fd151d4b7b4b86d65ae37386b96aae7cb6ba79 (diff) | |
download | lingo-archipelago-ed3247cd00cde86026379aebba200fee673cdba0.tar.gz lingo-archipelago-ed3247cd00cde86026379aebba200fee673cdba0.tar.bz2 lingo-archipelago-ed3247cd00cde86026379aebba200fee673cdba0.zip |
Added speed boost mode
Diffstat (limited to 'Archipelago/effects.gd')
-rw-r--r-- | Archipelago/effects.gd | 66 |
1 files changed, 57 insertions, 9 deletions
diff --git a/Archipelago/effects.gd b/Archipelago/effects.gd index 1e2e311..341a783 100644 --- a/Archipelago/effects.gd +++ b/Archipelago/effects.gd | |||
@@ -5,6 +5,7 @@ var effect_running = false | |||
5 | var slowness_remaining = 0 | 5 | var slowness_remaining = 0 |
6 | var iceland_remaining = 0 | 6 | var iceland_remaining = 0 |
7 | var atbash_remaining = 0 | 7 | var atbash_remaining = 0 |
8 | var speed_boosts_remaining = 0 | ||
8 | var queued_iceland = 0 | 9 | var queued_iceland = 0 |
9 | var skip_available = false | 10 | var skip_available = false |
10 | var puzzle_focused = false | 11 | var puzzle_focused = false |
@@ -48,6 +49,12 @@ func _ready(): | |||
48 | add_child(slowness_timer) | 49 | add_child(slowness_timer) |
49 | slowness_timer.connect("timeout", self, "_tick_slowness") | 50 | slowness_timer.connect("timeout", self, "_tick_slowness") |
50 | 51 | ||
52 | var speed_boost_timer = Timer.new() | ||
53 | speed_boost_timer.name = "SpeedBoostTimer" | ||
54 | speed_boost_timer.wait_time = 1.0 | ||
55 | add_child(speed_boost_timer) | ||
56 | speed_boost_timer.connect("timeout", self, "_tick_speed_boost") | ||
57 | |||
51 | var iceland_timer = Timer.new() | 58 | var iceland_timer = Timer.new() |
52 | iceland_timer.name = "IcelandTimer" | 59 | iceland_timer.name = "IcelandTimer" |
53 | iceland_timer.wait_time = 1.0 | 60 | iceland_timer.wait_time = 1.0 |
@@ -63,6 +70,12 @@ func activate(): | |||
63 | 70 | ||
64 | queued_iceland = 0 | 71 | queued_iceland = 0 |
65 | 72 | ||
73 | var apclient = global.get_node("Archipelago") | ||
74 | if apclient._speed_boost_mode: | ||
75 | var player = get_tree().get_root().get_node("Spatial/player") | ||
76 | player.walk_speed = orig_walk / 2.0 | ||
77 | player.run_speed = orig_run / 2.0 | ||
78 | |||
66 | 79 | ||
67 | func trigger_slowness_trap(length = 30): | 80 | func trigger_slowness_trap(length = 30): |
68 | if slowness_remaining == 0: | 81 | if slowness_remaining == 0: |
@@ -79,6 +92,21 @@ func trigger_slowness_trap(length = 30): | |||
79 | apclient.saveLocaldata() | 92 | apclient.saveLocaldata() |
80 | 93 | ||
81 | 94 | ||
95 | func trigger_speed_boost(length = 20): | ||
96 | if speed_boosts_remaining == 0: | ||
97 | var player = get_tree().get_root().get_node("Spatial/player") | ||
98 | player.walk_speed = orig_walk | ||
99 | player.run_speed = orig_run | ||
100 | |||
101 | $SpeedBoostTimer.start() | ||
102 | |||
103 | speed_boosts_remaining += length | ||
104 | text_dirty = true | ||
105 | |||
106 | var apclient = global.get_node("Archipelago") | ||
107 | apclient.saveLocaldata() | ||
108 | |||
109 | |||
82 | func trigger_iceland_trap(length = 60): | 110 | func trigger_iceland_trap(length = 60): |
83 | if not activated: | 111 | if not activated: |
84 | queued_iceland += length | 112 | queued_iceland += length |
@@ -99,7 +127,7 @@ func trigger_iceland_trap(length = 60): | |||
99 | 127 | ||
100 | 128 | ||
101 | func trigger_atbash_trap(): | 129 | func trigger_atbash_trap(): |
102 | var newly_atbash = (atbash_remaining == 0) | 130 | var newly_atbash = atbash_remaining == 0 |
103 | atbash_remaining += 1 | 131 | atbash_remaining += 1 |
104 | 132 | ||
105 | if newly_atbash: | 133 | if newly_atbash: |
@@ -121,7 +149,7 @@ func deactivate_atbash_trap(): | |||
121 | apclient.evaluateSolvability() | 149 | apclient.evaluateSolvability() |
122 | 150 | ||
123 | text_dirty = true | 151 | text_dirty = true |
124 | 152 | ||
125 | var apclient = global.get_node("Archipelago") | 153 | var apclient = global.get_node("Archipelago") |
126 | apclient.saveLocaldata() | 154 | apclient.saveLocaldata() |
127 | 155 | ||
@@ -192,23 +220,37 @@ func _tick_slowness(): | |||
192 | player.run_speed = orig_run | 220 | player.run_speed = orig_run |
193 | 221 | ||
194 | $SlownessTimer.stop() | 222 | $SlownessTimer.stop() |
195 | 223 | ||
196 | if slowness_remaining % 5 == 0: | 224 | if slowness_remaining % 5 == 0: |
197 | var apclient = global.get_node("Archipelago") | 225 | var apclient = global.get_node("Archipelago") |
198 | apclient.saveLocaldata() | 226 | apclient.saveLocaldata() |
199 | 227 | ||
200 | 228 | ||
229 | func _tick_speed_boost(): | ||
230 | speed_boosts_remaining -= 1 | ||
231 | text_dirty = true | ||
232 | |||
233 | if speed_boosts_remaining == 0: | ||
234 | var player = get_tree().get_root().get_node("Spatial/player") | ||
235 | player.walk_speed = orig_walk / 2.0 | ||
236 | player.run_speed = orig_run / 2.0 | ||
237 | |||
238 | $SpeedBoostTimer.stop() | ||
239 | |||
240 | if speed_boosts_remaining % 5 == 0: | ||
241 | var apclient = global.get_node("Archipelago") | ||
242 | apclient.saveLocaldata() | ||
243 | |||
244 | |||
201 | func _tick_iceland(): | 245 | func _tick_iceland(): |
202 | iceland_remaining -= 1 | 246 | iceland_remaining -= 1 |
203 | text_dirty = true | 247 | text_dirty = true |
204 | 248 | ||
205 | if iceland_remaining == 0: | 249 | if iceland_remaining == 0: |
206 | get_tree().get_root().get_node("Spatial/player/pivot/camera").set_environment( | 250 | get_tree().get_root().get_node("Spatial/player/pivot/camera").set_environment(orig_env) |
207 | orig_env | ||
208 | ) | ||
209 | 251 | ||
210 | $IcelandTimer.stop() | 252 | $IcelandTimer.stop() |
211 | 253 | ||
212 | if iceland_remaining % 5 == 0: | 254 | if iceland_remaining % 5 == 0: |
213 | var apclient = global.get_node("Archipelago") | 255 | var apclient = global.get_node("Archipelago") |
214 | apclient.saveLocaldata() | 256 | apclient.saveLocaldata() |
@@ -220,9 +262,11 @@ func _process(_delta): | |||
220 | if wallcast.is_colliding(): | 262 | if wallcast.is_colliding(): |
221 | var player = get_tree().get_root().get_node("Spatial/player") | 263 | var player = get_tree().get_root().get_node("Spatial/player") |
222 | var puzzlecast = player.get_node("pivot/camera/RayCast_sight") | 264 | var puzzlecast = player.get_node("pivot/camera/RayCast_sight") |
223 | var distance = puzzlecast.get_collision_point().distance_to(wallcast.get_collision_point()) | 265 | var distance = puzzlecast.get_collision_point().distance_to( |
266 | wallcast.get_collision_point() | ||
267 | ) | ||
224 | should_nbw = (distance < 0.05) | 268 | should_nbw = (distance < 0.05) |
225 | 269 | ||
226 | if should_nbw != not_behind_wall: | 270 | if should_nbw != not_behind_wall: |
227 | not_behind_wall = should_nbw | 271 | not_behind_wall = should_nbw |
228 | text_dirty = true | 272 | text_dirty = true |
@@ -239,6 +283,10 @@ func _process(_delta): | |||
239 | if not text.empty(): | 283 | if not text.empty(): |
240 | text += "\n" | 284 | text += "\n" |
241 | text += "Slowness: %d seconds" % slowness_remaining | 285 | text += "Slowness: %d seconds" % slowness_remaining |
286 | if speed_boosts_remaining > 0: | ||
287 | if not text.empty(): | ||
288 | text += "\n" | ||
289 | text += "Speed Boost: %d seconds" % speed_boosts_remaining | ||
242 | if iceland_remaining > 0: | 290 | if iceland_remaining > 0: |
243 | if not text.empty(): | 291 | if not text.empty(): |
244 | text += "\n" | 292 | text += "\n" |