[priority: medium] "Study Basic Weapon Enchantments" discipline doesn't unlock weapon enchantment effects #189
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: Study Basic Weapon Enchantments perk effects not actually unlocking
Description
The "Study Basic Weapon Enchantments" discipline has perks that should unlock enchantment effects:
sword_fire)sword_frost)sword_lightning)However, these effects don't appear to be unlocked in the EffectSelector.
Root Cause Analysis
The discipline perks use
unlocksEffects: ['sword_fire']etc. The unlock flow is:discipline-slice.ts→processTick()checks for newly unlocked perks withunlocksEffectsunlockedEffects: string[]fromprocessTick()gameStore.ts→tick()callsuseCraftingStore.getState().unlockEffects(disciplineResult.unlockedEffects)craftingStore.ts→unlockEffects()adds effect IDs tostate.unlockedEffectsThis flow looks correct. However, there may be these issues:
Effect IDs don't exist: The effect IDs
sword_fire,sword_frost,sword_lightningare defined inelemental-effects.ts. They exist inENCHANTMENT_EFFECTS. So this should work.EffectSelector filtering: In
EnchantmentDesigner/utils.ts→getAvailableEffects():The effect must be both unlocked AND match the equipment category.
sword_firehasallowedEquipmentCategories: ['caster', 'sword']. If the player selects a non-sword/caster equipment type, it won't show.Related to EffectSelector bug: Since
EffectSelectoralways shows "Learn Enchanting skill" (becauseenchantingLevelis hardcoded to 0), the user can never see ANY effects — unlocked or not. This bug may be masking the actual unlock behavior.Affected Files
src/lib/game/data/disciplines/enchanter.ts— discipline definitions withunlocksEffectssrc/lib/game/stores/discipline-slice.ts—processTickperk unlock logicsrc/lib/game/stores/craftingStore.ts—unlockEffectsactionsrc/components/game/crafting/EnchantmentDesigner/utils.ts—getAvailableEffectsfilteringSteps to Reproduce
Expected Behavior
Suggested Fix Direction
enchantingLevelbug (issue #5)✅ Resolved as a side effect of fixing #188. The EffectSelector was always showing "Learn Enchanting skill" because
enchantingLevelwas hardcoded to 0. With the fix, the selector now displays properly, allowing players to see unlocked effects. The discipline unlock flow (discipline-slice.ts→craftingStore.ts→unlockEffects()) was already correctly implemented — the issue was purely the UI gate preventing access.