]> granicus.if.org Git - nethack/commitdiff
fix M167 - hero lycanthrope vulnerable to level drain
authornethack.rankin <nethack.rankin>
Fri, 2 Sep 2005 06:29:15 +0000 (06:29 +0000)
committernethack.rankin <nethack.rankin>
Fri, 2 Sep 2005 06:29:15 +0000 (06:29 +0000)
     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.

doc/fixes34.4
src/mondata.c

index 2c429a4a4e641810c662a93d9bbafa479bb77e47..b221e48032030d80c9cc12df400230314797400c 100644 (file)
@@ -141,6 +141,7 @@ don't suppress corpse if you kill your own steed
 fix typo in tourist quest leader's greeting
 fix grammar for graveyard sounds when polymorphed
 avoid divide by zero crash if Luck drops below -1 while a prayer is in progress
+make hero inflicted with lycanthropy immune to level drain just like monsters
 
 
 Platform- and/or Interface-Specific Fixes
index 80513a95974d1d25948c92b27a720afb35ce3922..5f7d2ce8025086e9dab3c33b70df2bd443323818 100644 (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)));
 }