/*
 * Lords of the Realm 2 — battle figure (combat unit instance)
 *
 * Runtime array: up to 80 active figures (indices 1..0x50), stride 0x1b0 (432).
 * Base symbol: DAT_00549548 region (Ghidra); not fully recovered — key fields only.
 *
 * Provenance: docs/structs/lotr2_battle_figure.md
 * Confidence: likely (partial layout from field usage)
 */
#ifndef LOTR2_BATTLE_FIGURE_H
#define LOTR2_BATTLE_FIGURE_H

#include <stdint.h>

#pragma pack(push, 1)

typedef enum lotr2_unit_type {
    LOTR2_UNIT_PEASANT      = 0,
    LOTR2_UNIT_ARCHER       = 1,
    LOTR2_UNIT_SWORDSMAN    = 2,
    LOTR2_UNIT_MACEMAN      = 3,
    LOTR2_UNIT_PIKESMAN     = 4,
    LOTR2_UNIT_CROSSBOWMAN  = 5,
    LOTR2_UNIT_KNIGHT       = 6,
    LOTR2_UNIT_CATAPULT     = 7,
    LOTR2_UNIT_BATTERING_RAM = 8,
    LOTR2_UNIT_SIEGE_TOWER  = 9,
    LOTR2_UNIT_MOAT_LADDER  = 10,
} lotr2_unit_type;

/*
 * Partial battle figure layout — only evidenced offsets documented.
 * Full size 0x1b0 bytes.
 */
typedef struct lotr2_battle_figure {
    uint8_t  _pad00[0x0A];
    uint8_t  unit_type;           /* +0x0A  lotr2_combat_figure_unit_type   */
    uint8_t  _pad0b[0x1F];
    uint8_t  walk_counter;        /* +0x2A  lotr2_combat_figure_walk_counter */
    uint8_t  _pad2b[0x167];
    int16_t  damage_acc;          /* +0x192 lotr2_combat_figure_damage_acc   */
    int16_t  attack_damage;       /* +0x194 lotr2_combat_figure_attack_damage */
    int16_t  counter_atk_damage;  /* +0x196 lotr2_combat_figure_counter_atk  */
    int16_t  head_count;          /* +0x198 lotr2_combat_figure_head_count   */
    uint8_t  _pad19a[0x02];
    uint8_t  formation_tier;      /* +0x19B lotr2_combat_figure_formation_tier */
    uint8_t  _pad19c[0x02];
    int16_t  projectile_damage;   /* +0x19E lotr2_combat_figure_projectile_damage */
    /* ... remaining fields to 0x1b0 ... */
} lotr2_battle_figure;

#pragma pack(pop)

#define LOTR2_BATTLE_FIGURE_STRIDE 0x1B0
#define LOTR2_BATTLE_FIGURE_MAX    0x50
#define LOTR2_CASUALTY_POOL        100

#endif /* LOTR2_BATTLE_FIGURE_H */
