Skip to main content

Kinds of damage dealt to a monster

MonsterDamageFlags · 16-bit argument of the monster damage calculation; also the damage_flags of a SpellDefinitionRuntime

Damage to a monster › How the damage is reduced · Monster immunities · Attack spells

Every blow, missile or spell that hurts a monster says what kind of damage it is. The damage calculation uses these bits to choose how the damage is rolled, to cancel it against the monster type's immunities, and to award experience.1

/* Kinds of damage passed to the monster damage calculation (EOB II DOS). */
typedef enum MonsterDamageFlags {
MONSTER_DAMAGE_MAGIC = 0x0001, /* Magical: the monster may evade it; cancelled by MONSTER_IMMUNE_MAGIC. */
MONSTER_DAMAGE_ELECTRICITY = 0x0002, /* Shocking Grasp, Lightning Bolt; cancelled by MONSTER_IMMUNE_ELECTRICITY. */
MONSTER_DAMAGE_FLYING_OBJECT = 0x0010, /* With MONSTER_DAMAGE_WEAPON: thrown or shot; a non-missile item deals 1. */
MONSTER_DAMAGE_FIRE = 0x0020, /* Burning Hands, Fireball, Flame Blade, Flame Strike; cancelled by MONSTER_IMMUNE_FIRE. */
MONSTER_DAMAGE_COLD = 0x0040, /* Ice Storm, Cone of Cold; cancelled by MONSTER_IMMUNE_COLD. */
MONSTER_DAMAGE_UNKNOWN_0080 = 0x0080, /* Cancelled by MONSTER_IMMUNE_UNKNOWN_0400; never produced by the game. */
MONSTER_DAMAGE_WEAPON = 0x0100, /* The damage is an item's damage roll; weapon reductions apply. */
MONSTER_DAMAGE_UNKNOWN_0200 = 0x0200, /* Passed by Turn undead; no effect in the calculation. */
MONSTER_DAMAGE_UNKNOWN_0400 = 0x0400, /* Cancelled by MONSTER_IMMUNE_UNKNOWN_0040; never produced by the game. */
MONSTER_DAMAGE_EXPERIENCE = 0x0800 /* The party gains experience if the monster dies. */
} MonsterDamageFlags;

No source in the game produces MONSTER_DAMAGE_UNKNOWN_0080 or MONSTER_DAMAGE_UNKNOWN_0400: every call of the damage calculation is known, and none of them, nor any spell definition, passes these bits; see kinds that never occur. Bits 0x0004 and 0x0008 have no effect in the calculation. Melf's Acid Arrow sets 0x0010 without MONSTER_DAMAGE_WEAPON, which changes nothing. A melee blow passes MONSTER_DAMAGE_WEAPON, and also MONSTER_DAMAGE_MAGIC when the weapon is a conjured one.

Sources​

Locations refer to the game executable reference; comparative sources are listed in the technical references.

Footnotes​

  1. The monster damage calculation and its immunity pairs; the magic object hit and the melee attack, which pass the flags; the callers of monster damage with a saving throw and the initial definition table. Comparative source: EoBCoreEngine::calcMonsterDamage in REF-SCUMM-013. ↩