// ─── Enchanter Disciplines ────────────────────────────────────────────────────
// Core enchanter disciplines and weapon enchantment studies

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

export const enchanterDisciplines: DisciplineDefinition[] = [
  {
    id: 'enchant-crafting',
    name: 'Enchantment Crafting',
    attunement: DisciplinesAttunementType.ENCHANTER,
    manaType: 'transference',
    baseCost: 8,
    description: 'Boost your enchantment power, making all enchantments more effective.',
    statBonus: { stat: 'enchantPower', baseValue: 8, label: 'Enchantment Power' },
    difficultyFactor: 120,
    scalingFactor: 60,
    drainBase: 3,
    perks: [
      {
        id: 'enchant-1',
        type: 'infinite',
        threshold: 150,
        value: 150,
        description: '+5 Enchantment Power per tier',
        bonus: { stat: 'enchantPower', amount: 5 },
      },
      {
        id: 'enchant-2',
        type: 'capped',
        threshold: 300,
        value: 200,
        maxTier: 3,
        description: '+10 Enchantment Power per tier (max 3)',
        bonus: { stat: 'enchantPower', amount: 10 },
      },
    ],
  },
  {
    id: 'mana-channeling',
    name: 'Mana Channeling',
    attunement: DisciplinesAttunementType.ENCHANTER,
    manaType: 'transference',
    baseCost: 12,
    description: 'Improve your ability to channel mana through manual focus.',
    statBonus: { stat: 'clickManaMultiplier', baseValue: 0.3, label: 'Click Mana Multiplier' },
    difficultyFactor: 180,
    scalingFactor: 90,
    drainBase: 5,
    perks: [
      {
        id: 'channel-1',
        type: 'once',
        threshold: 250,
        value: 0,
        description: '+15 Lightning Mana Capacity',
        bonus: { stat: 'elementCap_lightning', amount: 15 },
      },
    ],
  },
  {
    id: 'study-basic-weapon-enchantments',
    name: 'Study Basic Weapon Enchantments',
    attunement: DisciplinesAttunementType.ENCHANTER,
    manaType: 'transference',
    baseCost: 10,
    description: 'Learn to enchant weapons with basic elemental effects.',
    statBonus: { stat: 'enchantPower', baseValue: 3, label: 'Enchantment Power' },
    difficultyFactor: 100,
    scalingFactor: 80,
    drainBase: 2,
    perks: [
      {
        id: 'basic-weapon-fire',
        type: 'once',
        threshold: 50,
        value: 0,
        description: 'Unlock Fire Enchant for weapons',
        unlocksEffects: ['sword_fire'],
      },
      {
        id: 'basic-weapon-frost',
        type: 'once',
        threshold: 100,
        value: 0,
        description: 'Unlock Frost Enchant for weapons',
        unlocksEffects: ['sword_frost'],
      },
      {
        id: 'basic-weapon-lightning',
        type: 'once',
        threshold: 150,
        value: 0,
        description: 'Unlock Lightning Enchant for weapons',
        unlocksEffects: ['sword_lightning'],
      },
    ],
  },
  {
    id: 'study-advanced-weapon-enchantments',
    name: 'Study Advanced Weapon Enchantments',
    attunement: DisciplinesAttunementType.ENCHANTER,
    manaType: 'transference',
    baseCost: 20,
    description: 'Learn to enchant weapons with exotic and combat effects.',
    statBonus: { stat: 'enchantPower', baseValue: 5, label: 'Enchantment Power' },
    difficultyFactor: 200,
    scalingFactor: 120,
    drainBase: 4,
    requires: ['study-basic-weapon-enchantments'],
    perks: [
      {
        id: 'advanced-weapon-void',
        type: 'once',
        threshold: 100,
        value: 0,
        description: 'Unlock Void Enchant for weapons',
        unlocksEffects: ['sword_void'],
      },
      {
        id: 'advanced-weapon-damage-5',
        type: 'once',
        threshold: 150,
        value: 0,
        description: 'Unlock Minor Power enchantment',
        unlocksEffects: ['damage_5'],
      },
      {
        id: 'advanced-weapon-crit',
        type: 'once',
        threshold: 200,
        value: 0,
        description: 'Unlock Sharp Edge enchantment',
        unlocksEffects: ['crit_5'],
      },
      {
        id: 'advanced-weapon-attack-speed',
        type: 'once',
        threshold: 250,
        value: 0,
        description: 'Unlock Swift Casting enchantment',
        unlocksEffects: ['attack_speed_10'],
      },
    ],
  },
  {
    id: 'transference-channeling',
    name: 'Transference Channeling',
    attunement: DisciplinesAttunementType.ENCHANTER,
    manaType: 'transference',
    baseCost: 15,
    description: 'Channel transference mana through your equipment, making enchanted gear strike and cast faster. Higher mastery costs more mana but grants greater speed.',
    statBonus: { stat: 'channelIntensity', baseValue: 0.10, label: 'Channel Intensity' },
    difficultyFactor: 180,
    scalingFactor: 100,
    drainBase: 4,
    perks: [
      {
        id: 'channel-efficiency',
        type: 'once',
        threshold: 100,
        value: 0,
        description: '15% less drain for same speed',
        bonus: { stat: 'channelEfficiency', amount: 0.15 },
      },
      {
        id: 'channel-power',
        type: 'infinite',
        threshold: 200,
        value: 150,
        description: '+0.05 Channel Intensity per tier',
        bonus: { stat: 'channelIntensity', amount: 0.05 },
      },
      {
        id: 'channel-mastery',
        type: 'capped',
        threshold: 400,
        value: 200,
        maxTier: 3,
        description: '+0.10 Channel Efficiency per tier (max 3)',
        bonus: { stat: 'channelEfficiency', amount: 0.10 },
      },
    ],
  },
];
