Mjollnir fix

Fix one of the problems From a bug report:  Mjollnir is only
giving the intended feedback when it is thrown.  Against ordinary
monsters the problem isn't too bad--you get a lightning message
without the preceding hit message--but against resistant ones there
is no message at all when you hit hand-to-hand.  (There is a similar
bug for artifacts which add magic missile damage, but since no such
artifacts exist that isn't much of a problem. :-)
This commit is contained in:
nethack.rankin
2002-03-23 04:37:02 +00:00
parent fba4cbd6af
commit db95c38e20
2 changed files with 9 additions and 7 deletions
+3 -1
View File
@@ -2,7 +2,9 @@ $RCSfile$ $Revision$ $Date$
General Fixes and Modified Features General Fixes and Modified Features
----------------------------------- -----------------------------------
Prevent panic() obj_not_free when pushing a boulder over a landmine prevent panic() obj_not_free when pushing a boulder over a landmine
there was no feedback when successfully hitting shock resistant monsters
with Mjollnir via hand-to-hand attack
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes
+6 -6
View File
@@ -1,4 +1,4 @@
/* SCCS Id: @(#)artifact.c 3.4 2002/02/21 */ /* SCCS Id: @(#)artifact.c 3.4 2002/03/22 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -725,7 +725,9 @@ int dieroll; /* needed for Magicbane and vorpal blades */
return FALSE; return FALSE;
} }
realizes_damage = (youdefend || vis); realizes_damage = (youdefend || vis ||
/* feel the effect even if not seen */
(youattack && mdef == u.ustuck));
/* the four basic attacks: fire, cold, shock and missiles */ /* the four basic attacks: fire, cold, shock and missiles */
if (attacks(AD_FIRE, otmp)) { if (attacks(AD_FIRE, otmp)) {
@@ -751,8 +753,7 @@ int dieroll; /* needed for Magicbane and vorpal blades */
} }
if (attacks(AD_ELEC, otmp)) { if (attacks(AD_ELEC, otmp)) {
if (realizes_damage) { if (realizes_damage) {
if (youattack ? otmp != uwep : !spec_dbon_applies) pline_The("massive hammer hits %s%c",
pline("%s %s%c", Tobjnam(otmp, "hit"),
hittee, !spec_dbon_applies ? '.' : '!'); hittee, !spec_dbon_applies ? '.' : '!');
if (spec_dbon_applies) if (spec_dbon_applies)
pline("Lightning strikes %s!", hittee); pline("Lightning strikes %s!", hittee);
@@ -763,8 +764,7 @@ int dieroll; /* needed for Magicbane and vorpal blades */
} }
if (attacks(AD_MAGM, otmp)) { if (attacks(AD_MAGM, otmp)) {
if (realizes_damage) { if (realizes_damage) {
if (youattack ? otmp != uwep : !spec_dbon_applies) pline_The("imaginary widget hits %s%c",
pline("%s %s%c", Tobjnam(otmp, "hit"),
hittee, !spec_dbon_applies ? '.' : '!'); hittee, !spec_dbon_applies ? '.' : '!');
if (spec_dbon_applies) if (spec_dbon_applies)
pline("A hail of magic missiles strikes %s!", hittee); pline("A hail of magic missiles strikes %s!", hittee);