OSDN Git Service

patch src/
[jnethack/source.git] / src / write.c
index 1000b29..517121d 100644 (file)
@@ -1,6 +1,11 @@
 /* NetHack 3.6 write.c $NHDT-Date: 1446078770 2015/10/29 00:32:50 $  $NHDT-Branch: master $:$NHDT-Revision: 1.16 $ */
 /* 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-2016            */
+/* JNetHack may be freely redistributed.  See license for details. */
+
 #include "hack.h"
 
 STATIC_DCL int FDECL(cost, (struct obj *));
@@ -105,11 +110,19 @@ register struct obj *pen;
     const char *typeword;
 
     if (nohands(youmonst.data)) {
+/*JP
         You("need hands to be able to write!");
+*/
+        You("\8f\91\82­\82½\82ß\82É\82Í\8eè\82ª\95K\97v\82¾\81I");
         return 0;
     } else if (Glib) {
+#if 0 /*JP*/
         pline("%s from your %s.", Tobjnam(pen, "slip"),
               makeplural(body_part(FINGER)));
+#else
+        pline("%s\82ª%s\82©\82ç\8a\8a\82è\82¨\82¿\82½\81D", xname(pen),
+              body_part(FINGER));
+#endif
         dropx(pen);
         return 1;
     }
@@ -120,14 +133,25 @@ register struct obj *pen;
         return 0;
     /* can't write on a novel (unless/until it's been converted into a blank
        spellbook), but we want messages saying so to avoid "spellbook" */
+#if 0 /*JP*/
     typeword = (paper->otyp == SPE_NOVEL)
                   ? "book"
                   : (paper->oclass == SPBOOK_CLASS)
                      ? "spellbook"
                      : "scroll";
+#else
+    typeword = (paper->otyp == SPE_NOVEL)
+                  ? "\96{"
+                  : (paper->oclass == SPBOOK_CLASS)
+                     ? "\96\82\96@\8f\91"
+                     : "\8aª\95¨";
+#endif
     if (Blind) {
         if (!paper->dknown) {
+/*JP
             You("don't know if that %s is blank or not.", typeword);
+*/
+            You("%s\82ª\94\92\8e\86\82©\82Ç\82¤\82©\82í\82©\82ç\82È\82¢\81I", typeword);
             return 1;
         } else if (paper->oclass == SPBOOK_CLASS) {
             /* can't write a magic book while blind */
@@ -138,18 +162,25 @@ register struct obj *pen;
     }
     paper->dknown = 1;
     if (paper->otyp != SCR_BLANK_PAPER && paper->otyp != SPE_BLANK_PAPER) {
+/*JP
         pline("That %s is not blank!", typeword);
+*/
+        pline("%s\82Í\94\92\8e\86\82\82á\82È\82¢\81I", typeword);
         exercise(A_WIS, FALSE);
         return 1;
     }
 
     /* what to write */
+/*JP
     Sprintf(qbuf, "What type of %s do you want to write?", typeword);
+*/
+    Sprintf(qbuf, "\82Ç\82Ì\8eí\82Ì%s\82Ì\8eô\95\82ð\8f\91\82«\82Ü\82·\82©\81H", typeword);
     getlin(qbuf, namebuf);
     (void) mungspaces(namebuf); /* remove any excess whitespace */
     if (namebuf[0] == '\033' || !namebuf[0])
         return 1;
     nm = namebuf;
+#if 0 /*JP*//*\93ú\96{\8cê\82Å\82Í\95s\97v*/
     if (!strncmpi(nm, "scroll ", 7))
         nm += 7;
     else if (!strncmpi(nm, "spellbook ", 10))
@@ -161,6 +192,7 @@ register struct obj *pen;
         (void) strncpy(bp, " armor ", 7); /* won't add '\0' */
         (void) mungspaces(bp + 1);        /* remove the extra space */
     }
+#endif
 
     deferred = 0;       /* not any scroll or book */
     deferralchance = 0; /* incremented for each oc_uname match */
@@ -204,21 +236,36 @@ register struct obj *pen;
         goto found;
     }
 
+/*JP
     There("is no such %s!", typeword);
+*/
+    pline("\82»\82Ì\82æ\82¤\82È%s\82Í\82È\82¢\81I", typeword);
     return 1;
 found:
 
     if (i == SCR_BLANK_PAPER || i == SPE_BLANK_PAPER) {
+/*JP
         You_cant("write that!");
+*/
+        pline("\94\92\8e\86\82É\94\92\8e\86\82ð\8f\91\82­\81H\81I");
+/*JP
         pline("It's obscene!");
+*/
+        pline("\82»\82¤\82¢\82¤\82â\82è\82©\82½\82Í\82¿\82å\82Á\82Æ\95s\96ù\89õ\82¾\82È\81I");
         return 1;
     } else if (i == SPE_BOOK_OF_THE_DEAD) {
+/*JP
         pline("No mere dungeon adventurer could write that.");
+*/
+        pline("\88ê\89î\82Ì\96À\8b{\96`\8c¯\89Æ\82É\82Í\8f\91\82¯\82é\82à\82Ì\82Å\82Í\82È\82¢\81D");
         return 1;
     } else if (by_descr && paper->oclass == SPBOOK_CLASS
                && !objects[i].oc_name_known) {
         /* can't write unknown spellbooks by description */
+/*JP
         pline("Unfortunately you don't have enough information to go on.");
+*/
+        pline("\8ec\94O\82È\82ª\82ç\82»\82ê\82ð\8f\91\82­\82¾\82¯\82Ì\8f\\95ª\82È\92m\8e¯\82ª\82È\82¢\81D");
         return 1;
     }
 
