From e5097211ba568d2de2a8a770f344bd4306fde3fe Mon Sep 17 00:00:00 2001 From: n8n-gitea Date: Sun, 7 Jun 2026 18:09:03 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20recovery=20room=2010=C3=97=20regen/conve?= =?UTF-8?q?rsion=20multiplier=20double-counting=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/circular-deps.txt | 2 +- docs/dependency-graph.json | 2 +- src/lib/game/stores/gameStore.ts | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/circular-deps.txt b/docs/circular-deps.txt index 2352e6c..caca774 100644 --- a/docs/circular-deps.txt +++ b/docs/circular-deps.txt @@ -1,4 +1,4 @@ # Circular Dependencies -Generated: 2026-06-07T12:48:17.619Z +Generated: 2026-06-07T14:14:38.464Z No circular dependencies found. ✅ diff --git a/docs/dependency-graph.json b/docs/dependency-graph.json index 1a338d9..289fbae 100644 --- a/docs/dependency-graph.json +++ b/docs/dependency-graph.json @@ -1,6 +1,6 @@ { "_meta": { - "generated": "2026-06-07T12:48:15.677Z", + "generated": "2026-06-07T14:14:36.561Z", "description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.", "usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry." }, diff --git a/src/lib/game/stores/gameStore.ts b/src/lib/game/stores/gameStore.ts index c1efff3..6549825 100644 --- a/src/lib/game/stores/gameStore.ts +++ b/src/lib/game/stores/gameStore.ts @@ -274,13 +274,18 @@ export const useGameStore = create()( const roomType = ctx.combat.currentRoom?.roomType; if (roomType === 'library' || roomType === 'recovery' || roomType === 'treasure' || roomType === 'puzzle') { if (roomType === 'recovery') { + // Recovery room grants 10× regen/conversion multiplier. + // Normal regen was already applied above, so we apply only + // the delta (9× additional) to avoid double-counting. const boostedRegen = baseRegen * 10; const netBoostedRegen = Math.max(0, boostedRegen * (1 - incursionStrength) * meditationMultiplier - conversionResult.totalRawDrain); - rawMana = Math.min(rawMana + netBoostedRegen * HOURS_PER_TICK, maxMana); + const regenDelta = netBoostedRegen - netRawRegen; + rawMana = Math.min(rawMana + regenDelta * HOURS_PER_TICK, maxMana); for (const [elem, entry] of Object.entries(conversionResult.rates)) { if (entry.paused || entry.finalRate <= 0 || !elements[elem]) continue; if (!elements[elem].unlocked) elements[elem] = { ...elements[elem], unlocked: true }; - elements[elem] = { ...elements[elem], current: Math.min(elements[elem].max, elements[elem].current + entry.finalRate * 10 * HOURS_PER_TICK) }; + // Normal conversion already applied above; add only the 9× delta + elements[elem] = { ...elements[elem], current: Math.min(elements[elem].max, elements[elem].current + entry.finalRate * 9 * HOURS_PER_TICK) }; } } useCombatStore.getState().tickNonCombatRoom(HOURS_PER_TICK);