feat: add fabricator disciplines for recipe unlocks
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m21s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m21s
- Add unlocksRecipes field to DisciplinePerk type - Add study-fabricator-recipes discipline (earth/metal/sand/crystal recipes) - Add study-wizard-branch discipline (wizard equipment recipes) - Add study-physical-branch discipline (physical combat equipment recipes) - Collect unlocksRecipes during discipline tick processing - Pass recipe unlocks to crafting store via gameStore - Add unlockRecipes action to craftingStore with persistence - Filter fabricator recipes by unlock status in FabricatorSubTab UI
This commit is contained in:
@@ -344,6 +344,21 @@ export const useCraftingStore = create<CraftingStore>()(
|
||||
});
|
||||
},
|
||||
|
||||
unlockRecipes: (recipeIds: string[]) => {
|
||||
set((state) => {
|
||||
const existing = new Set(state.unlockedRecipes);
|
||||
let changed = false;
|
||||
for (const id of recipeIds) {
|
||||
if (!existing.has(id)) {
|
||||
existing.add(id);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if (!changed) return state;
|
||||
return { unlockedRecipes: Array.from(existing) };
|
||||
});
|
||||
},
|
||||
|
||||
processEquipmentCraftingTick: (): { completed: boolean; logMessage?: string } => {
|
||||
const state = get();
|
||||
return processEquipmentCraftingTick(state, set as unknown as (partial: Partial<CraftingState>) => void);
|
||||
@@ -366,6 +381,7 @@ export const useCraftingStore = create<CraftingStore>()(
|
||||
equipmentCraftingProgress: state.equipmentCraftingProgress,
|
||||
enchantmentDesigns: state.enchantmentDesigns,
|
||||
unlockedEffects: state.unlockedEffects,
|
||||
unlockedRecipes: state.unlockedRecipes,
|
||||
equipmentInstances: state.equipmentInstances,
|
||||
equippedInstances: state.equippedInstances,
|
||||
lootInventory: state.lootInventory,
|
||||
|
||||
Reference in New Issue
Block a user