feat: Enhance key selection process by storing original inventory keys and correct key ID for retries

This commit is contained in:
Z. Cliffe Schreuders
2025-11-24 13:52:07 +00:00
parent 5ecfa5db27
commit 0d7ba1f2fc
2 changed files with 5 additions and 2 deletions

View File

@@ -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

View File

@@ -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 {