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
+5 -2
View File
@@ -6,6 +6,7 @@ import { useGameStore } from '../stores/gameStore';
import { useManaStore } from '../stores/manaStore';
import { useCombatStore } from '../stores/combatStore';
import { usePrestigeStore } from '../stores/prestigeStore';
import { useAttunementStore } from '../stores/attunementStore';
import { computeEffects } from '../effects/upgrade-effects';
import {
computeMaxMana,
@@ -18,6 +19,7 @@ import {
getElementalBonus,
} from '../utils';
import { computePactMultiplier, computePactInsightMultiplier } from '../utils/pact-utils';
import { ELEMENTS, SPELLS_DEF, getStudySpeedMultiplier, getStudyCostMultiplier, HOURS_PER_TICK, TICK_MS } from '../constants';
import { getGuardianForFloor } from '../data/guardian-encounters';
import { hasSpecial, SPECIAL_EFFECTS } from '../effects/special-effects';
@@ -32,6 +34,7 @@ export function useManaStats() {
const meditateTicks = useManaStore((s) => s.meditateTicks);
const day = useGameStore((s) => s.day);
const hour = useGameStore((s) => s.hour);
const attunements = useAttunementStore((s) => s.attunements);
const disciplineEffects = useMemo(
() => computeDisciplineEffects(),
@@ -49,8 +52,8 @@ export function useManaStats() {
);
const baseRegen = useMemo(
() => computeRegen({ prestigeUpgrades, attunements: {} } as any, upgradeEffects),
[prestigeUpgrades, upgradeEffects]
() => computeRegen({ prestigeUpgrades, attunements } as any, upgradeEffects),
[prestigeUpgrades, upgradeEffects, attunements]
);
const clickMana = useMemo(