Skip to content

Commit

Permalink
Zombies are immune to being scared by any source
Browse files Browse the repository at this point in the history
The initial idea for this was "all mindless undead are immune to active
scare effects, but not the scroll of scare monster". The roadblock I ran
into was that onscary() is really not well set up for that and you'd
have to hack several special cases into otherwise clean conditions to
make it work. Perhaps at some point it could be refactored into a
(monster -> bitmask of things they would be scared by) function, but at
the moment it's easiest to simply add more cases to the "completely
immune to fear" conditional.

To compensate for making the fear immunity broader than originally, I
narrowed the scope to only zombies, which dovetails nicely with the
feature from several commits ago where they can't open doors - other
"mindless" undead may still possess enough instinct or trace of mental
faculties to open doors and avoid scary things, but zombies are dumb as
a rock and don't.

Closes #113
  • Loading branch information
copperwater committed Apr 20, 2024
1 parent 91d5281 commit a70f112
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions doc/xnh-changelog-9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ changes:
- The chance of finding a secret door or passage via searching is no longer
dependent on Luck.
- Zombies cannot open closed doors.
- Zombies additionally are immune to being scared by any source, including the
scroll of scare monster.
- Orcs, barbarians, and cavemen have a Wisdom-dependent chance of avoiding the
urge to take a bath in a fountain.
- Scrolls of earth work again in all levels besides the non-Earth Planes.
Expand Down
5 changes: 3 additions & 2 deletions src/monmove.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,14 @@ onscary(coordxy x, coordxy y, struct monst *mtmp)
* humans aren't monsters
* uniques have ascended their base monster instincts
* Rodney, lawful minions, Angels, the Riders, shopkeepers
* inside their own shop, priests inside their own temple, uniques */
* inside their own shop, priests inside their own temple, uniques,
* zombies */
if (mtmp->iswiz || is_lminion(mtmp) || mtmp->data == &mons[PM_ANGEL]
|| is_rider(mtmp->data)
|| mtmp->data->mlet == S_HUMAN || unique_corpstat(mtmp->data)
|| (mtmp->isshk && inhishop(mtmp))
|| (mtmp->ispriest && inhistemple(mtmp))
|| (mtmp->data->geno & G_UNIQ))
|| (mtmp->data->geno & G_UNIQ) || is_zombie(mtmp->data))
return FALSE;

/* <0,0> is used by musical scaring to check for the above;
Expand Down

0 comments on commit a70f112

Please sign in to comment.