// ─── Attunement Types ───────────────────────────────────────────────────────

// Attunement body slots
export type AttunementSlot = 'rightHand' | 'leftHand' | 'head' | 'back' | 'chest' | 'leftLeg' | 'rightLeg';

// Attunement definition
export interface AttunementDef {
  id: string;
  name: string;
  desc: string;
  slot: AttunementSlot;
  icon: string;
  color: string;
  primaryManaType?: string;      // Primary mana type this attunement generates (null for Invoker)
  rawManaRegen: number;          // Raw mana regeneration per hour granted by this attunement
  conversionRate: number;        // Raw mana converted to primary type per hour
  unlocked: boolean;             // Whether this is unlocked by default
  unlockCondition?: string;      // Description of how to unlock (for future challenges)
  capabilities: string[];        // What this attunement enables (e.g., 'enchanting', 'pacts', 'golemCrafting')
  skillCategories: string[];     // Skill categories this attunement provides access to
}

// Attunement instance state (tracks player's attunements)
export interface AttunementState {
  id: string;
  active: boolean;               // Whether this attunement is currently active
  level: number;                 // Attunement level (for future progression)
  experience: number;            // Progress toward next level
  title?: string;                // Title based on level (e.g., 'Novice Enchanter')
}

// Boon types that guardians can grant
export interface GuardianBoon {
  type: 'maxMana' | 'manaRegen' | 'castingSpeed' | 'elementalDamage' | 'rawDamage' |
        'critChance' | 'critDamage' | 'spellEfficiency' | 'manaGain' | 'insightGain' |
        'studySpeed' | 'prestigeInsight';
  value: number;
  desc: string;
}

export interface GuardianDef {
  name: string;
  element: string[];
  hp: number;
  pact: number;           // Pact multiplier when signed
  color: string;
  boons: GuardianBoon[];  // Bonuses granted when pact is signed
  pactCost: number;       // Mana cost to perform pact ritual
  pactTime: number;       // Hours required for pact ritual
  uniquePerk: string;     // Description of unique perk
  armor?: number;         // Damage reduction (0-1, e.g., 0.2 = 20% reduction)
  shield?: number;        // Flat damage absorption pool (absorbs damage before HP)
  shieldRegen?: number;   // Shield regeneration per tick (flat amount)
  barrier?: number;       // Percentage-based damage reduction (0-1, e.g., 0.1 = 10%) that absorbs damage before HP
  barrierRegen?: number;  // Barrier regeneration per tick (percentage of max barrier)
  healthRegen?: number;   // Health regeneration per tick (flat amount, can be percentage-based with healthRegenIsPercent)
  healthRegenIsPercent?: boolean; // If true, healthRegen is % of max HP per tick; if false, flat HP per tick
  power: number;          // Combat power for display
  effects: { type: string; value: number }[];  // Passive combat effects
  signingCost: { mana: number; time: number };  // Pact ritual cost & time
  unlocksMana: string[];  // Mana types unlocked on pact
  damageMultiplier: number;   // Pact damage multiplier
  insightMultiplier: number;  // Pact insight multiplier
}