-/* NetHack 3.6 mon.c $NHDT-Date: 1545259929 2018/12/19 22:52:09 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.275 $ */
+/* NetHack 3.6 mon.c $NHDT-Date: 1545430257 2018/12/21 22:10:57 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.276 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
* themselves --ALI
*/
if (!is_clinger(mtmp->data) && !likes_lava(mtmp->data)) {
+ /* not fair...? hero doesn't automatically teleport away
+ from lava, just from water */
+ if (can_teleport(mtmp->data) && !tele_restrict(mtmp)) {
+ if (rloc(mtmp, TRUE))
+ return 0;
+ }
if (!resists_fire(mtmp)) {
if (cansee(mtmp->mx, mtmp->my)) {
struct attack *dummy = &mtmp->data->mattk[0];
: !strcmp(how, "melting") ? "melts away"
: "burns to a crisp");
}
- mondead(mtmp);
+ /* unlike fire -> melt ice -> pool, there's no way for the
+ hero to create lava beneath a monster, so the !mon_moving
+ case is not expected to happen (and we haven't made a
+ player-against-monster variation of the message above) */
+ if (context.mon_moving)
+ mondead(mtmp);
+ else
+ xkilled(mtmp, XKILL_NOMSG);
} else {
mtmp->mhp -= 1;
if (DEADMONSTER(mtmp)) {
*/
if (!is_clinger(mtmp->data) && !is_swimmer(mtmp->data)
&& !amphibious(mtmp->data)) {
+ /* like hero with teleport intrinsic or spell, teleport away
+ if possible */
+ if (can_teleport(mtmp->data) && !tele_restrict(mtmp)) {
+ if (rloc(mtmp, TRUE))
+ return 0;
+ }
if (cansee(mtmp->mx, mtmp->my)) {
- pline("%s drowns.", Monnam(mtmp));
+ if (context.mon_moving)
+ pline("%s drowns.", Monnam(mtmp));
+ else
+ /* hero used fire to melt ice that monster was on */
+ You("drown %s.", mon_nam(mtmp));
}
if (u.ustuck && u.uswallow && u.ustuck == mtmp) {
/* This can happen after a purple worm plucks you off a
- flying steed while you are over water. */
+ flying steed while you are over water. */
pline("%s sinks as %s rushes in and flushes you out.",
Monnam(mtmp), hliquid("water"));
}
- mondead(mtmp);
+ if (context.mon_moving)
+ mondead(mtmp);
+ else
+ xkilled(mtmp, XKILL_NOMSG);
if (!DEADMONSTER(mtmp)) {
water_damage_chain(mtmp->minvent, FALSE);
(void) rloc(mtmp, FALSE);
-/* NetHack 3.6 zap.c $NHDT-Date: 1544442714 2018/12/10 11:51:54 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.302 $ */
+/* NetHack 3.6 zap.c $NHDT-Date: 1545431660 2018/12/21 22:34:20 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.303 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
/* hit() and miss() need bhitpos to match the target */
bhitpos.x = sx, bhitpos.y = sy;
/* Fireballs only damage when they explode */
- if (type != ZT_SPELL(ZT_FIRE))
+ if (type != ZT_SPELL(ZT_FIRE)) {
range += zap_over_floor(sx, sy, type, &shopdamage, 0);
+ /* zap with fire -> melt ice -> drown monster, so monster
+ found and cached above might not be here any more */
+ mon = m_at(sx, sy);
+ }
if (mon) {
if (type == ZT_SPELL(ZT_FIRE))
{
struct rm *lev = &levl[x][y];
struct obj *otmp;
+ struct monst *mtmp;
if (!msg)
msg = "The ice crackles and melts.";
}
if (x == u.ux && y == u.uy)
spoteffects(TRUE); /* possibly drown, notice objects */
+ else if (is_pool(x, y) && (mtmp = m_at(x, y)) != 0)
+ (void) minliquid(mtmp);
}
#define MIN_ICE_TIME 50
{
xchar x, y;
long where = arg->a_long;
+ boolean save_mon_moving = context.mon_moving; /* will be False */
+ /* melt_ice -> minliquid -> mondead|xkilled shouldn't credit/blame hero */
+ context.mon_moving = TRUE; /* hero isn't causing this ice to melt */
y = (xchar) (where & 0xFFFF);
x = (xchar) ((where >> 16) & 0xFFFF);
/* melt_ice does newsym when appropriate */
melt_ice(x, y, "Some ice melts away.");
+ context.mon_moving = save_mon_moving;
}
/* Burn floor scrolls, evaporate pools, etc... in a single square.