From 37be40c8129ccaa3cd26629c383f1d9d03523366 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sun, 24 Mar 2024 09:57:05 -0400 Subject: Geronimo gets you a puzzle skip --- Archipelago/client.gd | 20 ++++++++++++++++++-- Archipelago/load.gd | 3 +++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 06fb3a6..05294d5 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -115,6 +115,7 @@ var _puzzle_skips = 0 var _cached_slowness = 0 var _cached_iceland = 0 var _cached_atbash = 0 +var _geronimo_skip = false signal could_not_connect signal connect_status @@ -300,7 +301,7 @@ func _on_data(): if localdata.size() > 1: _puzzle_skips = localdata[1] - + if localdata.size() > 2: _cached_slowness = localdata[2] else: @@ -316,6 +317,11 @@ func _on_data(): else: _cached_atbash = 0 + if localdata.size() > 5: + _geronimo_skip = localdata[5] + else: + _geronimo_skip = false + requestSync() emit_signal("client_connected") @@ -475,7 +481,8 @@ func saveLocaldata(): _puzzle_skips, effects_node.slowness_remaining, effects_node.iceland_remaining, - effects_node.atbash_remaining + effects_node.atbash_remaining, + _geronimo_skip ] file.store_var(data, true) file.close() @@ -720,6 +727,15 @@ func usePuzzleSkip(): saveLocaldata() +func geronimo(): + if !_geronimo_skip: + messages.showMessage("Geronimo! You found a puzzle skip.") + + _puzzle_skips += 1 + _geronimo_skip = true + saveLocaldata() + + func colorForItemType(flags): var int_flags = int(flags) if int_flags & 1: # progression diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 66c9b8a..207550b 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd @@ -577,6 +577,9 @@ func _load(): var multiplayer_node = apclient.SCRIPT_multiplayer.new() multiplayer_node.ghost_mode = true add_child(multiplayer_node) + + # Hook up Geronimo handler. + $player.connect("player_jumped", apclient, "geronimo") # Hook up the scene to be able to handle connection failures. apclient.connect("could_not_connect", self, "archipelago_disconnected") -- cgit 1.4.1