From a3cc416a21297747b412dabe75fc4532cd5c8d68 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 3 Aug 2023 21:57:04 -0400 Subject: Puzzle skips --- Archipelago/client.gd | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Archipelago/client.gd') diff --git a/Archipelago/client.gd b/Archipelago/client.gd index e3b2c89..f0a4d2e 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -92,6 +92,7 @@ var _last_new_item = -1 var _progressive_progress = {} var _has_colors = ["white"] var _received_indexes = [] +var _puzzle_skips = 0 signal could_not_connect signal connect_status @@ -539,6 +540,7 @@ func mapFinishedLoading(): _received_indexes.clear() _progressive_progress.clear() _has_colors = ["white"] + _puzzle_skips = 0 emit_signal("evaluate_solvability") for item in _held_items: @@ -632,6 +634,8 @@ func processItem(item, index, from, flags): effects_node.trigger_iceland_trap() if item_name == "Atbash Trap": effects_node.trigger_atbash_trap() + if item_name == "Puzzle Skip": + _puzzle_skips += 1 func doorIsVanilla(door): @@ -646,6 +650,14 @@ func evaluateSolvability(): emit_signal("evaluate_solvability") +func getAvailablePuzzleSkips(): + return _puzzle_skips + + +func usePuzzleSkip(): + _puzzle_skips -= 1 + + func colorForItemType(flags): var int_flags = int(flags) if int_flags & 1: # progression -- cgit 1.4.1