[Critical] [Feature] Overhaul mana conversion system to unified regen-deduction model #263
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?
Summary
The current mana conversion system is fragmented across multiple inconsistent mechanisms (attunement conversions, discipline conversions, manual conversion, pact conversions). This issue overhauls everything into a single unified system.
Problem
Solution
See full specification at
docs/specs/mana-conversion-spec.md.Key Changes
1. Unified Conversion Formula
All three sources (disciplines, attunements, guardian pacts) contribute to a single rate:
2. Element Distance from Raw Mana
Every element has a distance (base=1, composite=2, exotic=3, time=4). Used for:
3. Tiered Conversion Costs
4. Regen Deduction Model
All conversion costs are deducted from mana regen, not from the mana pool. Each element shows:
5. Auto-Pause on Insufficient Regen
If conversion cost > gross regen for any source type, the conversion is completely disabled with a visible warning in the UI.
6. Attunement Level Multiplier
Each attunement level adds +50% to the multiplier for conversions involving the attunement's primary element (as destination or component).
7. Pact Conversion Bonus
Each signed pact grants +0.15/hr base rate for the guardian's element, plus a level bonus scaled by Invoker attunement level (pactCount × invokerLevel × 0.25).
8. Meditation Applies to Conversions
Meditation multiplier boosts conversion rates at full strength for distance-1 elements, half strength for distance-2, etc.
9. No Manual Conversion
Remove
convertMana,processConvertAction,craftComposite, and the "convert" player action. All conversion is passive.10. Stats Tab Overhaul
New Conversion Stats section showing per-element breakdown with formulas, sources, drains, net regen, and pause warnings.
Files to Modify
src/lib/game/utils/element-distance.ts(new)src/lib/game/utils/conversion-rates.ts(new)src/lib/game/data/conversion-costs.ts(new)src/lib/game/data/disciplines/elemental-regen.tssrc/lib/game/data/disciplines/elemental-regen-advanced.tssrc/lib/game/data/attunements.tssrc/lib/game/effects/discipline-effects.tssrc/lib/game/stores/gameStore.tssrc/lib/game/stores/manaStore.tssrc/lib/game/stores/prestigeStore.tssrc/components/game/tabs/StatsTab/ElementStatsSection.tsxsrc/components/game/ManaDisplay.tsxAcceptance Criteria
Starting implementation of unified mana conversion system overhaul. Plan: 10 tasks covering new utility files, updated discipline/attunement data, store changes, and UI updates.
Implementation complete. All 10 acceptance criteria met:
finalRate = (discBase + attBase + pactBase) × attMult × pactMult × medMultab3afae