drain life vs drain resisting objects (trunk only)

From the newsgroup:  casting spell of drain life at Stormbringer
(or Excalibur or Staff of Aesculapius) would reduce its enchantment just
like any other weapon.  Drain resistance should protect against that even
when not actively wielded.
This commit is contained in:
nethack.rankin
2012-01-08 01:26:35 +00:00
parent e3648c2adc
commit 1563a3e0ec
2 changed files with 5 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
$RCSfile$ $Revision$ $Date$
$rcsfile: fixes35.0,v $ $Revision$ $Date$
General Fixes and Modified Features
-----------------------------------
@@ -398,8 +398,9 @@ wand/scroll/spell of light now hurts gremlins (lamp/candle light doesn't)
ditto for hero in gremlin form (camera too)
autosearch finds and transforms secret doors and corridors even while blind,
but it wasn't updating the map to show them unless the hero could see
panic save made during magic mapping or <foo> detection performed while
hangup save made during magic mapping or <foo> detection performed while
underwater could put hero on top of the water after restore
items conferring life drain resistance were affected by drain life spell
Platform- and/or Interface-Specific Fixes

View File

@@ -1007,7 +1007,8 @@ register struct obj *obj;
obj->oclass != ARMOR_CLASS && !is_weptool(obj)) ||
obj->spe <= 0)
return (FALSE);
if (obj_resists(obj, 10, 90))
if (defends(AD_DRLI, obj) || defends_when_carried(AD_DRLI, obj) ||
obj_resists(obj, 10, 90))
return (FALSE);
/* Charge for the cost of the object */