Every point of damage in Warman flows through the same pipeline, whether it comes from a sword swing, a fireball, a trap, or a ground effect. The pipeline determines the final number that appears on screen, and that number depends on damage type, attacker stats, defender stats, crit rolls, species bonuses, and mitigation.
Three Damage Types
All damage falls into one of three types. Physical damage is the most common. Melee weapons, arrows, and many skills deal physical. It's reduced by the target's Armor stat and can be partially blocked by Physical Block. Magical damage comes from spells and enchantments: fireballs, lightning, wind blasts. It's reduced by Resistance and Magical Block. Pure damage bypasses everything. No armor, no resistance, no block. It's rare, reserved for special mechanics like trap damage or boss abilities where the designer wants guaranteed hurt.
Damage Snapshots
Snapshots matter for projectiles especially. A fireball might take a full second to travel across the room. Without snapshots, the damage would be calculated using the caster's stats at impact time, which could be different from cast time if buffs changed in between. Snapshots make the damage feel consistent and predictable.
Damage Groups and Ticks
A DamageGroup bundles a damage type with one or more DamageTick entries. A single attack can deal damage in multiple ticks. A sword swing might hit once, but a spinning attack might deal 3 ticks of damage in quick succession. Each tick has its own base damage value and scaling, and they all share the same damage type from the group.
This separation lets designers create attacks that feel different even if they deal similar total damage. A heavy slam hits once for big damage. A flurry hits four times for small damage each. Both can have the same DPS but play completely differently against armor (four small hits get reduced four times, one big hit gets reduced once).
Species Multipliers
The snapshot contains per-species damage multipliers: damage against elites, monsters, undead, humans, magical creatures, and structures. These start at 100% and can be increased by item effects and modifiers. When a hit resolves, the game checks the target's species and applies the corresponding multiplier. A weapon with "+30% damage against undead" makes every hit against skeleton enemies deal 130% of normal damage.
Crit and Penetration
Crit chance is rolled per hit from the snapshot's crit chance value (capped at 75% by default). A crit multiplies the final damage by the snapshot's crit multiplier (base 150%, increasable through gear). Penetration reduces the target's effective armor or resistance before mitigation is calculated. 20 points of physical penetration means the target's armor is treated as 20 points lower for this hit.
The Custom Physics Layer
All queries are scoped to the current room. The physics system iterates over the room's unit/enemy/destructible lists directly. No spatial partitioning, or broadphase. For the room sizes in Warman (typically 20-40 units wide), brute-force radius checks against a few dozen entities per room are faster than maintaining a spatial index.