diff --git a/include/rm.h b/include/rm.h index 59ddf1b87..14005d90a 100644 --- a/include/rm.h +++ b/include/rm.h @@ -103,9 +103,9 @@ enum levl_typ_types { */ #define IS_WALL(typ) ((typ) && (typ) <= DBWALL) #define IS_STWALL(typ) ((typ) <= DBWALL) /* STONE <= (typ) <= DBWALL */ -#define IS_ROCK(typ) ((typ) < POOL) /* absolutely nonaccessible */ +#define IS_OBSTRUCTED(typ) ((typ) < POOL) /* absolutely nonaccessible */ #define IS_DOOR(typ) ((typ) == DOOR) -#define IS_DOORJOIN(typ) (IS_ROCK(typ) || (typ) == IRONBARS) +#define IS_DOORJOIN(typ) (IS_OBSTRUCTED(typ) || (typ) == IRONBARS) #define IS_TREE(typ) \ ((typ) == TREE || (svl.level.flags.arboreal && (typ) == STONE)) #define ACCESSIBLE(typ) ((typ) >= DOOR) /* good position */ diff --git a/src/apply.c b/src/apply.c index c03a1a9cf..271a6cd18 100644 --- a/src/apply.c +++ b/src/apply.c @@ -2512,7 +2512,7 @@ figurine_location_checks(struct obj *obj, coord *cc, boolean quietly) You("cannot put the figurine there."); return FALSE; } - if (IS_ROCK(levl[x][y].typ) + if (IS_OBSTRUCTED(levl[x][y].typ) && !(passes_walls(&mons[obj->corpsenm]) && may_passwall(x, y))) { if (!quietly) You("cannot place a figurine in %s!", @@ -2829,7 +2829,7 @@ use_trap(struct obj *otmp) else if (On_stairs(u.ux, u.uy)) { stairway *stway = stairway_at(u.ux, u.uy); what = stway->isladder ? "on the ladder" : "on the stairs"; - } else if (IS_FURNITURE(levtyp) || IS_ROCK(levtyp) + } else if (IS_FURNITURE(levtyp) || IS_OBSTRUCTED(levtyp) || closed_door(u.ux, u.uy) || t_at(u.ux, u.uy)) what = "here"; else if (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)) diff --git a/src/ball.c b/src/ball.c index 1ff2cc339..c3c53c289 100644 --- a/src/ball.c +++ b/src/ball.c @@ -609,7 +609,7 @@ drag_ball(coordxy x, coordxy y, int *bc_control, (distmin(x, y, chx, chy) <= 1 \ && distmin(chx, chy, uball->ox, uball->oy) <= 1) #define IS_CHAIN_ROCK(x, y) \ - (IS_ROCK(levl[x][y].typ) \ + (IS_OBSTRUCTED(levl[x][y].typ) \ || (IS_DOOR(levl[x][y].typ) \ && (levl[x][y].doormask & (D_CLOSED | D_LOCKED)))) /* diff --git a/src/dig.c b/src/dig.c index ed0879683..bedae5cf9 100644 --- a/src/dig.c +++ b/src/dig.c @@ -56,7 +56,7 @@ mkcavepos(coordxy x, coordxy y, int dist, boolean waslit, boolean rockit) if (rockit) { struct monst *mtmp; - if (IS_ROCK(lev->typ)) + if (IS_OBSTRUCTED(lev->typ)) return; if (t_at(x, y)) return; /* don't cover the portal */ @@ -186,7 +186,7 @@ dig_typ(struct obj *otmp, coordxy x, coordxy y) ? DIGTYP_DOOR : IS_TREE(levl[x][y].typ) ? (ispick ? DIGTYP_UNDIGGABLE : DIGTYP_TREE) - : (ispick && IS_ROCK(levl[x][y].typ) + : (ispick && IS_OBSTRUCTED(levl[x][y].typ) && (!svl.level.flags.arboreal || IS_WALL(levl[x][y].typ))) ? DIGTYP_ROCK @@ -227,7 +227,7 @@ dig_check(struct monst *madeby, coordxy x, coordxy y) return DIGCHECK_FAIL_AIRLEVEL; } else if (Is_waterlevel(&u.uz)) { return DIGCHECK_FAIL_WATERLEVEL; - } else if ((IS_ROCK(levl[x][y].typ) && levl[x][y].typ != SDOOR + } else if ((IS_OBSTRUCTED(levl[x][y].typ) && levl[x][y].typ != SDOOR && (levl[x][y].wall_info & W_NONDIGGABLE) != 0)) { return DIGCHECK_FAIL_TOOHARD; } else if (ttmp && undestroyable_trap(ttmp->ttyp)) { @@ -328,7 +328,7 @@ dig(void) pline("This tree seems to be petrified."); return 0; } - if (IS_ROCK(lev->typ) && !may_dig(dpx, dpy) + if (IS_OBSTRUCTED(lev->typ) && !may_dig(dpx, dpy) && dig_typ(uwep, dpx, dpy) == DIGTYP_ROCK) { pline("This %s is too hard to %s.", is_db_wall(dpx, dpy) ? "drawbridge" : "wall", verb); @@ -561,7 +561,7 @@ dig(void) return 0; } } else if (dig_target == DIGTYP_UNDIGGABLE - || (dig_target == DIGTYP_ROCK && !IS_ROCK(lev->typ))) + || (dig_target == DIGTYP_ROCK && !IS_OBSTRUCTED(lev->typ))) return 0; /* statue or boulder got taken */ if (!gd.did_dig_msg) { @@ -913,7 +913,7 @@ dighole(boolean pit_only, boolean by_magic, coord *cc) old_typ = lev->typ; if ((ttmp && (undestroyable_trap(ttmp->ttyp) || nohole)) - || (IS_ROCK(old_typ) && old_typ != SDOOR + || (IS_OBSTRUCTED(old_typ) && old_typ != SDOOR && (lev->wall_info & W_NONDIGGABLE) != 0)) { pline_The("%s %shere is too hard to dig in.", surface(dig_x, dig_y), (dig_x != u.ux || dig_y != u.uy) ? "t" : ""); @@ -1230,7 +1230,7 @@ use_pick_axe2(struct obj *obj) (void) fire_damage(uwep, FALSE, rx, ry); } else if (IS_TREE(lev->typ)) { You("need an axe to cut down a tree."); - } else if (IS_ROCK(lev->typ)) { + } else if (IS_OBSTRUCTED(lev->typ)) { You("need a pick to dig rock."); } else if ((boulder = sobj_at(BOULDER, rx, ry)) != 0 || sobj_at(STATUE, rx, ry)) { @@ -1398,7 +1398,7 @@ watch_dig(struct monst *mtmp, coordxy x, coordxy y, boolean zap) str = "door"; else if (IS_TREE(lev->typ)) str = "tree"; - else if (IS_ROCK(lev->typ)) + else if (IS_OBSTRUCTED(lev->typ)) str = "wall"; else str = "fountain"; @@ -1452,7 +1452,7 @@ mdig_tunnel(struct monst *mtmp) newsym(mtmp->mx, mtmp->my); draft_message(FALSE); /* "You feel a draft." */ return FALSE; - } else if (!IS_ROCK(here->typ) && !IS_TREE(here->typ)) { /* no dig */ + } else if (!IS_OBSTRUCTED(here->typ) && !IS_TREE(here->typ)) { /* no dig */ return FALSE; } @@ -1709,7 +1709,7 @@ zap_dig(void) pline_The("rock glows then fades."); break; } - } else if (IS_ROCK(room->typ)) { + } else if (IS_OBSTRUCTED(room->typ)) { if (!may_dig(zx, zy)) break; if (IS_WALL(room->typ) || room->typ == SDOOR) { @@ -1727,7 +1727,7 @@ zap_dig(void) } else if (IS_TREE(room->typ)) { room->typ = ROOM, room->flags = 0; digdepth -= 2; - } else { /* IS_ROCK but not IS_WALL or SDOOR */ + } else { /* IS_OBSTRUCTED but not IS_WALL or SDOOR */ room->typ = CORR, room->flags = 0; digdepth--; } diff --git a/src/display.c b/src/display.c index fb198e97d..30eb249dd 100644 --- a/src/display.c +++ b/src/display.c @@ -783,7 +783,7 @@ feel_location(coordxy x, coordxy y) * + Room/water positions * + Everything else (hallways!) */ - if (IS_ROCK(lev->typ) + if (IS_OBSTRUCTED(lev->typ) || (IS_DOOR(lev->typ) && (lev->doormask & (D_LOCKED | D_CLOSED)))) { map_background(x, y, 1); @@ -3101,7 +3101,7 @@ check_pos(coordxy x, coordxy y, int which) if (!isok(x, y)) return which; type = levl[x][y].typ; - if (IS_ROCK(type) || type == CORR || type == SCORR) + if (IS_OBSTRUCTED(type) || type == CORR || type == SCORR) return which; return 0; } diff --git a/src/dogmove.c b/src/dogmove.c index 6e25c39c2..2c77a6487 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -1362,7 +1362,7 @@ can_reach_location( continue; if (dist2(i, j, fx, fy) >= dist) continue; - if (IS_ROCK(levl[i][j].typ) && !passes_walls(mon->data) + if (IS_OBSTRUCTED(levl[i][j].typ) && !passes_walls(mon->data) && (!may_dig(i, j) || !tunnels(mon->data) /* tunnelling monsters can't do that on the rogue level */ || Is_rogue_level(&u.uz))) diff --git a/src/dokick.c b/src/dokick.c index 6d3d82cd2..b9d25eaaf 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -612,9 +612,9 @@ really_kick_object(coordxy x, coordxy y) Norep("You kick %s.", !isgold ? singular(gk.kickedobj, doname) : doname(gk.kickedobj)); - if (IS_ROCK(levl[x][y].typ) || closed_door(x, y)) { + if (IS_OBSTRUCTED(levl[x][y].typ) || closed_door(x, y)) { if ((!martial() && rn2(20) > ACURR(A_DEX)) - || IS_ROCK(levl[u.ux][u.uy].typ) || closed_door(u.ux, u.uy)) { + || IS_OBSTRUCTED(levl[u.ux][u.uy].typ) || closed_door(u.ux, u.uy)) { if (Blind) pline("It doesn't come loose."); else @@ -805,7 +805,7 @@ kickstr(char *buf, const char *kickobjnam) what = "a tree"; else if (IS_STWALL(gm.maploc->typ)) what = "a wall"; - else if (IS_ROCK(gm.maploc->typ)) + else if (IS_OBSTRUCTED(gm.maploc->typ)) what = "a rock"; else if (IS_THRONE(gm.maploc->typ)) what = "a throne"; @@ -1360,7 +1360,7 @@ dokick(void) * reachable for bracing purposes * Possible extension: allow bracing against stuff on the side? */ - if (isok(xx, yy) && !IS_ROCK(levl[xx][yy].typ) + if (isok(xx, yy) && !IS_OBSTRUCTED(levl[xx][yy].typ) && !IS_DOOR(levl[xx][yy].typ) && (!Is_airlevel(&u.uz) || !OBJ_AT(xx, yy))) { You("have nothing to brace yourself against."); diff --git a/src/dothrow.c b/src/dothrow.c index 286e00f1c..ef61e7137 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -785,7 +785,7 @@ hurtle_step(genericptr_t arg, coordxy x, coordxy y) && (levl[x][y].doormask & D_ISOPEN) && (u.ux - x) && (u.uy - y)); - if (IS_ROCK(levl[x][y].typ) || closed_door(x, y) || odoor_diag) { + if (IS_OBSTRUCTED(levl[x][y].typ) || closed_door(x, y) || odoor_diag) { const char *s; if (odoor_diag) @@ -793,7 +793,7 @@ hurtle_step(genericptr_t arg, coordxy x, coordxy y) pline("Ouch!"); if (IS_TREE(levl[x][y].typ)) s = "bumping into a tree"; - else if (IS_ROCK(levl[x][y].typ)) + else if (IS_OBSTRUCTED(levl[x][y].typ)) s = "bumping into a wall"; else s = "bumping into a door"; diff --git a/src/hack.c b/src/hack.c index e3290da7e..de5d072ff 100644 --- a/src/hack.c +++ b/src/hack.c @@ -151,8 +151,8 @@ could_move_onto_boulder(coordxy sx, coordxy sy) /* can if a giant, unless doing so allows hero to pass into a diagonal squeeze at the same time */ if (throws_rocks(gy.youmonst.data)) - return (!u.dx || !u.dy || !(IS_ROCK(levl[u.ux][sy].typ) - && IS_ROCK(levl[sx][u.uy].typ))); + return (!u.dx || !u.dy || !(IS_OBSTRUCTED(levl[u.ux][sy].typ) + && IS_OBSTRUCTED(levl[sx][u.uy].typ))); /* can if tiny (implies carrying very little else couldn't move at all) */ if (verysmall(gy.youmonst.data)) return TRUE; @@ -427,7 +427,7 @@ moverock_core(coordxy sx, coordxy sy) pline("You're too small to push that %s.", xname(otmp)); return cannot_push(otmp, sx, sy); } - if (isok(rx, ry) && !IS_ROCK(levl[rx][ry].typ) + if (isok(rx, ry) && !IS_OBSTRUCTED(levl[rx][ry].typ) && levl[rx][ry].typ != IRONBARS && (!IS_DOOR(levl[rx][ry].typ) || !(u.dx && u.dy) || doorless_door(rx, ry)) && !sobj_at(BOULDER, rx, ry)) { @@ -632,7 +632,7 @@ still_chewing(coordxy x, coordxy y) sizeof (struct dig_info)); if (!boulder - && ((IS_ROCK(lev->typ) && !may_dig(x, y)) + && ((IS_OBSTRUCTED(lev->typ) && !may_dig(x, y)) /* may_dig() checks W_NONDIGGABLE but doesn't handle iron bars */ || (lev->typ == IRONBARS && (lev->wall_info & W_NONDIGGABLE)))) { You("hurt your teeth on the %s.", @@ -661,7 +661,7 @@ still_chewing(coordxy x, coordxy y) assign_level(&svc.context.digging.level, &u.uz); /* solid rock takes more work & time to dig through */ svc.context.digging.effort = - (IS_ROCK(lev->typ) && !IS_TREE(lev->typ) ? 30 : 60) + u.udaminc; + (IS_OBSTRUCTED(lev->typ) && !IS_TREE(lev->typ) ? 30 : 60) + u.udaminc; You("start chewing %s %s.", (boulder || IS_TREE(lev->typ) || lev->typ == IRONBARS) ? "on a" @@ -670,7 +670,7 @@ still_chewing(coordxy x, coordxy y) ? "boulder" : IS_TREE(lev->typ) ? "tree" - : IS_ROCK(lev->typ) + : IS_OBSTRUCTED(lev->typ) ? "rock" : (lev->typ == IRONBARS) ? "bar" @@ -685,7 +685,7 @@ still_chewing(coordxy x, coordxy y) ? "boulder" : IS_TREE(lev->typ) ? "tree" - : IS_ROCK(lev->typ) + : IS_OBSTRUCTED(lev->typ) ? "rock" : (lev->typ == IRONBARS) ? "bars" @@ -701,7 +701,7 @@ still_chewing(coordxy x, coordxy y) "ate for the first time, by chewing through %s", boulder ? "a boulder" : IS_TREE(lev->typ) ? "a tree" - : IS_ROCK(lev->typ) ? "rock" + : IS_OBSTRUCTED(lev->typ) ? "rock" : (lev->typ == IRONBARS) ? "iron bars" : "a door"); u.uhunger += rnd(20); @@ -717,7 +717,7 @@ still_chewing(coordxy x, coordxy y) * * [perhaps use does_block() below (from vision.c)] */ - if (IS_ROCK(lev->typ) || closed_door(x, y) + if (IS_OBSTRUCTED(lev->typ) || closed_door(x, y) || sobj_at(BOULDER, x, y)) { block_point(x, y); /* delobj will unblock the point */ /* reset dig state */ @@ -916,7 +916,7 @@ boolean bad_rock(struct permonst *mdat, coordxy x, coordxy y) { return (boolean) ((Sokoban && sobj_at(BOULDER, x, y)) - || (IS_ROCK(levl[x][y].typ) + || (IS_OBSTRUCTED(levl[x][y].typ) && (!tunnels(mdat) || needspick(mdat) || !may_dig(x, y)) && !(passes_walls(mdat) && may_passwall(x, y)))); @@ -979,7 +979,7 @@ test_move( /* * Check for physical obstacles. First, the place we are going. */ - if (IS_ROCK(tmpr->typ) || tmpr->typ == IRONBARS) { + if (IS_OBSTRUCTED(tmpr->typ) || tmpr->typ == IRONBARS) { if (Blind && mode == DO_MOVE) feel_location(x, y); if (Passes_walls && may_passwall(x, y)) { @@ -2878,7 +2878,7 @@ domove_core(void) reset_occupations(); if (svc.context.run) { if (svc.context.run < 8) - if (IS_DOOR(tmpr->typ) || IS_ROCK(tmpr->typ) + if (IS_DOOR(tmpr->typ) || IS_OBSTRUCTED(tmpr->typ) || IS_FURNITURE(tmpr->typ)) nomul(0); } @@ -3033,7 +3033,7 @@ void switch_terrain(void) { struct rm *lev = &levl[u.ux][u.uy]; - boolean blocklev = (IS_ROCK(lev->typ) || closed_door(u.ux, u.uy) + boolean blocklev = (IS_OBSTRUCTED(lev->typ) || closed_door(u.ux, u.uy) || IS_WATERWALL(lev->typ) || lev->typ == LAVAWALL), was_levitating = !!Levitation, was_flying = !!Flying; @@ -3801,7 +3801,7 @@ lookaround(void) } /* more uninteresting terrain */ - if (IS_ROCK(levl[x][y].typ) || levl[x][y].typ == ROOM + if (IS_OBSTRUCTED(levl[x][y].typ) || levl[x][y].typ == ROOM || IS_AIR(levl[x][y].typ) || levl[x][y].typ == ICE) { continue; } else if (closed_door(x, y) || (mtmp && is_door_mappear(mtmp))) { diff --git a/src/mhitm.c b/src/mhitm.c index a473fa06c..10fa8cfc8 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -818,7 +818,7 @@ engulf_target(struct monst *magr, struct monst *mdef) dy = (mdef == &gy.youmonst) ? u.uy : mdef->my; lev = &levl[dx][dy]; if (!(udef ? Passes_walls : passes_walls(mdef->data)) - && (IS_ROCK(lev->typ) || closed_door(dx, dy) || IS_TREE(lev->typ) + && (IS_OBSTRUCTED(lev->typ) || closed_door(dx, dy) || IS_TREE(lev->typ) /* not passes_bars(); engulfer isn't squeezing through */ || (lev->typ == IRONBARS && !is_whirly(magr->data)))) return FALSE; @@ -826,7 +826,7 @@ engulf_target(struct monst *magr, struct monst *mdef) ay = (magr == &gy.youmonst) ? u.uy : magr->my; lev = &levl[ax][ay]; if (!(uatk ? Passes_walls : passes_walls(magr->data)) - && (IS_ROCK(lev->typ) || closed_door(ax, ay) || IS_TREE(lev->typ) + && (IS_OBSTRUCTED(lev->typ) || closed_door(ax, ay) || IS_TREE(lev->typ) || (lev->typ == IRONBARS && !is_whirly(mdef->data)))) return FALSE; diff --git a/src/mklev.c b/src/mklev.c index 1e8a6f703..a209cf371 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -77,7 +77,7 @@ door_into_nonjoined(coordxy x, coordxy y) for (i = 0; i < 4; i++) { tx = x + xdir[dirs_ord[i]]; ty = y + ydir[dirs_ord[i]]; - if (!isok(tx, ty) || IS_ROCK(levl[tx][ty].typ)) + if (!isok(tx, ty) || IS_OBSTRUCTED(levl[tx][ty].typ)) continue; /* Is this connecting to a room that doesn't want joining? */ @@ -1621,10 +1621,10 @@ okdoor(coordxy x, coordxy y) boolean near_door = bydoor(x, y); return ((levl[x][y].typ == HWALL || levl[x][y].typ == VWALL) - && ((isok(x - 1, y) && !IS_ROCK(levl[x - 1][y].typ)) - || (isok(x + 1, y) && !IS_ROCK(levl[x + 1][y].typ)) - || (isok(x, y - 1) && !IS_ROCK(levl[x][y - 1].typ)) - || (isok(x, y + 1) && !IS_ROCK(levl[x][y + 1].typ))) + && ((isok(x - 1, y) && !IS_OBSTRUCTED(levl[x - 1][y].typ)) + || (isok(x + 1, y) && !IS_OBSTRUCTED(levl[x + 1][y].typ)) + || (isok(x, y - 1) && !IS_OBSTRUCTED(levl[x][y - 1].typ)) + || (isok(x, y + 1) && !IS_OBSTRUCTED(levl[x][y + 1].typ))) && !near_door); } diff --git a/src/mkmap.c b/src/mkmap.c index 32c6aef68..26c3d3836 100644 --- a/src/mkmap.c +++ b/src/mkmap.c @@ -345,8 +345,8 @@ finish_map( if (lit) { for (i = 1; i < COLNO; i++) for (j = 0; j < ROWNO; j++) - if ((!IS_ROCK(fg_typ) && levl[i][j].typ == fg_typ) - || (!IS_ROCK(bg_typ) && levl[i][j].typ == bg_typ) + if ((!IS_OBSTRUCTED(fg_typ) && levl[i][j].typ == fg_typ) + || (!IS_OBSTRUCTED(bg_typ) && levl[i][j].typ == bg_typ) || (bg_typ == TREE && levl[i][j].typ == bg_typ) || (walled && IS_WALL(levl[i][j].typ))) levl[i][j].lit = TRUE; diff --git a/src/mon.c b/src/mon.c index fbf3bde86..e3879d54b 100644 --- a/src/mon.c +++ b/src/mon.c @@ -2170,12 +2170,12 @@ mfndpos( if (nx == x && ny == y) continue; ntyp = levl[nx][ny].typ; - if (IS_ROCK(ntyp) + if (IS_OBSTRUCTED(ntyp) && !((flag & ALLOW_WALL) && may_passwall(nx, ny)) && !((IS_TREE(ntyp) ? treeok : rockok) && may_dig(nx, ny))) continue; /* intelligent peacefuls avoid digging shop/temple walls */ - if (IS_ROCK(ntyp) && rockok + if (IS_OBSTRUCTED(ntyp) && rockok && !mindless(mon->data) && (mon->mpeaceful || mon->mtame) && (*in_rooms(nx, ny, TEMPLE) || *in_rooms(nx, ny, SHOPBASE)) && !(*in_rooms(x, y, TEMPLE) || *in_rooms(x, y, SHOPBASE))) diff --git a/src/monmove.c b/src/monmove.c index dc343d333..7705a3e1a 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -1174,7 +1174,7 @@ holds_up_web(coordxy x, coordxy y) stairway *sway; if (!isok(x, y) - || IS_ROCK(levl[x][y].typ) + || IS_OBSTRUCTED(levl[x][y].typ) || ((levl[x][y].typ == STAIRS || levl[x][y].typ == LADDER) && (sway = stairway_at(x, y)) != 0 && sway->up) || levl[x][y].typ == IRONBARS) diff --git a/src/mthrowu.c b/src/mthrowu.c index b91d44435..455220098 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -528,7 +528,7 @@ ucatchgem( (/* missile hits edge of screen */ \ !isok(gb.bhitpos.x + dx, gb.bhitpos.y + dy) \ /* missile hits the wall */ \ - || IS_ROCK(levl[gb.bhitpos.x + dx][gb.bhitpos.y + dy].typ) \ + || IS_OBSTRUCTED(levl[gb.bhitpos.x + dx][gb.bhitpos.y + dy].typ) \ /* missile hit closed door */ \ || closed_door(gb.bhitpos.x + dx, gb.bhitpos.y + dy) \ /* missile might hit iron bars */ \ @@ -1080,7 +1080,7 @@ breamu(struct monst *mtmp, struct attack *mattk) staticfn boolean blocking_terrain(coordxy x, coordxy y) { - if (!isok(x, y) || IS_ROCK(levl[x][y].typ) || closed_door(x, y) + if (!isok(x, y) || IS_OBSTRUCTED(levl[x][y].typ) || closed_door(x, y) || is_waterwall(x, y) || levl[x][y].typ == LAVAWALL) return TRUE; return FALSE; diff --git a/src/muse.c b/src/muse.c index dd61a9432..cb2c72a2b 100644 --- a/src/muse.c +++ b/src/muse.c @@ -1840,7 +1840,7 @@ use_offensive(struct monst *mtmp) for (y = mmy - 1; y <= mmy + 1; y++) { /* Is this a suitable spot? */ if (isok(x, y) && !closed_door(x, y) - && !IS_ROCK(levl[x][y].typ) && !IS_AIR(levl[x][y].typ) + && !IS_OBSTRUCTED(levl[x][y].typ) && !IS_AIR(levl[x][y].typ) && (((x == mmx) && (y == mmy)) ? !is_blessed : !is_cursed) && (x != u.ux || y != u.uy)) { (void) drop_boulder_on_monster(x, y, confused, FALSE); diff --git a/src/pray.c b/src/pray.c index 3fa5de2b6..7a28fdc84 100644 --- a/src/pray.c +++ b/src/pray.c @@ -169,7 +169,7 @@ stuck_in_wall(void) continue; y = u.uy + j; if (!isok(x, y) - || (IS_ROCK(levl[x][y].typ) + || (IS_OBSTRUCTED(levl[x][y].typ) && (levl[x][y].typ != SDOOR && levl[x][y].typ != SCORR)) || (blocked_boulder(i, j) && !throws_rocks(gy.youmonst.data))) ++count; @@ -2633,7 +2633,7 @@ blocked_boulder(int dx, int dy) return TRUE; if (!isok(nx, ny)) return TRUE; - if (IS_ROCK(levl[nx][ny].typ)) + if (IS_OBSTRUCTED(levl[nx][ny].typ)) return TRUE; if (sobj_at(BOULDER, nx, ny)) return TRUE; diff --git a/src/read.c b/src/read.c index 1e53e5a2a..4110894ae 100644 --- a/src/read.c +++ b/src/read.c @@ -1850,7 +1850,7 @@ seffect_earth(struct obj **sobjp) for (y = u.uy - 1; y <= u.uy + 1; y++) { /* Is this a suitable spot? */ if (isok(x, y) && !closed_door(x, y) - && !IS_ROCK(levl[x][y].typ) + && !IS_OBSTRUCTED(levl[x][y].typ) && !IS_AIR(levl[x][y].typ) && (x != u.ux || y != u.uy)) { nboulders += diff --git a/src/sp_lev.c b/src/sp_lev.c index 5e7be44e7..a429ba10b 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -1291,7 +1291,7 @@ is_ok_location(coordxy x, coordxy y, getloc_flags_t humidity) if (humidity & ANY_LOC) return TRUE; - if ((humidity & SOLID) && IS_ROCK(typ)) + if ((humidity & SOLID) && IS_OBSTRUCTED(typ)) return TRUE; if ((humidity & (DRY|SPACELOC)) && SPACE_POS(typ)) { @@ -1758,7 +1758,7 @@ create_door(room_door *dd, struct mkroom *broom) y = broom->ly - 1; x = broom->lx + ((dpos == -1) ? rn2(1 + broom->hx - broom->lx) : dpos); - if (!isok(x, y - 1) || IS_ROCK(levl[x][y - 1].typ)) + if (!isok(x, y - 1) || IS_OBSTRUCTED(levl[x][y - 1].typ)) continue; break; case 1: @@ -1767,7 +1767,7 @@ create_door(room_door *dd, struct mkroom *broom) y = broom->hy + 1; x = broom->lx + ((dpos == -1) ? rn2(1 + broom->hx - broom->lx) : dpos); - if (!isok(x, y + 1) || IS_ROCK(levl[x][y + 1].typ)) + if (!isok(x, y + 1) || IS_OBSTRUCTED(levl[x][y + 1].typ)) continue; break; case 2: @@ -1776,7 +1776,7 @@ create_door(room_door *dd, struct mkroom *broom) x = broom->lx - 1; y = broom->ly + ((dpos == -1) ? rn2(1 + broom->hy - broom->ly) : dpos); - if (!isok(x - 1, y) || IS_ROCK(levl[x - 1][y].typ)) + if (!isok(x - 1, y) || IS_OBSTRUCTED(levl[x - 1][y].typ)) continue; break; case 3: @@ -1785,7 +1785,7 @@ create_door(room_door *dd, struct mkroom *broom) x = broom->hx + 1; y = broom->ly + ((dpos == -1) ? rn2(1 + broom->hy - broom->ly) : dpos); - if (!isok(x + 1, y) || IS_ROCK(levl[x + 1][y].typ)) + if (!isok(x + 1, y) || IS_OBSTRUCTED(levl[x + 1][y].typ)) continue; break; default: diff --git a/src/trap.c b/src/trap.c index b75dae7d5..91103153c 100644 --- a/src/trap.c +++ b/src/trap.c @@ -3383,7 +3383,7 @@ launch_obj( const char *bmsg = " as one boulder sets another in motion"; coordxy fx = x + dx, fy = y + dy; - if (!isok(fx, fy) || !dist || IS_ROCK(levl[fx][fy].typ)) + if (!isok(fx, fy) || !dist || IS_OBSTRUCTED(levl[fx][fy].typ)) bmsg = " as one boulder hits another"; Soundeffect(se_loud_crash, 80); diff --git a/src/uhitm.c b/src/uhitm.c index bda3557f0..e0a403ebb 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -469,7 +469,7 @@ do_attack(struct monst *mtmp) */ boolean foo = (Punished || !rn2(7) || (is_longworm(mtmp->data) && mtmp->wormno) - || (IS_ROCK(levl[u.ux][u.uy].typ) + || (IS_OBSTRUCTED(levl[u.ux][u.uy].typ) && !passes_walls(mtmp->data))), inshop = FALSE; char *p; diff --git a/src/vault.c b/src/vault.c index eca749697..44052f545 100644 --- a/src/vault.c +++ b/src/vault.c @@ -109,7 +109,7 @@ clear_fcorr(struct monst *grd, boolean forceshow) /* only give encased message if hero is still alive (might get here via paygd() -> mongone() -> grddead() when game is over; died: no message, quit: message) */ - if (IS_ROCK(levl[u.ux][u.uy].typ) && (Upolyd ? u.mh : u.uhp) > 0 + if (IS_OBSTRUCTED(levl[u.ux][u.uy].typ) && (Upolyd ? u.mh : u.uhp) > 0 && !silently) You("are encased in rock."); return TRUE; diff --git a/src/vision.c b/src/vision.c index d94c56bf4..4d4ac98cf 100644 --- a/src/vision.c +++ b/src/vision.c @@ -154,7 +154,7 @@ does_block(int x, int y, struct rm *lev) #endif /* Features that block . . */ - if (IS_ROCK(lev->typ) || lev->typ == TREE + if (IS_OBSTRUCTED(lev->typ) || lev->typ == TREE || (IS_DOOR(lev->typ) && (lev->doormask & (D_CLOSED | D_LOCKED | D_TRAPPED)))) return 1; @@ -221,7 +221,7 @@ vision_reset(void) block = TRUE; /* location (0,y) is always stone; it's !isok() */ lev = &levl[1][y]; for (x = 1; x < COLNO; x++, lev += ROWNO) - if (block != (IS_ROCK(lev->typ) || does_block(x, y, lev))) { + if (block != (IS_OBSTRUCTED(lev->typ) || does_block(x, y, lev))) { if (block) { for (i = dig_left; i < x; i++) { left_ptrs[y][i] = dig_left;