@@ -234,7 +281,10 @@ found:
     /* see if there's enough ink */
     basecost = cost(new_obj);
     if (pen->spe < basecost / 2) {
+/*JP
         Your("marker is too dry to write that!");
+*/
+        Your("\83}\81[\83J\82Í\8a£\82«\82·\82¬\82Ä\82¨\82è\82¤\82Ü\82­\8f\91\82¯\82È\82©\82Á\82½\81I");
         obfree(new_obj, (struct obj *) 0);
         return 1;
     }
@@ -247,13 +297,22 @@ found:
     /* dry out marker */
     if (pen->spe < actualcost) {
         pen->spe = 0;
+/*JP
         Your("marker dries out!");
+*/
+        pline("\8f\91\82¢\82Ä\82¢\82é\93r\92\86\82Å\83}\81[\83J\82Í\8a£\82«\82«\82Á\82½\81I");
         /* scrolls disappear, spellbooks don't */
         if (paper->oclass == SPBOOK_CLASS) {
+/*JP
             pline_The("spellbook is left unfinished and your writing fades.");
+*/
+            pline_The("\96\82\96@\8f\91\82É\82Í\8f\91\82«\82«\82ê\82È\82©\82Á\82½\81D\82»\82µ\82Ä\8f\91\82¢\82½\95\8e\9a\82Í\8fÁ\82¦\82Ä\82µ\82Ü\82Á\82½\81D");
             update_inventory(); /* pen charges */
         } else {
+/*JP
             pline_The("scroll is now useless and disappears!");
+*/
+            pline_The("\8aª\95¨\82Í\8eg\82¢\82à\82Ì\82É\82È\82ç\82È\82­\82È\82Á\82Ä\8fÁ\96Å\82µ\82½\81I");
             useup(paper);
         }
         obfree(new_obj, (struct obj *) 0);
@@ -290,19 +349,31 @@ found:
         && !(by_descr && label_known(new_obj->otyp, invent))
         /* and Luck might override after both checks have failed */
         && rnl(Role_if(PM_WIZARD) ? 5 : 15)) {
+/*JP
         You("%s to write that.", by_descr ? "fail" : "don't know how");
+*/
+        You("%s\81I", by_descr ? "\8f\91\82­\82Ì\82É\8e¸\94s\82µ\82½" : "\82Ç\82¤\82â\82Á\82Ä\8f\91\82­\82Ì\82©\92m\82ç\82È\82¢");
         /* scrolls disappear, spellbooks don't */
         if (paper->oclass == SPBOOK_CLASS) {
             You(
+/*JP
       "write in your best handwriting:  \"My Diary\", but it quickly fades.");
+*/
+      "\92\9a\94J\82É\8f\91\82¢\82½\81F\81u\89ä\82ª\93ú\8bL\81v\81D\82µ\82©\82µ\82 \82Á\82Æ\8c¾\82¤\8aÔ\82É\8fÁ\82¦\82Ä\82µ\82Ü\82Á\82½\81D");
             update_inventory(); /* pen charges */
         } else {
             if (by_descr) {
                 Strcpy(namebuf, OBJ_DESCR(objects[new_obj->otyp]));
                 wipeout_text(namebuf, (6 + MAXULEV - u.ulevel) / 6, 0);
             } else
+/*JP
                 Sprintf(namebuf, "%s was here!", plname);
+*/
+                Sprintf(namebuf, "%s\82Í\82±\82±\82É\82 \82è\81I", plname);
+/*JP
             You("write \"%s\" and the scroll disappears.", namebuf);
+*/
+            You("\81u%s\81v\82Æ\8f\91\82¢\82½\81D\82·\82é\82Æ\8aª\95¨\82Í\8fÁ\82¦\82Ä\82µ\82Ü\82Á\82½\81D", namebuf);
             useup(paper);
         }
         obfree(new_obj, (struct obj *) 0);
@@ -328,8 +399,13 @@ found:
     /* success */
     if (new_obj->oclass == SPBOOK_CLASS) {
         /* acknowledge the change in the object's description... */
+#if 0 /*JP*/
         pline_The("spellbook warps strangely, then turns %s.",
                   new_book_description(new_obj->otyp, namebuf));
+#else
+        pline("\96\82\96@\8f\91\82Í\96­\82É\94½\82è\82©\82¦\82è\81C\82»\82µ\82Ä%s\82É\82È\82Á\82½\81D",
+                  new_book_description(new_obj->otyp, namebuf));
+#endif
     }
     new_obj->blessed = (curseval > 0);
     new_obj->cursed = (curseval < 0);
@@ -337,9 +413,15 @@ found:
     if (new_obj->otyp == SCR_MAIL)
         new_obj->spe = 1;
 #endif
+#if 0 /*JP*/
     new_obj =
         hold_another_object(new_obj, "Oops!  %s out of your grasp!",
                             The(aobjnam(new_obj, "slip")), (const char *) 0);
+#else
+    new_obj =
+        hold_another_object(new_obj, "\82¨\82Á\82Æ\81I%s\82Í\82 \82È\82½\82Ì\8eè\82©\82ç\8a\8a\82è\97\8e\82¿\82½\81I",
+                            xname(new_obj), (const char *) 0);
+#endif
     return 1;
 }