From 6f90e5bc8c7066421bfac30e5edd6cfefd9f48fa Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sat, 23 Feb 2002 10:55:43 +0000 Subject: [PATCH] Another artifact damage update Make being hit by an artifact which does fire, cold, or lightning (or magic missiles, since the code is there) affect inventory even when the target resists the damage him-/her-/itself. This removes the need for the redundant fire vs slime handling that I put in yesterday. Unfortunately it also means that Valkyries who throw Mjollnir will inevitably end up destroying all their mettalic wands and rings, so I reduced the chance of it hitting upon its return. --- doc/fixes34.0 | 6 +++--- src/artifact.c | 40 +++++++++++++++++++++++----------------- src/dothrow.c | 31 +++++++++++++++++++------------ 3 files changed, 45 insertions(+), 32 deletions(-) diff --git a/doc/fixes34.0 b/doc/fixes34.0 index 1cd57b2f7..6c1477985 100644 --- a/doc/fixes34.0 +++ b/doc/fixes34.0 @@ -434,7 +434,7 @@ halve air elemental damage to compensate for side effect of speed system strengthen Death; weaken Famine, Pestilence, and Demogorgon pet purple worms get nutrition from engulfing attack throwing an artifact upwards will trigger artifact hit effects when it falls -being hit by Fire Brand when not resistant stops the turning-into-slime process +being hit by Fire Brand stops the turning-into-slime process monsters hitting other monsters can split puddings with weapons be consistent with checking for iron weapons when splitting puddings @@ -550,12 +550,12 @@ new window-port preference options added, and some existing options made each of the end disclosure options customizable to "prompt;default no", "prompt;default yes", "show it without prompt", and "don't show it and don't prompt" -add female role level names "Medica ossium", "Magistra", "Chevaliere", - and "Dame" +add female role level names "Medica ossium", "Magistra", "Chevaliere", "Dame" more feedback about skill advancement from #enhance command USER_SOUNDS compilation option to enable use of SOUND and SOUNDDIR variables in the config file for user-specified sound clips for user-specified, regex-based message patterns +resistance does not protect inventory from artifacts (cold vs Frost Brand,&c) Platform- and/or Interface-Specific New Features diff --git a/src/artifact.c b/src/artifact.c index b08cbb559..e5bc1f0a5 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -721,14 +721,6 @@ int dieroll; /* needed for Magicbane and vorpal blades */ if (youattack && youdefend) { impossible("attacking yourself with weapon?"); return FALSE; - } else if (!spec_dbon_applies) { - if (youdefend && Slimed && attacks(AD_FIRE, otmp)) { - pline_The("fiery blade hits you."); - burn_away_slime(); - return TRUE; - } - /* since damage bonus didn't apply, nothing more to do */ - return FALSE; } realizes_damage = (youdefend || vis); @@ -736,9 +728,11 @@ int dieroll; /* needed for Magicbane and vorpal blades */ /* the four basic attacks: fire, cold, shock and missiles */ if (attacks(AD_FIRE, otmp)) { if (realizes_damage) - pline_The("fiery blade %s %s!", + pline_The("fiery blade %s %s%c", + !spec_dbon_applies ? "hits" : (mdef->data == &mons[PM_WATER_ELEMENTAL]) ? - "vaporizes part of" : "burns", hittee); + "vaporizes part of" : "burns", + hittee, !spec_dbon_applies ? '.' : '!'); if (!rn2(4)) (void) destroy_mitem(mdef, POTION_CLASS, AD_FIRE); if (!rn2(4)) (void) destroy_mitem(mdef, SCROLL_CLASS, AD_FIRE); if (!rn2(7)) (void) destroy_mitem(mdef, SPBOOK_CLASS, AD_FIRE); @@ -747,15 +741,19 @@ int dieroll; /* needed for Magicbane and vorpal blades */ } if (attacks(AD_COLD, otmp)) { if (realizes_damage) - pline_The("ice-cold blade freezes %s!", hittee); + pline_The("ice-cold blade %s %s%c", + !spec_dbon_applies ? "hits" : "freezes", + hittee, !spec_dbon_applies ? '.' : '!'); if (!rn2(4)) (void) destroy_mitem(mdef, POTION_CLASS, AD_COLD); return realizes_damage; } if (attacks(AD_ELEC, otmp)) { if (realizes_damage) { - if (youattack && otmp != uwep) - pline("%s %s!", Tobjnam(otmp, "hit"), hittee); - pline("Lightning strikes %s!", hittee); + if (youattack ? otmp != uwep : !spec_dbon_applies) + pline("%s %s%c", Tobjnam(otmp, "hit"), + hittee, !spec_dbon_applies ? '.' : '!'); + if (spec_dbon_applies) + pline("Lightning strikes %s!", hittee); } if (!rn2(5)) (void) destroy_mitem(mdef, RING_CLASS, AD_ELEC); if (!rn2(5)) (void) destroy_mitem(mdef, WAND_CLASS, AD_ELEC); @@ -763,13 +761,21 @@ int dieroll; /* needed for Magicbane and vorpal blades */ } if (attacks(AD_MAGM, otmp)) { if (realizes_damage) { - if (youattack && otmp != uwep) - pline("%s %s!", Tobjnam(otmp, "hit"), hittee); - pline("A hail of magic missiles strikes %s!", hittee); + if (youattack ? otmp != uwep : !spec_dbon_applies) + pline("%s %s%c", Tobjnam(otmp, "hit"), + hittee, !spec_dbon_applies ? '.' : '!'); + if (spec_dbon_applies) + pline("A hail of magic missiles strikes %s!", hittee); } return realizes_damage; } + if (!spec_dbon_applies) { + /* since damage bonus didn't apply, nothing more to do; + no further attacks have side-effects on inventory */ + return FALSE; + } + /* * Magicbane's intrinsic magic is incompatible with normal * enchantment magic. Thus, its effects have a negative diff --git a/src/dothrow.c b/src/dothrow.c index d10317602..291d558fe 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -990,18 +990,25 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */ if(cansee(bhitpos.x, bhitpos.y)) newsym(bhitpos.x,bhitpos.y); } else { - int dmg = rnd(4); - if (Blind) - pline("%s your %s!", - Tobjnam(obj, "hit"), body_part(ARM)); - else - pline("%s back toward you, hitting your %s!", - Tobjnam(obj, "fly"), body_part(ARM)); - (void) artifact_hit((struct monst *) 0, &youmonst, - obj, &dmg, 0); - losehp(dmg, xname(obj), KILLED_BY); - if(ship_object(obj, u.ux, u.uy, FALSE)) - return; + int dmg = rn2(2); + if (!dmg) { + pline(Blind ? "%s lands %s your %s." : + "%s back to you, landing %s your %s.", + Blind ? Something : Tobjnam(obj, "return"), + Levitation ? "beneath" : "at", + makeplural(body_part(FOOT))); + } else { + dmg += rnd(3); + pline(Blind ? "%s your %s!" : + "%s back toward you, hitting your %s!", + Tobjnam(obj, Blind ? "hit" : "fly"), + body_part(ARM)); + (void) artifact_hit((struct monst *)0, + &youmonst, obj, &dmg, 0); + losehp(dmg, xname(obj), KILLED_BY); + } + if (ship_object(obj, u.ux, u.uy, FALSE)) + return; dropy(obj); } return;