fix #332 - strangulation affects headless monsters (trunk only)

From a bug report:  amulet of strangulation
continues to kill hero if he polymorphs into a creature which doesn't
need to breathe or doesn't have a head or even a circulatory system.
Currently, the messages are different when the hero doesn't need to
breathe, but that doesn't seem good enough.  This makes strangulation
stop when you polymorph into something which shouldn't be vulnerable and
restart if you poly into something vulnerable while still wearing the
bad amulet.

     can_be_strangled() is doing more checks that necessary, in case the
strangulation property ever gets conferred by something other than an
amulet.  Its criteria for protection from strangling might need tweaking.
This commit is contained in:
nethack.rankin
2007-05-18 02:10:39 +00:00
parent 78d9a4186a
commit 4be43239a8
6 changed files with 78 additions and 6 deletions

View File

@@ -354,6 +354,12 @@ nh_timeout()
Strcpy(killer.name,
(u.uburied) ? "suffocation" : "strangulation");
done(DIED);
/* must be declining to die in explore|wizard mode;
treat like being cured of strangulation by prayer */
if (uamul && uamul->otyp == AMULET_OF_STRANGULATION) {
Your("amulet vanishes!");
useup(uamul);
}
break;
case FUMBLING:
/* call this only when a move took place. */