-/* NetHack 3.6 region.c $NHDT-Date: 1496087244 2017/05/29 19:47:24 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.40 $ */
+/* NetHack 3.6 region.c $NHDT-Date: 1543455828 2018/11/29 01:43:48 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.43 $ */
/* Copyright (c) 1996 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
struct monst *mtmp =
find_mid(regions[i]->monsters[j], FM_FMON);
- if (!mtmp || mtmp->mhp <= 0
+ if (!mtmp || DEADMONSTER(mtmp)
|| (*callbacks[f_indx])(regions[i], mtmp)) {
/* The monster died, remove it from list */
k = (regions[i]->n_monst -= 1);
if (p2 == (genericptr_t) 0) { /* That means the player */
if (!Blind)
- You("bump into %s. Ouch!",
+ You("bump into %s. Ouch!",
Hallucination ? "an invisible tree"
: "some kind of invisible wall");
else
struct monst *mtmp;
int dam;
+ /*
+ * Gas clouds can't be targetted at water locations, but they can
+ * start next to water and spread over it.
+ */
+
reg = (NhRegion *) p1;
dam = reg->arg.a_int;
if (p2 == (genericptr_t) 0) { /* This means *YOU* Bozo! */
- if (u.uinvulnerable || nonliving(youmonst.data) || Breathless)
+ if (u.uinvulnerable || nonliving(youmonst.data) || Breathless
+ || Underwater)
return FALSE;
if (!Blind) {
/*JP
adult green dragon is not affected by gas cloud, baby one is */
if (!(nonliving(mtmp->data) || is_vampshifter(mtmp))
&& !breathless(mtmp->data)
+ /* not is_swimmer(); assume that non-fish are swimming on
+ the surface and breathing the air above it periodically
+ unless located at water spot on plane of water */
+ && !((mtmp->data->mlet == S_EEL || Is_waterlevel(&u.uz))
+ && is_pool(mtmp->mx, mtmp->my))
/* exclude monsters with poison gas breath attack:
adult green dragon and Chromatic Dragon (and iron golem,
but nonliving() and breathless() tests also catch that) */
if (resists_poison(mtmp))
return FALSE;
mtmp->mhp -= rnd(dam) + 5;
- if (mtmp->mhp <= 0) {
+ if (DEADMONSTER(mtmp)) {
if (heros_fault(reg))
killed(mtmp);
else
monkilled(mtmp, "gas cloud", AD_DRST);
*/
monkilled(mtmp, "\83K\83X\89_", AD_DRST);
- if (mtmp->mhp <= 0) { /* not lifesaved */
+ if (DEADMONSTER(mtmp)) { /* not lifesaved */
return TRUE;
}
}