[priority: highest] Remove skill system leftovers — migrate click mana to discipline perk #174
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 old skill system (
skills: Record<string, number>,skillUpgrades,skillTiers,skillProgress,studyQueue, etc.) was removed, but significant dead code remains scattered across the codebase. This issue tracks the full cleanup and one migration.What needs to happen
1. Scrap meditation-tier skills completely
The
getMeditationBonus()function insrc/lib/game/utils/mana-utils.ts:127-166checks three skill flags —skills.meditation,skills.deepTrance,skills.voidMeditation— that are alwaysundefinedbecauseskillsis always{}at runtime. The multi-tier ramp (base 1.5× → 2.5× → 3.0× → 5.0×) is dead code.Change: Simplify
getMeditationBonus()to a single continuous ramp:1 + (hours / 8) * 4, capped at5.0 * meditationEfficiency. Remove theskillsparameter entirely. The function signature becomes:See:
src/lib/game/utils/mana-utils.ts:127-1662. Replace meditation cap discipline perk
The Mana Circulation discipline in
src/lib/game/data/disciplines/base.ts:62-69has a capped perk:This should be changed to a direct multiplier bonus instead:
The stat key stays
meditationCapBonus— it still adds to the cap value, which is now just5.0 + disciplineMeditationCap. No plumbing changes needed indiscipline-effects.ts.See:
src/lib/game/data/disciplines/base.ts:62-693. Remove mana skills (manaWell, manaFlow, manaSpring)
These skills are read in
computeMaxMana()andcomputeRegen()insrc/lib/game/utils/mana-utils.ts:skills.manaWell→+100 max mana per level(line 41)skills.manaFlow→+1 regen per level(line 62)skills.manaSpring→+2 regen per level(line 63)Replaced by discipline stat bonuses (
maxManaBonus,regenBonus,regenMultiplier) from Raw Mana Mastery and Mana Circulation. Remove these three skill reads fromcomputeMaxMana()andcomputeRegen().Remove
manaWellandmanaFlowprestige upgrade handling too — they are still defined insrc/lib/game/constants/prestige.tsand consumed ineffects.ts:189andmana-utils.ts:42,64. The prestige upgrade table and its references ineffects.tsandmana-utils.tsneed removal.See:
src/lib/game/utils/mana-utils.ts:38-43(computeMaxMana)src/lib/game/utils/mana-utils.ts:60-64(computeRegen)src/lib/game/effects.ts:184-190(computeTotalMaxMana)src/lib/game/effects.ts:196-210(computeTotalRegen)src/lib/game/constants/prestige.ts(prestige upgrade definitions)4. Add click-mana capped perk to Mana Circulation discipline
The old
manaTap(+1 click/level) andmanaSurge(+3 click/level) skills are removed, but click-mana progression needs to exist. Add a capped perk to the Mana Circulation discipline insrc/lib/game/data/disciplines/base.ts:Wire the
clickManaBonusstat intocomputeDisciplineEffects()→ already handled byKNOWN_BONUS_STATSinsrc/lib/game/effects/discipline-effects.ts— verifyclickManaBonusis in the set (it flows through the genericbonusespath tocomputeClickMana).Then remove all
skills.manaTapandskills.manaSurgereads fromcomputeClickMana():Wait — the stat name is
clickManaBonus(additive) notclickManaMultiplier. ThecomputeClickManafunction usesdiscipline?.bonuses?.clickManaMultiplier. Perk bonus stat should beclickManaBonusand should be added:1 + discipline?.bonuses?.clickManaBonus || 0.See:
src/lib/game/utils/mana-utils.ts:114-120(computeClickMana)src/lib/game/data/disciplines/base.ts:49-69(Mana Circulation perks)5. Remove all remaining skill leftover types/fields
Remove the following from
GameStateinsrc/lib/game/types/game.ts:170-173:Remove from
GameActionTypeinsrc/lib/game/types/game.ts:293-294:Remove from
ManaComputeParams/RegenComputeParamsinterfaces insrc/lib/game/utils/mana-utils.ts:20-24:Remove
skillUpgradesandskillTiersparameters fromcomputeAllEffects()and related function signatures insrc/lib/game/effects.ts.Remove
skillUpgrades/skillTiersfrommanaStore.tsresetMana()signature.Remove
skillUpgrades/skillTiersfrom all call sites in:src/lib/game/stores/gameStore.ts(lines 108, 113, 132)src/lib/game/stores/gameHooks.ts(lines 36-37, 58-59, 65, 71)src/lib/game/stores/gameActions.ts(lines 56-57)src/lib/game/hooks/useGameDerived.ts(lines 42, 47)6. Update tests
The following test files reference removed skill keys and need updating:
src/lib/game/__tests__/mana-utils.test.ts— Remove tests formanaWell,manaFlow,manaSpring,manaTap,manaSurgeskills; remove meditation tier skill tests; updategetMeditationBonussignaturesrc/lib/game/__tests__/computed-stats.test.ts— Remove skill-based assertionssrc/lib/game/__tests__/cross-module-combat-meditation.test.ts— Update meditation multiplier expectations to match new simplified rampsrc/lib/game/__tests__/tick-integration.test.ts— Remove skill referencesFiles affected (confirmed)
src/lib/game/types/game.tssrc/lib/game/utils/mana-utils.tsgetMeditationBonus, remove skill reads fromcomputeMaxMana/computeRegen/computeClickMana, remove skill params from interfacessrc/lib/game/data/disciplines/base.tssrc/lib/game/effects.tsskillUpgrades/skillTiersparams, remove skill readssrc/lib/game/stores/gameStore.tsskills/skillUpgrades/skillTiersfrom all call sitessrc/lib/game/stores/gameHooks.tsskillUpgrades/skillTiersfrom all call sitessrc/lib/game/stores/gameActions.tsskillUpgrades/skillTierssrc/lib/game/stores/manaStore.tsresetMana()src/lib/game/hooks/useGameDerived.tsskills/skillUpgrades/skillTiersfrom all call sitessrc/lib/game/constants/core.tsgetStudySpeedMultiplier/getStudyCostMultiplier(useskillsparam)src/lib/game/constants/prestige.tsmanaWellandmanaFlowprestige upgradessrc/lib/game/__tests__/mana-utils.test.tssrc/lib/game/__tests__/computed-stats.test.tssrc/lib/game/__tests__/cross-module-combat-meditation.test.tssrc/lib/game/__tests__/tick-integration.test.tsStarting work on issue #174: Remove skill system leftovers and migrate click mana to discipline perk. I'll work through the 6 steps in order.
All 6 steps completed. 916 tests passing across 48 test files.
Summary of changes:
Simplified
getMeditationBonus()— removedskillsparam, replaced multi-tier ramp (1.5×→2.5×→3.0×→5.0×) with single continuous ramp:1 + (hours/8)*4, capped at5.0 + disciplineMeditationCapUpdated Mana Circulation discipline — changed meditation cap perk description from "Raises Void Meditation ceiling" to "Adds directly to the meditation multiplier cap"; added new capped perk:
mana-circulation-click(Every 500 XP: +1 mana per click, 5 tiers up to +5)Removed mana skill reads — removed
skills.manaWellfromcomputeMaxMana(),skills.manaFlow/skills.manaSpringfromcomputeRegen(); removedmanaWellandmanaFlowprestige upgrades fromPRESTIGE_DEFMigrated click-mana to discipline perk —
computeClickMana()no longer takesskillsparam, usesdiscipline.bonuses.clickManaBonusinstead; removedskills.manaTap/skills.manaSurgereadsRemoved all skill leftover types/fields — removed
skills,skillProgress,skillUpgrades,skillTiersfromGameState; removedSTART_STUDYING_SKILL,SELECT_SKILL_UPGRADE,TIER_UP_SKILLfromGameActionType; removedskills/skillUpgrades/skillTiersfromManaComputeParams,RegenComputeParams,DamageCalcParams,DPSCalcParams,InsightCalcParams; updated all call sites across stores, hooks, and derived stateUpdated tests — removed skill-based test cases; updated signatures; all 916 tests passing
Issue #174 completed. All 6 steps done, 916 tests passing. Committing and pushing now.