[priority: medium-high] refactor: Replace natural-regen disciplines with mana conversion speed disciplines #139
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?
Problem
There are currently 14 elemental regen disciplines (8 in
elemental-regen.ts, 6 inelemental-regen-advanced.ts) that passively generate element mana from nothing usingregen_{element}stat bonuses. The design intent has changed: these should instead speed up mana conversion from raw mana (and/or constituent mana types) to the target mana type, following the same zero-sum transfer pattern used by attunement conversions.Current System (to be removed)
Each discipline adds
regen_{element}todisciplineEffects.bonuses, and the tick ingameStore.tsappliesvalue * HOURS_PER_TICKdirectly toelements[element].current— creating mana from nothing.New System (to be implemented)
Each element discipline should define a conversion rate (similar to attunement
conversionRate). The tick should:Conversion Recipes (from
elements.ts)(Base elements: raw mana only. Composites: raw + constituent base elements. Exotics: raw + constituent composite/base elements.)
Locking Requirements
requiresfield on these disciplines should reference guardian floor numbers or mana type access checks, NOT prerequisite discipline IDs.Requires: fire mana, earth mana(element names), notRequires: fire(raw IDs).What Needs to Change
Data Layer
src/lib/game/data/disciplines/elemental-regen.ts— rewrite all 8 base disciplines withconversionRateinstead ofregen_*statBonussrc/lib/game/data/disciplines/elemental-regen-advanced.ts— rewrite all 6 composite/exotic disciplines similarlyregen_{element}stat keys, replace withconversionRate+sourceManaTypes[]fields on the discipline definitionType Layer
src/lib/game/types/disciplines.ts— addconversionRateandsourceManaTypesfields toDisciplineDefinitionEffect Layer
src/lib/game/effects/discipline-effects.ts— instead of adding tobonuses['regen_*'], disciplines withconversionRateshould produce a conversion entryconversionSpeedmap in the effect system (similar toperElementRegenBonus)Tick Pipeline
src/lib/game/stores/gameStore.ts— replace theregen_*bonus application (lines ~277-289) with a conversion step:conversionRate: drain source mana types, add to target elementPrerequisite Display
src/lib/game/utils/discipline-math.ts—checkDisciplinePrerequisites()should resolve mana type IDs to names like"fire mana"instead of"fire"src/lib/game/stores/discipline-slice.ts—activate()should gate on having source mana types unlockedFiles
src/lib/game/types/disciplines.tssrc/lib/game/data/disciplines/elemental-regen.ts(full rewrite)src/lib/game/data/disciplines/elemental-regen-advanced.ts(full rewrite)src/lib/game/effects/discipline-effects.tssrc/lib/game/effects.tssrc/lib/game/stores/gameStore.tssrc/lib/game/stores/discipline-slice.tssrc/lib/game/utils/discipline-math.tssrc/lib/game/components/game/tabs/DisciplinesTab.tsx(prereq display)refactor: Replace natural-regen disciplines with mana conversion speed disciplinesto [priority: high] refactor: Replace natural-regen disciplines with mana conversion speed disciplines[priority: high] refactor: Replace natural-regen disciplines with mana conversion speed disciplinesto [priority: medium-high] refactor: Replace natural-regen disciplines with mana conversion speed disciplinesStarting work on replacing natural-regen disciplines with mana conversion speed disciplines. Plan:
✅ Complete. Replaced all 14 natural-regen disciplines with mana conversion speed disciplines.
Changes (12 files, 430 insertions, 263 deletions):
conversionRateandsourceManaTypesfields toDisciplineDefinitionconversionsmap instead ofregen_{element}bonuses; conversion rate scales with XP via stat bonusactivate()now gates on all source mana types being unlocked (not just the target)checkDisciplinePrerequisites()resolves unknown IDs as mana type requirements, displaying as "X mana" (e.g. "fire mana, earth mana")regen_{element}merge loop (no longer produced)All 885 tests pass. Files within 400-line limit.