Make minliquid handle walls of water

This commit is contained in:
Pasi Kallinen
2022-02-23 11:30:51 +02:00
parent e0a83630e1
commit 4eaa8cd055

View File

@@ -708,6 +708,7 @@ static int
minliquid_core(struct monst* mtmp)
{
boolean inpool, inlava, infountain;
boolean waterwall = (levl[mtmp->mx][mtmp->my].typ == WATER);
/* [ceiling clingers are handled below] */
inpool = (is_pool(mtmp->mx, mtmp->my)
@@ -723,7 +724,7 @@ minliquid_core(struct monst* mtmp)
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))
if (mtmp == u.usteed && (Flying || Levitation) && !waterwall)
return 0;
/* Gremlin multiplying won't go on forever since the hit points
@@ -801,13 +802,13 @@ minliquid_core(struct monst* mtmp)
}
return 1;
}
} else if (inpool) {
} else if (inpool || waterwall) {
/* Most monsters drown in pools. flooreffects() will take care of
* water damage to dead monsters' inventory, but survivors need to
* be handled here. Swimmers are able to protect their stuff...
*/
if (!is_clinger(mtmp->data) && !is_swimmer(mtmp->data)
&& !amphibious(mtmp->data)) {
if ((waterwall || !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)) {