export interface AnimationConfig {
  key: string;
  textureKey: string;
  frames: number[];
  frameRate: number;
  repeat: number;
}



export const GAME_CONFIG = {
  player: {
    initialStats: { 
      maxHp: 20, 
      hp: 20,
      maxMana: 20,
      mana: 20,
      attack: 5, 
      defense: 2,
      level: 1,
      exp: 0,
      expToNextLevel: 10,
      statPoints: 0,
      skillPoints: 0,
      strength: 10,
      dexterity: 10,
      intelligence: 10,
      // Offensive
      critChance: 5,
      critMultiplier: 150,
      accuracy: 90,
      lifesteal: 0,
      // Defensive
      evasion: 5,
      blockChance: 0,
      // Utility
      luck: 0,
      passiveNodes: [] as string[]
    },
    speed: 100,
    viewRadius: 8
  },

  map: {
    width: 60,
    height: 40,
    minRooms: 8,
    maxRooms: 13,
    roomMinWidth: 5,
    roomMaxWidth: 12,
    roomMinHeight: 4,
    roomMaxHeight: 10
  },
  
  enemies: {
    rat: {
      baseHp: 8,
      baseAttack: 3,
      baseDefense: 0,
      minSpeed: 80,
      maxSpeed: 110,
      expValue: 5
    },
    bat: {
      baseHp: 6,
      baseAttack: 4,
      baseDefense: 0,
      minSpeed: 110,
      maxSpeed: 140,
      expValue: 8
    }
  },

  enemyScaling: {
    baseCount: 3,
    baseCountPerFloor: 3,
    hpPerFloor: 5,
    attackPerTwoFloors: 1,
  },
  
  leveling: {
    baseExpToNextLevel: 10,
    expMultiplier: 1.5,
    hpGainPerLevel: 5,
    manaGainPerLevel: 3,
    attackGainPerLevel: 1,
    statPointsPerLevel: 5,
    skillPointsPerLevel: 1
  },

  mana: {
    regenPerTurn: 2,
    regenInterval: 3  // Regenerate every 3 turns
  },

  rendering: {
    tileSize: 16,
    cameraZoom: 2,
    minZoom: 0.5,
    maxZoom: 4,
    zoomStep: 0.1,
    wallColor: 0x2b2b2b,
    floorColor: 0x161616,
    exitColor: 0xffd166,
    playerColor: 0x66ff66,
    enemyColor: 0xff6666,
    pathPreviewColor: 0x3355ff,
    expOrbColor: 0x33ccff,
    expTextColor: 0x33ccff,
    levelUpColor: 0xffff00,
    fogAlphaFloor: 0.15,
    fogAlphaWall: 0.35,
    visibleMinAlpha: 0.35,
    visibleMaxAlpha: 1.0,
    visibleStrengthFactor: 0.65
  },

  ui: {
  // ... rest of content ...
    minimapPanelWidth: 340,
    minimapPanelHeight: 220,
    minimapPadding: 20,
    menuPanelWidth: 340,
    menuPanelHeight: 220,
    // Targeting
    targetingLineColor: 0xff0000,
    targetingLineWidth: 2,
    targetingLineAlpha: 0.7
  },
  
  gameplay: {
    energyThreshold: 100,
    actionCost: 100
  },

  assets: {
    spritesheets: [
      { key: "warrior", path: "assets/sprites/actors/player/warrior.png", frameConfig: { frameWidth: 12, frameHeight: 15 } },
      { key: "rat", path: "assets/sprites/actors/enemies/rat.png", frameConfig: { frameWidth: 16, frameHeight: 15 } },
      { key: "bat", path: "assets/sprites/actors/enemies/bat.png", frameConfig: { frameWidth: 15, frameHeight: 15 } },
      { key: "dungeon", path: "assets/tilesets/dungeon.png", frameConfig: { frameWidth: 16, frameHeight: 16 } },
      { key: "soldier.idle", path: "assets/sprites/actors/player/soldier/Idle.png", frameConfig: { frameWidth: 60, frameHeight: 75 } },
      { key: "items", path: "assets/sprites/items/items.png", frameConfig: { frameWidth: 16, frameHeight: 16 } },
    ],
    images: [
      { key: "splash_bg", path: "assets/ui/splash_bg.png" }
    ]
  },

  animations: [
    // Warrior
    { key: "warrior-idle", textureKey: "warrior", frames: [0, 0, 0, 1, 0, 0, 1, 1], frameRate: 2, repeat: -1 },
    { key: "warrior-run", textureKey: "warrior", frames: [2, 3, 4, 5, 6, 7], frameRate: 15, repeat: -1 },
    { key: "warrior-die", textureKey: "warrior", frames: [8, 9, 10, 11, 12], frameRate: 10, repeat: 0 },
    
    // Rat
    { key: "rat-idle", textureKey: "rat", frames: [0, 0, 0, 1], frameRate: 4, repeat: -1 },
    { key: "rat-run", textureKey: "rat", frames: [6, 7, 8, 9, 10], frameRate: 10, repeat: -1 },
    { key: "rat-die", textureKey: "rat", frames: [11, 12, 13, 14], frameRate: 10, repeat: 0 },

    // Bat
    { key: "bat-idle", textureKey: "bat", frames: [0, 1], frameRate: 8, repeat: -1 },
    { key: "bat-run", textureKey: "bat", frames: [0, 1], frameRate: 12, repeat: -1 },
    { key: "bat-die", textureKey: "bat", frames: [4, 5, 6], frameRate: 10, repeat: 0 },

    // Soldier
    { key: "soldier-idle", textureKey: "soldier.idle", frames: [0, 1, 2, 3, 4, 5, 6, 7], frameRate: 8, repeat: -1 },
  ]
} as const;

export type GameConfig = typeof GAME_CONFIG;
