fix #H7618 - gas cloud affects underwater monsters

Stinking cloud placed near water or poison gas breathed across it
would affect and potentially kill underwater monsters.  Most swimmers
are on the surface and should be affected, but eels and other fish
shouldn't be.

This also changes minliquid() to not treat flying and levitating as
ways to survive water when on the Plane of Water.

I think goodpos() needs to be taught about that Plane (where many ways
of existing at a water location don't apply).  This doesn't do that.
This commit is contained in:
PatR
2018-11-28 17:43:53 -08:00
parent 8d1aa429ca
commit 234bf7b1b6
3 changed files with 23 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mon.c $NHDT-Date: 1543100460 2018/11/24 23:01:00 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.271 $ */
/* NetHack 3.6 mon.c $NHDT-Date: 1543455827 2018/11/29 01:43:47 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.272 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -483,13 +483,18 @@ register struct monst *mtmp;
/* [what about ceiling clingers?] */
inpool = (is_pool(mtmp->mx, mtmp->my)
&& !(is_flyer(mtmp->data) || is_floater(mtmp->data)));
&& (!(is_flyer(mtmp->data) || is_floater(mtmp->data))
/* there's no "above the surface" on the plane of water */
|| Is_waterlevel(&u.uz)));
inlava = (is_lava(mtmp->mx, mtmp->my)
&& !(is_flyer(mtmp->data) || is_floater(mtmp->data)));
infountain = IS_FOUNTAIN(levl[mtmp->mx][mtmp->my].typ);
/* Flying and levitation keeps our steed out of the liquid */
/* (but not water-walking or swimming) */
/* Flying and levitation keeps our steed out of the liquid
(but not water-walking or swimming; note: if hero is in a
water location on the Plane of Water, flight and levitating
are blocked so this (Flying || Levitation) test fails there
and steed will be subject to water effects, as intended) */
if (mtmp == u.usteed && (Flying || Levitation))
return 0;