Walls of lava

Add "walls of lava", basically lava which blocks vision and
require a bit more than just levitation or flight to move through.

No levels use this yet, as testing isn't thorough enough.
This commit is contained in:
Pasi Kallinen
2023-02-06 19:23:39 +02:00
parent b85fb2a197
commit 7401b44fa1
17 changed files with 338 additions and 289 deletions

View File

@@ -65,7 +65,7 @@ is_lava(coordxy x, coordxy y)
if (!isok(x, y))
return FALSE;
ltyp = levl[x][y].typ;
if (ltyp == LAVAPOOL
if (ltyp == LAVAPOOL || ltyp == LAVAWALL
|| (ltyp == DRAWBRIDGE_UP
&& (levl[x][y].drawbridgemask & DB_UNDER) == DB_LAVA))
return TRUE;

View File

@@ -2153,6 +2153,9 @@ back_to_glyph(coordxy x, coordxy y)
case LAVAPOOL:
idx = S_lava;
break;
case LAVAWALL:
idx = S_lavawall;
break;
case ICE:
idx = S_ice;
break;
@@ -2316,6 +2319,9 @@ get_bkglyph_and_framecolor(coordxy x, coordxy y, int *bkglyph, uint32 *framecolo
case LAVAPOOL:
idx = S_lava;
break;
case LAVAWALL:
idx = S_lavawall;
break;
default:
idx = S_room;
break;
@@ -2889,6 +2895,7 @@ static const char *const type_names[MAX_TYPE] = {
"STONE", "VWALL", "HWALL", "TLCORNER", "TRCORNER", "BLCORNER", "BRCORNER",
"CROSSWALL", "TUWALL", "TDWALL", "TLWALL", "TRWALL", "DBWALL", "TREE",
"SDOOR", "SCORR", "POOL", "MOAT", "WATER", "DRAWBRIDGE_UP", "LAVAPOOL",
"LAVAWALL",
"IRON_BARS", "DOOR", "CORR", "ROOM", "STAIRS", "LADDER", "FOUNTAIN",
"THRONE", "SINK", "GRAVE", "ALTAR", "ICE", "DRAWBRIDGE_DOWN", "AIR",
"CLOUD"

View File

@@ -2931,6 +2931,7 @@ recalc_mapseen(void)
mptr->feat.water = count;
break;
case LAVAPOOL:
case LAVAWALL:
count = mptr->feat.lava + 1;
if (count <= 3)
mptr->feat.lava = count;

View File

@@ -1078,7 +1078,7 @@ test_move(
/* 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 */
&& ((IS_WATERWALL(levl[x][y].typ) || levl[x][y].typ == LAVAWALL) /* never enter wall of liquid */
/* 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
@@ -1630,6 +1630,8 @@ u_simple_floortyp(coordxy x, coordxy y)
if (is_waterwall(x, y))
return WATER; /* wall of water, fly/lev does not matter */
if (levl[x][y].typ == LAVAWALL)
return LAVAWALL; /* wall of lava, fly/lev does not matter */
if (!u_in_air) {
if (is_pool(x, y))
return POOL;
@@ -1644,7 +1646,8 @@ static boolean
swim_move_danger(coordxy x, coordxy y)
{
schar newtyp = u_simple_floortyp(x, y);
boolean liquid_wall = IS_WATERWALL(newtyp);
boolean liquid_wall = IS_WATERWALL(newtyp)
|| newtyp == LAVAWALL;
if ((newtyp != u_simple_floortyp(u.ux, u.uy))
&& !Stunned && !Confusion && levl[x][y].seenv
@@ -2164,7 +2167,7 @@ avoid_moving_on_liquid(
|| gc.context.travel)
/* and you know you won't fall in */
&& (in_air || Known_lwalking || (is_pool(x, y) && Known_wwalking))
&& !IS_WATERWALL(levl[x][y].typ)) {
&& !(IS_WATERWALL(levl[x][y].typ) || levl[x][y].typ == LAVAWALL)) {
/* XXX: should send 'is_clinger(gy.youmonst.data)' here once clinging
polyforms are allowed to move over water */
return FALSE; /* liquid is safe to traverse */
@@ -2679,7 +2682,8 @@ switch_terrain(void)
{
struct rm *lev = &levl[u.ux][u.uy];
boolean blocklev = (IS_ROCK(lev->typ) || closed_door(u.ux, u.uy)
|| IS_WATERWALL(lev->typ)),
|| IS_WATERWALL(lev->typ)
|| lev->typ == LAVAWALL),
was_levitating = !!Levitation, was_flying = !!Flying;
if (blocklev) {

View File

@@ -1012,6 +1012,9 @@ cmap_to_type(int sym)
case S_water:
typ = WATER;
break;
case S_lavawall:
typ = LAVAWALL;
break;
default:
break; /* not a cmap symbol? */
}

View File

@@ -1989,6 +1989,8 @@ mfndpos(
|| (m_at(x, ny) && m_at(nx, y) && worm_cross(x, y, nx, ny)
&& !m_at(nx, ny) && (nx != u.ux || ny != u.uy))))
continue;
if ((!lavaok || !(flag & ALLOW_WALL)) && ntyp == LAVAWALL)
continue;
if ((poolok || is_pool(nx, ny) == wantpool)
&& (lavaok || !is_lava(nx, ny))) {
int dispx, dispy;

View File

@@ -338,6 +338,7 @@ const struct {
{ '}', MOAT },
{ 'P', POOL },
{ 'L', LAVAPOOL },
{ 'Z', LAVAWALL },
{ 'I', ICE },
{ 'W', WATER },
{ 'T', TREE },

View File

@@ -3291,12 +3291,13 @@ wizterrainwish(struct _readobjnam_data *d)
madeterrain = TRUE;
/* also matches "molten lava" */
} else if (!BSTRCMPI(bp, p - 4, "lava")) {
lev->typ = LAVAPOOL;
} else if (!BSTRCMPI(bp, p - 4, "lava")
|| !BSTRCMPI(bp, p - 12, "wall of lava")) {
lev->typ = !BSTRCMPI(bp, p - 12, "wall of lava") ? LAVAWALL : LAVAPOOL;
lev->flags = 0;
del_engr_at(x, y);
pline("A pool of molten lava.");
if (!(Levitation || Flying))
if (!(Levitation || Flying) || lev->typ == LAVAWALL)
pooleffects(FALSE);
madeterrain = TRUE;
} else if (!BSTRCMPI(bp, p - 3, "ice")) {

View File

@@ -519,6 +519,9 @@ waterbody_name(coordxy x, coordxy y)
return "limitless water"; /* even if hallucinating */
Snprintf(pooltype, sizeof pooltype, "wall of %s", hliquid("water"));
return pooltype;
} else if (ltyp == LAVAWALL) {
Snprintf(pooltype, sizeof pooltype, "wall of %s", hliquid("lava"));
return pooltype;
}
/* default; should be unreachable */
return "water"; /* don't hallucinate this as some other liquid */

View File

@@ -161,6 +161,7 @@ does_block(int x, int y, struct rm *lev)
if (gs.seethru != 1) {
#endif
if (lev->typ == CLOUD || IS_WATERWALL(lev->typ)
|| lev->typ == LAVAWALL
|| (Underwater && is_moat(x, y)))
return 1;
#ifdef DEBUG

View File

@@ -3524,7 +3524,7 @@ bhit(coordxy ddx, coordxy ddy, int range, /* direction and range */
typ = levl[gb.bhitpos.x][gb.bhitpos.y].typ;
/* WATER aka "wall of water" stops items */
if (IS_WATERWALL(typ)) {
if (IS_WATERWALL(typ) || typ == LAVAWALL) {
if (weapon == THROWN_WEAPON || weapon == KICKED_WEAPON)
break;
}
@@ -4780,8 +4780,8 @@ zap_over_floor(
break; /* ZT_FIRE */
case ZT_COLD:
if (is_pool(x, y) || is_lava(x, y)) {
boolean lava = is_lava(x, y),
if (is_pool(x, y) || is_lava(x, y) || levl[x][y].typ == LAVAWALL) {
boolean lava = (is_lava(x, y) || levl[x][y].typ == LAVAWALL),
moat = is_moat(x, y);
if (IS_WATERWALL(lev->typ)) {