]> granicus.if.org Git - nethack/commitdiff
#U770 part II - lack of "miss" message when throwing gold at monster
authornethack.rankin <nethack.rankin>
Fri, 5 Dec 2003 11:37:37 +0000 (11:37 +0000)
committernethack.rankin <nethack.rankin>
Fri, 5 Dec 2003 11:37:37 +0000 (11:37 +0000)
     There was no feedback when gold was thrown or kicked at monsters
who weren't interested in catching it.  Now it'll give the same "<obj>
misses <monster>" message as other thrown or kicked items objects which
don't hit.

doc/fixes34.3
src/dokick.c
src/dothrow.c

index f3631b89e73ebe379d1421ef20fa33e98828211a..1ff7d824164ac45e478d697b0b9145f8ce3a7f91 100644 (file)
@@ -99,6 +99,7 @@ killing a long worm on a drawbridge could produce a panic
 prevent "see it drop from your pack" when figurine monster becomes undetected
 attempting to drop a subset of a stack of multiple cursed loadstones could
        corrupt inventory or cause a crash
+"miss" message was missing for thrown or kicked gold not caught by a monster
 
 
 Platform- and/or Interface-Specific Fixes
index 43169418df5797a2a26aa042fa303da2f3fc700b..7787138b53755013153761086eef5f8f5c5e4e91 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)dokick.c   3.4     2003/03/14      */
+/*     SCCS Id: @(#)dokick.c   3.4     2003/12/04      */
 /* Copyright (c) Izchak Miller, Mike Stephenson, Steve Linhart, 1989. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -238,13 +238,18 @@ ghitm(mtmp, gold)
 register struct monst *mtmp;
 register struct obj *gold;
 {
+       boolean msg_given = FALSE;
+
        if(!likes_gold(mtmp->data) && !mtmp->isshk && !mtmp->ispriest
                        && !is_mercenary(mtmp->data)) {
                wakeup(mtmp);
        } else if (!mtmp->mcanmove) {
                /* too light to do real damage */
-               if (canseemon(mtmp))
-                   pline_The("gold hits %s.", mon_nam(mtmp));
+               if (canseemon(mtmp)) {
+                   pline_The("%s harmlessly %s %s.", xname(gold),
+                             otense(gold, "hit"), mon_nam(mtmp));
+                   msg_given = TRUE;
+               }
        } else {
 #ifdef GOLDOBJ
                 long value = gold->quan * objects[gold->otyp].oc_cost;
@@ -318,16 +323,18 @@ register struct obj *gold;
                     if (mtmp->mpeaceful)
                            verbalize("That should do.  Now beat it!");
                     else verbalize("That's not enough, coward!");
-                }
+               }
 
 #ifndef GOLDOBJ
                dealloc_obj(gold);
 #else
-                add_to_minv(mtmp, gold);
+               add_to_minv(mtmp, gold);
 #endif
-               return(1);
+               return TRUE;
        }
-       return(0);
+
+       if (!msg_given) miss(xname(gold), mtmp);
+       return FALSE;
 }
 
 /* container is kicked, dropped, thrown or otherwise impacted by player.
index c82b2f3b4a34d1ac69207a064594e5a9b8169106..16407997725d8844333013acae50d05ae76ac3d4 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)dothrow.c  3.4     2003/10/21      */
+/*     SCCS Id: @(#)dothrow.c  3.4     2003/12/04      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1168,7 +1168,7 @@ struct monst *mon;
        an arrow just landing short of any target (no message in that case),
        so will realize that there is a valid target here anyway. */
     if (!canseemon(mon) || (mon->m_ap_type && mon->m_ap_type != M_AP_MONSTER))
-       pline("%s misses.", The(missile));
+       pline("%s %s.", The(missile), otense(obj, "miss"));
     else
        miss(missile, mon);
     if (!rn2(3)) wakeup(mon);
@@ -1697,9 +1697,6 @@ boolean in_view;
        }
 }
 
-/*
- *  Note that the gold object is *not* attached to the fobj chain.
- */
 STATIC_OVL int
 throw_gold(obj)
 struct obj *obj;