feat: add wizard and physical gear branches to Fabricator
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m21s

- Split fabricator-recipes.ts into 4 files (all under 400 lines):
  - fabricator-recipes.ts: core/elemental equipment recipes + helpers
  - fabricator-wizard-recipes.ts: 7 wizard branch recipes (staffs, circlet, robe, catalyst, pendant)
  - fabricator-physical-recipes.ts: 9 physical branch recipes (blades, helm, robe, boots, gauntlets, shields)
  - fabricator-material-recipes.ts: 12 material crafting recipes
- Added branch filter UI (All/Elemental/Wizard/Physical) to FabricatorSubTab
- All 902 tests pass
This commit is contained in:
2026-05-27 15:22:16 +02:00
parent 9a2da67006
commit 5e76fe7145
9 changed files with 510 additions and 314 deletions
+13 -189
View File
@@ -1,10 +1,15 @@
// ─── Fabricator Recipes ──────────────────────────────────────────────────────
// Crafting recipes for the Fabricator attunement.
// Each recipe is tied to a mana type the player has unlocked.
// ─── Fabricator Equipment Recipes ──────────────────────────────────────────────
// Core and elemental recipes. Branch recipes are in separate files.
// Material recipes are in fabricator-material-recipes.ts.
import type { FabricatorRecipe } from './fabricator-recipe-types';
export type { FabricatorRecipe, MANA_TYPE_LABELS } from './fabricator-recipe-types';
export { MATERIAL_RECIPES } from './fabricator-material-recipes';
export { WIZARD_BRANCH_RECIPES } from './fabricator-wizard-recipes';
export { PHYSICAL_BRANCH_RECIPES } from './fabricator-physical-recipes';
import { WIZARD_BRANCH_RECIPES } from './fabricator-wizard-recipes';
import { PHYSICAL_BRANCH_RECIPES } from './fabricator-physical-recipes';
export const FABRICATOR_RECIPES: FabricatorRecipe[] = [
// ─── Earth Gear (Compacted Earth — high defense) ──────────────────────
@@ -171,187 +176,9 @@ export const FABRICATOR_RECIPES: FabricatorRecipe[] = [
gearTrait: '+20% cast speed, +5% evasion',
},
];
// ─── Material Crafting Recipes ───────────────────────────────────────────────
export const MATERIAL_RECIPES: FabricatorRecipe[] = [
{
id: 'manaCrystal',
name: 'Mana Crystal',
description: 'Condense raw mana into a stable crystal. Used in all advanced crafting.',
manaType: 'raw',
equipmentTypeId: 'basicStaff',
slot: 'mainHand',
materials: {},
manaCost: 500,
craftTime: 1,
rarity: 'uncommon',
gearTrait: 'Produces 1 Mana Crystal',
recipeType: 'material',
resultMaterial: 'manaCrystal',
resultAmount: 1,
},
{
id: 'manaCrystalDustCraft',
name: 'Mana Crystal Dust',
description: 'Grind a Mana Crystal into dust. Used as a base material.',
manaType: 'raw',
equipmentTypeId: 'basicStaff',
slot: 'mainHand',
materials: { manaCrystal: 1 },
manaCost: 10,
craftTime: 1,
rarity: 'common',
gearTrait: 'Produces 2 Mana Crystal Dust',
recipeType: 'material',
resultMaterial: 'manaCrystalDust',
resultAmount: 2,
},
{
id: 'fireCrystal',
name: 'Fire Attuned Crystal',
description: 'Infuse a Mana Crystal with fire mana to attune it to the flame element.',
manaType: 'fire',
equipmentTypeId: 'basicStaff',
slot: 'mainHand',
materials: { manaCrystal: 1 },
manaCost: 100,
craftTime: 1,
rarity: 'rare',
gearTrait: 'Produces 1 Fire Attuned Crystal',
recipeType: 'material',
resultMaterial: 'fireCrystal',
resultAmount: 1,
},
{
id: 'waterCrystal',
name: 'Water Attuned Crystal',
description: 'Infuse a Mana Crystal with water mana to attune it to the flow element.',
manaType: 'water',
equipmentTypeId: 'basicStaff',
slot: 'mainHand',
materials: { manaCrystal: 1 },
manaCost: 100,
craftTime: 1,
rarity: 'rare',
gearTrait: 'Produces 1 Water Attuned Crystal',
recipeType: 'material',
resultMaterial: 'waterCrystal',
resultAmount: 1,
},
{
id: 'airCrystal',
name: 'Air Attuned Crystal',
description: 'Infuse a Mana Crystal with air mana to attune it to the wind element.',
manaType: 'air',
equipmentTypeId: 'basicStaff',
slot: 'mainHand',
materials: { manaCrystal: 1 },
manaCost: 100,
craftTime: 1,
rarity: 'rare',
gearTrait: 'Produces 1 Air Attuned Crystal',
recipeType: 'material',
resultMaterial: 'airCrystal',
resultAmount: 1,
},
{
id: 'earthCrystal',
name: 'Earth Attuned Crystal',
description: 'Infuse a Mana Crystal with earth mana to attune it to the stone element.',
manaType: 'earth',
equipmentTypeId: 'basicStaff',
slot: 'mainHand',
materials: { manaCrystal: 1 },
manaCost: 100,
craftTime: 1,
rarity: 'rare',
gearTrait: 'Produces 1 Earth Attuned Crystal',
recipeType: 'material',
resultMaterial: 'earthCrystal',
resultAmount: 1,
},
{
id: 'lightCrystal',
name: 'Light Attuned Crystal',
description: 'Infuse a Mana Crystal with light mana to attune it to the radiant element.',
manaType: 'light',
equipmentTypeId: 'basicStaff',
slot: 'mainHand',
materials: { manaCrystal: 1 },
manaCost: 100,
craftTime: 1,
rarity: 'rare',
gearTrait: 'Produces 1 Light Attuned Crystal',
recipeType: 'material',
resultMaterial: 'lightCrystal',
resultAmount: 1,
},
{
id: 'darkCrystal',
name: 'Dark Attuned Crystal',
description: 'Infuse a Mana Crystal with dark mana to attune it to the shadow element.',
manaType: 'dark',
equipmentTypeId: 'basicStaff',
slot: 'mainHand',
materials: { manaCrystal: 1 },
manaCost: 100,
craftTime: 1,
rarity: 'rare',
gearTrait: 'Produces 1 Dark Attuned Crystal',
recipeType: 'material',
resultMaterial: 'darkCrystal',
resultAmount: 1,
},
{
id: 'metalCrystal',
name: 'Metal Attuned Crystal',
description: 'Infuse a Mana Crystal with metal mana to attune it to the alloy element.',
manaType: 'metal',
equipmentTypeId: 'basicStaff',
slot: 'mainHand',
materials: { manaCrystal: 1 },
manaCost: 100,
craftTime: 1,
rarity: 'rare',
gearTrait: 'Produces 1 Metal Attuned Crystal',
recipeType: 'material',
resultMaterial: 'metalCrystal',
resultAmount: 1,
},
{
id: 'crystalCrystal',
name: 'Crystal Attuned Crystal',
description: 'Infuse a Mana Crystal with crystal mana to attune it to the prismatic element.',
manaType: 'crystal',
equipmentTypeId: 'basicStaff',
slot: 'mainHand',
materials: { manaCrystal: 1 },
manaCost: 100,
craftTime: 1,
rarity: 'epic',
gearTrait: 'Produces 1 Crystal Attuned Crystal',
recipeType: 'material',
resultMaterial: 'crystalCrystal',
resultAmount: 1,
},
{
id: 'elementalCore',
name: 'Elemental Core',
description: 'Combine mana crystals and all four base elements into a powerful core.',
manaType: 'raw',
equipmentTypeId: 'basicStaff',
slot: 'mainHand',
materials: { manaCrystal: 10 },
manaCost: 100,
craftTime: 10,
rarity: 'epic',
gearTrait: 'Produces 1 Elemental Core',
recipeType: 'material',
resultMaterial: 'elementalCore',
resultAmount: 1,
},
// ─── Branch recipes ───────────────────────────────────────────────────
...WIZARD_BRANCH_RECIPES,
...PHYSICAL_BRANCH_RECIPES,
];
// ─── Helpers ──────────────────────────────────────────────────────────────────
@@ -361,7 +188,7 @@ export function getRecipesByManaType(manaType: string): FabricatorRecipe[] {
}
export function getRecipeById(id: string): FabricatorRecipe | undefined {
return FABRICATOR_RECIPES.find(r => r.id === id) ?? MATERIAL_RECIPES.find(r => r.id === id);
return FABRICATOR_RECIPES.find(r => r.id === id);
}
export function canCraftRecipe(
@@ -381,9 +208,6 @@ export function canCraftRecipe(
}
}
// If manaType is provided, manaAmount is already the correct pool value.
// Otherwise fall back to treating manaAmount as raw mana (backward compat).
const effectiveManaType = manaType ?? recipe.manaType;
const missingMana = Math.max(0, recipe.manaCost - manaAmount);
if (missingMana > 0) {
canCraft = false;