-/* NetHack 3.6 write.c $NHDT-Date: 1446078770 2015/10/29 00:32:50 $ $NHDT-Branch: master $:$NHDT-Revision: 1.16 $ */
+/* NetHack 3.6 write.c $NHDT-Date: 1450261366 2015/12/16 10:22:46 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.17 $ */
/* 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 */
+/* JNetHack may be freely redistributed. See license for details. */
+
#include "hack.h"
STATIC_DCL int FDECL(cost, (struct obj *));
}
/* decide whether the hero knowns a particular scroll's label;
- unfortunately, we can't track things are haven't been added to
+ unfortunately, we can't track things that haven't been added to
the discoveries list and aren't present in current inventory,
so some scrolls with ought to yield True will end up False */
STATIC_OVL boolean
register struct obj *pen;
{
register struct obj *paper;
- char namebuf[BUFSZ], *nm, *bp;
+#if 0 /*JP*/
+ char namebuf[BUFSZ] = DUMMY, *nm, *bp;
+#else
+ char namebuf[BUFSZ] = DUMMY, *nm;
+#endif
register struct obj *new_obj;
int basecost, actualcost;
int curseval;
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:T*/
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;
}
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:T*/
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);
- return 1;
+*/
+ You("%s\82ª\94\92\8e\86\82©\82Ç\82¤\82©\82í\82©\82ç\82È\82¢\81I", typeword);
+ return 0;
} else if (paper->oclass == SPBOOK_CLASS) {
/* can't write a magic book while blind */
+/*JP
pline("%s can't create braille text.",
+*/
+ pline("%s\82Å\82Í\93_\8e\9a\82ð\8dì\82ê\82È\82¢\81D",
upstart(ysimple_name(pen)));
- return 1;
+ return 0;
}
}
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))
(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 */
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;
}
/* 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;
}
/* 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);
&& !(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);
have passed the write-an-unknown scroll test
above we can still fail this one, so it's doubly
hard to write an unknown scroll while blind */
+/*JP
You("fail to write the scroll correctly and it disappears.");
+*/
+ You("\8aª\95¨\82É\90³\82µ\82\8f\91\82\82Ì\82É\8e¸\94s\82µ\82½\81D\8aª\95¨\82Í\8fÁ\82¦\82½\81D");
useup(paper);
obfree(new_obj, (struct obj *) 0);
return 1;
/* success */
if (new_obj->oclass == SPBOOK_CLASS) {
/* acknowledge the change in the object's description... */
+#if 0 /*JP:T*/
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);
#ifdef MAIL
if (new_obj->otyp == SCR_MAIL)
- new_obj->spe = 1;
+ /* 0: delivered in-game via external event (or randomly for fake mail);
+ 1: from bones or wishing; 2: written with marker */
+ new_obj->spe = 2;
#endif
+ /* unlike alchemy, for example, a successful result yields the
+ specifically chosen item so hero recognizes it even if blind;
+ the exception is for being lucky writing an undiscovered scroll,
+ where the label associated with the type-name isn't known yet */
+ new_obj->dknown = label_known(new_obj->otyp, invent) ? 1 : 0;
+
+#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, "Oops! %s out of your grasp!",
- The(aobjnam(new_obj, "slip")), (const char *) 0);
+ 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
+ nhUse(new_obj); /* try to avoid complaint about dead assignment */
return 1;
}
int booktype;
char *outbuf;
{
+#if 0 /*JP*//*\93ú\96{\8cê\82Å\82Í\95s\97v*/
/* subset of description strings from objects.c; if it grows
much, we may need to add a new flag field to objects[] instead */
static const char *const compositions[] = {
break;
Sprintf(outbuf, "%s%s", *comp_p ? "into " : "", descr);
+#else /*JP:\92P\8f\83\82É\83R\83s\81[*/
+ Strcpy(outbuf, OBJ_DESCR(objects[booktype]));
+#endif
return outbuf;
}