fix M167 - hero lycanthrope vulnerable to level drain

From a bug report, player's character inflicted
with lycanthropy doesn't gain level drain resistance when in normal form
even though lycanthrope monsters do have it when in their human form.  The
report claimed that the character didn't gain it when in beast form either,
but the code--and testing--suggests otherwise.

     The same resist_drli() call used for monsters is used for the hero,
but the is_were() check there isn't able to recognize a lychanthrope hero
since youmonst->data doesn't track that when in human/normal form.  This
adds another more specific check to handle that case.
This commit is contained in:
nethack.rankin
2005-09-02 06:29:15 +00:00
parent 8ce7216a0c
commit 545239f4b1
2 changed files with 4 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)mondata.c 3.5 2005/01/29 */
/* SCCS Id: @(#)mondata.c 3.5 2005/09/01 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -82,6 +82,8 @@ struct monst *mon;
struct obj *wep = ((mon == &youmonst) ? uwep : MON_WEP(mon));
return (boolean)(is_undead(ptr) || is_demon(ptr) || is_were(ptr) ||
/* is_were() doesn't handle hero in human form */
(mon == &youmonst && u.ulycn >= LOW_PM) ||
ptr == &mons[PM_DEATH] || is_vampshifter(mon) ||
(wep && wep->oartifact && defends(AD_DRLI, wep)));
}