// ─── Special Enchantment Effects ─────────────────────────────────────────
// All special-related enchantment effects that can be applied to equipment

import type { EquipmentCategory } from '../equipment'
import type { EnchantmentEffectDef } from '../enchantment-types'

// Helper to define allowed equipment categories for each effect type
const ALL_CASTER: EquipmentCategory[] = ['caster']
const CASTER_AND_HANDS: EquipmentCategory[] = ['caster', 'hands']
const CASTER_CATALYST_ACCESSORY: EquipmentCategory[] = ['caster', 'catalyst', 'accessory']

export const SPECIAL_EFFECTS: Record<string, EnchantmentEffectDef> = {
  // ═══════════════════════════════════════════════════════════════════════════
  // SPECIAL EFFECTS - Unique and powerful effects
  // ═══════════════════════════════════════════════════════════════════════════
  
  spell_echo_10: {
    id: 'spell_echo_10',
    name: 'Echo Chamber',
    description: '10% chance to cast a spell twice',
    category: 'special',
    baseCapacityCost: 60,
    maxStacks: 2,
    allowedEquipmentCategories: ALL_CASTER,
    effect: { type: 'special', specialId: 'spellEcho10' }
  },
  guardian_dmg_10: {
    id: 'guardian_dmg_10',
    name: 'Bane',
    description: '+10% damage to guardians',
    category: 'special',
    baseCapacityCost: 35,
    maxStacks: 3,
    allowedEquipmentCategories: CASTER_CATALYST_ACCESSORY,
    effect: { type: 'multiplier', stat: 'guardianDamage', value: 1.10 }
  },
  overpower_80: {
    id: 'overpower_80',
    name: 'Overpower',
    description: '+50% damage when mana above 80%',
    category: 'special',
    baseCapacityCost: 55,
    maxStacks: 1,
    allowedEquipmentCategories: CASTER_AND_HANDS,
    effect: { type: 'special', specialId: 'overpower' }
  },
  first_strike: {
    id: 'first_strike',
    name: 'First Strike',
    description: '+15% damage on first attack each floor',
    category: 'special',
    baseCapacityCost: 45,
    maxStacks: 1,
    allowedEquipmentCategories: CASTER_AND_HANDS,
    effect: { type: 'special', specialId: 'firstStrike' }
  },
  combo_master: {
    id: 'combo_master',
    name: 'Combo Master',
    description: 'Every 5th attack deals 3x damage',
    category: 'special',
    baseCapacityCost: 65,
    maxStacks: 1,
    allowedEquipmentCategories: CASTER_AND_HANDS,
    effect: { type: 'special', specialId: 'comboMaster' }
  },
  adrenaline_rush: {
    id: 'adrenaline_rush',
    name: 'Adrenaline Rush',
    description: 'Defeating enemy restores 5% mana',
    category: 'special',
    baseCapacityCost: 50,
    maxStacks: 1,
    allowedEquipmentCategories: CASTER_AND_HANDS,
    effect: { type: 'special', specialId: 'adrenalineRush' }
  },
};
