E struct obj *FDECL(buried_ball, (coord *));
E void NDECL(buried_ball_to_punishment);
E void NDECL(buried_ball_to_freedom);
+E schar FDECL(fillholetyp, (int, int));
+E void FDECL(liquid_flow, (XCHAR_P,XCHAR_P,SCHAR_P,struct trap *, const char *));
#if 0
E void FDECL(bury_monst, (struct monst *));
E void NDECL(bury_you);
int dmg, damage;
boolean affects_objects;
boolean shop_damage = FALSE;
+ boolean fillmsg = FALSE;
int expltype = EXPL_MAGICAL;
char confirm[QBUFSZ], the_wand[BUFSZ], buf[BUFSZ];
if (!isok(x,y)) continue;
if (obj->otyp == WAN_DIGGING) {
+ schar typ;
if(dig_check(BY_OBJECT, FALSE, x, y)) {
if (IS_WALL(levl[x][y].typ) || IS_DOOR(levl[x][y].typ)) {
/* normally, pits and holes don't anger guards, but they
* do if it's a wall or door that's being dug */
watch_dig((struct monst *)0, x, y, TRUE);
if (*in_rooms(x,y,SHOPBASE)) shop_damage = TRUE;
- }
- digactualhole(x, y, BY_OBJECT,
+ }
+ typ = fillholetyp(x,y);
+ if (typ != ROOM) {
+ levl[x][y].typ = typ;
+ liquid_flow(x, y, typ, t_at(x,y),
+ fillmsg ? (char *)0 :
+ "Some holes are quickly filled with %s!");
+ fillmsg = TRUE;
+ } else
+ digactualhole(x, y, BY_OBJECT,
(rn2(obj->spe) < 3 || !Can_dig_down(&u.uz)) ?
PIT : HOLE);
}
STATIC_DCL void FDECL(mkcavearea, (BOOLEAN_P));
STATIC_DCL int FDECL(dig_typ, (struct obj *,XCHAR_P,XCHAR_P));
STATIC_DCL int NDECL(dig);
-STATIC_DCL schar FDECL(fillholetyp, (int, int));
STATIC_DCL void NDECL(dig_up_grave);
/* Indices returned by dig_typ() */
}
/* Return typ of liquid to fill a hole with, or ROOM, if no liquid nearby */
-STATIC_OVL
schar
fillholetyp(x,y)
int x, y;
}
}
+/*
+ * Called from dighole(), but also from do_break_wand()
+ * in apply.c.
+ */
+void
+liquid_flow(x, y, typ, ttmp, fillmsg)
+xchar x,y;
+schar typ;
+struct trap *ttmp;
+const char *fillmsg;
+{
+ boolean u_spot = (x == u.ux && y == u.uy);
+
+ if (ttmp) (void) delfloortrap(ttmp);
+ /* if any objects were frozen here, they're released now */
+ unearth_objs(x, y);
+
+ if (fillmsg) pline(fillmsg, typ == LAVAPOOL ? "lava" : "water");
+ if (u_spot && !(Levitation || Flying)) {
+ if (typ == LAVAPOOL)
+ (void) lava_effects();
+ else if (!Wwalking)
+ (void) drown();
+ }
+}
+
/* return TRUE if digging succeeded, FALSE otherwise */
boolean
dighole(pit_only)
lev->drawbridgemask &= ~DB_UNDER;
lev->drawbridgemask |= (typ == LAVAPOOL) ? DB_LAVA : DB_MOAT;
-
- liquid_flow:
- if (ttmp) (void) delfloortrap(ttmp);
- /* if any objects were frozen here, they're released now */
- unearth_objs(u.ux, u.uy);
-
- pline("As you dig, the hole fills with %s!",
- typ == LAVAPOOL ? "lava" : "water");
- if (!Levitation && !Flying) {
- if (typ == LAVAPOOL)
- (void) lava_effects();
- else if (!Wwalking)
- (void) drown();
- }
+ liquid_flow(u.ux, u.uy, typ, ttmp,
+ "As you dig, the hole fills with %s!");
return TRUE;
/* the following two are here for the wand of digging */
if (typ != ROOM) {
lev->typ = typ;
- goto liquid_flow;
+ liquid_flow(u.ux, u.uy, typ, ttmp,
+ "As you dig, the hole fills with %s!");
+ return TRUE;
}
/* finally we get to make a hole */