boulder sanity check

From entrez, pushing a boulder into the water on Plane of Water
resulted in a sanity check warning about a boulder at water location
(every turn until bubble movement eventually pushed it back out of
the water).  Make boulders in that situation always fail to plug the
water and vanish rather not attempt to plug and remain intact.

This also changes the chance to plugging water from 90% to 50% when
dealing with a wall of water somewhere other than Plane of Water.
This commit is contained in:
PatR
2022-07-02 11:54:31 -07:00
parent 75c5f3713f
commit 896686e860
2 changed files with 14 additions and 6 deletions

View File

@@ -1282,6 +1282,7 @@ save files created with SCORE_ON_BOTL disabled were erroneously being rejected
if the program was rebuilt with it enabled and vice versa
avoid "It suddenly appears!" if a monster with the STRAT_APPEARMSG attribute
is seen to teleport away then not seen at its destination
avoid boulder-on/in-water sanity_check warnings on the Plane of Water
curses: 'msg_window' option wasn't functional for curses unless the binary
also included tty support

View File

@@ -43,18 +43,23 @@ dodrop(void)
* it's gone for good... If the destination is not a pool, returns FALSE.
*/
boolean
boulder_hits_pool(struct obj *otmp, coordxy rx, coordxy ry, boolean pushing)
boulder_hits_pool(
struct obj *otmp,
coordxy rx, coordxy ry,
boolean pushing)
{
if (!otmp || otmp->otyp != BOULDER) {
impossible("Not a boulder?");
} else if (!Is_waterlevel(&u.uz) && is_pool_or_lava(rx, ry)) {
} else if (is_pool_or_lava(rx, ry)) {
boolean lava = is_lava(rx, ry), fills_up;
const char *what = waterbody_name(rx, ry);
schar ltyp = levl[rx][ry].typ;
int chance = rn2(10); /* water: 90%; lava: 10% */
struct monst *mtmp;
fills_up = lava ? chance == 0 : chance != 0;
fills_up = Is_waterlevel(&u.uz) ? FALSE
: (ltyp == WATER) ? (chance < 5) /* wall of water */
: lava ? (chance == 0) : (chance != 0);
if (fills_up) {
struct trap *ttmp = t_at(rx, ry);
@@ -62,9 +67,9 @@ boulder_hits_pool(struct obj *otmp, coordxy rx, coordxy ry, boolean pushing)
if (ltyp == DRAWBRIDGE_UP) {
levl[rx][ry].drawbridgemask &= ~DB_UNDER; /* clear lava */
levl[rx][ry].drawbridgemask |= DB_FLOOR;
} else
} else {
levl[rx][ry].typ = ROOM, levl[rx][ry].flags = 0;
}
/* 3.7: normally DEADMONSTER() is used when traversing the fmon
list--dead monsters usually aren't still at specific map
locations; however, if ice melts causing a giant to drown,
@@ -100,8 +105,9 @@ boulder_hits_pool(struct obj *otmp, coordxy rx, coordxy ry, boolean pushing)
There("is a large splash as %s %s the %s.",
the(xname(otmp)), fills_up ? "fills" : "falls into",
what);
} else if (!Deaf)
} else if (!Deaf) {
You_hear("a%s splash.", lava ? " sizzling" : "");
}
wake_nearto(rx, ry, 40);
}
@@ -112,6 +118,7 @@ boulder_hits_pool(struct obj *otmp, coordxy rx, coordxy ry, boolean pushing)
You("find yourself on dry land again!");
} else if (lava && next2u(rx, ry)) {
int dmg;
You("are hit by molten %s%c",
hliquid("lava"), Fire_resistance ? '.' : '!');
burn_away_slime();