Skip to content

Commit

Permalink
Zombies can't open doors
Browse files Browse the repository at this point in the history
Note by copperwater: the motivation for this is to add a bit more flavor
for zombies -- depictions in pop culture vary of course, but many have
them as shambling, unthinking beings which lack the ability to do things
like intentionally lift a door latch. This gives a player being pursued
by zombies an extra tactical option to put a door between them (of
course, this was already a tactical option for a lot of other monsters
too.)

Ideally zombies ought to be able to open some doors by simply pushing,
from one direction, if they have no latch or are ajar, but NetHack
doesn't store data like that about doors. So the assumption is that all
doors latch when closed.

(I considered having the condition be _mindless_ and not just zombies
specifically, but other undead which NetHack treats as mindless --
ghouls, mummies, skeletons -- are frequently depicted in other media as
being a little smarter than brainless zombies, enough at least to figure
out a door latch.)

Closes #140
Closes #166
  • Loading branch information
Nephi Allred authored and copperwater committed Apr 19, 2024
1 parent 769c21f commit b9d77da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/xnh-changelog-9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ changes:
- Sitting down can partly wipe engravings on your space.
- The chance of finding a secret door or passage via searching is no longer
dependent on Luck.
- Zombies cannot open closed doors.

### Interface changes

Expand Down
6 changes: 4 additions & 2 deletions include/mondata.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,10 @@
|| obj->material == VEGGY \
|| ((obj)->otyp == CORPSE && (obj)->corpsenm == PM_LICHEN))))

/* Wielding and opening doors use the same flags: handed and not verysmall. */
#define can_open_doors(ptr) (!cantwield(ptr))
/* Wielding and opening doors use the same flags: handed and not verysmall.
Exception: zombies cannot open doors.
*/
#define can_open_doors(ptr) (!cantwield(ptr) && !is_zombie(ptr))

/* Noise that a monster makes when engaged in combat. Assume that vocalizations
* account for some noise, so monsters capable of vocalizing make more.
Expand Down

0 comments on commit b9d77da

Please sign in to comment.