From d25ede081997fcfe6bcb6879b7914f76a78bc8bd Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Thu, 1 Jun 2006 04:27:35 +0000 Subject: [PATCH] golem life When testing the spoteffects/drown hack I noticed that draining myself with Stormbringer (toss up, get hit on head) while in iron golem form gave messages about it drawing or draining life. (I'm sure that this has come up before....) I've altered the artifact hit message rather than making golems become resistant, although the opposite approach seems at least as valid. The drain life spell uses different wording and isn't affected. --- doc/fixes34.4 | 1 + src/artifact.c | 27 ++++++++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 0e8523e94..290c22c73 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -234,6 +234,7 @@ temple donation can recover protection previously stolen by attrcurse attack display the invisible monster glyph ('I') whenever an unseen monster forces poly'd hero out of hiding escape the deleted trap after performing the invocation while trapped +use alternate phrasing when life drain attack affects non-living creature Platform- and/or Interface-Specific Fixes diff --git a/src/artifact.c b/src/artifact.c index 44496631e..75f26d930 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)artifact.c 3.5 2006/04/14 */ +/* SCCS Id: @(#)artifact.c 3.5 2006/05/31 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1142,16 +1142,21 @@ int dieroll; /* needed for Magicbane and vorpal blades */ } } if (spec_ability(otmp, SPFX_DRLI)) { + /* some non-living creatures (golems, vortices) are + vulnerable to life drain effects */ + const char *life = nonliving(mdef->data) ? + "animating force" : "life"; + if (!youdefend) { if (vis) { if(otmp->oartifact == ART_STORMBRINGER) - pline_The("%s blade draws the life from %s!", + pline_The("%s blade draws the %s from %s!", hcolor(NH_BLACK), - mon_nam(mdef)); + life, mon_nam(mdef)); else - pline("%s draws the life from %s!", + pline("%s draws the %s from %s!", The(distant_name(otmp, xname)), - mon_nam(mdef)); + life, mon_nam(mdef)); } if (mdef->m_lev == 0) { *dmgptr = 2 * mdef->mhp + FATAL_DAMAGE_MODIFIER; @@ -1168,15 +1173,15 @@ int dieroll; /* needed for Magicbane and vorpal blades */ int oldhpmax = u.uhpmax; if (Blind) - You_feel("an %s drain your life!", + You_feel("an %s drain your %s!", otmp->oartifact == ART_STORMBRINGER ? - "unholy blade" : "object"); + "unholy blade" : "object", life); else if (otmp->oartifact == ART_STORMBRINGER) - pline_The("%s blade drains your life!", - hcolor(NH_BLACK)); + pline_The("%s blade drains your %s!", + hcolor(NH_BLACK), life); else - pline("%s drains your life!", - The(distant_name(otmp, xname))); + pline("%s drains your %s!", + The(distant_name(otmp, xname)), life); losexp("life drainage"); if (magr && magr->mhp < magr->mhpmax) { magr->mhp += (oldhpmax - u.uhpmax)/2; -- 2.40.0