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 | |
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')
-rw-r--r-- | Archipelago/client.gd | 15 | ||||
-rw-r--r-- | Archipelago/effects.gd | 66 |
2 files changed, 71 insertions, 10 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 3973f0e..6621194 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd | |||
@@ -104,6 +104,7 @@ var _pilgrimage_allows_roof_access = false | |||
104 | var _pilgrimage_allows_paintings = false | 104 | var _pilgrimage_allows_paintings = false |
105 | var _sunwarp_shuffle = false | 105 | var _sunwarp_shuffle = false |
106 | var _sunwarp_mapping = [] | 106 | var _sunwarp_mapping = [] |
107 | var _speed_boost_mode = false | ||
107 | var _slot_seed = 0 | 108 | var _slot_seed = 0 |
108 | 109 | ||
109 | var _map_loaded = false | 110 | var _map_loaded = false |
@@ -117,6 +118,7 @@ var _puzzle_skips = 0 | |||
117 | var _cached_slowness = 0 | 118 | var _cached_slowness = 0 |
118 | var _cached_iceland = 0 | 119 | var _cached_iceland = 0 |
119 | var _cached_atbash = 0 | 120 | var _cached_atbash = 0 |
121 | var _cached_speed_boosts = 0 | ||
120 | var _geronimo_skip = false | 122 | var _geronimo_skip = false |
121 | var _checked_paintings = [] | 123 | var _checked_paintings = [] |
122 | 124 | ||
@@ -330,6 +332,10 @@ func _on_data(): | |||
330 | _sunwarp_shuffle = false | 332 | _sunwarp_shuffle = false |
331 | if _slot_data.has("sunwarp_permutation"): | 333 | if _slot_data.has("sunwarp_permutation"): |
332 | _sunwarp_mapping = _slot_data["sunwarp_permutation"] | 334 | _sunwarp_mapping = _slot_data["sunwarp_permutation"] |
335 | if _slot_data.has("speed_boost_mode"): | ||
336 | _speed_boost_mode = _slot_data["speed_boost_mode"] | ||
337 | else: | ||
338 | _speed_boost_mode = false | ||
333 | 339 | ||
334 | if ( | 340 | if ( |
335 | _location_classification_bit != kCLASSIFICATION_LOCAL_INSANITY | 341 | _location_classification_bit != kCLASSIFICATION_LOCAL_INSANITY |
@@ -348,6 +354,7 @@ func _on_data(): | |||
348 | _cached_slowness = 0 | 354 | _cached_slowness = 0 |
349 | _cached_iceland = 0 | 355 | _cached_iceland = 0 |
350 | _cached_atbash = 0 | 356 | _cached_atbash = 0 |
357 | _cached_speed_boosts = 0 | ||
351 | _geronimo_skip = false | 358 | _geronimo_skip = false |
352 | 359 | ||
353 | _localdata_file = "user://archipelago_data/%s_%d" % [_seed, _slot] | 360 | _localdata_file = "user://archipelago_data/%s_%d" % [_seed, _slot] |
@@ -379,6 +386,9 @@ func _on_data(): | |||
379 | if localdata.size() > 5: | 386 | if localdata.size() > 5: |
380 | _geronimo_skip = localdata[5] | 387 | _geronimo_skip = localdata[5] |
381 | 388 | ||
389 | if localdata.size() > 6: | ||
390 | _cached_speed_boosts = localdata[6] | ||
391 | |||
382 | requestSync() | 392 | requestSync() |
383 | 393 | ||
384 | sendMessage( | 394 | sendMessage( |
@@ -568,7 +578,8 @@ func saveLocaldata(): | |||
568 | effects_node.slowness_remaining, | 578 | effects_node.slowness_remaining, |
569 | effects_node.iceland_remaining, | 579 | effects_node.iceland_remaining, |
570 | effects_node.atbash_remaining, | 580 | effects_node.atbash_remaining, |
571 | _geronimo_skip | 581 | _geronimo_skip, |
582 | effects_node.speed_boosts_remaining, | ||
572 | ] | 583 | ] |
573 | file.store_var(data, true) | 584 | file.store_var(data, true) |
574 | file.close() | 585 | file.close() |
@@ -800,6 +811,8 @@ func processItem(item, index, from, flags): | |||
800 | effects_node.trigger_iceland_trap() | 811 | effects_node.trigger_iceland_trap() |
801 | if item_name == "Atbash Trap": | 812 | if item_name == "Atbash Trap": |
802 | effects_node.trigger_atbash_trap() | 813 | effects_node.trigger_atbash_trap() |
814 | if item_name == "Speed Boost": | ||
815 | effects_node.trigger_speed_boost() | ||
803 | if item_name == "Puzzle Skip": | 816 | if item_name == "Puzzle Skip": |
804 | _puzzle_skips += 1 | 817 | _puzzle_skips += 1 |
805 | 818 | ||
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" |