/*
 * Lords of the Realm 2 — battle projectile instance
 *
 * Up to 100 slots (indices 1..0x64), stride 0x4c (76 bytes).
 * Checksum-synced in multiplayer alongside figures.
 *
 * Provenance: docs/structs/lotr2_projectile.md
 * Confidence: likely (partial layout)
 */
#ifndef LOTR2_PROJECTILE_H
#define LOTR2_PROJECTILE_H

#include <stdint.h>

#pragma pack(push, 1)

typedef enum lotr2_projectile_kind {
    LOTR2_PROJ_ARROW           = 1,
    LOTR2_PROJ_CROSSBOW_BOLT   = 2,
    LOTR2_PROJ_SIEGE_SHOT      = 3,
    LOTR2_PROJ_CATAPULT_BOULDER = 4,
    LOTR2_PROJ_BOILING_OIL     = 5,
    LOTR2_PROJ_CATAPULT_AIM    = 7,
} lotr2_projectile_kind;

typedef struct lotr2_projectile {
    uint8_t  _pad00[0x09];
    uint8_t  kind;                /* +0x09 lotr2_projectile_kind */
    uint8_t  _pad0a[0x2c];
    int32_t  tile_index;          /* +0x36 target map tile linear index */
    uint8_t  _pad3a[0x04];
    int16_t  phase_timer;         /* +0x3e indexes damage tables */
    uint8_t  _pad40[0x02];
    int16_t  damage;              /* +0x40 damage to units on impact */
    /* ... to 0x4c ... */
} lotr2_projectile;

#pragma pack(pop)

#define LOTR2_PROJECTILE_STRIDE 0x4C
#define LOTR2_PROJECTILE_MAX      0x64

#endif /* LOTR2_PROJECTILE_H */
