more #802 - lava travel rather than running

Too many negations for my brain to cope with.  I've tested travel
properly this time, but not re-tested running (which shouldn't be
affected by this code).
This commit is contained in:
PatR
2022-07-04 12:28:12 -07:00
parent 7e6fc4e4ed
commit bb53addd14
2 changed files with 20 additions and 15 deletions

View File

@@ -57,8 +57,10 @@ boulder_hits_pool(
int chance = rn2(10); /* water: 90%; lava: 10% */
struct monst *mtmp;
/* chance for boulder to fill pool: Plane of Water==0%,
lava 10%, wall of water==50%, other water==90% */
fills_up = Is_waterlevel(&u.uz) ? FALSE
: (ltyp == WATER) ? (chance < 5) /* wall of water */
: IS_WATERWALL(ltyp) ? (chance < 5)
: lava ? (chance == 0) : (chance != 0);
if (fills_up) {

View File

@@ -1039,17 +1039,20 @@ test_move(
if (g.context.run == 8 && (mode != DO_MOVE) && !u_at(x, y)) {
struct trap *t = t_at(x, y);
if ((t && t->tseen && t->ttyp != VIBRATING_SQUARE)
|| ((!Levitation && !Flying
/* FIXME: should be using lastseentyp[x][y] rather than
seen vector (ditto for WATERWALL below) */
&& levl[x][y].seenv && is_pool_or_lava(x, y))
/* is_lava(ux,uy): don't move onto/over lava with known
lava-walking because it isn't completely safe, but do
continue to move over lava if already doing so */
? (is_lava(x, y) && Known_lwalking && is_lava(u.ux, u.uy))
: Known_wwalking) /* must be seen && is_pool() to get here */
|| (IS_WATERWALL(levl[x][y].typ) && levl[x][y].seenv))
if (t && t->tseen && t->ttyp != VIBRATING_SQUARE)
return (mode == TEST_TRAP);
/* FIXME: should be using lastseentyp[x][y] rather than seen vector
*/
if ((levl[x][y].seenv && is_pool_or_lava(x, y)) /* known pool/lava */
&& (IS_WATERWALL(levl[x][y].typ) /* never enter wall of water */
/* don't enter pool or lava (must be one of the two to
get here) unless flying or levitating or have known
water-walking for pool or known lava-walking and
already be on/over lava for lava */
|| !(Levitation || Flying
|| (is_pool(x, y) ? Known_wwalking
: (Known_lwalking && is_lava(u.ux, u.uy))))))
return (mode == TEST_TRAP);
}
@@ -1592,12 +1595,12 @@ u_simple_floortyp(coordxy x, coordxy y)
{
boolean u_in_air = (Levitation || Flying || !grounded(g.youmonst.data));
if (is_waterwall(x,y))
if (is_waterwall(x, y))
return WATER; /* wall of water, fly/lev does not matter */
if (!u_in_air) {
if (is_pool(x,y))
if (is_pool(x, y))
return POOL;
if (is_lava(x,y))
if (is_lava(x, y))
return LAVAPOOL;
}
return ROOM;