export interface CombatMessage {
    type: string;
    origin: 'player' | 'enemy' | 'neutral' | 'system';
    data: Record<string, any>;
    timestamp?: string;
}

export interface FloatingText {
    id: string;
    text: string;
    type: 'damage' | 'heal' | 'info' | 'crit' | 'miss' | 'xp' | 'stamina';
    x: number; // Percentage 0-100
    y: number; // Percentage 0-100
    origin: 'player' | 'enemy';
    timestamp: number;
}

export interface CombatState {
    inCombat: boolean;
    turn: 'player' | 'enemy' | 'attacker' | 'defender';
    yourTurn?: boolean; // True when it's the current player's turn (works for both PvE and PvP)
    npcId?: string;
    npcName?: string;
    npcHp: number;
    npcMaxHp: number;
    npcImage?: string;
    playerHp: number;
    playerMaxHp: number;
    messages: CombatMessage[]; // History of messages
    turnTimeRemaining?: number;
    round: number;
    isPvP?: boolean;
    opponentName?: string;
}

export interface CombatActionResponse {
    success: boolean;
    messages: CombatMessage[]; // The structured messages from this action
    combat_over: boolean;
    player_won?: boolean;
    combat?: any; // Updated combat state from API
    pvp_combat?: any; // Updated PvP combat state from API
    player?: {
        hp: number;
        max_hp: number;
        xp: number;
        level: number;
    };
    winner_id?: string;
}

export interface AnimationState {
    shaking: boolean;
    flashing: boolean;
    enemyAttacking: boolean;
    playerAttacking: boolean;
    playerHit?: boolean; // New: Player taking damage
    npcHit?: boolean;    // New: NPC taking damage
}
