about summary refs log tree commit diff stats
path: root/Archipelago/client.gd
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-02-04 13:49:06 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2024-02-04 13:49:06 -0500
commit72bb06c42fcab5c215ff034e8445c33057e0c23d (patch)
treeab1c15c52567fbdf3c8a1cf89dc0aee149c97500 /Archipelago/client.gd
parent8175ffdc895392764613a8bb6c738c49926d5773 (diff)
downloadlingo-archipelago-72bb06c42fcab5c215ff034e8445c33057e0c23d.tar.gz
lingo-archipelago-72bb06c42fcab5c215ff034e8445c33057e0c23d.tar.bz2
lingo-archipelago-72bb06c42fcab5c215ff034e8445c33057e0c23d.zip
Persist traps between connections
Diffstat (limited to 'Archipelago/client.gd')
-rw-r--r--Archipelago/client.gd28
1 files changed, 27 insertions, 1 deletions
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 = {}
112var _has_colors = ["white"] 112var _has_colors = ["white"]
113var _received_indexes = [] 113var _received_indexes = []
114var _puzzle_skips = 0 114var _puzzle_skips = 0
115var _cached_slowness = 0
116var _cached_iceland = 0
117var _cached_atbash = 0
115 118
116signal could_not_connect 119signal could_not_connect
117signal connect_status 120signal connect_status
@@ -297,6 +300,21 @@ func _on_data():
297 300
298 if localdata.size() > 1: 301 if localdata.size() > 1:
299 _puzzle_skips = localdata[1] 302 _puzzle_skips = localdata[1]
303
304 if localdata.size() > 2:
305 _cached_slowness = localdata[2]
306 else:
307 _cached_slowness = 0
308
309 if localdata.size() > 3:
310 _cached_iceland = localdata[3]
311 else:
312 _cached_iceland = 0
313
314 if localdata.size() > 4:
315 _cached_atbash = localdata[4]
316 else:
317 _cached_atbash = 0
300 318
301 requestSync() 319 requestSync()
302 320
@@ -450,7 +468,15 @@ func saveLocaldata():
450 var file = File.new() 468 var file = File.new()
451 file.open(_localdata_file, File.WRITE) 469 file.open(_localdata_file, File.WRITE)
452 470
453 var data = [_last_new_item, _puzzle_skips] 471 var effects_node = get_tree().get_root().get_node("Spatial/AP_Effects")
472
473 var data = [
474 _last_new_item,
475 _puzzle_skips,
476 effects_node.slowness_remaining,
477 effects_node.iceland_remaining,
478 effects_node.atbash_remaining
479 ]
454 file.store_var(data, true) 480 file.store_var(data, true)
455 file.close() 481 file.close()
456 482