digging in ice

If the spot in front of a closed drawbridge was ICE, digging there
had issues....
This commit is contained in:
PatR
2024-11-27 08:41:55 -08:00
parent c1c74db90c
commit 9c0e47785a
5 changed files with 64 additions and 33 deletions

View File

@@ -48,9 +48,9 @@ dodrop(void)
*/
boolean
boulder_hits_pool(
struct obj *otmp,
coordxy rx, coordxy ry,
boolean pushing)
struct obj *otmp, /* the object falling into a pool or water or lava */
coordxy rx, coordxy ry, /* coordinates of the pool */
boolean pushing) /* for a boulder, whether or not it is being pushed */
{
if (!otmp || otmp->otyp != BOULDER) {
impossible("Not a boulder?");
@@ -138,8 +138,9 @@ boulder_hits_pool(
losehp(Maybe_Half_Phys(dmg), /* lava damage */
"molten lava", KILLED_BY);
} else if (!fills_up && flags.verbose
&& (pushing ? !Blind : cansee(rx, ry)))
&& (pushing ? !Blind : cansee(rx, ry))) {
pline("It sinks without a trace!");
}
}
/* boulder is now gone */
@@ -157,7 +158,10 @@ boulder_hits_pool(
* away.
*/
boolean
flooreffects(struct obj *obj, coordxy x, coordxy y, const char *verb)
flooreffects(
struct obj *obj, /* the object landing on the floor */
coordxy x, coordxy y, /* map coordinates for spot where it is landing */
const char *verb) /* "fall", "drop", "land", &c */
{
struct trap *t;
struct monst *mtmp;
@@ -236,12 +240,10 @@ flooreffects(struct obj *obj, coordxy x, coordxy y, const char *verb)
You_hear("a CRASH! beneath you.");
} else if (!Blind && cansee(x, y)) {
pline_The("boulder %s%s.",
(ttyp == TRAPDOOR && !tseen)
? "triggers and " : "",
(ttyp == TRAPDOOR)
? "plugs a trap door"
: (ttyp == HOLE) ? "plugs a hole"
: "fills a pit");
(ttyp == TRAPDOOR && !tseen) ? "triggers and " : "",
(ttyp == TRAPDOOR) ? "plugs a trap door"
: (ttyp == HOLE) ? "plugs a hole"
: "fills a pit");
} else {
Soundeffect(se_boulder_drop, 100);
You_hear("a boulder %s.", verb);
@@ -252,10 +254,13 @@ flooreffects(struct obj *obj, coordxy x, coordxy y, const char *verb)
* || mondied) -> mondead -> m_detach -> fill_pit.
*/
deletedwithboulder:
if ((t = t_at(x, y)) != 0)
deltrap(t);
if (u.utrap && u_at(x, y))
reset_utrap(FALSE);
/* creating a pit in ice results in that ice being turned into
floor so we shouldn't need any special ice handing here */
if ((t = t_at(x, y)) != 0) {
(void) delfloortrap(t);
if (u.utrap && u_at(x, y))
reset_utrap(FALSE);
}
useupf(obj, 1L);
bury_objs(x, y);
newsym(x, y);