// ─── Fabricator Discipline Files ──────────────────────────────────────────────
// Attunement-focused disciplines for Fabricator role

import { DisciplinesAttunementType } from '../../types/disciplines';
import type { DisciplineDefinition } from '../../types/disciplines';

export const fabricatorDisciplines: DisciplineDefinition[] = [
  {
    id: 'golem-crafting',
    name: 'Golem Crafting',
    attunement: DisciplinesAttunementType.FABRICATOR,
    manaType: 'earth',
    baseCost: 10,
    description: 'Improve your ability to craft and maintain golems.',
    statBonus: { stat: 'golemCapacity', baseValue: 2, label: 'Golem Capacity' },
    difficultyFactor: 150,
    scalingFactor: 80,
    drainBase: 4,
    perks: [
      {
        id: 'golem-1',
        type: 'once',
        threshold: 200,
        value: 0,
        description: 'Unlock golem summoning',
      },
      {
        id: 'golem-2',
        type: 'capped',
        threshold: 500,
        value: 500,
        maxTier: 2,
        description: '+1 Golem Capacity per tier (max 2)',
        bonus: { stat: 'golemCapacity', amount: 1 },
      },
    ],
  },
  {
    id: 'crafting-efficiency',
    name: 'Crafting Efficiency',
    attunement: DisciplinesAttunementType.FABRICATOR,
    manaType: 'earth',
    baseCost: 12,
    description: 'Reduce material costs for crafting.',
    statBonus: { stat: 'craftingCostReduction', baseValue: 15, label: 'Crafting Cost Reduction' },
    difficultyFactor: 180,
    scalingFactor: 90,
    drainBase: 6,
    perks: [
      {
        id: 'efficiency-1',
        type: 'once',
        threshold: 300,
        value: 0,
        description: '+10% Crafting Cost Reduction',
        bonus: { stat: 'craftingCostReduction', amount: 10 },
      },
    ],
  },
  {
    id: 'study-fabricator-recipes',
    name: 'Study Fabricator Recipes',
    attunement: DisciplinesAttunementType.FABRICATOR,
    manaType: 'earth',
    baseCost: 10,
    description: 'Learn to craft elemental equipment at the fabricator.',
    statBonus: { stat: 'enchantPower', baseValue: 3, label: 'Enchantment Power' },
    difficultyFactor: 100,
    scalingFactor: 80,
    drainBase: 2,
    perks: [
      {
        id: 'fabricator-earth',
        type: 'once',
        threshold: 50,
        value: 0,
        description: 'Unlock Earth fabricator recipes',
        unlocksRecipes: ['earthHelm', 'earthChest', 'earthBoots'],
      },
      {
        id: 'fabricator-metal',
        type: 'once',
        threshold: 100,
        value: 0,
        description: 'Unlock Metal fabricator recipes',
        unlocksRecipes: ['metalBlade', 'metalShield', 'metalGloves'],
      },
      {
        id: 'fabricator-sand',
        type: 'once',
        threshold: 150,
        value: 0,
        description: 'Unlock Sand fabricator recipes',
        unlocksRecipes: ['sandBoots', 'sandGloves', 'sandVest'],
      },
      {
        id: 'fabricator-crystal',
        type: 'once',
        threshold: 200,
        value: 0,
        description: 'Unlock Crystal fabricator recipes',
        unlocksRecipes: ['crystalWand', 'crystalRing', 'crystalAmulet'],
      },
    ],
  },
  {
    id: 'study-wizard-branch',
    name: 'Study Wizard Equipment',
    attunement: DisciplinesAttunementType.FABRICATOR,
    manaType: 'earth',
    baseCost: 15,
    description: 'Learn to craft advanced wizard equipment.',
    statBonus: { stat: 'enchantPower', baseValue: 5, label: 'Enchantment Power' },
    difficultyFactor: 150,
    scalingFactor: 100,
    drainBase: 3,
    requires: ['study-fabricator-recipes'],
    perks: [
      {
        id: 'wizard-oak',
        type: 'once',
        threshold: 50,
        value: 0,
        description: 'Unlock Oak Staff recipe',
        unlocksRecipes: ['oakStaff'],
      },
      {
        id: 'wizard-arcanist-staff',
        type: 'once',
        threshold: 100,
        value: 0,
        description: 'Unlock Arcanist Staff recipe',
        unlocksRecipes: ['arcanistStaff'],
      },
      {
        id: 'wizard-battlestaff',
        type: 'once',
        threshold: 150,
        value: 0,
        description: 'Unlock Battlestaff recipe',
        unlocksRecipes: ['battlestaff'],
      },
      {
        id: 'wizard-arcanist-gear',
        type: 'once',
        threshold: 150,
        value: 0,
        description: 'Unlock Arcanist Circlet and Robe recipes',
        unlocksRecipes: ['arcanistCirclet', 'arcanistRobe'],
      },
      {
        id: 'wizard-void-catalyst',
        type: 'once',
        threshold: 200,
        value: 0,
        description: 'Unlock Void Catalyst recipe',
        unlocksRecipes: ['voidCatalyst'],
      },
      {
        id: 'wizard-arcanist-pendant',
        type: 'once',
        threshold: 250,
        value: 0,
        description: 'Unlock Arcanist Pendant recipe',
        unlocksRecipes: ['arcanistPendant'],
      },
    ],
  },
  {
    id: 'study-physical-branch',
    name: 'Study Physical Equipment',
    attunement: DisciplinesAttunementType.FABRICATOR,
    manaType: 'earth',
    baseCost: 15,
    description: 'Learn to craft advanced physical combat equipment.',
    statBonus: { stat: 'enchantPower', baseValue: 5, label: 'Enchantment Power' },
    difficultyFactor: 150,
    scalingFactor: 100,
    drainBase: 3,
    requires: ['study-fabricator-recipes'],
    perks: [
      {
        id: 'physical-crystal-blade',
        type: 'once',
        threshold: 50,
        value: 0,
        description: 'Unlock Crystal Blade recipe',
        unlocksRecipes: ['crystalBlade'],
      },
      {
        id: 'physical-arcanist-blade',
        type: 'once',
        threshold: 100,
        value: 0,
        description: 'Unlock Arcanist Blade recipe',
        unlocksRecipes: ['arcanistBlade'],
      },
      {
        id: 'physical-void-blade',
        type: 'once',
        threshold: 150,
        value: 0,
        description: 'Unlock Void Blade recipe',
        unlocksRecipes: ['voidBlade'],
      },
      {
        id: 'physical-battle-gear',
        type: 'once',
        threshold: 200,
        value: 0,
        description: 'Unlock Battle Helm and Robe recipes',
        unlocksRecipes: ['battleHelm', 'battleRobe'],
      },
      {
        id: 'physical-battle-boots',
        type: 'once',
        threshold: 250,
        value: 0,
        description: 'Unlock Battle Boots recipe',
        unlocksRecipes: ['battleBoots'],
      },
      {
        id: 'physical-combat-gauntlets',
        type: 'once',
        threshold: 300,
        value: 0,
        description: 'Unlock Combat Gauntlets recipe',
        unlocksRecipes: ['combatGauntlets'],
      },
    ],
  },
];
