[High] [Bug] Enchanting spec vs code: 6 discrepancies including missing disenchant recovery, duplicate spell_iceShard, missing discipline perks #324
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?
Spec:
docs/specs/attunements/enchanter/systems/enchanting-spec.mdDiscrepancies found:
D2 [HIGH] —
spell_iceSharddefined twice with different costsdata/enchantments/spell-effects/basic-spells.ts): cost 75data/enchantments/spell-effects/frost-spells.ts): cost 95ENCHANTMENT_EFFECTSmerge (spread order), so effective cost is 95D7 [HIGH] —
disenchantEquipmentdoesn't add 'Ready for Enchantment' tag or reset raritydisenchant-actions.tsonly clears enchantments and resetsusedCapacity'Ready for Enchantment'tag or resetrarityto'common'crafting-prep.ts→completePreparation()which DOES add the tag and reset raritydisenchantEquipmentshould also add the tag and reset rarity, matchingcompletePreparationD8 [HIGH] —
disenchantEquipmentcalculates mana recovery but never credits itdisenchant-actions.ts:17-19calculatestotalRecoveredbut only writes to logtotalRecoveredto the appropriate mana poolD13 [HIGH] — Discipline perks from spec §8 have no data/definition files
unlockedEffectsstate in the crafting store exists but is never populated from discipline perksunlockedEffectsD14 [HIGH] —
enchantPowermechanic doesn't existenchant-1(infinite, 150 XP, +5 enchantPower/tier) andenchant-2(capped, 300 XP, +10/tier, max 3)enchantPowerstat orENCHANTMENT CRAFTINGdiscipline definition existsefficiencyBonusparameter incalculateEffectCapacityCostis never set to non-zeroenchantPowerstat and wire it to enchantment strengthD3 [LOW] — Spec references non-existent file
src/lib/game/crafting-attunements.ts— file doesn't existcalculateEnchantingXPlives insrc/lib/game/data/attunements.ts:126-128D1/D6 [MEDIUM] —
metalSpellFocusmissing from spec capacity tablecatalysts.ts:30-36definesmetalSpellFocus(catalyst, offHand, capacity 50)Starting work on enchanting spec vs code discrepancies. Will investigate all 6 issues systematically.
All 6 discrepancies resolved and pushed to master (commit
e45c206):D2 [HIGH] — spell_iceShard: Added to basic-spells.ts at cost 75 (canonical per spec §7.1 Basic), removed duplicate from frost-spells.ts (cost 95).
D7 [HIGH] — disenchantEquipment now adds 'Ready for Enchantment' tag and resets rarity to 'common', matching completePreparation() behavior.
D8 [HIGH] — disenchantEquipment now credits recovered mana to the raw mana pool via useManaStore.
D13 [HIGH] — Already implemented: discipline perks with unlocksEffects are defined in data files, collected by discipline-slice processTick, and wired to craftingStore.unlockEffects via gameStore tick.
D14 [HIGH] — Added getEnchantingEfficiencyBonus() in discipline-effects.ts that converts enchantPower to efficiencyBonus (enchantPower/100, capped at 0.9). Wired into craftingStore.startDesigningEnchantment, design-actions.ts, and enchanting-tick.ts.
D3 [LOW] — Fixed spec file reference from crafting-attunements.ts to data/attunements.ts.
D1/D6 [MEDIUM] — Added missing metalSpellFocus (capacity 50) to spec capacity table.
All 1086 tests pass.