From 6a301c8bc3c5b19c2cc23bd2c7b1c1658ac5e4c2 Mon Sep 17 00:00:00 2001 From: Damian-I Date: Thu, 13 Mar 2025 18:49:24 +0000 Subject: [PATCH] Lockpick unlocks target --- index.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index fe5fe47..178d006 100644 --- a/index.html +++ b/index.html @@ -3313,7 +3313,11 @@ // If not found, try object-level difficulty difficulty = difficulty || lockable.scenarioData?.difficulty || lockable.properties?.difficulty; debugLog('STARTING LOCKPICK MINIGAME', { difficulty }, 2); - startLockpickingMinigame(lockable, game.scene.scenes[0], difficulty); + startLockpickingMinigame(lockable, game.scene.scenes[0], difficulty, () => { + // Add callback to handle successful lockpicking + unlockTarget(lockable, type, lockable.layer); + gameAlert(`Successfully picked the lock!`, 'success', 'Lock Picked', 4000); + }); } } else { debugLog('KEY NOT FOUND - FAIL', null, 2); @@ -5721,7 +5725,7 @@ MinigameFramework.registerScene('lockpicking', LockpickingMinigame); // Replacement for the startLockpickingMinigame function - function startLockpickingMinigame(lockable, scene, difficulty = 'medium') { + function startLockpickingMinigame(lockable, scene, difficulty = 'medium', callback) { // Initialize the framework if not already done if (!MinigameFramework.mainGameScene) { MinigameFramework.init(scene); @@ -5735,6 +5739,7 @@ if (success) { debugLog('LOCKPICK SUCCESS', null, 1); gameAlert(`Successfully picked the lock!`, 'success', 'Lockpicking', 4000); + callback(); } else { debugLog('LOCKPICK FAILED', null, 2); gameAlert(`Failed to pick the lock.`, 'error', 'Lockpicking', 4000);