melting ice follow-up
This commit is contained in:
@@ -769,7 +769,7 @@ dighole(boolean pit_only, boolean by_magic, coord *cc)
|
|||||||
struct obj *boulder_here;
|
struct obj *boulder_here;
|
||||||
schar typ, old_typ;
|
schar typ, old_typ;
|
||||||
xchar dig_x, dig_y;
|
xchar dig_x, dig_y;
|
||||||
boolean nohole, retval = TRUE;
|
boolean nohole, retval = FALSE;
|
||||||
|
|
||||||
if (!cc) {
|
if (!cc) {
|
||||||
dig_x = u.ux;
|
dig_x = u.ux;
|
||||||
@@ -805,12 +805,12 @@ dighole(boolean pit_only, boolean by_magic, coord *cc)
|
|||||||
closed "door" where the portcullis/mechanism is located */
|
closed "door" where the portcullis/mechanism is located */
|
||||||
if (pit_only) {
|
if (pit_only) {
|
||||||
pline_The("drawbridge seems too hard to dig through.");
|
pline_The("drawbridge seems too hard to dig through.");
|
||||||
retval = FALSE;
|
|
||||||
} else {
|
} else {
|
||||||
int x = dig_x, y = dig_y;
|
int x = dig_x, y = dig_y;
|
||||||
/* if under the portcullis, the bridge is adjacent */
|
/* if under the portcullis, the bridge is adjacent */
|
||||||
(void) find_drawbridge(&x, &y);
|
(void) find_drawbridge(&x, &y);
|
||||||
destroy_drawbridge(x, y);
|
destroy_drawbridge(x, y);
|
||||||
|
retval = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if ((boulder_here = sobj_at(BOULDER, dig_x, dig_y)) != 0) {
|
} else if ((boulder_here = sobj_at(BOULDER, dig_x, dig_y)) != 0) {
|
||||||
@@ -831,6 +831,7 @@ dighole(boolean pit_only, boolean by_magic, coord *cc)
|
|||||||
} else if (IS_GRAVE(old_typ)) {
|
} else if (IS_GRAVE(old_typ)) {
|
||||||
digactualhole(dig_x, dig_y, BY_YOU, PIT);
|
digactualhole(dig_x, dig_y, BY_YOU, PIT);
|
||||||
dig_up_grave(cc);
|
dig_up_grave(cc);
|
||||||
|
retval = TRUE;
|
||||||
} else if (old_typ == DRAWBRIDGE_UP) {
|
} else if (old_typ == DRAWBRIDGE_UP) {
|
||||||
/* must be floor or ice, other cases handled above */
|
/* must be floor or ice, other cases handled above */
|
||||||
/* dig "pit" and let fluid flow in (if possible) */
|
/* dig "pit" and let fluid flow in (if possible) */
|
||||||
@@ -844,12 +845,12 @@ dighole(boolean pit_only, boolean by_magic, coord *cc)
|
|||||||
pline_The("%s %shere is too hard to dig in.",
|
pline_The("%s %shere is too hard to dig in.",
|
||||||
surface(dig_x, dig_y),
|
surface(dig_x, dig_y),
|
||||||
(dig_x != u.ux || dig_y != u.uy) ? "t" : "");
|
(dig_x != u.ux || dig_y != u.uy) ? "t" : "");
|
||||||
retval = FALSE;
|
|
||||||
} else {
|
} else {
|
||||||
lev->drawbridgemask &= ~DB_UNDER;
|
lev->drawbridgemask &= ~DB_UNDER;
|
||||||
lev->drawbridgemask |= (typ == LAVAPOOL) ? DB_LAVA : DB_MOAT;
|
lev->drawbridgemask |= (typ == LAVAPOOL) ? DB_LAVA : DB_MOAT;
|
||||||
liquid_flow(dig_x, dig_y, typ, ttmp,
|
liquid_flow(dig_x, dig_y, typ, ttmp,
|
||||||
"As you dig, the hole fills with %s!");
|
"As you dig, the hole fills with %s!");
|
||||||
|
retval = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the following two are here for the wand of digging */
|
/* the following two are here for the wand of digging */
|
||||||
@@ -869,6 +870,7 @@ dighole(boolean pit_only, boolean by_magic, coord *cc)
|
|||||||
liquid_flow(dig_x, dig_y, typ, ttmp,
|
liquid_flow(dig_x, dig_y, typ, ttmp,
|
||||||
"As you dig, the hole fills with %s!");
|
"As you dig, the hole fills with %s!");
|
||||||
}
|
}
|
||||||
|
retval = TRUE;
|
||||||
} else {
|
} else {
|
||||||
/* magical digging disarms settable traps */
|
/* magical digging disarms settable traps */
|
||||||
if (by_magic && ttmp
|
if (by_magic && ttmp
|
||||||
@@ -884,9 +886,11 @@ dighole(boolean pit_only, boolean by_magic, coord *cc)
|
|||||||
digactualhole(dig_x, dig_y, BY_YOU, PIT);
|
digactualhole(dig_x, dig_y, BY_YOU, PIT);
|
||||||
else
|
else
|
||||||
digactualhole(dig_x, dig_y, BY_YOU, HOLE);
|
digactualhole(dig_x, dig_y, BY_YOU, HOLE);
|
||||||
|
retval = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
spot_checks(dig_x, dig_y, old_typ);
|
if (retval)
|
||||||
|
spot_checks(dig_x, dig_y, old_typ);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -3441,7 +3441,8 @@ spot_checks(xchar x, xchar y, schar old_typ)
|
|||||||
db_ice_now = ((levl[x][y].drawbridgemask & DB_UNDER) == DB_ICE);
|
db_ice_now = ((levl[x][y].drawbridgemask & DB_UNDER) == DB_ICE);
|
||||||
/*FALLTHRU*/
|
/*FALLTHRU*/
|
||||||
case ICE:
|
case ICE:
|
||||||
if ((new_typ != old_typ) || !db_ice_now) {
|
if ((new_typ != old_typ)
|
||||||
|
|| (old_typ == DRAWBRIDGE_UP && !db_ice_now)) {
|
||||||
/* make sure there's no MELT_ICE_AWAY timer */
|
/* make sure there's no MELT_ICE_AWAY timer */
|
||||||
if (spot_time_left(x, y, MELT_ICE_AWAY)) {
|
if (spot_time_left(x, y, MELT_ICE_AWAY)) {
|
||||||
spot_stop_timers(x, y, MELT_ICE_AWAY);
|
spot_stop_timers(x, y, MELT_ICE_AWAY);
|
||||||
|
|||||||
Reference in New Issue
Block a user