troll corpse revival

Prevent corpses left by cancelled trolls from reviving.  Their
revival is an innate ability but is clearly a magical one, so make
that be subject to cancellation magic.

Change existing corpses that are scheduled to revive to rot instead
if they get cancelled as objects.  Rider corpses are excluded.

Uncancel an ice troll whose corpse is put into an ice box.

Commit e9f53ab7f6 at the end of May
to fix corpses taken out of ice boxes by monsters changed removing
corpses from ice boxes by anybody to always give them rot-away
timers, even for trolls.  Make an exception for ice troll corpses:
give those revive timers instead.
This commit is contained in:
PatR
2020-07-26 11:13:43 -07:00
parent 0fe9905cf8
commit fae75f5930
4 changed files with 42 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mkobj.c $NHDT-Date: 1593306908 2020/06/28 01:15:08 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.181 $ */
/* NetHack 3.6 mkobj.c $NHDT-Date: 1595787211 2020/07/26 18:13:31 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.182 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1516,6 +1516,10 @@ unsigned corpstatflags;
if (!ptr)
ptr = mtmp->data;
/* don't give a revive timer to a cancelled troll's corpse */
if (mtmp->mcan && !is_rider(ptr))
otmp->norevive = 1;
}
/* when 'ptr' is non-null it comes from our caller or from 'mtmp';
@@ -1639,6 +1643,7 @@ boolean copyof;
/* Never insert this returned pointer into mon chains! */
mnew = mtmp;
}
mnew->data = &mons[mnew->mnum];
}
return mnew;
}