drain energy attack (trunk only)

During some recent newsgroup discussion, <Someone> posted an entry from
his personal bug list:  energy draining damage from ordinary attacks is
implemented even though there are no monsters with that capability and it
was not implemented for engulf attacks even though energy vortices have
the capability.  This implements energy drain engulf attacks against the
hero and also both modes of energy drain attacks for monsters and poly'd
hero against spellcasting monsters.  Since monsters don't have energy,
they lose access to their special abilities (their spells, that is) for a
few turns, same as a post-3.4.3 change done for anti-magic traps.
This commit is contained in:
nethack.rankin
2007-12-20 23:02:47 +00:00
parent 67d5fb1481
commit d0a7d15023
7 changed files with 48 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)uhitm.c 3.5 2007/05/16 */
/* SCCS Id: @(#)uhitm.c 3.5 2007/12/19 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1566,6 +1566,11 @@ register struct attack *mattk;
hurtmarmor(mdef, AD_DCAY);
tmp = 0;
break;
case AD_DREN:
if (!negated && !rn2(4))
xdrainenergym(mdef, TRUE);
tmp = 0;
break;
case AD_DRST:
case AD_DRDX:
case AD_DRCO:
@@ -1958,6 +1963,11 @@ register struct attack *mattk;
golemeffects(mdef,(int)mattk->adtyp,dam);
} else dam = 0;
break;
case AD_DREN:
if (!rn2(4))
xdrainenergym(mdef, TRUE);
dam = 0;
break;
}
end_engulf();
if ((mdef->mhp -= dam) <= 0) {