]> granicus.if.org Git - nethack/commitdiff
dwarf + pick-axe feedback
authorPatR <rankin@nethack.org>
Fri, 29 Jul 2022 23:11:35 +0000 (16:11 -0700)
committerPatR <rankin@nethack.org>
Fri, 29 Jul 2022 23:11:35 +0000 (16:11 -0700)
When you see a dwarf wield a pick-axe,
|The dwarf wields a pick-axe!
avoid the exclamation point if that dwarf just intends to dig.
|The dwarf wields a pick-axe.

src/weapon.c

index c38855dddad51e112d72d5884de0923d2e335200..fc019810fc206efed5c466c4908a5b65e6696f32 100644 (file)
@@ -746,6 +746,7 @@ int
 mon_wield_item(struct monst *mon)
 {
     struct obj *obj;
+    boolean exclaim = TRUE; /* assume mon is planning to attack */
 
     /* This case actually should never happen */
     if (mon->weapon_check == NO_WEAPON_WANTED)
@@ -763,12 +764,14 @@ mon_wield_item(struct monst *mon)
         /* KMH -- allow other picks */
         if (!obj && !which_armor(mon, W_ARMS))
             obj = m_carrying(mon, DWARVISH_MATTOCK);
+        exclaim = FALSE; /* mon is just planning to dig */
         break;
     case NEED_AXE:
         /* currently, only 2 types of axe */
         obj = m_carrying(mon, BATTLE_AXE);
         if (!obj || which_armor(mon, W_ARMS))
             obj = m_carrying(mon, AXE);
+        exclaim = FALSE;
         break;
     case NEED_PICK_OR_AXE:
         /* prefer pick for fewer switches on most levels */
@@ -780,6 +783,7 @@ mon_wield_item(struct monst *mon)
             if (!obj)
                 obj = m_carrying(mon, AXE);
         }
+        exclaim = FALSE;
         break;
     default:
         impossible("weapon_check %d for %s?", mon->weapon_check,
@@ -829,7 +833,8 @@ mon_wield_item(struct monst *mon)
         if (canseemon(mon)) {
             boolean newly_welded;
 
-            pline("%s wields %s!", Monnam(mon), doname(obj));
+            pline("%s wields %s%c", Monnam(mon), doname(obj),
+                  exclaim ? '!' : '.');
             /* 3.6.3: mwelded() predicate expects the object to have its
                W_WEP bit set in owormmask, but the pline here and for
                artifact_light don't want that because they'd have '(weapon