OSDN Git Service

fix #45401
[jnethack/source.git] / src / cmd.c
index 9958388..f8dc36a 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -5,7 +5,7 @@
 
 /* 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-2022            */
 /* JNetHack may be freely redistributed.  See license for details. */
 
 #include "hack.h"
@@ -2478,7 +2478,9 @@ basics_enlightenment(mode, final)
 int mode UNUSED;
 int final;
 {
+#if 0 /*JP*//*unused*/
     static char Power[] = "energy points (spell power)";
+#endif
     char buf[BUFSZ];
     int pw = u.uen, hp = (Upolyd ? u.mh : u.uhp),
         pwmax = u.uenmax, hpmax = (Upolyd ? u.mhmax : u.uhpmax);
@@ -2559,7 +2561,7 @@ int final;
 /*JP
             enl_msg(Your_wallet, "is ", "was ", "empty", "");
 */
-            enl_msg(Your_wallet, "\82Å\82 \82é", "\82ł¾\82Á\82½", "\82Í\8bó", "");
+            enl_msg(Your_wallet, "\82Å\82 \82é", "\82¾\82Á\82½", "\82Í\8bó", "");
         } else {
 #if 0 /*JP:T*/
             Sprintf(buf, "%ld %s", umoney, currency(umoney));
@@ -2596,7 +2598,7 @@ int final;
 */
             Strcat(buf, "(\97á\8aO\82 \82è)");
 #if 1 /*JP*/
-        Strcpy(buf, "\82É\91Î\82µ\82Ä\83I\83\93");
+        Strcat(buf, "\82É\91Î\82µ\82Ä\83I\83\93");
 #endif
     } else
 /*JP
@@ -2621,7 +2623,7 @@ int final;
 /*JP
     Sprintf(buf, "%s Characteristics:", !final ? "Current" : "Final");
 */
-    Sprintf(buf, "%s\91®\90«\81F", !final ? "\8c»\8dÝ\82Ì" : "\8dÅ\8fI");
+    Sprintf(buf, "%s\93Á\90«\81F", !final ? "\8c»\8dÝ\82Ì" : "\8dÅ\8fI");
     enlght_out(buf);
 
     /* bottom line order */
@@ -3548,9 +3550,9 @@ int final;
         enl_msg(You_, "could be", "could have been", " clairvoyant", buf);
 #else
         /*JP:\81u\81c\82É\82æ\82Á\82Ä\81v*/
-        if (!strncmp(buf, "\82É\82æ\82Á\82Ä", 8))
+        if (!STRNCMP2(buf, "\82É\82æ\82Á\82Ä"))
             /*JP:\81u\81c\82ª\82È\82¯\82ê\82Î\81v\82É\8f\91\82«\8a·\82¦\82é*/
-            strcpy(eos(buf) - 8, "\82ª\82È\82¯\82ê\82Î");
+            strcpy(eos(buf) - strlen("\82É\82æ\82Á\82Ä"), "\82ª\82È\82¯\82ê\82Î");
         you_have("\90ç\97¢\8aá\94\\97Í", buf);
 #endif
     }
