-/* NetHack 3.6 hack.c $NHDT-Date: 1551137618 2019/02/25 23:33:38 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.208 $ */
+/* NetHack 3.6 hack.c $NHDT-Date: 1576638500 2019/12/18 03:08:20 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.220 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* 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-2022 */
/* JNetHack may be freely redistributed. See license for details. */
#include "hack.h"
if (mtmp && !noncorporeal(mtmp->data)
&& (!mtmp->mtrapped
|| !(ttmp && is_pit(ttmp->ttyp)))) {
+ boolean deliver_part1 = FALSE;
+
if (Blind)
feel_location(sx, sy);
if (canspotmon(mtmp)) {
pline("There's %s on the other side.", a_monnam(mtmp));
*/
pline("\94½\91Î\91¤\82É%s\82ª\82¢\82é\81D", a_monnam(mtmp));
+ deliver_part1 = TRUE;
} else {
/*JP
You_hear("a monster behind %s.", the(xname(otmp)));
*/
pline("%s\82Ì\94w\8cã\82É\89ö\95¨\82Ì\8bC\94z\82ª\82·\82é\81D", the(xname(otmp)));
+ if (!Deaf)
+ deliver_part1 = TRUE;
map_invisible(rx, ry);
}
- if (flags.verbose)
-#if 0 /*JP*/
- pline("Perhaps that's why %s cannot move it.",
- u.usteed ? y_monnam(u.usteed) : "you");
+ if (flags.verbose) {
+ char you_or_steed[BUFSZ];
+
+#if 0 /*JP:T*/
+ Strcpy(you_or_steed,
+ u.usteed ? y_monnam(u.usteed) : "you");
#else
- pline("\82½\82Ô\82ñ\82±\82ê\82ª\81C\8aâ\82ð\93®\82©\82¹\82È\82¢\97\9d\97R\82¾\81D");
+ Strcpy(you_or_steed,
+ u.usteed ? y_monnam(u.usteed) : "\82 \82È\82½");
#endif
+#if 0 /*JP:T*/
+ pline("%s%s cannot move %s.",
+ deliver_part1
+ ? "Perhaps that's why "
+ : "",
+ deliver_part1
+ ? you_or_steed
+ : upstart(you_or_steed),
+ deliver_part1
+ ? "it"
+ : the(xname(otmp)));
+#else
+ /* "Perhaps that's why (you_or_steed) cannot move it."*/
+ /* "(You_or_steed) cannot move (otmp)."*/
+ if (deliver_part1) {
+ pline("\82½\82Ô\82ñ\82±\82ê\82ª\81C%s\82ª\82»\82ê\82ð\93®\82©\82¹\82È\82¢\97\9d\97R\82¾\81D",
+ you_or_steed);
+ } else {
+ pline("%s\82Í%s\82ð\93®\82©\82¹\82È\82¢\81D",
+ you_or_steed, xname(otmp));
+ }
+#endif
+ }
goto cannot_push;
}
obj_extract_self(otmp);
place_object(otmp, rx, ry);
newsym(sx, sy);
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("KAABLAMM!!! %s %s land mine.",
Tobjnam(otmp, "trigger"),
ttmp->madeby_u ? "your" : "a");
pline("\83h\83T\83b\81I\82 \82È\82½\82Í\82à\82¤%s\82ð\8a´\82¶\82ç\82ê\82È\82¢\81D",
the(xname(otmp)));
else
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s%s and %s a %s in the %s!",
Tobjnam(otmp, (ttmp->ttyp == TRAPDOOR)
? "trigger"
dopush:
if (!u.usteed) {
if (moves > lastmovetime + 2 || moves < lastmovetime)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("With %s effort you move %s.",
throws_rocks(youmonst.data) ? "little"
: "great",
#endif
exercise(A_STR, TRUE);
} else
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s moves %s.", upstart(y_monnam(u.usteed)),
the(xname(otmp)));
#else
} else {
nopushmsg:
if (u.usteed)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s tries to move %s, but cannot.",
upstart(y_monnam(u.usteed)), the(xname(otmp)));
#else
willpickup = (canpickup && autopick_testobj(otmp, TRUE));
if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("aren't skilled enough to %s %s from %s.",
willpickup ? "pick up" : "push aside",
the(xname(otmp)), y_monnam(u.usteed));
* canpickup: you could easily pick it up
* otherwise: you easily push it aside
*/
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("However, you %seasily %s.",
(willpickup || !canpickup) ? "" : "could ",
(willpickup || canpickup) ? "pick it up"
&& ((IS_ROCK(lev->typ) && !may_dig(x, y))
/* may_dig() checks W_NONDIGGABLE but doesn't handle iron bars */
|| (lev->typ == IRONBARS && (lev->wall_info & W_NONDIGGABLE)))) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("hurt your teeth on the %s.",
(lev->typ == IRONBARS)
? "bars"
/* solid rock takes more work & time to dig through */
context.digging.effort =
(IS_ROCK(lev->typ) && !IS_TREE(lev->typ) ? 30 : 60) + u.udaminc;
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("start chewing %s %s.",
(boulder || IS_TREE(lev->typ) || lev->typ == IRONBARS)
? "on a"
return 1;
} else if ((context.digging.effort += (30 + u.udaminc)) <= 100) {
if (flags.verbose)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("%s chewing on the %s.",
context.digging.chew ? "continue" : "begin",
boulder
if (boulder) {
delobj(boulder); /* boulder goes bye-bye */
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("eat the boulder."); /* yum */
#else
You("\8aâ\82ð\90H\82×\82½\81D"); /* yum */
int ty = u.ty;
boolean ret;
int g = glyph_at(x,y);
+
if (x == u.ux && y == u.uy)
return TRUE;
if (isok(x,y) && glyph_is_cmap(g) && S_stone == glyph_to_cmap(g)
if (--u.utrap) {
if (flags.verbose) {
if (anchored) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
predicament = "chained to the";
culprit = "buried ball";
#else
culprit = "\96\84\82Ü\82Á\82Ä\82¢\82é\8b\85";
#endif
} else {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
predicament = "stuck in the";
culprit = surface(u.ux, u.uy);
#else
}
if (u.usteed) {
if (anchored)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Norep("You and %s are %s %s.", steedname, predicament,
culprit);
#else
predicament);
#endif
else
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Norep("%s is %s %s.", upstart(steedname), predicament,
culprit);
#else
u_rooted()
{
if (!youmonst.data->mmove) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("are rooted %s.",
Levitation || Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)
? "in place"
domove_attempting = 0L;
}
-void
+STATIC_OVL void
domove_core()
{
register struct monst *mtmp;
xchar chainx = 0, chainy = 0,
ballx = 0, bally = 0; /* ball&chain new positions */
int bc_control = 0; /* control for ball&chain */
- boolean cause_delay = FALSE; /* dragging ball will skip a move */
+ boolean cause_delay = FALSE, /* dragging ball will skip a move */
+ u_with_boulder = (sobj_at(BOULDER, u.ux, u.uy) != 0);
if (context.travel) {
if (!findtravelpath(FALSE))
}
}
if (!isok(x, y)) {
+ if (iflags.mention_walls) {
+ int dx = u.dx, dy = u.dy;
+
+ if (dx && dy) { /* diagonal */
+ /* only as far as possible diagonally if in very
+ corner; otherwise just report whichever of the
+ cardinal directions has reached its limit */
+ if (isok(x, u.uy))
+ dx = 0;
+ else if (isok(u.ux, y))
+ dy = 0;
+ }
+#if 0 /*JP*/
+ You("have already gone as far %s as possible.",
+ directionname(xytod(dx, dy)));
+#else
+ You("\82·\82Å\82É\82Å\82«\82é\82¾\82¯%s\82É\93®\82¢\82Ä\82¢\82é\81D",
+ directionname(xytod(dx, dy)));
+#endif
+ }
nomul(0);
return;
}
You("%s\82Ì\8eè\91O\82Å\8e~\82Ü\82Á\82½\81D",
an(defsyms[trap_to_defsym(tt)].explanation));
} else if (is_pool_or_lava(x,y) && levl[x][y].seenv) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("stop at the edge of the %s.",
hliquid(is_pool(x,y) ? "water" : "lava"));
#else
because you don't see remembered terrain while underwater;
although the hero can attack an adjacent monster this way,
assume he can't reach out far enough to distinguish terrain */
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Sprintf(buf, (Is_waterlevel(&u.uz) && levl[x][y].typ == AIR)
? "an air bubble"
: "nothing");
unlike searching, this won't reveal what that terrain is
(except for solid rock, where the glyph would otherwise
yield ludicrous "dark part of a room") */
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Strcpy(buf, (levl[x][y].typ == STONE) ? "solid rock"
: glyph_is_cmap(glyph)
? the(defsyms[glyph_to_cmap(glyph)].explanation)
*/
Strcpy(buf, "\89½\82à\82È\82¢\8bó\92\86");
}
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("%s%s %s.",
!(boulder || solid) ? "" : !explo ? "harmlessly " : "futilely ",
explo ? "explode at" : "attack", buf);
#else
- You("%s%s%s.",
+ You("%s%s%s\81D",
!(boulder || solid) ? "" : !explo ? "\8cø\89Ê\82È\82" : "\82Þ\82¾\82É",
buf, explo ? "\82Å\94\9a\94\82µ\82½" : "\82ð\8dU\8c\82\82µ\82½");
#endif
You("stop. %s can't move diagonally.", upstart(y_monnam(mtmp)));
*/
You("\8e~\82Ü\82Á\82½\81D%s\82Í\8eÎ\82ß\82É\93®\82¯\82È\82¢\81D", upstart(y_monnam(mtmp)));
+ } else if (u_with_boulder
+ && !(verysmall(mtmp->data)
+ && (!mtmp->minvent || (curr_mon_load(mtmp) <= 600)))) {
+ /* can't swap places when pet won't fit there with the boulder */
+ u.ux = u.ux0, u.uy = u.uy0; /* didn't move after all */
+ if (u.usteed)
+ u.usteed->mx = u.ux, u.usteed->my = u.uy;
+#if 0 /*JP:T*/
+ You("stop. %s won't fit into the same spot that you're at.",
+ upstart(y_monnam(mtmp)));
+#else
+ You("\8e~\82Ü\82Á\82½\81D%s\82Í\82 \82È\82½\82Ì\82¢\82é\82Ì\82Æ\93¯\82¶\8fê\8f\8a\82É\82Í\8eû\82Ü\82ç\82È\82¢\81D",
+ y_monnam(mtmp));
+#endif
} else if (u.ux0 != x && u.uy0 != y && bad_rock(mtmp->data, x, u.uy0)
&& bad_rock(mtmp->data, u.ux0, y)
&& (bigmonst(mtmp->data) || (curr_mon_load(mtmp) > 600))) {
newsym(x, y);
newsym(u.ux0, u.uy0);
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("%s %s.", mtmp->mtame ? "swap places with" : "frighten",
pnambuf);
#else
}
}
-void
+STATIC_OVL void
maybe_smudge_engr(x1,y1,x2,y2)
int x1, y1, x2, y2;
{
You("%s\8aï\96\82È\90U\93®\82ð\8a´\82¶\82½\81D", buf);
u.uevent.uvibrated = 1;
if (otmp && otmp->spe == 7 && otmp->lamplit)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s!", The(xname(otmp)),
Blind ? "throbs palpably" : "glows with a strange light");
#else
*/
You("\82Ð\82å\82¢\82Æ\8bó\8bC\82Ì\96A\82É\93ü\82Á\82½\81D");
else if (is_lava(u.ux, u.uy))
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("leave the %s...", hliquid("water")); /* oops! */
#else
You("%s\90\85\82©\82ç\94²\82¯\82¾\82µ\82½\81D\81D\81D", hliquid("\90\85")); /* oops! */
#endif
else
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("are on solid %s again.",
is_ice(u.ux, u.uy) ? "ice" : "land");
#else
}
/* not mounted */
+ /* if hiding on ceiling then don't automatically enter pool */
+ if (Upolyd && ceiling_hider(&mons[u.umonnum]) && u.uundetected)
+ return FALSE;
+
/* drown(),lava_effects() return true if hero changes
location while surviving the problem */
if (is_lava(u.ux, u.uy)) {
/* Warning alerts you to ice danger */
if (Warning && is_ice(u.ux, u.uy)) {
static const char *const icewarnings[] = {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
"The ice seems very soft and slushy.",
"You feel the ice shift beneath you!",
"The ice, is gonna BREAK!", /* The Dead Zone */
mtmp->mundetected = mtmp->msleeping = 0;
switch (mtmp->data->mlet) {
case S_PIERCER:
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s suddenly drops from the %s!", Amonnam(mtmp),
ceiling(u.ux, u.uy));
#else
} else {
int dmg;
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("are hit by %s!",
x_monnam(mtmp, ARTICLE_A, "falling", 0, TRUE));
#else
break;
default: /* monster surprises you. */
if (mtmp->mtame)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s jumps near you from the %s.", Amonnam(mtmp),
ceiling(u.ux, u.uy));
#else
pline("\83f\83r\83b\83g\95ó\94 \93®\95¨\89\80\82É\82æ\82¤\82±\82»\81I");
break;
case SWAMP:
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("It %s rather %s down here.", Blind ? "feels" : "looks",
Blind ? "humid" : "muddy");
#else
break;
case MORGUE:
if (midnight()) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
const char *run = locomotion(youmonst.data, "Run");
pline("%s away! %s away!", run, run);
#else
*/
verbalize("\82¨\82Ü\82¦\82Í\83f\83\8b\83t\83@\83C\82Ì\90_\91õ\8f\8a\82É\82¢\82é\81D");
else
-#if 0 /*JP*/
+#if 0 /*JP:T*/
verbalize("%s, %s, welcome to Delphi!",
Hello((struct monst *) 0), plname);
#else
*/
pline("\82µ\82©\82µ\81C\82»\82ê\82Í\82Ê\82é\82Ê\82é\82µ\82Ä\95s\89õ\82¾\82Á\82½\82Ì\82Å\8eÌ\82Ä\82Ä\82µ\82Ü\82Á\82½\81D");
} else
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("don't %s anything in here to pick up.",
Blind ? "feel" : "see");
#else
*/
pline("\83q\83\93\83W\82ð\8aO\82¹\82È\82¢\81D");
else if (IS_ALTAR(lev->typ))
+/*JP
pline("Moving the altar would be a very bad idea.");
+*/
+ pline("\8dÕ\92d\82ð\93®\82©\82·\82Ì\82Í\82Æ\82Ä\82à\88«\82¢\8dl\82¦\82¾\81D");
else if (lev->typ == STAIRS)
+#if 0 /*JP:T*/
pline_The("stairs are solidly fixed to the %s.",
surface(u.ux, u.uy));
+#else
+ pline_The("\8aK\92i\82Í%s\82É\82µ\82Á\82©\82è\82Æ\8cÅ\92è\82³\82ê\82Ä\82¢\82é\81D",
+ surface(u.ux, u.uy));
+#endif
else
/*JP
There("is nothing here to pick up.");
}
if (!can_reach_floor(TRUE)) {
struct trap *traphere = t_at(u.ux, u.uy);
- if (traphere && uteetering_at_seen_pit(traphere))
-/*JP
- You("cannot reach the bottom of the pit.");
-*/
- You("\97\8e\82µ\8c\8a\82Ì\92ê\82É%s\82ª\93Í\82©\82È\82©\82Á\82½\81D", body_part(HAND));
+ if (traphere
+ && (uteetering_at_seen_pit(traphere) || uescaped_shaft(traphere)))
+#if 0 /*JP*/
+ You("cannot reach the bottom of the %s.",
+ is_pit(traphere->ttyp) ? "pit" : "abyss");
+#else
+ You("%s\82Ì\92ê\82É\93Í\82©\82È\82©\82Á\82½\81D",
+ is_pit(traphere->ttyp) ? "\97\8e\82µ\8c\8a" : "\93Þ\97\8e");
+#endif
else if (u.usteed && P_SKILL(P_RIDING) < P_BASIC)
rider_cant_reach();
else if (Blind && !can_reach_floor(TRUE))
? multi + 1 : 0;
multi = 0; /* always reset */
- if ((ret = pickup_checks() >= 0))
+ if ((ret = pickup_checks()) >= 0) {
return ret;
- else if (ret == -2) {
+ } else if (ret == -2) {
tmpcount = -count;
return loot_mon(u.ustuck, &tmpcount, (boolean *) 0);
} /* else ret == -1 */
if (x == u.ux + u.dx && y == u.uy + u.dy) {
if (iflags.mention_walls) {
int tt = what_trap(trap->ttyp, rn2_on_display_rng);
+
/*JP
You("stop in front of %s.",
*/
* into a pool and seeing if the game allowed it
*/
if (iflags.mention_walls)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("stop at the edge of the %s.",
hliquid(is_pool(x,y) ? "water" : "lava"));
#else
if (!IS_DOOR(lev_p->typ))
return FALSE;
/* all rogue level doors are doorless but disallow diagonal access, so
- we treat them as if their non-existant doors were actually present */
+ we treat them as if their non-existent doors were actually present */
if (Is_rogue_level(&u.uz))
return FALSE;
return !(lev_p->doormask & ~(D_NODOOR | D_BROKEN));
nomovemsg = msg_override;
else if (!nomovemsg)
nomovemsg = You_can_move_again;
- if (*nomovemsg)
+ if (*nomovemsg) {
pline("%s", nomovemsg);
+ /* follow "you survived that attempt on your life" with a message
+ about current form if it's not the default; primarily for
+ life-saving while turning into green slime but is also a reminder
+ if life-saved while poly'd and Unchanging (explore or wizard mode
+ declining to die since can't be both Unchanging and Lifesaved) */
+#if 0 /*JP:T*/
+ if (Upolyd && !strncmpi(nomovemsg, "You survived that ", 18))
+ You("are %s.", an(mons[u.umonnum].mname)); /* (ignore Hallu) */
+#else
+ if (Upolyd && !STRNCMP2(nomovemsg, "\82 \82È\82½\82Í\90¶\82«\82È\82ª\82ç"))
+ You("%s\82¾\81D", mons[u.umonnum].mname); /* (ignore Hallu) */
+#endif
+ }
nomovemsg = 0;
u.usleep = 0;
multi_reason = NULL;
const char *who;
int i, powercnt;
-#if 0 /*JP*/
+#if 0 /*JP:T*/
who = (Role_if(PM_WIZARD) || Role_if(PM_VALKYRIE)) ? urole.name.m
: "Elf";
#else