Improve digging vs furniture messaging
When a wand of digging explosion overwrites furniture, describe it appropriately. "A pit appears in the altar" doesn't sound right.
This commit is contained in:
@@ -561,7 +561,7 @@ digactualhole(coordxy x, coordxy y, struct monst *madeby, int ttyp)
|
|||||||
{
|
{
|
||||||
struct obj *oldobjs, *newobjs;
|
struct obj *oldobjs, *newobjs;
|
||||||
register struct trap *ttmp;
|
register struct trap *ttmp;
|
||||||
char surface_type[BUFSZ];
|
const char *surface_type, *furniture = (const char *) 0;
|
||||||
struct rm *lev = &levl[x][y];
|
struct rm *lev = &levl[x][y];
|
||||||
boolean shopdoor;
|
boolean shopdoor;
|
||||||
struct monst *mtmp = m_at(x, y); /* may be madeby */
|
struct monst *mtmp = m_at(x, y); /* may be madeby */
|
||||||
@@ -569,6 +569,7 @@ digactualhole(coordxy x, coordxy y, struct monst *madeby, int ttyp)
|
|||||||
boolean madeby_obj = (madeby == BY_OBJECT);
|
boolean madeby_obj = (madeby == BY_OBJECT);
|
||||||
boolean at_u = u_at(x, y);
|
boolean at_u = u_at(x, y);
|
||||||
boolean wont_fall = Levitation || Flying;
|
boolean wont_fall = Levitation || Flying;
|
||||||
|
int old_typ;
|
||||||
|
|
||||||
if (at_u && u.utrap) {
|
if (at_u && u.utrap) {
|
||||||
if (u.utraptype == TT_BURIEDBALL)
|
if (u.utraptype == TT_BURIEDBALL)
|
||||||
@@ -586,12 +587,14 @@ digactualhole(coordxy x, coordxy y, struct monst *madeby, int ttyp)
|
|||||||
ttyp = PIT;
|
ttyp = PIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* maketrap() might change it, also, in this situation,
|
old_typ = lev->typ; /* maketrap() might change it */
|
||||||
surface() returns an inappropriate string for a grave */
|
if (IS_FURNITURE(lev->typ)) {
|
||||||
if (IS_GRAVE(lev->typ))
|
surface_type = (IS_ROOM(old_typ) && !Is_earthlevel(&u.uz)
|
||||||
Strcpy(surface_type, "grave");
|
? "floor" : "ground");
|
||||||
else
|
furniture = surface(x, y);
|
||||||
Strcpy(surface_type, surface(x, y));
|
} else {
|
||||||
|
surface_type = surface(x, y);
|
||||||
|
}
|
||||||
shopdoor = IS_DOOR(lev->typ) && *in_rooms(x, y, SHOPBASE);
|
shopdoor = IS_DOOR(lev->typ) && *in_rooms(x, y, SHOPBASE);
|
||||||
oldobjs = gl.level.objects[x][y];
|
oldobjs = gl.level.objects[x][y];
|
||||||
ttmp = maketrap(x, y, ttyp);
|
ttmp = maketrap(x, y, ttyp);
|
||||||
@@ -621,6 +624,8 @@ digactualhole(coordxy x, coordxy y, struct monst *madeby, int ttyp)
|
|||||||
} else if (cansee(x, y) && flags.verbose) {
|
} else if (cansee(x, y) && flags.verbose) {
|
||||||
pline("A pit appears in the %s.", surface_type);
|
pline("A pit appears in the %s.", surface_type);
|
||||||
}
|
}
|
||||||
|
if (furniture && cansee(x, y))
|
||||||
|
pline_The("%s falls into the pit!", furniture);
|
||||||
/* in case we're digging down while encased in solid rock
|
/* in case we're digging down while encased in solid rock
|
||||||
which is blocking levitation or flight */
|
which is blocking levitation or flight */
|
||||||
switch_terrain();
|
switch_terrain();
|
||||||
@@ -644,14 +649,16 @@ digactualhole(coordxy x, coordxy y, struct monst *madeby, int ttyp)
|
|||||||
(void) mintrap(mtmp, NO_TRAP_FLAGS);
|
(void) mintrap(mtmp, NO_TRAP_FLAGS);
|
||||||
}
|
}
|
||||||
} else { /* was TRAPDOOR now a HOLE*/
|
} else { /* was TRAPDOOR now a HOLE*/
|
||||||
|
if (madeby_u) {
|
||||||
if (madeby_u)
|
|
||||||
You("dig a hole through the %s.", surface_type);
|
You("dig a hole through the %s.", surface_type);
|
||||||
else if (!madeby_obj && canseemon(madeby))
|
} else if (!madeby_obj && canseemon(madeby)) {
|
||||||
pline("%s digs a hole through the %s.", Monnam(madeby),
|
pline("%s digs a hole through the %s.", Monnam(madeby),
|
||||||
surface_type);
|
surface_type);
|
||||||
else if (cansee(x, y) && flags.verbose)
|
} else if (cansee(x, y) && flags.verbose) {
|
||||||
pline("A hole appears in the %s.", surface_type);
|
pline("A hole appears in the %s.", surface_type);
|
||||||
|
}
|
||||||
|
if (furniture && cansee(x, y))
|
||||||
|
pline_The("%s falls through the hole!", furniture);
|
||||||
|
|
||||||
if (at_u) {
|
if (at_u) {
|
||||||
/* in case we're digging down while encased in solid rock
|
/* in case we're digging down while encased in solid rock
|
||||||
|
|||||||
Reference in New Issue
Block a user