diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-08-03 21:59:05 -0400 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-08-03 21:59:05 -0400 |
| commit | ff91005b9d80789c7429d35974120e1bedca3bfd (patch) | |
| tree | 9ed8ff5748454046372eaee90546a4beb790a204 /Archipelago | |
| parent | a3cc416a21297747b412dabe75fc4532cd5c8d68 (diff) | |
| download | lingo-archipelago-ff91005b9d80789c7429d35974120e1bedca3bfd.tar.gz lingo-archipelago-ff91005b9d80789c7429d35974120e1bedca3bfd.tar.bz2 lingo-archipelago-ff91005b9d80789c7429d35974120e1bedca3bfd.zip | |
Remaining puzzle skips are saved between sessions
Diffstat (limited to 'Archipelago')
| -rw-r--r-- | Archipelago/client.gd | 12 |
1 files changed, 10 insertions, 2 deletions
| diff --git a/Archipelago/client.gd b/Archipelago/client.gd index f0a4d2e..d21806f 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd | |||
| @@ -249,6 +249,8 @@ func _on_data(): | |||
| 249 | if _slot_data.has("level_2_requirement"): | 249 | if _slot_data.has("level_2_requirement"): |
| 250 | _level_2_requirement = _slot_data["level_2_requirement"] | 250 | _level_2_requirement = _slot_data["level_2_requirement"] |
| 251 | 251 | ||
| 252 | _puzzle_skips = 0 | ||
| 253 | |||
| 252 | _localdata_file = "user://archipelago_data/%s_%d" % [_seed, _slot] | 254 | _localdata_file = "user://archipelago_data/%s_%d" % [_seed, _slot] |
| 253 | var ap_file = File.new() | 255 | var ap_file = File.new() |
| 254 | if ap_file.file_exists(_localdata_file): | 256 | if ap_file.file_exists(_localdata_file): |
| @@ -261,6 +263,9 @@ func _on_data(): | |||
| 261 | else: | 263 | else: |
| 262 | _last_new_item = -1 | 264 | _last_new_item = -1 |
| 263 | 265 | ||
| 266 | if localdata.size() > 1: | ||
| 267 | _puzzle_skips = localdata[1] | ||
| 268 | |||
| 264 | requestSync() | 269 | requestSync() |
| 265 | 270 | ||
| 266 | emit_signal("client_connected") | 271 | emit_signal("client_connected") |
| @@ -415,7 +420,7 @@ func saveLocaldata(): | |||
| 415 | var file = File.new() | 420 | var file = File.new() |
| 416 | file.open(_localdata_file, File.WRITE) | 421 | file.open(_localdata_file, File.WRITE) |
| 417 | 422 | ||
| 418 | var data = [_last_new_item] | 423 | var data = [_last_new_item, _puzzle_skips] |
| 419 | file.store_var(data, true) | 424 | file.store_var(data, true) |
| 420 | file.close() | 425 | file.close() |
| 421 | 426 | ||
| @@ -540,7 +545,6 @@ func mapFinishedLoading(): | |||
| 540 | _received_indexes.clear() | 545 | _received_indexes.clear() |
| 541 | _progressive_progress.clear() | 546 | _progressive_progress.clear() |
| 542 | _has_colors = ["white"] | 547 | _has_colors = ["white"] |
| 543 | _puzzle_skips = 0 | ||
| 544 | emit_signal("evaluate_solvability") | 548 | emit_signal("evaluate_solvability") |
| 545 | 549 | ||
| 546 | for item in _held_items: | 550 | for item in _held_items: |
| @@ -637,6 +641,8 @@ func processItem(item, index, from, flags): | |||
| 637 | if item_name == "Puzzle Skip": | 641 | if item_name == "Puzzle Skip": |
| 638 | _puzzle_skips += 1 | 642 | _puzzle_skips += 1 |
| 639 | 643 | ||
| 644 | saveLocaldata() | ||
| 645 | |||
| 640 | 646 | ||
| 641 | func doorIsVanilla(door): | 647 | func doorIsVanilla(door): |
| 642 | return !$Gamedata.mentioned_doors.has(door) | 648 | return !$Gamedata.mentioned_doors.has(door) |
| @@ -657,6 +663,8 @@ func getAvailablePuzzleSkips(): | |||
| 657 | func usePuzzleSkip(): | 663 | func usePuzzleSkip(): |
| 658 | _puzzle_skips -= 1 | 664 | _puzzle_skips -= 1 |
| 659 | 665 | ||
| 666 | saveLocaldata() | ||
| 667 | |||
| 660 | 668 | ||
| 661 | func colorForItemType(flags): | 669 | func colorForItemType(flags): |
| 662 | var int_flags = int(flags) | 670 | var int_flags = int(flags) |
