// ─── Fabricator Recipe Types ───────────────────────────────────────────────────
// Shared types for fabricator and material recipes to avoid circular dependencies.
import type { EquipmentSlot } from './equipment/types';
import type { AppliedEnchantment } from '../types/equipment';

export interface FabricatorRecipe {
  id: string;
  name: string;
  description: string;
  /** Mana type required to craft this recipe (must be unlocked) */
  manaType: string;
  /** Equipment type ID produced */
  equipmentTypeId: string;
  /** Which slot the resulting equipment occupies */
  slot: EquipmentSlot;
  /** Materials required: materialId -> count */
  materials: Record<string, number>;
  /** Mana cost in the recipe's mana type */
  manaCost: number;
  /** Craft time in hours */
  craftTime: number;
  /** Rarity tier */
  rarity: 'common' | 'uncommon' | 'rare' | 'epic' | 'legendary';
  /** Flavor text describing the gear's properties */
  gearTrait: string;
  /** Actual enchantments applied to the crafted instance (empty = no bonus effects) */
  bonusEnchantments?: AppliedEnchantment[];
  /** Recipe type: 'equipment' (default) or 'material' */
  recipeType?: 'equipment' | 'material';
  /** For material recipes: the material ID produced */
  resultMaterial?: string;
  /** For material recipes: how many are produced */
  resultAmount?: number;
}

export const MANA_TYPE_LABELS: Record<string, string> = {
  raw: '⚪ Raw',
  fire: '🔥 Fire',
  water: '💧 Water',
  air: '🌬️ Air',
  earth: '⛰️ Earth',
  light: '☀️ Light',
  dark: '🌑 Dark',
  death: '💀 Death',
  transference: '🔗 Transference',
  metal: '🔩 Metal',
  sand: '🏜️ Sand',
  lightning: '⚡ Lightning',
  frost: '❄️ Frost',
  blackflame: '🌋 BlackFlame',
  radiantflames: '🌟 Radiant Flames',
  miasma: '☁️ Miasma',
  shadowglass: '🖤 Shadow Glass',
  crystal: '💎 Crystal',
  stellar: '⭐ Stellar',
  void: '🕳️ Void',
  soul: '💫 Soul',
  time: '⏱️ Time',
  plasma: '⚡ Plasma',
};
