-/* NetHack 3.6 engrave.c $NHDT-Date: 1445388915 2015/10/21 00:55:15 $ $NHDT-Branch: master $:$NHDT-Revision: 1.59 $ */
+/* NetHack 3.6 engrave.c $NHDT-Date: 1570318925 2019/10/05 23:42:05 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.75 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
+/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* 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-2020 */
+/* JNetHack may be freely redistributed. See license for details. */
+
#include "hack.h"
#include "lev.h"
STATIC_VAR NEARDATA struct engr *head_engr;
+STATIC_DCL const char *NDECL(blengr);
char *
random_engraving(outbuf)
/* a random engraving may come from the "rumors" file,
or from the "engrave" file (formerly in an array here) */
if (!rn2(4) || !(rumor = getrumor(0, outbuf, TRUE)) || !*rumor)
- (void) get_rnd_text(ENGRAVEFILE, outbuf);
+ (void) get_rnd_text(ENGRAVEFILE, outbuf, rn2);
wipeout_text(outbuf, (int) (strlen(outbuf) / 4), 0);
return outbuf;
int cnt;
unsigned seed; /* for semi-controlled randomization */
{
+#if 0 /*JP*/
char *s;
+#else
+ unsigned char *s;
+#endif
int i, j, nxt, use_rubout, lth = (int) strlen(engr);
if (lth && cnt > 0) {
seed *= 31, seed %= (BUFSZ - 1);
use_rubout = seed & 3;
}
+#if 0 /*JP*/
s = &engr[nxt];
+#else /*JP: \93ú\96{\8cê\82Ì\8fê\8d\87\82Íjrubout()\82ð\8eg\82Á\82Ä\8fÁ\82·*/
+ if (!seed)
+ j = rn2(2);
+ else {
+ seed *= 31, seed %= (BUFSZ-1);
+ j = seed % 2;
+ }
+
+ if(jrubout(engr, nxt, use_rubout, j)){
+ continue;
+ }
+
+ s = (unsigned char *)&engr[nxt];
+#endif
if (*s == ' ')
continue;
if (u.usteed && P_SKILL(P_RIDING) < P_BASIC)
return FALSE;
if (check_pit && !Flying
- && (t = t_at(u.ux, u.uy)) != 0 && uteetering_at_seen_pit(t))
+ && (t = t_at(u.ux, u.uy)) != 0
+ && (uteetering_at_seen_pit(t) || uescaped_shaft(t)))
return FALSE;
return (boolean) ((!Levitation || Is_airlevel(&u.uz)
int x, y;
boolean up, check_pit;
{
+#if 0 /*JP:T*/
You("can't reach the %s.",
up ? ceiling(x, y)
: (check_pit && can_reach_floor(FALSE))
? "bottom of the pit"
: surface(x, y));
+#else
+ You("%s\82É\93Í\82©\82È\82¢\81D",
+ up ? ceiling(x, y)
+ : (check_pit && can_reach_floor(FALSE))
+ ? "\97\8e\82µ\8c\8a\82Ì\92ê"
+ : surface(x, y));
+#endif
}
const char *
register struct rm *lev = &levl[x][y];
if (x == u.ux && y == u.uy && u.uswallow && is_animal(u.ustuck->data))
+/*JP
return "maw";
+*/
+ return "\88Ý\91Ü";
else if (IS_AIR(lev->typ) && Is_airlevel(&u.uz))
+/*JP
return "air";
+*/
+ return "\8bó\92\86";
else if (is_pool(x, y))
- return (Underwater && !Is_waterlevel(&u.uz)) ? "bottom" : "water";
+#if 0 /*JP:T*/
+ return (Underwater && !Is_waterlevel(&u.uz))
+ ? "bottom" : hliquid("water");
+#else
+ return (Underwater && !Is_waterlevel(&u.uz))
+ ? "\90\85\82Ì\92ê" : hliquid("\90\85\92\86");
+#endif
else if (is_ice(x, y))
+/*JP
return "ice";
+*/
+ return "\95X";
else if (is_lava(x, y))
- return "lava";
+/*JP
+ return hliquid("lava");
+*/
+ return hliquid("\97n\8aâ");
else if (lev->typ == DRAWBRIDGE_DOWN)
+/*JP
return "bridge";
+*/
+ return "\8b´";
else if (IS_ALTAR(levl[x][y].typ))
+/*JP
return "altar";
+*/
+ return "\8dÕ\92d";
else if (IS_GRAVE(levl[x][y].typ))
+/*JP
return "headstone";
+*/
+ return "\95æ\90Î";
else if (IS_FOUNTAIN(levl[x][y].typ))
+/*JP
return "fountain";
+*/
+ return "\90ò";
else if ((IS_ROOM(lev->typ) && !Is_earthlevel(&u.uz))
|| IS_WALL(lev->typ) || IS_DOOR(lev->typ) || lev->typ == SDOOR)
+/*JP
return "floor";
+*/
+ return "\8f°";
else
+/*JP
return "ground";
+*/
+ return "\92n\96Ê";
}
const char *
* see check_special_room()
*/
if (*in_rooms(x, y, VAULT))
+/*JP
what = "vault's ceiling";
+*/
+ what = "\91q\8cÉ\82Ì\93V\88ä";
else if (*in_rooms(x, y, TEMPLE))
+/*JP
what = "temple's ceiling";
+*/
+ what = "\8e\9b\89@\82Ì\93V\88ä";
else if (*in_rooms(x, y, SHOPBASE))
+/*JP
what = "shop's ceiling";
+*/
+ what = "\93X\82Ì\93V\88ä";
else if (Is_waterlevel(&u.uz))
/* water plane has no surface; its air bubbles aren't below sky */
+/*JP
what = "water above";
+*/
+ what = "\90\85\82Ì\8fã\95û";
else if (IS_AIR(lev->typ))
+/*JP
what = "sky";
+*/
+ what = "\8bó";
else if (Underwater)
+/*JP
what = "water's surface";
+*/
+ what = "\90\85\96Ê";
else if ((IS_ROOM(lev->typ) && !Is_earthlevel(&u.uz))
|| IS_WALL(lev->typ) || IS_DOOR(lev->typ) || lev->typ == SDOOR)
+/*JP
what = "ceiling";
+*/
+ what = "\93V\88ä";
else
+/*JP
what = "rock cavern";
+*/
+ what = "\93´\8cA\82Ì\93V\88ä";
return what;
}
* Ignore headstones, in case the player names herself "Elbereth".
*
* If strict checking is requested, the word is only considered to be
- * present if it is intact and is the first word in the engraving.
- * ("Elbereth burrito" matches; "o Elbereth" does not.)
+ * present if it is intact and is the entire content of the engraving.
*/
int
sengr_at(s, x, y, strict)
register struct engr *ep = engr_at(x, y);
if (ep && ep->engr_type != HEADSTONE && ep->engr_time <= moves) {
- return strict ? (strncmpi(ep->engr_txt, s, strlen(s)) == 0)
+ return strict ? (fuzzymatch(ep->engr_txt, s, "", TRUE))
: (strstri(ep->engr_txt, s) != 0);
}
+
return FALSE;
}
void
wipe_engr_at(x, y, cnt, magical)
-xchar x, y, cnt, magical;
+xchar x, y, cnt;
+boolean magical;
{
register struct engr *ep = engr_at(x, y);
{
register struct engr *ep = engr_at(x, y);
int sensed = 0;
- char buf[BUFSZ];
/* Sensing an engraving does not require sight,
* nor does it necessarily imply comprehension (literacy).
case DUST:
if (!Blind) {
sensed = 1;
+#if 0 /*JP:T*/
pline("%s is written here in the %s.", Something,
is_ice(x, y) ? "frost" : "dust");
+#else
+ pline("\89½\82©\82Ì\95¶\8e\9a\82ª%s\82É\8f\91\82¢\82Ä\82 \82é\81D",
+ is_ice(x, y) ? "\91\9a" : "\82Ù\82±\82è");
+#endif
}
break;
case ENGRAVE:
case HEADSTONE:
if (!Blind || can_reach_floor(TRUE)) {
sensed = 1;
+/*JP
pline("%s is engraved here on the %s.", Something,
+*/
+ pline("\89½\82©\82Ì\95¶\8e\9a\82ª%s\82É\8d\8f\82Ü\82ê\82Ä\82¢\82é\81D",
surface(x, y));
}
break;
case BURN:
if (!Blind || can_reach_floor(TRUE)) {
sensed = 1;
+#if 0 /*JP:T*/
pline("Some text has been %s into the %s here.",
is_ice(x, y) ? "melted" : "burned", surface(x, y));
+#else
+ pline("\89½\82©\82Ì\95¶\8e\9a\82ª%s%s\82¢\82é\81D",
+ surface(x,y),
+ is_ice(x,y) ? "\82É\8d\8f\82Ü\82ê\82Ä" : "\82É\8fÄ\82«\95t\82¯\82ç\82ê\82Ä");
+#endif
}
break;
case MARK:
if (!Blind) {
sensed = 1;
+/*JP
pline("There's some graffiti on the %s here.", surface(x, y));
+*/
+ pline("%s\82É\97\8e\8f\91\82ª\82 \82é\81D", surface(x,y));
}
break;
case ENGR_BLOOD:
*/
if (!Blind) {
sensed = 1;
+/*JP
You_see("a message scrawled in blood here.");
+*/
+ You("\8c\8c\95¶\8e\9a\82ª\82È\82®\82è\8f\91\82«\82³\82ê\82Ä\82¢\82é\82Ì\82ð\8c©\82Â\82¯\82½\81D");
}
break;
default:
impossible("%s is written in a very strange way.", Something);
sensed = 1;
}
+
if (sensed) {
- char *et;
- unsigned maxelen = BUFSZ - sizeof("You feel the words: \"\". ");
- if (strlen(ep->engr_txt) > maxelen) {
- (void) strncpy(buf, ep->engr_txt, (int) maxelen);
+ char *et, buf[BUFSZ];
+ int maxelen = (int) (sizeof buf
+ /* sizeof "literal" counts terminating \0 */
+/*JP
+ - sizeof "You feel the words: \"\".");
+*/
+ - sizeof "\82 \82È\82½\82Í\8e\9f\82Ì\82æ\82¤\82É\8a´\82¶\82½\81F\81u\81v");
+
+ if ((int) strlen(ep->engr_txt) > maxelen) {
+ (void) strncpy(buf, ep->engr_txt, maxelen);
buf[maxelen] = '\0';
et = buf;
- } else
+ } else {
et = ep->engr_txt;
+ }
+/*JP
You("%s: \"%s\".", (Blind) ? "feel the words" : "read", et);
- if (context.run > 1)
+*/
+ You("%s\81F\81u%s\81v", (Blind) ? "\8e\9f\82Ì\82æ\82¤\82É\8a´\82¶\82½" : "\93Ç\82ñ\82¾", et);
+ if (context.run > 0)
nomul(0);
}
}
xchar e_type;
{
struct engr *ep;
+ unsigned smem = strlen(s) + 1;
if ((ep = engr_at(x, y)) != 0)
del_engr(ep);
- ep = newengr(strlen(s) + 1);
+ ep = newengr(smem);
+ (void) memset((genericptr_t)ep, 0, smem + sizeof(struct engr));
ep->nxt_engr = head_engr;
head_engr = ep;
ep->engr_x = x;
exercise(A_WIS, TRUE);
ep->engr_time = e_time;
ep->engr_type = e_type > 0 ? e_type : rnd(N_ENGRAVE - 1);
- ep->engr_lth = strlen(s) + 1;
+ ep->engr_lth = smem;
}
/* delete any engraving at location <x,y> */
}
/*
- * freehand - returns true if player has a free hand
+ * freehand - returns true if player has a free hand
*/
int
freehand()
RING_CLASS, 0 };
/* Mohs' Hardness Scale:
- * 1 - Talc 6 - Orthoclase
- * 2 - Gypsum 7 - Quartz
- * 3 - Calcite 8 - Topaz
- * 4 - Fluorite 9 - Corundum
- * 5 - Apatite 10 - Diamond
+ * 1 - Talc 6 - Orthoclase
+ * 2 - Gypsum 7 - Quartz
+ * 3 - Calcite 8 - Topaz
+ * 4 - Fluorite 9 - Corundum
+ * 5 - Apatite 10 - Diamond
*
* Since granite is an igneous rock hardness ~ 7, anything >= 8 should
* probably be able to scratch the rock.
* Devaluation of less hard gems is not easily possible because obj struct
* does not contain individual oc_cost currently. 7/91
*
- * steel - 5-8.5 (usu. weapon)
- * diamond - 10 * jade - 5-6 (nephrite)
- * ruby - 9 (corundum) * turquoise - 5-6
- * sapphire - 9 (corundum) * opal - 5-6
- * topaz - 8 * glass - ~5.5
- * emerald - 7.5-8 (beryl) * dilithium - 4-5??
- * aquamarine - 7.5-8 (beryl) * iron - 4-5
- * garnet - 7.25 (var. 6.5-8) * fluorite - 4
- * agate - 7 (quartz) * brass - 3-4
- * amethyst - 7 (quartz) * gold - 2.5-3
- * jasper - 7 (quartz) * silver - 2.5-3
- * onyx - 7 (quartz) * copper - 2.5-3
- * moonstone - 6 (orthoclase) * amber - 2-2.5
+ * steel - 5-8.5 (usu. weapon)
+ * diamond - 10 * jade - 5-6 (nephrite)
+ * ruby - 9 (corundum) * turquoise - 5-6
+ * sapphire - 9 (corundum) * opal - 5-6
+ * topaz - 8 * glass - ~5.5
+ * emerald - 7.5-8 (beryl) * dilithium - 4-5??
+ * aquamarine - 7.5-8 (beryl) * iron - 4-5
+ * garnet - 7.25 (var. 6.5-8) * fluorite - 4
+ * agate - 7 (quartz) * brass - 3-4
+ * amethyst - 7 (quartz) * gold - 2.5-3
+ * jasper - 7 (quartz) * silver - 2.5-3
+ * onyx - 7 (quartz) * copper - 2.5-3
+ * moonstone - 6 (orthoclase) * amber - 2-2.5
*/
/* return 1 if action took 1 (or more) moves, 0 if error or aborted */
boolean teleengr = FALSE; /* TRUE if we move the old engraving */
boolean zapwand = FALSE; /* TRUE if we remove a wand charge */
xchar type = DUST; /* Type of engraving made */
+ xchar oetype = 0; /* will be set to type of current engraving */
char buf[BUFSZ]; /* Buffer for final/poly engraving text */
char ebuf[BUFSZ]; /* Buffer for initial engraving text */
char fbuf[BUFSZ]; /* Buffer for "your fingers" */
ebuf[0] = (char) 0;
post_engr_text[0] = (char) 0;
maxelen = BUFSZ - 1;
+ if (oep)
+ oetype = oep->engr_type;
if (is_demon(youmonst.data) || youmonst.data->mlet == S_VAMPIRE)
type = ENGR_BLOOD;
if (u.uswallow) {
if (is_animal(u.ustuck->data)) {
+/*JP
pline("What would you write? \"Jonah was here\"?");
+*/
+ pline("\89½\82ð\8f\91\82\82ñ\82¾\82¢\81H\81u\83\88\83i\82Í\82±\82±\82É\82¢\82é\81v\81H");
return 0;
} else if (is_whirly(u.ustuck->data)) {
cant_reach_floor(u.ux, u.uy, FALSE, FALSE);
} else
jello = TRUE;
} else if (is_lava(u.ux, u.uy)) {
+/*JP
You_cant("write on the %s!", surface(u.ux, u.uy));
+*/
+ You("%s\82É\93Í\82©\82È\82¢\81D", surface(u.ux,u.uy));
return 0;
} else if (is_pool(u.ux, u.uy) || IS_FOUNTAIN(levl[u.ux][u.uy].typ)) {
+/*JP
You_cant("write on the %s!", surface(u.ux, u.uy));
+*/
+ You("%s\82É\82Í\8f\91\82¯\82È\82¢\81I", surface(u.ux, u.uy));
return 0;
}
if (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz) /* in bubble */) {
+/*JP
You_cant("write in thin air!");
+*/
+ You("\8bó\92\86\82É\82Í\8f\91\82¯\82È\82¢\81I");
return 0;
} else if (!accessible(u.ux, u.uy)) {
/* stone, tree, wall, secret corridor, pool, lava, bars */
+/*JP
You_cant("write here.");
+*/
+ You_cant("\82±\82±\82É\82Í\8f\91\82¯\82È\82¢\81D");
return 0;
}
if (cantwield(youmonst.data)) {
+/*JP
You_cant("even hold anything!");
+*/
+ You("\89½\82©\82ð\8e\9d\82Â\82±\82Æ\82·\82ç\82Å\82«\82È\82¢\81I");
return 0;
}
if (check_capacity((char *) 0))
return 0;
if (otmp == &zeroobj) {
- Strcat(strcpy(fbuf, "your "), makeplural(body_part(FINGER)));
+/*JP
+ Strcat(strcpy(fbuf, "your "), body_part(FINGERTIP));
+*/
+ Strcat(strcpy(fbuf, "\82 \82È\82½\82Ì"), body_part(FINGERTIP));
writer = fbuf;
} else
writer = yname(otmp);
* while both your hands are tied up.
*/
if (!freehand() && otmp != uwep && !otmp->owornmask) {
+/*JP
You("have no free %s to write with!", body_part(HAND));
+*/
+ pline("%s\82Ì\8e©\97R\82ª\8cø\82©\82È\82¢\82Ì\82Å\8f\91\82¯\82È\82¢\81I", body_part(HAND));
return 0;
}
if (jello) {
+/*JP
You("tickle %s with %s.", mon_nam(u.ustuck), writer);
+*/
+ You("%s\82Å%s\82ð\82\82·\82®\82Á\82½\81D", writer, mon_nam(u.ustuck));
+/*JP
Your("message dissolves...");
+*/
+ Your("\83\81\83b\83Z\81[\83W\82Í\8fÁ\82¦\82½\81D\81D\81D");
return 0;
}
if (otmp->oclass != WAND_CLASS && !can_reach_floor(TRUE)) {
return 0;
}
if (IS_ALTAR(levl[u.ux][u.uy].typ)) {
+/*JP
You("make a motion towards the altar with %s.", writer);
+*/
+ You("%s\82ð\8eg\82Á\82Ä\8dÕ\92d\82É\8f\91\82±\82¤\82Æ\82µ\82½\81D", writer);
altar_wrath(u.ux, u.uy);
return 0;
}
if (IS_GRAVE(levl[u.ux][u.uy].typ)) {
if (otmp == &zeroobj) { /* using only finger */
+/*JP
You("would only make a small smudge on the %s.",
+*/
+ You("%s\82ð\8f\82µ\82æ\82²\82·\82±\82Æ\82µ\82©\82Å\82«\82È\82©\82Á\82½\81D",
surface(u.ux, u.uy));
return 0;
} else if (!levl[u.ux][u.uy].disturbed) {
+/*JP
You("disturb the undead!");
+*/
+ You("\95s\8e\80\82Ì\8eÒ\82Ì\96°\82è\82ð\96W\82°\82½\81I");
levl[u.ux][u.uy].disturbed = 1;
(void) makemon(&mons[PM_GHOUL], u.ux, u.uy, NO_MM_FLAGS);
exercise(A_WIS, FALSE);
/* Objects too large to engrave with */
case BALL_CLASS:
case ROCK_CLASS:
+/*JP
You_cant("engrave with such a large object!");
+*/
+ pline("\82»\82ñ\82È\91å\82«\82È\82à\82Ì\82ð\8eg\82Á\82Ä\95¶\8e\9a\82ð\8d\8f\82ß\82È\82¢\81I");
ptext = FALSE;
break;
/* Objects too silly to engrave with */
case FOOD_CLASS:
case SCROLL_CLASS:
case SPBOOK_CLASS:
+#if 0 /*JP:T*/
pline("%s would get %s.", Yname2(otmp),
is_ice(u.ux, u.uy) ? "all frosty" : "too dirty");
+#else
+ Your("%s\82Í%s\82È\82Á\82½\81D", xname(otmp),
+ is_ice(u.ux,u.uy) ? "\91\9a\82¾\82ç\82¯\82É" : "\89\98\82È\82");
+#endif
ptext = FALSE;
break;
case RANDOM_CLASS: /* This should mean fingers */
*/
case WAN_STRIKING:
Strcpy(post_engr_text,
+/*JP
"The wand unsuccessfully fights your attempt to write!");
+*/
+ "\82 \82È\82½\82ª\8f\91\82±\82¤\82Æ\82·\82é\82Æ\8fñ\82Í\92ï\8dR\82µ\82½\81I");
break;
case WAN_SLOW_MONSTER:
if (!Blind) {
+/*JP
Sprintf(post_engr_text, "The bugs on the %s slow down!",
+*/
+ Sprintf(post_engr_text, "%s\82Ì\8fã\82Ì\92\8e\82Ì\93®\82«\82ª\92x\82\82È\82Á\82½\81I",
surface(u.ux, u.uy));
}
break;
case WAN_SPEED_MONSTER:
if (!Blind) {
+/*JP
Sprintf(post_engr_text, "The bugs on the %s speed up!",
+*/
+ Sprintf(post_engr_text, "%s\82Ì\8fã\82Ì\92\8e\82Ì\93®\82«\82ª\91¬\82\82È\82Á\82½\81I",
surface(u.ux, u.uy));
}
break;
if (!Blind) {
type = (xchar) 0; /* random */
(void) random_engraving(buf);
+ } else {
+ /* keep the same type so that feels don't
+ change and only the text is altered,
+ but you won't know anyway because
+ you're a _blind writer_ */
+ if (oetype)
+ type = oetype;
+ xcrypt(blengr(), buf);
}
dengr = TRUE;
}
ptext = TRUE;
if (!Blind) {
Sprintf(post_engr_text,
+/*JP
"The %s is riddled by bullet holes!",
+*/
+ "%s\82Í\8eU\92e\82Å\8d×\82©\82¢\8c\8a\82¾\82ç\82¯\82É\82È\82Á\82½\81I",
surface(u.ux, u.uy));
}
break;
case WAN_SLEEP:
case WAN_DEATH:
if (!Blind) {
+/*JP
Sprintf(post_engr_text, "The bugs on the %s stop moving!",
+*/
+ Sprintf(post_engr_text, "%s\82Ì\8fã\82Ì\92\8e\82Ì\93®\82«\82ª\8e~\82Ü\82Á\82½\81I",
surface(u.ux, u.uy));
}
break;
case WAN_COLD:
if (!Blind)
Strcpy(post_engr_text,
+/*JP
"A few ice cubes drop from the wand.");
+*/
+ "\95X\82Ì\82©\82¯\82ç\82ª\8fñ\82©\82ç\82±\82Ú\82ê\97\8e\82¿\82½\81D");
if (!oep || (oep->engr_type != BURN))
break;
+ /*FALLTHRU*/
case WAN_CANCELLATION:
case WAN_MAKE_INVISIBLE:
if (oep && oep->engr_type != HEADSTONE) {
if (!Blind)
+/*JP
pline_The("engraving on the %s vanishes!",
+*/
+ pline("%s\82Ì\8fã\82Ì\95¶\8e\9a\82Í\8fÁ\82¦\82½\81I",
surface(u.ux, u.uy));
dengr = TRUE;
}
case WAN_TELEPORTATION:
if (oep && oep->engr_type != HEADSTONE) {
if (!Blind)
+/*JP
pline_The("engraving on the %s vanishes!",
+*/
+ pline("%s\82Ì\8fã\82Ì\95¶\8e\9a\82Í\8fÁ\82¦\82½\81I",
surface(u.ux, u.uy));
teleengr = TRUE;
}
type = ENGRAVE;
if (!objects[otmp->otyp].oc_name_known) {
if (flags.verbose)
+/*JP
pline("This %s is a wand of digging!", xname(otmp));
+*/
+ pline("\82±\82ê\82Í\8c\8a\8c@\82è\82Ì\8fñ\82¾\81I");
doknown = TRUE;
}
+#if 0 /*JP:T*/
+ Strcpy(post_engr_text,
+ (Blind && !Deaf)
+ ? "You hear drilling!" /* Deaf-aware */
+ : Blind
+ ? "You feel tremors."
+ : IS_GRAVE(levl[u.ux][u.uy].typ)
+ ? "Chips fly out from the headstone."
+ : is_ice(u.ux, u.uy)
+ ? "Ice chips fly up from the ice surface!"
+ : (level.locations[u.ux][u.uy].typ
+ == DRAWBRIDGE_DOWN)
+ ? "Splinters fly up from the bridge."
+ : "Gravel flies up from the floor.");
+#else
Strcpy(post_engr_text,
- Blind
- ? "You hear drilling!"
- : IS_GRAVE(levl[u.ux][u.uy].typ)
- ? "Chips fly out from the headstone."
- : is_ice(u.ux, u.uy)
- ? "Ice chips fly up from the ice surface!"
- : (level.locations[u.ux][u.uy].typ
- == DRAWBRIDGE_DOWN)
- ? "Splinters fly up from the bridge."
- : "Gravel flies up from the floor.");
+ (Blind && !Deaf)
+ ? "\8c\8a\82ª\8aJ\82\89¹\82ð\95·\82¢\82½\81I" /* Deaf-aware */
+ : Blind
+ ? "\90U\93®\82ð\8a´\82¶\82½\81D"
+ : IS_GRAVE(levl[u.ux][u.uy].typ)
+ ? "\95æ\90Î\82©\82ç\94j\95Ð\82ª\94ò\82Ñ\8eU\82Á\82½\81D"
+ : is_ice(u.ux,u.uy)
+ ? "\95X\82Ì\95\\96Ê\82©\82ç\95X\82Ì\82©\82¯\82ç\82ª\94ò\82Ñ\8eU\82Á\82½\81D"
+ : (level.locations[u.ux][u.uy].typ
+ == DRAWBRIDGE_DOWN)
+ ? "\94j\95Ð\82ª\8b´\82©\82ç\95\91\82¢\82 \82ª\82Á\82½\81D"
+ : "\8d»\97\98\82ª\8f°\82©\82ç\94ò\82Ñ\8eU\82Á\82½\81D");
+#endif
break;
/* type = BURN wands */
case WAN_FIRE:
type = BURN;
if (!objects[otmp->otyp].oc_name_known) {
if (flags.verbose)
+/*JP
pline("This %s is a wand of fire!", xname(otmp));
+*/
+ pline("\82±\82ê\82Í\89\8a\82Ì\8fñ\82¾\81I");
doknown = TRUE;
}
+#if 0 /*JP:T*/
Strcpy(post_engr_text, Blind ? "You feel the wand heat up."
: "Flames fly from the wand.");
+#else
+ Strcpy(post_engr_text, Blind ? "\8fñ\82ª\92g\82©\82\82È\82Á\82½\82æ\82¤\82È\8bC\82ª\82µ\82½\81D"
+ : "\89\8a\82ª\8fñ\82©\82ç\94ò\82Ñ\8eU\82Á\82½\81D");
+#endif
break;
case WAN_LIGHTNING:
ptext = TRUE;
type = BURN;
if (!objects[otmp->otyp].oc_name_known) {
if (flags.verbose)
+/*JP
pline("This %s is a wand of lightning!", xname(otmp));
+*/
+ pline("\82±\82ê\82Í\97\8b\82Ì\8fñ\82¾\81I");
doknown = TRUE;
}
if (!Blind) {
+/*JP
Strcpy(post_engr_text, "Lightning arcs from the wand.");
+*/
+ Strcpy(post_engr_text, "\89Î\89Ô\82ª\8fñ\82©\82ç\94ò\82Ñ\8eU\82Á\82½\81D");
doblind = TRUE;
} else
- Strcpy(post_engr_text, "You hear crackling!");
+#if 0 /*JP:T*/
+ Strcpy(post_engr_text, !Deaf
+ ? "You hear crackling!" /* Deaf-aware */
+ : "Your hair stands up!");
+#else
+ Strcpy(post_engr_text, !Deaf
+ ? "\83p\83`\83p\83`\82Æ\82¢\82¤\89¹\82ð\95·\82¢\82½\81I" /* Deaf-aware */
+ : "\83]\83b\82Æ\82µ\82½\81I");
+#endif
break;
/* type = MARK wands */
zapwand = TRUE;
/* empty wand just doesn't write */
else
+/*JP
pline_The("wand is too worn out to engrave.");
+*/
+ pline_The("\8fñ\82Í\95¶\8e\9a\82ð\8d\8f\82Þ\82É\82Í\8eg\82¢\82·\82¬\82Ä\82¢\82é\81D");
}
}
break;
if ((int) otmp->spe > -3)
type = ENGRAVE;
else
+/*JP
pline("%s too dull for engraving.", Yobjnam2(otmp, "are"));
+*/
+ pline("%s\82Í\90n\82ª\83{\83\8d\83{\83\8d\82Å\81C\95¶\8e\9a\82ð\92¤\82ê\82È\82¢\81D", xname(otmp));
}
break;
case TOOL_CLASS:
if (otmp == ublindf) {
pline(
+/*JP
"That is a bit difficult to engrave with, don't you think?");
+*/
+ "\82¿\82å\82Á\82Æ\82»\82ê\82Å\92¤\82é\82Ì\82Í\91å\95Ï\82¾\82ë\82¤\81C\82»\82¤\8ev\82í\82È\82¢\81H");
return 0;
}
switch (otmp->otyp) {
case MAGIC_MARKER:
if (otmp->spe <= 0)
+/*JP
Your("marker has dried out.");
+*/
+ Your("\83}\81[\83J\82Í\8a£\82«\82«\82Á\82½\81D");
else
type = MARK;
break;
if (is_wet_towel(otmp))
dry_a_towel(otmp, -1, TRUE);
if (!Blind)
+/*JP
You("wipe out the message here.");
+*/
+ You("\83\81\83b\83Z\81[\83W\82ð\90@\82«\82Æ\82Á\82½\81D");
else
+#if 0 /*JP:T*/
pline("%s %s.", Yobjnam2(otmp, "get"),
is_ice(u.ux, u.uy) ? "frosty" : "dusty");
+#else
+ pline("%s\82Í%s\82É\82È\82Á\82½\81D", xname(otmp),
+ is_ice(u.ux,u.uy) ? "\91\9a\82¾\82ç\82¯" : "\82Ù\82±\82è\82Ü\82Ý\82ê");
+#endif
dengr = TRUE;
} else
+/*JP
pline("%s can't wipe out this engraving.", Yname2(otmp));
+*/
+ pline("\82±\82Ì\95¶\8e\9a\82Í%s\82Å\82Í\90@\82«\82Æ\82ê\82È\82¢\81D", xname(otmp));
else
+#if 0 /*JP:T*/
pline("%s %s.", Yobjnam2(otmp, "get"),
is_ice(u.ux, u.uy) ? "frosty" : "dusty");
+#else
+ pline("%s\82Í%s\82É\82È\82Á\82½\81D", xname(otmp),
+ is_ice(u.ux,u.uy) ? "\91\9a\82¾\82ç\82¯" : "\82Ù\82±\82è\82Ü\82Ý\82ê");
+#endif
break;
default:
break;
case VENOM_CLASS:
if (wizard) {
+/*JP
pline("Writing a poison pen letter??");
+*/
+ pline("\82Ó\82Þ\81D\82±\82ê\82±\82»\96{\93\96\82Ì\93Å\90ã\82¾\81D");
break;
}
/*FALLTHRU*/
/* Something has changed the engraving here */
if (*buf) {
make_engr_at(u.ux, u.uy, buf, moves, type);
- pline_The("engraving now reads: \"%s\".", buf);
+ if (!Blind)
+/*JP
+ pline_The("engraving now reads: \"%s\".", buf);
+*/
+ pline("\8d\8f\82Ü\82ê\82½\95¶\8e\9a\82ð\93Ç\82ñ\82¾\81F\81u%s\81v\81D", buf);
ptext = FALSE;
}
if (zapwand && (otmp->spe < 0)) {
+#if 0 /*JP:T*/
pline("%s %sturns to dust.", The(xname(otmp)),
Blind ? "" : "glows violently, then ");
+#else
+ pline("%s\82Í%s\82¿\82è\82Æ\82È\82Á\82½\81D", xname(otmp),
+ Blind ? "" : "\8c\83\82µ\82\8bP\82«\81C");
+#endif
if (!IS_GRAVE(levl[u.ux][u.uy].typ))
+#if 0 /*JP:T*/
You(
"are not going to get anywhere trying to write in the %s with your dust.",
is_ice(u.ux, u.uy) ? "frost" : "dust");
+#else
+ You(
+ "\90o\82Å%s\82É\89½\82©\8f\91\82±\82¤\82Æ\82µ\82½\82ª\81C\82Å\82«\82È\82©\82Á\82½\81D",
+ is_ice(u.ux,u.uy) ? "\95X" : "\82Ù\82±\82è");
+#endif
useup(otmp);
otmp = 0; /* wand is now gone */
ptext = FALSE;
} else if (type == oep->engr_type
&& (!Blind || oep->engr_type == BURN
|| oep->engr_type == ENGRAVE)) {
+/*JP
c = yn_function("Do you want to add to the current engraving?",
+*/
+ c = yn_function("\89½\82©\8f\91\82«\89Á\82¦\82Ü\82·\82©\81H",
ynqchars, 'y');
if (c == 'q') {
pline1(Never_mind);
|| oep->engr_type == ENGR_BLOOD
|| oep->engr_type == MARK) {
if (!Blind) {
+#if 0 /*JP:T*/
You("wipe out the message that was %s here.",
(oep->engr_type == DUST)
? "written in the dust"
: (oep->engr_type == ENGR_BLOOD)
? "scrawled in blood"
: "written");
+#else
+ You("%s\83\81\83b\83Z\81[\83W\82ð\90@\82«\82Æ\82Á\82½\81D",
+ (oep->engr_type == DUST)
+ ? "\82Ù\82±\82è\82É\8f\91\82©\82ê\82Ä\82¢\82é"
+ : (oep->engr_type == BLOOD)
+ ? "\8c\8c\95¶\8e\9a\82Å\82È\82®\82è\8f\91\82«\82³\82ê\82Ä\82¢\82é"
+ : "\8f\91\82©\82ê\82Ä\82¢\82é");
+#endif
del_engr(oep);
oep = (struct engr *) 0;
} else
*/
eow = TRUE;
} else if (type == DUST || type == MARK || type == ENGR_BLOOD) {
+#if 0 /*JP:T*/
You("cannot wipe out the message that is %s the %s here.",
oep->engr_type == BURN
? (is_ice(u.ux, u.uy) ? "melted into" : "burned into")
: "engraved in",
surface(u.ux, u.uy));
+#else
+ You("%s\83\81\83b\83Z\81[\83W\82ð\90@\82«\82Æ\82ê\82È\82©\82Á\82½\81D",
+ oep->engr_type == BURN
+ ? (is_ice(u.ux, u.uy) ? "\8d\8f\82Ü\82ê\82Ä\82¢\82é" : "\8fÄ\82«\95t\82¯\82ç\82ê\82Ä\82¢\82é")
+ : "\8d\8f\82Ü\82ê\82Ä\82¢\82é");
+#endif
return 1;
} else if (type != oep->engr_type || c == 'n') {
if (!Blind || can_reach_floor(TRUE))
+/*JP
You("will overwrite the current message.");
+*/
+ You("\83\81\83b\83Z\81[\83W\82ð\8fã\8f\91\82«\82µ\82æ\82¤\82Æ\82µ\82½\81D");
eow = TRUE;
}
}
eloc = surface(u.ux, u.uy);
switch (type) {
default:
+/*JP
everb = (oep && !eow ? "add to the weird writing on"
+*/
+ everb = (oep && !eow ? "\8aï\96\82È\95¶\8e\9a\97ñ\82É\8f\91\82«\89Á\82¦\82é"
+/*JP
: "write strangely on");
+*/
+ : "\8aï\96\82È\95¶\8e\9a\97ñ\82ð\8f\91\82");
break;
case DUST:
+/*JP
everb = (oep && !eow ? "add to the writing in" : "write in");
+*/
+ everb = (oep && !eow ? "\8f\91\82«\89Á\82¦\82é" : "\8f\91\82");
+/*JP
eloc = is_ice(u.ux, u.uy) ? "frost" : "dust";
+*/
+ eloc = is_ice(u.ux,u.uy) ? "\91\9a" : "\82Ù\82±\82è";
break;
case HEADSTONE:
+/*JP
everb = (oep && !eow ? "add to the epitaph on" : "engrave on");
+*/
+ everb = (oep && !eow ? "\95æ\94è\96Á\82ð\8d\8f\82Ý\89Á\82¦\82é" : "\95æ\94è\96Á\82ð\8d\8f\82Þ");
break;
case ENGRAVE:
+/*JP
everb = (oep && !eow ? "add to the engraving in" : "engrave in");
+*/
+ everb = (oep && !eow ? "\8d\8f\82Ý\89Á\82¦\82é" : "\8d\8f\82Þ");
break;
case BURN:
+#if 0 /*JP:T*/
everb = (oep && !eow
? (is_ice(u.ux, u.uy) ? "add to the text melted into"
: "add to the text burned into")
: (is_ice(u.ux, u.uy) ? "melt into" : "burn into"));
+#else
+ everb = (oep && !eow
+ ? ( is_ice(u.ux,u.uy) ? "\8d\8f\82Ý\89Á\82¦\82é"
+ : "\94R\82¦\82Ä\82¢\82é\95¶\8e\9a\82É\8f\91\82«\89Á\82¦\82é")
+ : ( is_ice(u.ux,u.uy) ? "\8d\8f\82Þ" : "\8fÄ\88ó\82ð\82¢\82ê\82é"));
+#endif
break;
case MARK:
+/*JP
everb = (oep && !eow ? "add to the graffiti on" : "scribble on");
+*/
+ everb = (oep && !eow ? "\97\8e\8f\91\82É\8f\91\82«\89Á\82¦\82é" : "\82Í\82µ\82è\8f\91\82«\82·\82é");
break;
case ENGR_BLOOD:
+/*JP
everb = (oep && !eow ? "add to the scrawl on" : "scrawl on");
+*/
+ everb = (oep && !eow ? "\82È\82®\82è\8f\91\82«\82É\8f\91\82«\89Á\82¦\82é" : "\82È\82®\82è\8f\91\82«\82·\82é");
break;
}
/* Tell adventurer what is going on */
if (otmp != &zeroobj)
+/*JP
You("%s the %s with %s.", everb, eloc, doname(otmp));
+*/
+ You("%s\82Å%s\82É%s\81D", doname(otmp), eloc, jpast(everb));
else
- You("%s the %s with your %s.", everb, eloc,
- makeplural(body_part(FINGER)));
+#if 0 /*JP:T*/
+ You("%s the %s with your %s.", everb, eloc, body_part(FINGERTIP));
+#else
+ You("%s\82Å%s\82É%s\81D", body_part(FINGER), eloc, jpast(everb));
+#endif
/* Prompt for engraving! */
+/*JP
Sprintf(qbuf, "What do you want to %s the %s here?", everb, eloc);
+*/
+ Sprintf(qbuf,"%s\82É\89½\82Æ%s\82©\81H", eloc, jpolite(everb));
getlin(qbuf, ebuf);
/* convert tabs to spaces and condense consecutive spaces to one */
mungspaces(ebuf);
if (len == 0 || index(ebuf, '\033')) {
if (zapwand) {
if (!Blind)
+#if 0 /*JP:T*/
pline("%s, then %s.", Tobjnam(otmp, "glow"),
otense(otmp, "fade"));
+#else
+ pline("%s\82Í\8bP\82¢\82½\82ª\81C\82·\82®\82É\8fÁ\82¦\82½\81D", xname(otmp));
+#endif
return 1;
} else {
pline1(Never_mind);
if (((type == DUST || type == ENGR_BLOOD) && !rn2(25))
|| (Blind && !rn2(11)) || (Confusion && !rn2(7))
|| (Stunned && !rn2(4)) || (Hallucination && !rn2(2)))
+#if 0 /*JP*/
*sp = ' ' + rnd(96 - 2); /* ASCII '!' thru '~'
(excludes ' ' and DEL) */
+#else /*JP:\93ú\96{\8cê\82Å\83\89\83\93\83_\83\80\89» */
+ {
+ if(is_kanji1(ebuf, sp-ebuf))
+ jrndm_replace(sp);
+ else if(is_kanji2(ebuf, sp-ebuf))
+ jrndm_replace(sp-1);
+ else
+ *sp = '!' + rn2(93); /* ASCII-code only */
+ }
+#endif
}
/* Previous engraving is overwritten */
default:
multi = -(len / 10);
if (multi)
+/*JP
nomovemsg = "You finish your weird engraving.";
+*/
+ nomovemsg = "\82 \82È\82½\82Í\8aï\96\82È\8d\8f\82Ý\82ð\8fI\82¦\82½\81D";
break;
case DUST:
multi = -(len / 10);
if (multi)
+/*JP
nomovemsg = "You finish writing in the dust.";
+*/
+ nomovemsg = "\82 \82È\82½\82Í\82Ù\82±\82è\82É\8f\91\82«\8fI\82¦\82½\81D";
break;
case HEADSTONE:
case ENGRAVE:
* to engrave "Elbereth" all at once.
* However, you can engrave "Elb", then "ere", then "th".
*/
+/*JP
pline("%s dull.", Yobjnam2(otmp, "get"));
+*/
+ Your("%s\82Í\90n\82±\82Ú\82ê\82µ\82½\81D", xname(otmp));
costly_alteration(otmp, COST_DEGRD);
if (len > maxelen) {
multi = -maxelen;
multi = -len;
}
if (multi)
+/*JP
nomovemsg = "You finish engraving.";
+*/
+ nomovemsg = "\82 \82È\82½\82Í\8d\8f\82Ý\8fI\82¦\82½\81D";
break;
case BURN:
multi = -(len / 10);
if (multi)
nomovemsg = is_ice(u.ux, u.uy)
+/*JP
? "You finish melting your message into the ice."
+*/
+ ? "\95X\82Ö\83\81\83b\83Z\81[\83W\82ð\8d\8f\82Ý\8fI\82¦\82½\81D"
+/*JP
: "You finish burning your message into the floor.";
+*/
+ : "\8f°\82Ö\83\81\83b\83Z\81[\83W\82ð\8fÄ\82«\82¢\82ê\8fI\82¦\82½\81D";
break;
case MARK:
multi = -(len / 10);
if (otmp->otyp == MAGIC_MARKER) {
maxelen = otmp->spe * 2; /* one charge / 2 letters */
if (len > maxelen) {
+/*JP
Your("marker dries out.");
+*/
+ Your("\83}\81[\83J\82Í\8a£\82«\82«\82Á\82½\81D");
otmp->spe = 0;
multi = -(maxelen / 10);
} else if (len > 1)
otmp->spe -= 1; /* Prevent infinite graffiti */
}
if (multi)
+/*JP
nomovemsg = "You finish defacing the dungeon.";
+*/
+ nomovemsg = "\82 \82È\82½\82Í\96À\8b{\82Ö\82Ì\97\8e\8f\91\82ð\8f\91\82«\8fI\82¦\82½\81D";
break;
case ENGR_BLOOD:
multi = -(len / 10);
if (multi)
+/*JP
nomovemsg = "You finish scrawling.";
+*/
+ nomovemsg = "\82Í\82µ\82è\8f\91\82«\82ð\8f\91\82«\8fI\82¦\82½\81D";
break;
}
if (*sp == ' ')
maxelen--;
if (!maxelen && *sp) {
+#if 1 /*JP*//*\8a¿\8e\9a\82Ì1\83o\83C\83g\96Ú\82¾\82¯\82ª\8ec\82ç\82È\82¢\82æ\82¤\82É*/
+ if(is_kanji2(ebuf, sp - ebuf))
+ --sp;
+#endif
*sp = '\0';
if (multi)
+/*JP
nomovemsg = "You cannot write any more.";
+*/
+ nomovemsg = "\82±\82ê\88È\8fã\89½\82à\8f\91\82¯\82È\82©\82Á\82½\81D";
+/*JP
You("are only able to write \"%s\".", ebuf);
+*/
+ You("\81u%s\81v\82Æ\82Ü\82Å\82µ\82©\8f\91\82¯\82È\82©\82Á\82½\81D", ebuf);
}
}
if (post_engr_text[0])
pline("%s", post_engr_text);
if (doblind && !resists_blnd(&youmonst)) {
+/*JP
You("are blinded by the flash!");
+*/
+ You("\82Ü\82Î\82ä\82¢\8cõ\82Å\96Ú\82ª\82\82ç\82ñ\82¾\81I");
make_blinded((long) rnd(50), FALSE);
if (!Blind)
Your1(vision_clears);
}
}
+/* to support '#stats' wizard-mode command */
+void
+engr_stats(hdrfmt, hdrbuf, count, size)
+const char *hdrfmt;
+char *hdrbuf;
+long *count, *size;
+{
+ struct engr *ep;
+
+ Sprintf(hdrbuf, hdrfmt, (long) sizeof (struct engr));
+ *count = *size = 0L;
+ for (ep = head_engr; ep; ep = ep->nxt_engr) {
+ ++*count;
+ *size += (long) sizeof *ep + (long) ep->engr_lth;
+ }
+}
+
void
del_engr(ep)
register struct engr *ep;
/* Engrave the headstone */
del_engr_at(x, y);
if (!str)
- str = get_rnd_text(EPITAPHFILE, buf);
+ str = get_rnd_text(EPITAPHFILE, buf, rn2);
make_engr_at(x, y, str, 0L, HEADSTONE);
return;
}
+static const char blind_writing[][21] = {
+ {0x44, 0x66, 0x6d, 0x69, 0x62, 0x65, 0x22, 0x45, 0x7b, 0x71,
+ 0x65, 0x6d, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+ {0x51, 0x67, 0x60, 0x7a, 0x7f, 0x21, 0x40, 0x71, 0x6b, 0x71,
+ 0x6f, 0x67, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x49, 0x6d, 0x73, 0x69, 0x62, 0x65, 0x22, 0x4c, 0x61, 0x7c,
+ 0x6d, 0x67, 0x24, 0x42, 0x7f, 0x69, 0x6c, 0x77, 0x67, 0x7e, 0x00},
+ {0x4b, 0x6d, 0x6c, 0x66, 0x30, 0x4c, 0x6b, 0x68, 0x7c, 0x7f,
+ 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x51, 0x67, 0x70, 0x7a, 0x7f, 0x6f, 0x67, 0x68, 0x64, 0x71,
+ 0x21, 0x4f, 0x6b, 0x6d, 0x7e, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x4c, 0x63, 0x76, 0x61, 0x71, 0x21, 0x48, 0x6b, 0x7b, 0x75,
+ 0x67, 0x63, 0x24, 0x45, 0x65, 0x6b, 0x6b, 0x65, 0x00, 0x00, 0x00},
+ {0x4c, 0x67, 0x68, 0x6b, 0x78, 0x68, 0x6d, 0x76, 0x7a, 0x75,
+ 0x21, 0x4f, 0x71, 0x7a, 0x75, 0x6f, 0x77, 0x00, 0x00, 0x00, 0x00},
+ {0x44, 0x66, 0x6d, 0x7c, 0x78, 0x21, 0x50, 0x65, 0x66, 0x65,
+ 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x44, 0x66, 0x73, 0x69, 0x62, 0x65, 0x22, 0x56, 0x7d, 0x63,
+ 0x69, 0x76, 0x6b, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+};
+
+STATIC_OVL const char *
+blengr(VOID_ARGS)
+{
+ return blind_writing[rn2(SIZE(blind_writing))];
+}
+
/*engrave.c*/