💡 Add enchanter disciplines to unlock enchantment effects #126
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?
Request
Add new enchanter disciplines that unlock enchantment effects for the player to use when crafting. Currently, the
unlockedEffectsarray in the crafting store is always empty — there is no mechanism to populate it.Current State
craftingStore.tshasunlockedEffects: string[](always empty)EnchantmentDesignerreadsunlockedEffectsand filters available effectsEFFECT_RESEARCH_MAPPINGinconstants/skills.tsmaps ~60 research skill IDs to effect IDs, but is never consumed by any codeenchant-craftingandmana-channelingDisciplineDefinitiontype supportsperkswithonce,capped, andinfinitetypesProposed Design
Discipline Categories
Create tiered enchanter disciplines that unlock enchantment effects:
Weapon Enchantments:
Armor Enchantments:
Accessory Enchantments:
Elemental Enchantments (by mana type):
Tiered Cost System
Implementation Requirements
unlocksEffectsfield toDisciplineDefinitionorDisciplinePerktype to specify which enchantment effect IDs are unlockedunlockEffects()action to crafting store that merges effect IDs intounlockedEffectsunlockEffects()data/disciplines/enchanter.tscappedwith a max levelFiles Involved
src/lib/game/data/disciplines/enchanter.ts— New discipline definitionssrc/lib/game/types/disciplines.ts— AddunlocksEffectsfieldsrc/lib/game/stores/craftingStore.ts— AddunlockEffectsactionsrc/lib/game/effects/discipline-effects.ts— Wire perk completion to effect unlockingsrc/lib/game/data/enchantments/— Reference existing effect definitionssrc/lib/game/constants/skills.ts— ReferenceEFFECT_RESEARCH_MAPPINGfor effect groupingsContext
The
EFFECT_RESEARCH_MAPPINGalready provides a good template for grouping effects by category. The discipline-based unlock system should follow a similar pattern but trigger from discipline/perk progression instead of skill research.Starting work on #126 — Add enchanter disciplines to unlock enchantment effects. Investigating the current state of EFFECT_RESEARCH_MAPPING, discipline system, and crafting store to understand what needs to be wired up.
Implementation Complete
Successfully implemented enchanter disciplines that unlock enchantment effects through the discipline/perk system.
Changes Made
1.
src/lib/game/types/disciplines.tsunlocksEffects?: string[]field toDisciplinePerkinterface2.
src/lib/game/stores/discipline-slice.tsprocessedPerks: string[]toDisciplineStoreStateto track which perks have already unlocked effects (prevents duplicate unlocks)processTick()to detect when XP crosses a perk threshold withunlocksEffects, collect those effect IDs, and return them asunlockedEffectsin the return valueunlockEffectson the crafting store — no circular dependency3.
src/lib/game/stores/craftingStore.ts&craftingStore.types.tsunlockEffects(effectIds: string[])action that merges new effect IDs intounlockedEffects(deduplicates)unlockEffectsto theCraftingActionstype4.
src/lib/game/stores/gameStore.tsprocessTick, checks forunlockedEffectsand callsuseCraftingStore.getState().unlockEffects()to persist them5.
src/lib/game/data/disciplines/enchanter.tsrequiresprerequisitestype: 'once'with increasing thresholds for balanced progressionTest Results
room-utils.test.ts(unrelated) ✅✅ Issue #126 — RESOLVED
Successfully implemented enchanter disciplines that unlock enchantment effects through the discipline/perk system.
Summary of Changes (11 files, +576/-4)
Type System:
types/disciplines.ts— AddedunlocksEffects?: string[]toDisciplinePerkStore Changes:
stores/craftingStore.ts+craftingStore.types.ts— AddedunlockEffects()actionstores/discipline-slice.ts—processTick()now detects perk thresholds and returnsunlockedEffects; addedprocessedPerkstrackingstores/gameStore.ts— Wires discipline unlocks to crafting store after each tickNew Discipline Files (modular split, all under 400 lines):
data/disciplines/enchanter.ts(142 lines) — Core + Basic/Advanced Weapon enchantmentsdata/disciplines/enchanter-utility.ts(108 lines) — Utility + Mana enchantmentsdata/disciplines/enchanter-spells.ts(244 lines) — Basic/Intermediate/Advanced Spell enchantmentsdata/disciplines/enchanter-special.ts(71 lines) — Special enchantmentsdata/disciplines/index.ts— Updated barrel export8 new tiered disciplines unlocking ~60 enchantment effects total, with prerequisite chains (e.g., Basic Spell → Intermediate Spell → Advanced Spell).