fix: resolve elemental mana conversion pause bug (#348)
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m22s

Two root causes fixed:
1. gameStore.ts: computeRegen now receives actual attunements instead of empty {}, so rawGrossRegen includes attunement contributions (was ~2/hr, now correct 3000+/hr)
2. gameStore.ts buildConversionParams: use rawManaRegen with level scaling (1.5^(level-1)) instead of conversionRate for per-element grossRegen
3. LeftPanel.tsx: same grossRegen fix + include attunement regen in rawGrossRegen display
4. ElementStatsSection.tsx: same grossRegen fix
5. useGameDerived.ts: pass actual attunements to computeRegen for baseRegen calculation

Added regression test: conversion-pause-bug-regression.test.ts (7 tests)
This commit is contained in:
2026-06-10 11:19:10 +02:00
parent bdf2b0050f
commit 076282caf3
8 changed files with 290 additions and 13 deletions
+4 -3
View File
@@ -117,7 +117,7 @@ export const useGameStore = create<GameCoordinatorStore>()(
disciplineEffects,
);
const baseRegen = computeRegen(
{ prestigeUpgrades: ctx.prestige.prestigeUpgrades, attunements: {} },
{ prestigeUpgrades: ctx.prestige.prestigeUpgrades, attunements: ctx.attunement.attunements },
undefined,
disciplineEffects,
) * (1 + (disciplineEffects.multipliers.regenMultiplier || 0));
@@ -389,9 +389,10 @@ function buildConversionParams(
for (const [id, state] of Object.entries(attunements)) {
if (!state.active) continue;
const def = ATTUNEMENTS_DEF[id];
if (def?.primaryManaType) {
if (def?.primaryManaType && def.rawManaRegen) {
const levelMult = Math.pow(1.5, (state.level || 1) - 1);
grossRegen[def.primaryManaType] = (grossRegen[def.primaryManaType] || 0)
+ (def.conversionRate || 0);
+ def.rawManaRegen * levelMult;
}
}
return { pactElementMap, grossRegen };