]> granicus.if.org Git - nethack/commitdiff
mon vs mon attack message phrasing
authornethack.rankin <nethack.rankin>
Tue, 8 Aug 2006 05:08:23 +0000 (05:08 +0000)
committernethack.rankin <nethack.rankin>
Tue, 8 Aug 2006 05:08:23 +0000 (05:08 +0000)
     From <Someone>:
  Pet picks up 8 spears.
  Pet wields 8 spears.
  Pet thrusts its spear at Foe.
The routine to handle a monster attacking the hero are already uses "mon
thrusts one of its spears" in this case, so make monster against monster
messages do the same.  Also, it's no longer necessary to save one monster
name before formatting another when using two monster names in the same
message, so switch to the more straightforward usage here.  (The Blind
check is needed in the mhitu case but not in the mhitm one, where it's
redundant because the caller has already verified that both monsters'
locations are visible, but I left it in.)

doc/fixes34.4
src/mhitm.c
src/mhitu.c

index ccb91eec711f4b4051c0917d15f02f9e2b937bf3..408d3a4f5c1f1a4c558b9ee6ecbf11b06f7b5246 100644 (file)
@@ -244,6 +244,8 @@ free storage used to hold region messages in free_region()
 honor pushweapon when applying a tool or weapon causes it to become wielded
 in the quest, if the locate level hasn't been reached yet, don't fall or
        randomly teleport past it
+fix phrasing in monster against monster attack feedback when attacker is
+       wielding stacked weapons
 
 
 Platform- and/or Interface-Specific Fixes
index 9d0fcd16ca38169d79ebda6b1138b3839fc95af0..37341a6f97c5586d3e4864840a08295c5800b1f1 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)mhitm.c    3.5     2006/05/09      */
+/*     SCCS Id: @(#)mhitm.c    3.5     2006/08/07      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1321,15 +1321,15 @@ register struct obj *obj;
 
 STATIC_OVL void
 mswingsm(magr, mdef, otemp)
-register struct monst *magr, *mdef;
-register struct obj *otemp;
+struct monst *magr, *mdef;
+struct obj *otemp;
 {
-       char buf[BUFSZ];
-       if (!flags.verbose || Blind || !mon_visible(magr)) return;
-       Strcpy(buf, mon_nam(mdef));
-       pline("%s %s %s %s at %s.", Monnam(magr),
+    if (flags.verbose && !Blind && mon_visible(magr)) {
+       pline("%s %s %s%s %s at %s.", Monnam(magr),
              (objects[otemp->otyp].oc_dir & PIERCE) ? "thrusts" : "swings",
-             mhis(magr), singular(otemp, xname), buf);
+             (otemp->quan > 1L) ? "one of " : "",
+             mhis(magr), xname(otemp), mon_nam(mdef));
+    }
 }
 
 /*
index d0f1a3ba42706edba8a5fdcdedc170e24d66efb1..798fab331dbe83572eb73d305c7e5ca9d4d09dbb 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)mhitu.c    3.5     2006/03/27      */
+/*     SCCS Id: @(#)mhitu.c    3.5     2006/08/07      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -97,15 +97,15 @@ register struct attack *mattk;
 
 STATIC_OVL void
 mswings(mtmp, otemp)           /* monster swings obj */
-register struct monst *mtmp;
-register struct obj *otemp;
+struct monst *mtmp;
+struct obj *otemp;
 {
-       if (!flags.verbose || Blind || !mon_visible(mtmp))
-               return;
+    if (flags.verbose && !Blind && mon_visible(mtmp)) {
        pline("%s %s %s%s %s.", Monnam(mtmp),
              (objects[otemp->otyp].oc_dir & PIERCE) ? "thrusts" : "swings",
              (otemp->quan > 1L) ? "one of " : "",
              mhis(mtmp), xname(otemp));
+    }
 }
 
 /* return how a poison attack was delivered */