- {enchantmentDesigns.map(design => (
+ {completedEnchantmentDesigns.map(design => (
void;
deleteDesign: (id: string) => void;
diff --git a/src/lib/game/__tests__/cross-module-helpers.ts b/src/lib/game/__tests__/cross-module-helpers.ts
index 9924bb9..b56f2c2 100644
--- a/src/lib/game/__tests__/cross-module-helpers.ts
+++ b/src/lib/game/__tests__/cross-module-helpers.ts
@@ -97,7 +97,7 @@ export function resetAllStores() {
preparationProgress: null,
applicationProgress: null,
equipmentCraftingProgress: null,
- enchantmentDesigns: [],
+ completedEnchantmentDesigns: [],
unlockedEffects: [],
equippedInstances: {},
equipmentInstances: {},
diff --git a/src/lib/game/__tests__/discipline-deactivate-on-spire-entry.test.ts b/src/lib/game/__tests__/discipline-deactivate-on-spire-entry.test.ts
index e82e43b..2b8e375 100644
--- a/src/lib/game/__tests__/discipline-deactivate-on-spire-entry.test.ts
+++ b/src/lib/game/__tests__/discipline-deactivate-on-spire-entry.test.ts
@@ -103,7 +103,7 @@ function resetAllStores() {
preparationProgress: null,
applicationProgress: null,
equipmentCraftingProgress: null,
- enchantmentDesigns: [],
+ completedEnchantmentDesigns: [],
unlockedEffects: [],
equippedInstances: {},
equipmentInstances: {},
diff --git a/src/lib/game/__tests__/paused-conversion-dedup.test.ts b/src/lib/game/__tests__/paused-conversion-dedup.test.ts
index 4017be7..deb95fa 100644
--- a/src/lib/game/__tests__/paused-conversion-dedup.test.ts
+++ b/src/lib/game/__tests__/paused-conversion-dedup.test.ts
@@ -92,7 +92,7 @@ function resetAllStores() {
preparationProgress: null,
applicationProgress: null,
equipmentCraftingProgress: null,
- enchantmentDesigns: [],
+ completedEnchantmentDesigns: [],
unlockedEffects: [],
equippedInstances: {},
equipmentInstances: {},
diff --git a/src/lib/game/__tests__/reset-game-comprehensive.test.ts b/src/lib/game/__tests__/reset-game-comprehensive.test.ts
index bae83fb..e0d92c0 100644
--- a/src/lib/game/__tests__/reset-game-comprehensive.test.ts
+++ b/src/lib/game/__tests__/reset-game-comprehensive.test.ts
@@ -111,7 +111,7 @@ function setNonDefaultState() {
equipmentType: 'basicStaff',
effects: [{ effectId: 'spell_fireBolt', stacks: 1, actualCost: 30 }],
},
- enchantmentDesigns: [{ id: 'design-1', name: 'My Design', equipmentType: 'basicStaff', effects: [], totalCapacityCost: 30, totalStacks: 1 }],
+ completedEnchantmentDesigns: [{ id: 'design-1', name: 'My Design', equipmentType: 'basicStaff', effects: [], totalCapacityCost: 30, totalStacks: 1 }],
unlockedEffects: ['spell_fireBolt', 'spell_iceBolt'],
unlockedRecipes: ['recipe1', 'recipe2'],
lootInventory: {
@@ -253,7 +253,7 @@ describe('resetGame comprehensive', () => {
const crafting = useCraftingStore.getState();
expect(crafting.designProgress).toBeNull();
expect(crafting.designProgress2).toBeNull();
- expect(crafting.enchantmentDesigns).toEqual([]);
+ expect(crafting.completedEnchantmentDesigns).toEqual([]);
expect(crafting.unlockedEffects).toEqual([]);
expect(crafting.unlockedRecipes).toEqual([]);
expect(crafting.lootInventory.materials).toEqual({});
diff --git a/src/lib/game/crafting-actions/application-actions.ts b/src/lib/game/crafting-actions/application-actions.ts
index 2e29aa0..64b74ea 100644
--- a/src/lib/game/crafting-actions/application-actions.ts
+++ b/src/lib/game/crafting-actions/application-actions.ts
@@ -19,7 +19,7 @@ export function startApplying(
): boolean {
const state = get();
const instance = state.equipmentInstances[equipmentInstanceId];
- const design = state.enchantmentDesigns.find(d => d.id === designId);
+ const design = state.completedEnchantmentDesigns.find(d => d.id === designId);
const validation = CraftingApply.canApplyEnchantment(
instance,
diff --git a/src/lib/game/crafting-actions/design-actions.ts b/src/lib/game/crafting-actions/design-actions.ts
index 45c6de7..fef7a0c 100644
--- a/src/lib/game/crafting-actions/design-actions.ts
+++ b/src/lib/game/crafting-actions/design-actions.ts
@@ -97,12 +97,12 @@ export function saveDesign(
const state = get();
if (state.designProgress2 && state.designProgress2.designId === design.id) {
set((s) => ({
- enchantmentDesigns: [...s.enchantmentDesigns, design],
+ completedEnchantmentDesigns: [...s.completedEnchantmentDesigns, design],
designProgress2: null,
}));
} else {
set((s) => ({
- enchantmentDesigns: [...s.enchantmentDesigns, design],
+ completedEnchantmentDesigns: [...s.completedEnchantmentDesigns, design],
designProgress: null,
}));
}
@@ -113,6 +113,6 @@ export function deleteDesign(
set: (fn: (state: CraftingState) => Partial) => void
) {
set((state) => ({
- enchantmentDesigns: state.enchantmentDesigns.filter(d => d.id !== designId),
+ completedEnchantmentDesigns: state.completedEnchantmentDesigns.filter(d => d.id !== designId),
}));
}
diff --git a/src/lib/game/stores/crafting-initial-state.ts b/src/lib/game/stores/crafting-initial-state.ts
index f337507..01f9bc1 100644
--- a/src/lib/game/stores/crafting-initial-state.ts
+++ b/src/lib/game/stores/crafting-initial-state.ts
@@ -17,7 +17,7 @@ export function createDefaultCraftingState(): CraftingState {
preparationProgress: null,
applicationProgress: null,
equipmentCraftingProgress: null,
- enchantmentDesigns: [],
+ completedEnchantmentDesigns: [],
unlockedEffects: [],
unlockedRecipes: [],
equippedInstances: initial.equippedInstances,
diff --git a/src/lib/game/stores/craftingStore.ts b/src/lib/game/stores/craftingStore.ts
index cc40122..c06cf72 100644
--- a/src/lib/game/stores/craftingStore.ts
+++ b/src/lib/game/stores/craftingStore.ts
@@ -293,7 +293,7 @@ export const useCraftingStore = create()(
preparationProgress: state.preparationProgress,
applicationProgress: state.applicationProgress,
equipmentCraftingProgress: state.equipmentCraftingProgress,
- enchantmentDesigns: state.enchantmentDesigns,
+ completedEnchantmentDesigns: state.completedEnchantmentDesigns,
unlockedEffects: state.unlockedEffects,
unlockedRecipes: state.unlockedRecipes,
equipmentInstances: state.equipmentInstances,
diff --git a/src/lib/game/stores/craftingStore.types.ts b/src/lib/game/stores/craftingStore.types.ts
index f99a1e7..ad07229 100644
--- a/src/lib/game/stores/craftingStore.types.ts
+++ b/src/lib/game/stores/craftingStore.types.ts
@@ -24,7 +24,7 @@ export interface CraftingState {
preparationProgress: PreparationProgress | null;
applicationProgress: ApplicationProgress | null;
equipmentCraftingProgress: EquipmentCraftingProgress | null;
- enchantmentDesigns: EnchantmentDesign[];
+ completedEnchantmentDesigns: EnchantmentDesign[];
unlockedEffects: string[];
unlockedRecipes: string[];
equipmentInstances: Record;
diff --git a/src/lib/game/stores/pipelines/enchanting-tick.ts b/src/lib/game/stores/pipelines/enchanting-tick.ts
index ddf43a1..ce71fe8 100644
--- a/src/lib/game/stores/pipelines/enchanting-tick.ts
+++ b/src/lib/game/stores/pipelines/enchanting-tick.ts
@@ -42,7 +42,7 @@ export function processEnchantingTicks(
writes.combat = { ...(writes.combat || {}), currentAction: 'meditate' };
} else {
const activeProgress = designProgress || designProgress2!;
- const isRepeatDesign = ctx.crafting.enchantmentDesigns.some(
+ const isRepeatDesign = ctx.crafting.completedEnchantmentDesigns.some(
(d) => d.name === activeProgress.name,
);
const designResult = calculateDesignProgress(
@@ -64,7 +64,7 @@ export function processEnchantingTicks(
);
// Return write instead of calling store directly
mergeCrafting({
- enchantmentDesigns: [...ctx.crafting.enchantmentDesigns, completedDesign],
+ completedEnchantmentDesigns: [...ctx.crafting.completedEnchantmentDesigns, completedDesign],
designProgress: designProgress ? null : undefined,
designProgress2: designProgress2 ? null : undefined,
});
@@ -145,7 +145,7 @@ export function processEnchantingTicks(
}
} else {
const instance = ctx.crafting.equipmentInstances[appProgress.equipmentInstanceId];
- const design = ctx.crafting.enchantmentDesigns.find((d) => d.id === appProgress.designId);
+ const design = ctx.crafting.completedEnchantmentDesigns.find((d) => d.id === appProgress.designId);
if (!instance || !design) {
mergeCrafting({ applicationProgress: null });
writes.combat = { ...(writes.combat || {}), currentAction: 'meditate' };
diff --git a/src/lib/game/types/game.ts b/src/lib/game/types/game.ts
index 2b93fe7..e354c52 100644
--- a/src/lib/game/types/game.ts
+++ b/src/lib/game/types/game.ts
@@ -239,7 +239,7 @@ export interface GameState {
// Equipment System (new instance-based system)
equippedInstances: Record; // slot -> instanceId
equipmentInstances: Record; // instanceId -> instance
- enchantmentDesigns: EnchantmentDesign[]; // Saved enchantment designs
+ completedEnchantmentDesigns: EnchantmentDesign[]; // Saved enchantment designs
// Crafting Progress
designProgress: DesignProgress | null;