From 0d7ba1f2fc2569b71a5b1192e92d73ed127554e6 Mon Sep 17 00:00:00 2001 From: "Z. Cliffe Schreuders" Date: Mon, 24 Nov 2025 13:52:07 +0000 Subject: [PATCH] feat: Enhance key selection process by storing original inventory keys and correct key ID for retries --- .../break_escape/js/minigames/lockpicking/key-operations.js | 4 ++-- .../js/minigames/lockpicking/lockpicking-game-phaser.js | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/public/break_escape/js/minigames/lockpicking/key-operations.js b/public/break_escape/js/minigames/lockpicking/key-operations.js index ea76583..fde408d 100644 --- a/public/break_escape/js/minigames/lockpicking/key-operations.js +++ b/public/break_escape/js/minigames/lockpicking/key-operations.js @@ -244,8 +244,8 @@ export class KeyOperations { // This is the locksmith-forge.html challenge mode this.parent.keySelection.createKeysForChallenge('correct_key'); } else { - // This is the main game - go back to key selection - this.parent.startWithKeySelection(); + // This is the main game - go back to key selection with original inventory keys + this.parent.startWithKeySelection(this.parent.originalInventoryKeys, this.parent.originalCorrectKeyId); } } }, 2000); // Longer delay to show the red flash diff --git a/public/break_escape/js/minigames/lockpicking/lockpicking-game-phaser.js b/public/break_escape/js/minigames/lockpicking/lockpicking-game-phaser.js index d19dc7d..f56b708 100644 --- a/public/break_escape/js/minigames/lockpicking/lockpicking-game-phaser.js +++ b/public/break_escape/js/minigames/lockpicking/lockpicking-game-phaser.js @@ -469,7 +469,10 @@ export class LockpickingMinigamePhaser extends MinigameScene { this.keySelectionMode = true; // Mark that we're in key selection mode + // Store the original inventory keys and correct key ID for use when retrying after wrong selection if (inventoryKeys && inventoryKeys.length > 0) { + this.originalInventoryKeys = inventoryKeys; + this.originalCorrectKeyId = correctKeyId; // Use provided inventory keys this.keySelection.createKeysFromInventory(inventoryKeys, correctKeyId); } else {