fix: totalManaGathered incorrectly accumulates spell costs instead of mana gathered #28
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: Critical
File:
src/lib/game/stores/combat-actions.ts(lines 48, 79)Problem:
totalManaGathered += spellDef.cost.amountis added every time a spell is cast. This is spell cost spent, not mana gathered. This inflates thetotalManaGatheredstat, which feeds intocalcInsight(), making insight gains artificially high proportional to combat casting.Impact: Players gain more insight than intended based on how much they cast spells, breaking game balance.
Fix: Remove
totalManaGatheredaccumulation fromprocessCombatTick. Mana gathering should only happen ingatherManaand passive regen ticks in the game store.Starting work on totalManaGathered incorrectly accumulates spell costs
Fixed: Removed
totalManaGathered += spellDef.cost.amountfrom both spell cast loops in combat-actions.ts. Mana gathering should only happen in gatherMana and passive regen.