// Every rule the engine plays by, with the value it ships with. The storage,
// the defaults, the console command and the Lua bridge are all generated from
// these rows. What each one means is documented in src/lua/api/rules.lua.
//
// A row names its own group so the group reaches the lookup map, where the
// markers have expanded to nothing. Naming a group that does not bracket the
// row fails to compile against the struct.
//
// A row's type is the one the engine stores the number in, so the range check
// that guards a write rejects what the storage could not hold.

// How much warmth Lara holds, and how fast she loses and regains it in a room
// flagged as damaging. LARA_INFO holds the warmth in an int16_t.
X_GROUP_BEGIN(exposure)
X_RULE(int16_t, exposure, max,         20 * LOGIC_FPS)
X_RULE(int16_t, exposure, drain_land,  1)
X_RULE(int16_t, exposure, drain_water, 2)
X_RULE(int16_t, exposure, recovery,    1)
X_RULE(int16_t, exposure, damage,      10)
X_GROUP_END(exposure)

// What becomes of a body once its owner is dead. TR4 fades a body out and
// takes it away; the other games leave it where it lies, so the shipped 0 is
// replaced with the game's own default in Rules_Reset.
X_GROUP_BEGIN(corpse)
X_RULE(int16_t, corpse, fade_speed, 0)
X_GROUP_END(corpse)

// Where an item a defeated enemy carried comes to rest, and which way it
// faces. The games differ on both, so the shipped values are replaced with the
// game's own defaults in Rules_Reset.
X_GROUP_BEGIN(carrier)
X_RULE(bool, carrier, snap_to_sector, false)
X_RULE(bool, carrier, inherit_facing, true)
X_GROUP_END(carrier)

// Determines how music triggered from floor data is played and the
// interpretation of their state flags.
X_GROUP_BEGIN(music)
X_RULE(bool, music, accumulate_trigger_masks, false)
X_RULE(bool, music, is_one_shot_default, false)
X_RULE(bool, music, supports_delay, false)
X_GROUP_END(music)
