github issue #475 revisited - Trollsbane

Change Trollsbane versus troll corpse revival:  instead of revival
failing if Trollsbane is wielded at time of revival attempt, mark
the corpse no-revive if killed by Trollsbane (whether by the hero
or a monster).

If a no-revive corpse is within view when time to revive occurs,
give "the troll corpse twitches feebly" even when the hero isn't
responsible.  That used to only apply if the hero zapped the
corpse with undead turning, which would have become inoperative
because now being zapped by undead turning clears the no-revive
flag and revives as normal.  In other words, undead turning magic
overrides killed-by-Trollsbane or non-ice troll having been in an
ice box.
This commit is contained in:
PatR
2021-04-02 10:38:57 -07:00
parent 770afba463
commit 328dc5bdfa
11 changed files with 79 additions and 58 deletions

View File

@@ -2176,25 +2176,4 @@ has_magic_key(struct monst *mon) /* if null, hero assumed */
return (struct obj *) 0;
}
/* True if anyone on the level is wielding Trollsbane, False otherwise;
used to prevent troll resurrection (FIXME: really ought to be inhibited
when killed by Trollsbane rather than whether anyone wields that) */
boolean
Trollsbane_wielded(void)
{
struct monst *mtmp;
struct obj *mw_tmp;
if (uwep && uwep->oartifact == ART_TROLLSBANE)
return TRUE;
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
if (DEADMONSTER(mtmp))
continue;
if ((mw_tmp = MON_WEP(mtmp)) != 0
&& mw_tmp->oartifact == ART_TROLLSBANE)
return TRUE;
}
return FALSE;
}
/*artifact.c*/