]> granicus.if.org Git - nethack/commitdiff
Mjollnir fix
authornethack.rankin <nethack.rankin>
Sat, 23 Mar 2002 04:37:02 +0000 (04:37 +0000)
committernethack.rankin <nethack.rankin>
Sat, 23 Mar 2002 04:37:02 +0000 (04:37 +0000)
     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. :-)

doc/fixes34.1
src/artifact.c

index 28ae8904d8973463b000ee11e70810b177847a05..f877194e718bbf1804d09c02100cbfe83e396f53 100644 (file)
@@ -2,7 +2,9 @@ $RCSfile$ $Revision$ $Date$
 
 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
index a8db867bec556887150f47c16d3d0d4a8490f329..071864052399c361fce7aef14e8e8f6d229a071f 100644 (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. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -725,7 +725,9 @@ int dieroll; /* needed for Magicbane and vorpal blades */
            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 */
        if (attacks(AD_FIRE, otmp)) {
@@ -751,8 +753,7 @@ int dieroll; /* needed for Magicbane and vorpal blades */
        }
        if (attacks(AD_ELEC, otmp)) {
            if (realizes_damage) {
-               if (youattack ? otmp != uwep : !spec_dbon_applies)
-                   pline("%s %s%c", Tobjnam(otmp, "hit"),
+               pline_The("massive hammer hits %s%c",
                          hittee, !spec_dbon_applies ? '.' : '!');
                if (spec_dbon_applies)
                    pline("Lightning strikes %s!", hittee);
@@ -763,8 +764,7 @@ int dieroll; /* needed for Magicbane and vorpal blades */
        }
        if (attacks(AD_MAGM, otmp)) {
            if (realizes_damage) {
-               if (youattack ? otmp != uwep : !spec_dbon_applies)
-                   pline("%s %s%c", Tobjnam(otmp, "hit"),
+               pline_The("imaginary widget hits %s%c",
                          hittee, !spec_dbon_applies ? '.' : '!');
                if (spec_dbon_applies)
                    pline("A hail of magic missiles strikes %s!", hittee);