OSDN Git Service

overhaul hcolor()/jconj_adj()
[jnethack/source.git] / src / wield.c
index 545052c..2334f7c 100644 (file)
@@ -1,11 +1,11 @@
-/* NetHack 3.6 wield.c $NHDT-Date: 1543492132 2018/11/29 11:48:52 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.58 $ */
+/* NetHack 3.6 wield.c $NHDT-Date: 1559670611 2019/06/04 17:50:11 $  $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.59 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2009. */
 /* NetHack may be freely redistributed.  See license for details. */
 
 /* JNetHack Copyright */
 /* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000  */
-/* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2019            */
+/* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2020            */
 /* JNetHack may be freely redistributed.  See license for details. */
 
 #include "hack.h"
@@ -207,7 +207,7 @@ struct obj *wep;
             pline("%s\82Í\8f\9f\8eè\82É\82 \82È\82½\82Ì%s\82É\91\95\94õ\82³\82ê\82½\81D",
                   xname(wep), body_part(HAND));
 #endif
-            wep->bknown = TRUE;
+            set_bknown(wep, 1);
         } else {
             /* The message must be printed before setuwep (since
              * you might die and be revived from changing weapons),
@@ -497,8 +497,9 @@ dowieldquiver()
             Sprintf(qbuf, "You are wielding %ld %s.  Ready %ld of them?",
                     uwep->quan, simpleonames(uwep), uwep->quan - 1L);
 #else
-            Sprintf(qbuf, "\82 \82È\82½\82Í%ld %s\82ð\91\95\94õ\82µ\82Ä\82¢\82é\81D\82»\82Ì\82¤\82¿ %ld \82ð\8f\80\94õ\82·\82é\81H",
-                    uwep->quan, simpleonames(uwep), uwep->quan - 1L);
+            Sprintf(qbuf, "\82 \82È\82½\82Í%ld%s\82Ì%s\82ð\91\95\94õ\82µ\82Ä\82¢\82é\81D\82»\82Ì\82¤\82¿%ld%s\82ð\8f\80\94õ\82·\82é\81H",
+                    uwep->quan, numeral(uwep), simpleonames(uwep),
+                    uwep->quan - 1L, numeral(uwep));
 #endif
             switch (ynq(qbuf)) {
             case 'q':
@@ -551,12 +552,12 @@ dowieldquiver()
                               : "Your alternate weapon is",
                     uswapwep->quan, simpleonames(uswapwep),
                     uswapwep->quan - 1L);
-#else /*TODO:\93ñ\93\81\97¬\82Ì\82Æ\82«\82Í\82©\82È\82è\95s\8e©\91R */
-            Sprintf(qbuf, "%s %ld %s\82¾\81D\82»\82Ì\82¤\82¿%ld\82ð\8f\80\94õ\82·\82é\81H",
-                    u.twoweap ? "\82 \82È\82½\82ª\82»\82ê\82¼\82ê\91\95\94õ\82µ\82Ä\82¢\82é\82Ì\82Í"
-                              : "\82 \82È\82½\82Ì\97\\94õ\82Ì\95\90\8aí\82Í",
-                    uswapwep->quan, simpleonames(uswapwep),
-                    uswapwep->quan - 1L);
+#else
+            Sprintf(qbuf, "\82 \82È\82½%s\82Í%ld%s\82Ì%s\82¾\81D\82»\82Ì\82¤\82¿%ld%s\82ð\8f\80\94õ\82·\82é\81H",
+                    u.twoweap ? "\82ª\93ñ\93\81\97¬\82Å\91\95\94õ\82µ\82Ä\82¢\82é\82Ì"
+                              : "\82Ì\97\\94õ\82Ì\95\90\8aí",
+                    uswapwep->quan, numeral(uswapwep), simpleonames(uswapwep),
+                    uswapwep->quan - 1L, numeral(uswapwep));
 #endif
             switch (ynq(qbuf)) {
             case 'q':
@@ -804,7 +805,7 @@ can_twoweapon()
         ; /* must be life-saved to reach here; return FALSE */
     } else if (Glib || uswapwep->cursed) {
         if (!Glib)
-            uswapwep->bknown = TRUE;
+            set_bknown(uswapwep, 1);
         drop_uswapwep();
     } else
         return TRUE;
@@ -915,7 +916,7 @@ chwepon(otmp, amount)
 register struct obj *otmp;
 register int amount;
 {
-    const char *color = hcolor((amount < 0) ? NH_BLACK : NH_BLUE);
+    const char *color = hcolor_adv((amount < 0) ? NH_BLACK : NH_BLUE);
     const char *xtime, *wepname = "";
     boolean multiple;
     int otyp = STRANGE_OBJECT;
@@ -932,7 +933,7 @@ register int amount;
                 Sprintf(buf, "%s\82Í%s\83I\81[\83\89\82É\82Â\82Â\82Ü\82ê\82½\81D",
                         xname(uwep), hcolor(NH_AMBER));
 #endif
-                uwep->bknown = !Hallucination;
+                uwep->bknown = !Hallucination; /* ok to bypass set_bknown() */
             } else {
                 /* cursed tin opener is wielded in right hand */
 /*JP
@@ -1016,7 +1017,7 @@ register int amount;
 /*JP
             pline("%s %s.", Yobjnam2(uwep, "faintly glow"), color);
 */
-            Your("%s\82Í\82í\82¸\82©\82É%s\8bP\82¢\82½\81D", xname(uwep),jconj_adj(color));
+            Your("%s\82Í\82í\82¸\82©\82É%s\8bP\82¢\82½\81D", xname(uwep), color);
         return 1;
     }
     /* there is a (soft) upper and lower limit to uwep->spe */
@@ -1029,7 +1030,7 @@ register int amount;
                   otense(uwep, "evaporate"));
 #else
             Your("%s\82Í\82µ\82Î\82ç\82­\8c\83\82µ\82­%s\8bP\82«\81C\8fö\94­\82µ\82½\81D",
-                 xname(uwep), jconj_adj(color));
+                 xname(uwep), color);
 #endif
         else
 /*JP
@@ -1051,7 +1052,7 @@ register int amount;
               xtime);
 #else
         Your("%s\82Í%s%s%s\8bP\82¢\82½\81D",
-             xname(uwep), xtime, jconj_adj(color)
+             xname(uwep), xtime, color
              amount == 0 ? "\8c\83\82µ\82­" : "");
 #endif
         if (otyp != STRANGE_OBJECT && uwep->known
@@ -1102,7 +1103,7 @@ welded(obj)
 register struct obj *obj;
 {
     if (obj && obj == uwep && will_weld(obj)) {
-        obj->bknown = TRUE;
+        set_bknown(obj, 1);
         return 1;
     }
     return 0;