fix: totalManaGathered incorrectly accumulates spell costs instead of mana gathered #28

Closed
opened 2026-05-18 15:56:07 +02:00 by Anexim · 2 comments
Owner

Severity: Critical

File: src/lib/game/stores/combat-actions.ts (lines 48, 79)

Problem: totalManaGathered += spellDef.cost.amount is added every time a spell is cast. This is spell cost spent, not mana gathered. This inflates the totalManaGathered stat, which feeds into calcInsight(), 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 totalManaGathered accumulation from processCombatTick. Mana gathering should only happen in gatherMana and passive regen ticks in the game store.

**Severity:** Critical **File:** `src/lib/game/stores/combat-actions.ts` (lines 48, 79) **Problem:** `totalManaGathered += spellDef.cost.amount` is added every time a spell is cast. This is **spell cost spent**, not mana gathered. This inflates the `totalManaGathered` stat, which feeds into `calcInsight()`, 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 `totalManaGathered` accumulation from `processCombatTick`. Mana gathering should only happen in `gatherMana` and passive regen ticks in the game store.
Anexim added the ai:todo label 2026-05-18 15:56:07 +02:00
n8n-gitea was assigned by Anexim 2026-05-18 15:56:07 +02:00
Author
Owner

Starting work on totalManaGathered incorrectly accumulates spell costs

Starting work on totalManaGathered incorrectly accumulates spell costs
Author
Owner

Fixed: Removed totalManaGathered += spellDef.cost.amount from both spell cast loops in combat-actions.ts. Mana gathering should only happen in gatherMana and passive regen.

Fixed: Removed `totalManaGathered += spellDef.cost.amount` from both spell cast loops in combat-actions.ts. Mana gathering should only happen in gatherMana and passive regen.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#28