]> granicus.if.org Git - nethack/commitdiff
gamelog: hit with wielded weapon for first time
authorPatR <rankin@nethack.org>
Sat, 19 Feb 2022 19:24:28 +0000 (11:24 -0800)
committerPatR <rankin@nethack.org>
Sat, 19 Feb 2022 19:24:28 +0000 (11:24 -0800)
Reordering "killed for the first time" and "hit with a wielded weapon
for the first time" was done by moving the latter to hmon().  Hitting
with an applied polearm also gave the first-hit message since it
bypassed the routine that had been doing so.  But the throwing code
that handles applied polearms calls hmon() for damage, so after that
reordering, the first-hit log message became duplicated if triggered
by polearm usage.

Also, fix a quibble with the wizard mode conduct message given after
never-hit-with-wielded-weapon conduct has been broken.  The message
said "used a wielded weapon N times" when it meant "hit with a wielded
weapon N times".  "Used" is misleading if that wielded weapon happens
to be a pick-axe, so change the message to say "hit with".

doc/fixes3-7-0.txt
src/dothrow.c
src/insight.c

index f3b75d43b81bf62b25f3406d55dce53335269fb2..86d46e5bf30fb44dd44c5e170883ec09606f3344 100644 (file)
@@ -1,4 +1,4 @@
-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.799 $ $NHDT-Date: 1645223893 2022/02/18 22:38:13 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.806 $ $NHDT-Date: 1645298657 2022/02/19 19:24:17 $
 
 General Fixes and Modified Features
 -----------------------------------
@@ -1028,6 +1028,9 @@ when trapeffect_selector() returns 2 to caller mintrap(), meant to signify
        returns that value too
 have com_pager() check for failed nhl_init(); probably can't actually happen
        because the program would never get that far if lua init was failing
+rearranging first-kill and first-hit gamelog messages to get hit before kill
+       ordering resulted in "hit with a wielded weapon for first time" being
+       given twice if that hit was delivered via applied polearm
 
 curses: 'msg_window' option wasn't functional for curses unless the binary
        also included tty support
index 4b19cfe6ac2cb4e75034cf24a4d50df8609fdbd1..b674eae3712903b8aa0416788e2cdaf1b97af3fa 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 dothrow.c       $NHDT-Date: 1621037618 2021/05/15 00:13:38 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.199 $ */
+/* NetHack 3.7 dothrow.c       $NHDT-Date: 1645298658 2022/02/19 19:24:18 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.217 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2013. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -1885,9 +1885,12 @@ thitmonst(
                     chopper = is_axe(obj);
 
             /* attack hits mon */
-            if (hmode == HMON_APPLIED)
-                if (!u.uconduct.weaphit++)
-                    livelog_printf(LL_CONDUCT, "hit with a wielded weapon for the first time");
+            if (hmode == HMON_APPLIED) { /* ranged hit with wielded polearm */
+                /* hmon()'s caller is expected to do this; however, hmon()
+                   delivers the "hit with wielded weapon for first time"
+                   gamelog message when applicable */
+                u.uconduct.weaphit++;
+            }
             if (hmon(mon, obj, hmode, dieroll)) { /* mon still alive */
                 if (mon->wormno)
                     cutworm(mon, g.bhitpos.x, g.bhitpos.y, chopper);
index 1b7db88334def647dc655f0fa059376187a1b774..d1414fc06143588e11cf5fd25e983a5800f6830c 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 insight.c       $NHDT-Date: 1619640466 2021/04/28 20:07:46 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.35 $ */
+/* NetHack 3.7 insight.c       $NHDT-Date: 1645298661 2022/02/19 19:24:21 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.49 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1985,8 +1985,8 @@ show_conduct(int final)
     if (!u.uconduct.weaphit) {
         you_have_never("hit with a wielded weapon");
     } else if (wizard) {
-        Sprintf(buf, "used a wielded weapon %ld time%s", u.uconduct.weaphit,
-                plur(u.uconduct.weaphit));
+        Sprintf(buf, "hit with a wielded weapon %ld time%s",
+                u.uconduct.weaphit, plur(u.uconduct.weaphit));
         you_have_X(buf);
     }
     if (!u.uconduct.killer)