@@ -4651,20 +4653,40 @@ struct ext_func_tab extcmdlist[] = {
     { M('A'), "annotate", "\8c»\8dÝ\82Ì\8aK\82É\96¼\91O\82ð\82Â\82¯\82é",
 #endif
             donamelevel, IFBURIED | AUTOCOMPLETE },
+#if 0 /*JP*/
     { 'a', "apply", "apply (use) a tool (pick-axe, key, lamp...)",
+#else
+    { 'a', "apply", "\93¹\8bï\82ð\8eg\82¤\81D(\82Â\82é\82Í\82µ, \8c®, \83\89\83\93\83v\81c)",
+#endif
             doapply },
     { C('x'), "attributes", "show your attributes",
             doattributes, IFBURIED },
+#if 0 /*JP:T*/
     { '@', "autopickup", "toggle the pickup option on/off",
+#else
+    { '@', "autopickup", "\8e©\93®\8fE\82¢\83I\83v\83V\83\87\83\93\82ð\90Ø\82è\91Ö\82¦\82é",
+#endif
             dotogglepickup, IFBURIED },
+#if 0 /*JP:T*/
     { 'C', "call", "call (name) something", docallcmd, IFBURIED },
+#else
+    { 'C', "call", "\96¼\91O\82ð\82Â\82¯\82é", docallcmd, IFBURIED },
+#endif
+#if 0 /*JP:T*/
     { 'Z', "cast", "zap (cast) a spell", docast, IFBURIED },
+#else
+    { 'Z', "cast", "\8eô\95\82ð\8f¥\82¦\82é", docast, IFBURIED },
+#endif
 #if 0 /*JP:T*/
     { M('c'), "chat", "talk to someone", dotalk, IFBURIED | AUTOCOMPLETE },
 #else
     { M('c'), "chat", "\92N\82©\82Æ\98b\82·", dotalk, IFBURIED | AUTOCOMPLETE },
 #endif
+#if 0 /*JP:T*/
     { 'c', "close", "close a door", doclose },
+#else
+    { 'c', "close", "\83h\83A\82ð\95Â\82ß\82é", doclose },
+#endif
 #if 0 /*JP:T*/
     { M('C'), "conduct", "list voluntary challenges you have maintained",
 #else
@@ -5212,11 +5234,17 @@ dokeylist(VOID_ARGS)
 
     datawin = create_nhwindow(NHW_TEXT);
     putstr(datawin, 0, "");
+/*JP
     putstr(datawin, 0, "            Full Current Key Bindings List");
+*/
+    putstr(datawin, 0, "             \8c»\8dÝ\82Ì\8a®\91S\82È\83L\81[\8a\84\82è\93\96\82Ä\88ê\97\97");
 
     /* directional keys */
     putstr(datawin, 0, "");
+/*JP
     putstr(datawin, 0, "Directional keys:");
+*/
+    putstr(datawin, 0, "\95û\8cü\83L\81[:");
     show_direction_keys(datawin, '.', FALSE); /* '.'==self in direction grid */
 
     keys_used[(uchar) Cmd.move_NW] = keys_used[(uchar) Cmd.move_N]
@@ -5243,16 +5271,31 @@ dokeylist(VOID_ARGS)
             = keys_used[(uchar) C(Cmd.move_S)]
             = keys_used[(uchar) C(Cmd.move_SE)] = TRUE;
         putstr(datawin, 0, "");
+#if 0 /*JP:T*/
         putstr(datawin, 0,
           "Shift-<direction> will move in specified direction until you hit");
         putstr(datawin, 0, "        a wall or run into something.");
+#else
+        putstr(datawin, 0,
+          "Shift-<\95û\8cü> \82Í\81A\95Ç\82É\82Ô\82Â\82©\82é\82©\89½\82©\82ª\82 \82é\82Ü\82Å\8ew\92è\82³\82ê\82½\95û\8cü\82É");
+        putstr(datawin, 0, "        \88Ú\93®\82·\82é\81D");
+#endif
+#if 0 /*JP:T*/
         putstr(datawin, 0,
           "Ctrl-<direction> will run in specified direction until something");
         putstr(datawin, 0, "        very interesting is seen.");
+#else
+        putstr(datawin, 0,
+          "Ctrl-<\95û\8cü> \82Í\81A\89½\82©\8b»\96¡\90[\82¢\82à\82Ì\82ª\8c©\82¦\82é\82Ü\82Å\8ew\92è\82³\82ê\82½\95û\8cü\82É");
+        putstr(datawin, 0, "        \88Ú\93®\82·\82é\81D");
+#endif
     }
 
     putstr(datawin, 0, "");
+/*JP
     putstr(datawin, 0, "Miscellaneous keys:");
+*/
+    putstr(datawin, 0, "\97l\81X\82È\83L\81[:");
     for (i = 0; misc_keys[i].desc; i++) {
         key = Cmd.spkeys[misc_keys[i].nhkf];
         if (key && ((misc_keys[i].numpad && iflags.num_pad)
@@ -5272,21 +5315,30 @@ dokeylist(VOID_ARGS)
 
     if (dokeylist_putcmds(datawin, TRUE, GENERALCMD, WIZMODECMD, keys_used)) {
         putstr(datawin, 0, "");
+/*JP
         putstr(datawin, 0, "General commands:");
+*/
+        putstr(datawin, 0, "\88ê\94Ê\83R\83}\83\93\83h:");
         (void) dokeylist_putcmds(datawin, FALSE, GENERALCMD, WIZMODECMD,
                                  keys_used);
     }
 
     if (dokeylist_putcmds(datawin, TRUE, 0, WIZMODECMD, keys_used)) {
         putstr(datawin, 0, "");
+/*JP
         putstr(datawin, 0, "Game commands:");
+*/
+        putstr(datawin, 0, "\83Q\81[\83\80\83R\83}\83\93\83h:");
         (void) dokeylist_putcmds(datawin, FALSE, 0, WIZMODECMD, keys_used);
     }
 
     if (wizard
         && dokeylist_putcmds(datawin, TRUE, WIZMODECMD, 0, keys_used)) {
         putstr(datawin, 0, "");
+/*JP
         putstr(datawin, 0, "Wizard-mode commands:");
+*/
+        putstr(datawin, 0, "\83E\83B\83U\81[\83h\83\82\81[\83h\83R\83}\83\93\83h:");
         (void) dokeylist_putcmds(datawin, FALSE, WIZMODECMD, 0, keys_used);
     }
 
@@ -6641,13 +6693,25 @@ const char *msg;
      * general message if it's on.
      */
     dothat = "do that";
+#if 0 /*JP*/
     how = " at"; /* for "<action> at yourself"; not used for up/down */
+#else
+    how = "";
+#endif
     switch (spkey) {
     case NHKF_NOPICKUP:
+#if 0 /*JP*/
         dothat = "move";
+#else
+        dothat = "\88Ú\93®\82·\82é";
+#endif
         break;
     case NHKF_RUSH:
+#if 0 /*JP*/
         dothat = "rush";
+#else
+        dothat = "\93Ë\90i\82·\82é";
+#endif
         break;
     case NHKF_RUN2:
         if (!Cmd.num_pad)
@@ -6655,14 +6719,22 @@ const char *msg;
         /*FALLTHRU*/
     case NHKF_RUN:
     case NHKF_RUN_NOPICKUP:
+#if 0 /*JP*/
         dothat = "run";
+#else
+        dothat = "\91\96\82é";
+#endif
         break;
     case NHKF_FIGHT2:
         if (!Cmd.num_pad)
             break;
         /*FALLTHRU*/
     case NHKF_FIGHT:
+#if 0 /*JP*/
         dothat = "fight";
+#else
+        dothat = "\90í\82¤";
+#endif
         how = ""; /* avoid "fight at yourself" */
         break;
     default:
@@ -6676,13 +6748,21 @@ const char *msg;
     if (prefixhandling
         && (sym == Cmd.spkeys[NHKF_GETDIR_SELF]
             || (Cmd.num_pad && sym == Cmd.spkeys[NHKF_GETDIR_SELF2]))) {
+/*JP
         Sprintf(buf, "You can't %s%s yourself.", dothat, how);
+*/
+        Sprintf(buf, "\8e©\95ª\8e©\90g\82É%s%s\82±\82Æ\82Í\82Å\82«\82È\82¢\81D", dothat, how);
     /* for movement prefix followed by up or down */
     } else if (prefixhandling && (sym == '<' || sym == '>')) {
+#if 0 /*JP*/
         Sprintf(buf, "You can't %s %s.", dothat,
                 /* was "upwards" and "downwards", but they're considered
                    to be variants of canonical "upward" and "downward" */
                 (sym == '<') ? "upward" : "downward");
+#else
+        Sprintf(buf, "%s%s\82±\82Æ\82Í\82Å\82«\82È\82¢\81D",
+                (sym == '<') ? "\8fã\95û\8cü\82É" : "\89º\95û\8cü\82É", dothat);
+#endif
     }
 
     /* if '!cmdassist', display via pline() and we're done (note: asking
@@ -6690,8 +6770,13 @@ const char *msg;
     if (!viawindow) {
         if (prefixhandling) {
             if (!*buf)
+#if 0 /*JP*/
                 Sprintf(buf, "Invalid direction for '%s' prefix.",
                         visctrl(Cmd.spkeys[spkey]));
+#else
+                Sprintf(buf, "'%s'\90Ú\93ª\8e«\82É\82Í\95s\90³\82È\95û\8cü\81D",
+                        visctrl(Cmd.spkeys[spkey]));
+#endif
             pline("%s", buf);
             return TRUE;
         }
@@ -6752,13 +6837,24 @@ const char *msg;
            given but we include up and down for 'm'+invalid_direction;
            self is excluded as a viable direction for every prefix */
         putstr(win, 0, "");
+/*JP
         putstr(win, 0, "          <  up");
+*/
+        putstr(win, 0, "          <  \8fã");
+/*JP
         putstr(win, 0, "          >  down");
+*/
+        putstr(win, 0, "          >  \89º");
         if (!prefixhandling) {
             int selfi = Cmd.num_pad ? NHKF_GETDIR_SELF2 : NHKF_GETDIR_SELF;
 
+#if 0 /*JP:T*/
             Sprintf(buf,   "       %4s  direct at yourself",
                     visctrl(Cmd.spkeys[selfi]));
+#else
+            Sprintf(buf,   "       %4s  \8e©\95ª\82É\8cü\82¯\82é",
+                    visctrl(Cmd.spkeys[selfi]));
+#endif
             putstr(win, 0, buf);
         }
     }