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
+13 -2
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 region.c $NHDT-Date: 1542765361 2018/11/21 01:56:01 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.42 $ */
/* 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. */
@@ -947,10 +947,16 @@ genericptr_t p2;
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) {
Your("%s sting.", makeplural(body_part(EYE)));
@@ -973,6 +979,11 @@ genericptr_t p2;
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) */