From b9d77dab07e96be925b7d4f5c1f46a8984f92b89 Mon Sep 17 00:00:00 2001 From: Nephi Allred Date: Thu, 1 Jun 2023 19:19:06 -0600 Subject: [PATCH] Zombies can't open doors 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 --- doc/xnh-changelog-9.0.md | 1 + include/mondata.h | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/xnh-changelog-9.0.md b/doc/xnh-changelog-9.0.md index 60dbeeb46..ad446a21f 100644 --- a/doc/xnh-changelog-9.0.md +++ b/doc/xnh-changelog-9.0.md @@ -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 diff --git a/include/mondata.h b/include/mondata.h index 851a9da74..975ed2c70 100644 --- a/include/mondata.h +++ b/include/mondata.h @@ -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.