rolling boulder trap's boulder can be generated in lava
> On 01/30/2012 08:20 PM, <Someone> wrote: > The boulder from a rolling boulder trap can be generated on a > lava pool. mkroll_launch() in trap.c, line 1584 checks only for pools > of water.
This commit is contained in:
@@ -223,6 +223,7 @@ E boolean FDECL(paranoid_query, (BOOLEAN_P,const char *));
|
||||
|
||||
E boolean FDECL(is_pool, (int,int));
|
||||
E boolean FDECL(is_lava, (int,int));
|
||||
E boolean FDECL(is_pool_or_lava, (int,int));
|
||||
E boolean FDECL(is_ice, (int,int));
|
||||
E int FDECL(is_drawbridge_wall, (int,int));
|
||||
E boolean FDECL(is_db_wall, (int,int));
|
||||
|
||||
@@ -64,6 +64,16 @@ int x,y;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
boolean
|
||||
is_pool_or_lava(x,y)
|
||||
int x,y;
|
||||
{
|
||||
if (is_pool(x,y) || is_lava(x,y))
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
boolean
|
||||
is_ice(x,y)
|
||||
int x,y;
|
||||
|
||||
@@ -202,7 +202,7 @@ dig_check(madeby, verbose, x, y)
|
||||
} else if (madeby == BY_OBJECT &&
|
||||
/* the block against existing traps is mainly to
|
||||
prevent broken wands from turning holes into pits */
|
||||
(ttmp || is_pool(x,y) || is_lava(x,y))) {
|
||||
(ttmp || is_pool_or_lava(x,y))) {
|
||||
/* digging by player handles pools separately */
|
||||
return FALSE;
|
||||
}
|
||||
@@ -747,7 +747,7 @@ coord *cc;
|
||||
surface(dig_x,dig_y),
|
||||
(dig_x != u.ux || dig_y != u.uy) ? "t" : "");
|
||||
|
||||
} else if (is_pool(dig_x, dig_y) || is_lava(dig_x, dig_y)) {
|
||||
} else if (is_pool_or_lava(dig_x, dig_y)) {
|
||||
pline_The("%s sloshes furiously for a moment, then subsides.",
|
||||
is_lava(dig_x, dig_y) ? "lava" : "water");
|
||||
wake_nearby(); /* splashing */
|
||||
@@ -1117,7 +1117,7 @@ struct obj *obj;
|
||||
You("swing %s through thin air.", yobjnam(obj, (char *)0));
|
||||
} else if (!can_reach_floor(FALSE)) {
|
||||
cant_reach_floor(u.ux, u.uy, FALSE, FALSE);
|
||||
} else if (is_pool(u.ux, u.uy) || is_lava(u.ux, u.uy)) {
|
||||
} else if (is_pool_or_lava(u.ux, u.uy)) {
|
||||
/* Monsters which swim also happen not to be able to dig */
|
||||
You("cannot stay under%s long enough.",
|
||||
is_pool(u.ux, u.uy) ? "water" : " the lava");
|
||||
|
||||
2
src/do.c
2
src/do.c
@@ -53,7 +53,7 @@ boolean pushing;
|
||||
{
|
||||
if (!otmp || otmp->otyp != BOULDER)
|
||||
impossible("Not a boulder?");
|
||||
else if (!Is_waterlevel(&u.uz) && (is_pool(rx,ry) || is_lava(rx,ry))) {
|
||||
else if (!Is_waterlevel(&u.uz) && 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;
|
||||
|
||||
@@ -2846,7 +2846,7 @@ floorfood(verb,corpsecheck) /* get food from floor or pack */
|
||||
#ifdef STEED
|
||||
(feeding && u.usteed) || /* can't eat off floor while riding */
|
||||
#endif
|
||||
((is_pool(u.ux, u.uy) || is_lava(u.ux, u.uy)) &&
|
||||
(is_pool_or_lava(u.ux, u.uy) &&
|
||||
(Wwalking || is_clinger(youmonst.data) ||
|
||||
(Flying && !Breathless))))
|
||||
goto skipfloor;
|
||||
|
||||
@@ -725,7 +725,7 @@ int mode;
|
||||
if ((t && t->tseen) ||
|
||||
(!Levitation && !Flying &&
|
||||
!is_clinger(youmonst.data) &&
|
||||
(is_pool(x, y) || is_lava(x, y)) && levl[x][y].seenv))
|
||||
is_pool_or_lava(x, y) && levl[x][y].seenv))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1222,7 +1222,7 @@ domove()
|
||||
if (((trap = t_at(x, y)) && trap->tseen) ||
|
||||
(Blind && !Levitation && !Flying &&
|
||||
!is_clinger(youmonst.data) &&
|
||||
(is_pool(x, y) || is_lava(x, y)) && levl[x][y].seenv)) {
|
||||
is_pool_or_lava(x, y) && levl[x][y].seenv)) {
|
||||
if(context.run >= 2) {
|
||||
nomul(0);
|
||||
context.move = 0;
|
||||
@@ -1718,7 +1718,7 @@ boolean newspot; /* true if called by spoteffects */
|
||||
|
||||
/* check for entering water or lava */
|
||||
if (!u.ustuck && !Levitation && !Flying &&
|
||||
(is_pool(u.ux, u.uy) || is_lava(u.ux, u.uy))) {
|
||||
is_pool_or_lava(u.ux, u.uy)) {
|
||||
#ifdef STEED
|
||||
if (u.usteed && (is_flyer(u.usteed->data) ||
|
||||
is_floater(u.usteed->data) || is_clinger(u.usteed->data))) {
|
||||
@@ -2309,7 +2309,7 @@ bcorr:
|
||||
if(context.run == 1) goto bcorr; /* if you must */
|
||||
if(x == u.ux+u.dx && y == u.uy+u.dy) goto stop;
|
||||
continue;
|
||||
} else if (is_pool(x,y) || is_lava(x,y)) {
|
||||
} else if (is_pool_or_lava(x,y)) {
|
||||
/* water and lava only stop you if directly in front, and stop
|
||||
* you even if you are running
|
||||
*/
|
||||
|
||||
@@ -199,8 +199,7 @@ const char *fmt, *arg;
|
||||
}
|
||||
check_strangling(TRUE);
|
||||
|
||||
if(!Levitation && !u.ustuck &&
|
||||
(is_pool(u.ux,u.uy) || is_lava(u.ux,u.uy)))
|
||||
if(!Levitation && !u.ustuck && is_pool_or_lava(u.ux,u.uy))
|
||||
spoteffects(TRUE);
|
||||
|
||||
see_monsters();
|
||||
@@ -746,7 +745,7 @@ int mntmp;
|
||||
}
|
||||
find_ac();
|
||||
if((!Levitation && !u.ustuck && !Flying &&
|
||||
(is_pool(u.ux,u.uy) || is_lava(u.ux,u.uy))) ||
|
||||
is_pool_or_lava(u.ux,u.uy)) ||
|
||||
(Underwater && !Swimming))
|
||||
spoteffects(TRUE);
|
||||
if (Passes_walls && u.utrap &&
|
||||
|
||||
@@ -1843,7 +1843,7 @@ long ocount;
|
||||
cc.x = x; cc.y = y;
|
||||
/* Prevent boulder from being placed on water */
|
||||
if (ttmp->ttyp == ROLLING_BOULDER_TRAP
|
||||
&& is_pool(x+distance*dx,y+distance*dy))
|
||||
&& is_pool_or_lava(x+distance*dx,y+distance*dy))
|
||||
success = FALSE;
|
||||
else success = isclearpath(&cc, distance, dx, dy);
|
||||
if (ttmp->ttyp == ROLLING_BOULDER_TRAP) {
|
||||
|
||||
Reference in New Issue
Block a user