-/* NetHack 3.6 monmove.c $NHDT-Date: 1557094802 2019/05/05 22:20:02 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.113 $ */
+/* NetHack 3.6 monmove.c $NHDT-Date: 1575245074 2019/12/02 00:04:34 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.116 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2006. */
/* 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"
pline("%s\82Í\82µ\82è\82²\82Ý\82µ\82Ä\82¢\82é\82æ\82¤\82¾\81D", Monnam(mtmp));
} else if (flees_light(mtmp)) {
if (rn2(10) || Deaf)
+#if 0 /*JP*/
pline("%s flees from the painful light of %s.",
Monnam(mtmp), bare_artifactname(uwep));
+#else
+ pline("%s\82Í%s\82Ì\8cõ\82É\82¨\82Ñ\82¦\82½\81D",
+ Monnam(mtmp), bare_artifactname(uwep));
+#endif
else
+/*JP
verbalize("Bright light!");
+*/
+ verbalize("\8bP\82\8cõ\81I");
} else
/*JP
pline("%s turns to flee.", Monnam(mtmp));
add_damage(mtmp->mx, mtmp->my, 0L);
}
} else if (levl[mtmp->mx][mtmp->my].typ == IRONBARS) {
- /* 3.6.2: was using may_dig() but it doesn't handle bars */
+ /* As of 3.6.2: was using may_dig() but it doesn't handle bars */
if (!(levl[mtmp->mx][mtmp->my].wall_info & W_NONDIGGABLE)
&& (dmgtype(ptr, AD_RUST) || dmgtype(ptr, AD_CORR))) {
if (canseemon(mtmp))
*/
boolean
undesirable_disp(mtmp, x, y)
-struct monst *mtmp;
-xchar x, y;
+struct monst *mtmp; /* barging creature */
+xchar x, y; /* spot 'mtmp' is considering moving to */
{
boolean is_pet = (mtmp && mtmp->mtame && !mtmp->isminion);
struct trap *trap = t_at(x, y);
return TRUE;
}
+ /* oversimplification: creatures that bargethrough can't swap places
+ when target monster is in rock or closed door or water (in particular,
+ avoid moving to spots where mondied() won't leave a corpse; doesn't
+ matter whether barger is capable of moving to such a target spot if
+ it were unoccupied) */
+ if (!accessible(x, y)
+ /* mondied() allows is_pool() as an exception to !accessible(),
+ but we'll only do that if 'mtmp' is already at a water location
+ so that we don't swap a water critter onto land */
+ && !(is_pool(x, y) && is_pool(mtmp->mx, mtmp->my)))
+ return TRUE;
+
return FALSE;
}