From 72bb06c42fcab5c215ff034e8445c33057e0c23d Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sun, 4 Feb 2024 13:49:06 -0500 Subject: Persist traps between connections --- Archipelago/client.gd | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'Archipelago/client.gd') diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 788f6ca..3a2a783 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -112,6 +112,9 @@ var _progressive_progress = {} var _has_colors = ["white"] var _received_indexes = [] var _puzzle_skips = 0 +var _cached_slowness = 0 +var _cached_iceland = 0 +var _cached_atbash = 0 signal could_not_connect signal connect_status @@ -297,6 +300,21 @@ func _on_data(): if localdata.size() > 1: _puzzle_skips = localdata[1] + + if localdata.size() > 2: + _cached_slowness = localdata[2] + else: + _cached_slowness = 0 + + if localdata.size() > 3: + _cached_iceland = localdata[3] + else: + _cached_iceland = 0 + + if localdata.size() > 4: + _cached_atbash = localdata[4] + else: + _cached_atbash = 0 requestSync() @@ -450,7 +468,15 @@ func saveLocaldata(): var file = File.new() file.open(_localdata_file, File.WRITE) - var data = [_last_new_item, _puzzle_skips] + var effects_node = get_tree().get_root().get_node("Spatial/AP_Effects") + + var data = [ + _last_new_item, + _puzzle_skips, + effects_node.slowness_remaining, + effects_node.iceland_remaining, + effects_node.atbash_remaining + ] file.store_var(data, true) file.close() -- cgit 1.4.1