[High] [Bug] All 24 conversion disciplines skip mana drain entirely — zero cost for full benefits #379
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?
Bug Summary
All 24 conversion disciplines (elemental-regen.ts and elemental-regen-advanced.ts) have zero mana drain when active, despite having
drainBasevalues defined. This affects ~47% of all disciplines.Expected Behavior
When a conversion discipline is active, it should drain mana from the pool specified by
def.manaTypeusing the formula:drainBase × (1 + (XP / difficultyFactor)^0.4). If insufficient mana exists, it should auto-pause.Root Cause
In
src/lib/game/stores/discipline-slice.ts:210-217, theprocessTickmethod explicitly skips mana drain for any discipline withsourceManaTypesdefined:The comment says "they contribute to conversion rates, not direct pool drain" — but this is incorrect. These disciplines have
drainBasevalues (1-3) indicating the intent was for them to drain mana.Affected Disciplines (24 total)
elemental-regen.ts (8): regen-fire, regen-water, regen-air, regen-earth, regen-light, regen-dark, regen-death, regen-transference
elemental-regen-advanced.ts (16): regen-metal, regen-sand, regen-lightning, regen-frost, regen-blackflame, regen-radiantflames, regen-miasma, regen-shadowglass, regen-crystal, regen-void, regen-stellar, regen-soul, regen-plasma, regen-time
Severity
High — Conversion disciplines provide mana generation (via conversion rates) while having zero cost, breaking game balance. The transference conversion discipline is one of the first disciplines a player encounters.
Fix Direction
Remove the
isConversionDisciplineguard and apply mana drain to all disciplines. The drain is separate from the conversion mechanic — disciplines should both drain their mana type AND contribute to conversion rates.Files Involved
src/lib/game/stores/discipline-slice.tsisConversionDisciplineguard skips drainsrc/lib/game/data/disciplines/elemental-regen.tssrc/lib/game/data/disciplines/elemental-regen-advanced.tsStarting investigation of conversion discipline mana drain bug.
✅ Fixed. Removed the
isConversionDisciplineguard indiscipline-slice.ts:processTickthat was skipping mana drain for all 24 conversion disciplines. Updated tests to verify correct behavior — conversion disciplines now properly drain mana from their target element pool. Added regression tests for auto-pause and XP accrual. All 1196 tests pass.