Skip to main content

Melee attacks

Monsters · Ranged attacks · Who a monster attacks

In brief​

A monster attacks in melee when the party is in the block ahead and the monster stands in the half of its block that faces the party, and then only every second time. Each attack sequence rolls the type's attacks against one character; damage that gets through can take an item, poison, paralyze or petrify. Monsters test no wall between their block and the party's, and the game has no rounds: a monster acts at its group's update.

When a pursuing monster attacks in melee. The party must be in the block ahead, otherwise the monster moves toward its destination. The monster must stand in the half of its block that faces the party, in its centre, or be of occupancy class 1, otherwise it moves within its block and its update ends. A bit of its state alternates at each chance, and only one value leads to an attack. It then runs one attack sequence against each character it attacks; when an attack hits, the character may lose an item, takes the damage, and may then be poisoned, paralyzed or petrified.
Three conditions must hold; in position, a monster strikes only at every second chance.

The attack sequence​

A monster attacks in melee only when the block ahead is the party's block. It must also stand in the half of its own block that faces the party, unless it stands in the centre of its block or its type's occupancy class is 1; otherwise it moves within its block and its update ends. Even in position it attacks only every second time: each chance flips a bit of its state, and only one of the two values leads to an attack. A monster directly in front of the party is animated as it attacks. Which character it attacks depends on the party's formation; see who a monster attacks.1

A monster type gives a number of attacks and a set of damage dice for each. For each character the monster attacks — the first eligible one of its order, or every one with MONSTER_CAP_ATTACKS_ALL — the game runs one attack sequence:2

total = 0
for i in 0 .. type.attacks - 1:
if hit_roll(monster, character in slot i): # see the bug below
total += roll(type.damage[i])
if total > 0:
if MONSTER_CAP_ITEM_LOSS and 1d4 != 4: lose an item (below)
damage the character by total # no saving throw
if MONSTER_CAP_POISONS: afflict POISONED (category 0)
and end its Slow Poison effect
if MONSTER_CAP_PARALYZES: afflict PARALYZED (category 2)
if MONSTER_CAP_PETRIFIES: afflict PETRIFIED (category 2)

The hit roll has no term for the character's condition. The damage reduces any Aid and Armor reserves as described for the character record; a character reduced to −10 hit points dies before the conditions are tested, and then escapes them. Slow Poison ends whether the poisoning succeeds or not.

Bug

The hit roll of attack number i, counted from 0, uses the defense and the Blur and Protection from Evil effects of the character in slot i, not those of the character attacked; projectile hits pass the target to the same roll. With one attack, slot 0 decides every melee hit, wherever the target stands; Prayer, a party effect, is unaffected. A faithful reimplementation rolls attack i against slot i.2

Item loss. A monster with MONSTER_CAP_ITEM_LOSS makes the character lose, three times in four, the first item met from a random inventory slot whose item type marks it as losable — weapons, armour, helmets, shields, rings, bracers, wands, an amulet and lock picks among the original item types: "name has lost her (his) item.". The item leaves the inventory without being placed anywhere.2

Effects on characters​

Poison, paralysis and petrification, from a monster's melee attack or mind blast, go through one routine:3

  1. Nothing happens if the character already has that condition, or is not living: absent, at −10 hit points or turned to stone.
  2. The character makes a saving throw of the given category, with its class and first level; success avoids the effect.
  3. Petrification ends every spell on the character and leaves only CHARACTER_STATUS_PRESENT and CHARACTER_STATUS_PETRIFIED; the other effects add their CharacterStatusFlags bit. A paralyzed or petrified character's open spell book closes.
  4. A character timer is set, then the game prints "name is poisoned!", "paralyzed!" or "PETRIFIED!".
ConditionSaving throwTimerWhat the timer does
Poisonedcategory 0546 ticks, then every 546While poisoned: 5 points of damage ("name feels the effects of poison!"), none under Slow Poison.
Paralyzed (melee)category 22 730 ticks"name is no longer paralyzed!"
Paralyzed (mind blast)category 12 730 ticksThe same.
Petrifiedcategory 2noneLasts until Stone to Flesh.

Poison thus costs 5 hit points per unit of time until Neutralize Poison or death, which clears the condition. Reading a unit of 546 ticks as a minute of game time is inferred from resting, where an hour is 60 such units.

What stops an attack​

Monsters test no line of sight beyond the ranged trace: noticing the party ignores walls, a melee attack needs only the party in the block ahead, and the ranged trace stops on reaching the party's block before testing that block's face. A type with MONSTER_CAP_ATTACKS_ANY_SIDE attacks a party in any of the four neighboring blocks without turning; the characters it hits are still chosen from its own facing.1

Anomaly

The face between the monster's block and the party's block is never tested by an attack, although the move check refuses the same faces. A monster beside a face that lets the party through but keeps monsters out, or facing the party through a closed door from the next block, cannot cross it but strikes the party beyond it in melee, and its ranged attack starts. A launched object is then stopped by the door as it flies; a mind blast, which has no flying object, reaches the party. A faithful reimplementation applies no face test to melee attacks or to the last step of the ranged trace.1

Faces that let the party through but keep monsters out, doors aside, are common in the original levels. Nearly all belong to blocks with such a reference on all four sides, which monsters cannot walk into. The number of these faces with a block on their other side that has a monster passage of its own is:4

Level12345678910111213141516
Faces174525317183428498669614966110

Most of them use a few references: on level 2, 35 of the 45 hold reference 26; on level 12, 29 of the 96 hold reference 25 and 28 hold reference 38. Levels 12 and 14 share one map. The count does not say whether a level's scripts let the party stay on a given block.

Attack timing​

There is no game round. A monster attacks only in pursuit, during its group's update — every 15, 25 or 35 ticks in the original levels — and does one thing per update: a ranged attack, a melee attempt, or a move, followed by a second melee attempt for MONSTER_CAP_POST_MOVE_ACTION. One attack sequence — the type's number of hit rolls against one character — is what a monster does to that character in one update. In position it attacks every second update; ranged attacks come two to four updates apart. A character's hand is ready again 54 ticks after an attack, 27 under Haste; see what decides a fight.5

Sources​

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

Footnotes​

  1. Close-range action, the attack position check, move within its block, the pursuit decision and the ranged action. Comparative sources: REF-SCUMM-018, updateMonsterTryCloseAttack; REF-SCUMM-020, updateMonsterTryDistanceAttack. ↩ ↩2 ↩3

  2. Monster attack, the monster's hit roll, roll dice, lose an item to a monster and damage characters. Comparative sources: REF-SCUMM-018, monsterCloseAttack; REF-SCUMM-021, monsterAttackHitTest. ↩ ↩2 ↩3

  3. Afflict a character with a condition, the character saving throw and the character timer events. Comparative source: REF-SCUMM-021, statusAttack, specialAttackSavingThrow and timerSpecialCharacterUpdate. ↩

  4. Counted from the faces of the MAZ file of each level, with the wall mappings of the first sublevel record of its INF file and the wall properties. A counted face has WALL_RUNTIME_PASSAGE, lacks WALL_RUNTIME_MONSTER_PASSAGE and WALL_RUNTIME_DOOR, and the block on its other side has a face with WALL_RUNTIME_MONSTER_PASSAGE. ↩

  5. Pursuit decision, close-range action and ranged action. ↩