rename IS_ROCK() macro to IS_OBSTRUCTED()
It has included trees since they were added, so give it a more fitting name.
This commit is contained in:
+2
-2
@@ -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 */
|
||||
|
||||
+2
-2
@@ -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))
|
||||
|
||||
+1
-1
@@ -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))))
|
||||
/*
|
||||
|
||||
@@ -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--;
|
||||
}
|
||||
|
||||
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
+1
-1
@@ -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)))
|
||||
|
||||
+4
-4
@@ -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.");
|
||||
|
||||
+2
-2
@@ -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";
|
||||
|
||||
+14
-14
@@ -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))) {
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
|
||||
+5
-5
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
@@ -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)))
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
+1
-1
@@ -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 +=
|
||||
|
||||
+5
-5
@@ -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:
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user