-/* NetHack 3.6 engrave.c $NHDT-Date: 1456304550 2016/02/24 09:02:30 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.61 $ */
+/* 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-2019 */
+/* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2021 */
/* JNetHack may be freely redistributed. See license for details. */
#include "hack.h"
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*/
+#if 0 /*JP:T*/
You("can't reach the %s.",
up ? ceiling(x, y)
: (check_pit && can_reach_floor(FALSE))
*/
return "\8bó\92\86";
else if (is_pool(x, y))
-#if 0 /*JP*/
+#if 0 /*JP:T*/
return (Underwater && !Is_waterlevel(&u.uz))
? "bottom" : hliquid("water");
#else
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*/
+#if 0 /*JP:T*/
pline("%s is written here in the %s.", Something,
is_ice(x, y) ? "frost" : "dust");
#else
case BURN:
if (!Blind || can_reach_floor(TRUE)) {
sensed = 1;
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("Some text has been %s into the %s here.",
is_ice(x, y) ? "melted" : "burned", surface(x, y));
#else
impossible("%s is written in a very strange way.", Something);
sensed = 1;
}
+
if (sensed) {
- char *et;
+ char *et, buf[BUFSZ];
+ int maxelen = (int) (sizeof buf
+ /* sizeof "literal" counts terminating \0 */
/*JP
- unsigned maxelen = BUFSZ - sizeof("You feel the words: \"\". ");
+ - sizeof "You feel the words: \"\".");
*/
- unsigned maxelen = BUFSZ - sizeof("\82 \82È\82½\82Í\8e\9f\82Ì\82æ\82¤\82É\8a´\82¶\82½\81F\81u\81v");
- if (strlen(ep->engr_txt) > maxelen) {
- (void) strncpy(buf, ep->engr_txt, (int) maxelen);
+ - 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);
*/
You("%s\81F\81u%s\81v", (Blind) ? "\8e\9f\82Ì\82æ\82¤\82É\8a´\82¶\82½" : "\93Ç\82ñ\82¾", et);
- if (context.run > 1)
+ if (context.run > 0)
nomul(0);
}
}
/*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));
+ 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");
+ 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)) {
case FOOD_CLASS:
case SCROLL_CLASS:
case SPBOOK_CLASS:
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s would get %s.", Yname2(otmp),
is_ice(u.ux, u.uy) ? "all frosty" : "too dirty");
#else
/*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");
+ "\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) {
pline("\82±\82ê\82Í\8c\8a\8c@\82è\82Ì\8fñ\82¾\81I");
doknown = TRUE;
}
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Strcpy(post_engr_text,
(Blind && !Deaf)
- ? "You hear drilling!"
+ ? "You hear drilling!" /* Deaf-aware */
: Blind
? "You feel tremors."
: IS_GRAVE(levl[u.ux][u.uy].typ)
: "Gravel flies up from the floor.");
#else
Strcpy(post_engr_text,
- Blind
- ? "\8c\8a\82ª\8aJ\82\89¹\82ð\95·\82¢\82½\81I"
- : 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");
+ (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 */
pline("\82±\82ê\82Í\89\8a\82Ì\8fñ\82¾\81I");
doknown = TRUE;
}
-#if 0 /*JP*/
+#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, "\89Î\89Ô\82ª\8fñ\82©\82ç\94ò\82Ñ\8eU\82Á\82½\81D");
doblind = TRUE;
} else
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Strcpy(post_engr_text, !Deaf
- ? "You hear crackling!"
+ ? "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"
+ ? "\83p\83`\83p\83`\82Æ\82¢\82¤\89¹\82ð\95·\82¢\82½\81I" /* Deaf-aware */
: "\83]\83b\82Æ\82µ\82½\81I");
#endif
break;
*/
You("\83\81\83b\83Z\81[\83W\82ð\90@\82«\82Æ\82Á\82½\81D");
else
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s.", Yobjnam2(otmp, "get"),
is_ice(u.ux, u.uy) ? "frosty" : "dusty");
#else
*/
pline("\82±\82Ì\95¶\8e\9a\82Í%s\82Å\82Í\90@\82«\82Æ\82ê\82È\82¢\81D", xname(otmp));
else
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s.", Yobjnam2(otmp, "get"),
is_ice(u.ux, u.uy) ? "frosty" : "dusty");
#else
ptext = FALSE;
}
if (zapwand && (otmp->spe < 0)) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %sturns to dust.", The(xname(otmp)),
Blind ? "" : "glows violently, then ");
#else
Blind ? "" : "\8c\83\82µ\82\8bP\82«\81C");
#endif
if (!IS_GRAVE(levl[u.ux][u.uy].typ))
-#if 0 /*JP*/
+#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");
|| oep->engr_type == ENGR_BLOOD
|| oep->engr_type == MARK) {
if (!Blind) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("wipe out the message that was %s here.",
(oep->engr_type == DUST)
? "written in the dust"
*/
eow = TRUE;
} else if (type == DUST || type == MARK || type == ENGR_BLOOD) {
-#if 0 /*JP*/
+#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",
+ You("%s\82É%s\83\81\83b\83Z\81[\83W\82ð\90@\82«\82Æ\82ê\82È\82©\82Á\82½\81D",
+ surface(u.ux, u.uy),
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é");
everb = (oep && !eow ? "\8d\8f\82Ý\89Á\82¦\82é" : "\8d\8f\82Þ");
break;
case BURN:
-#if 0 /*JP*/
+#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")
*/
You("%s\82Å%s\82É%s\81D", doname(otmp), eloc, jpast(everb));
else
-#if 0 /*JP*/
+#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));
if (len == 0 || index(ebuf, '\033')) {
if (zapwand) {
if (!Blind)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s, then %s.", Tobjnam(otmp, "glow"),
otense(otmp, "fade"));
#else