E void FDECL(b_trapped, (const char *,int));
E boolean NDECL(unconscious);
E boolean NDECL(lava_effects);
+E void FDECL(blow_up_landmine, (struct trap *));
E int FDECL(launch_obj,(SHORT_P,int,int,int,int,int));
/* ### u_init.c ### */
pline("%s breaks apart.",The(xname(otmp)));
fracture_rock(otmp);
place_object(otmp, sx, sy); /* put fragments on floor */
+ if ((otmp = sobj_at(BOULDER, sx, sy)) != 0) {
+ /* another boulder here, restack it to the top */
+ obj_extract_self(otmp);
+ place_object(otmp, sx, sy);
+ }
} else {
struct trap *trap;
ttmp->madeby_u ? "your" : "a");
obj_extract_self(otmp);
place_object(otmp, rx, ry);
- deltrap(ttmp);
- del_engr_at(rx,ry);
- scatter(rx,ry, 4,
- MAY_DESTROY|MAY_HIT|MAY_FRACTURE|VIS_EFFECTS,
- (struct obj *)0);
+ blow_up_landmine(ttmp);
+ /* if the boulder remains, it should fill the pit */
+ fill_pit(u.ux, u.uy);
if (cansee(rx,ry)) newsym(rx,ry);
continue;
}
STATIC_DCL int FDECL(mkroll_launch,
(struct trap *,XCHAR_P,XCHAR_P,SHORT_P,long));
STATIC_DCL boolean FDECL(isclearpath,(coord *, int, SCHAR_P, SCHAR_P));
-STATIC_DCL void FDECL(blow_up_landmine, (struct trap *));
#ifdef STEED
STATIC_OVL int FDECL(steedintrap, (struct trap *, struct obj *));
#endif
losehp(rnd(16), "land mine", KILLED_BY_AN);
/* fall recursively into the pit... */
if ((trap = t_at(u.ux, u.uy)) != 0) dotrap(trap, 0);
+ fill_pit(u.ux, u.uy);
break;
case ROLLING_BOULDER_TRAP:
#endif /*STEED*/
/* some actions common to both player and monsters for triggered landmine */
-STATIC_OVL void
+void
blow_up_landmine(trap)
struct trap *trap;
{
wake_nearto(trap->tx, trap->ty, 400);
if (IS_DOOR(levl[trap->tx][trap->ty].typ))
levl[trap->tx][trap->ty].doormask = D_BROKEN;
- /* TODO: destroy drawbridge if present;
- sometimes delete trap instead of always leaving a pit */
+ /* TODO: destroy drawbridge if present */
+ /* caller may subsequently fill pit, e.g. with a boulder */
trap->ttyp = PIT; /* explosion creates a pit */
trap->madeby_u = FALSE; /* resulting pit isn't yours */
}
/* monsters recursively fall into new pit */
if (mintrap(mtmp) == 2) trapkilled=TRUE;
}
+ /* a boulder may fill the new pit, crushing monster */
+ fill_pit(trap->tx, trap->ty);
+ if (mtmp->mhp <= 0) trapkilled = TRUE;
if (unconscious()) {
multi = -1;
nomovemsg="The explosion awakens you!";
* obj->spe into account.
*/
if(!strike) {
- if (cansee(mon->mx, mon->my))
- pline("%s is almost hit by %s!", Monnam(mon),
- doname(obj));
+ if (obj && cansee(mon->mx, mon->my))
+ pline("%s is almost hit by %s!", Monnam(mon), doname(obj));
} else {
int dam = 1;