| 5037 | } |
| 5038 | |
| 5039 | void |
| 5040 | melt_ice(coordxy x, coordxy y, const char *msg) |
| 5041 | { |
| 5042 | struct rm *lev = &levl[x][y]; |
| 5043 | struct obj *otmp; |
| 5044 | struct monst *mtmp; |
| 5045 | |
| 5046 | if (!msg) |
| 5047 | msg = "The ice crackles and melts."; |
| 5048 | if (lev->typ == DRAWBRIDGE_UP || lev->typ == DRAWBRIDGE_DOWN) { |
| 5049 | lev->drawbridgemask &= ~DB_ICE; /* revert to DB_MOAT */ |
| 5050 | } else { /* lev->typ == ICE */ |
| 5051 | lev->typ = (lev->icedpool == ICED_POOL ? POOL : MOAT); |
| 5052 | lev->icedpool = 0; |
| 5053 | } |
| 5054 | spot_stop_timers(x, y, MELT_ICE_AWAY); /* no more ice to melt away */ |
| 5055 | if (t_at(x, y)) |
| 5056 | trap_ice_effects(x, y, TRUE); /* TRUE because ice_is_melting */ |
| 5057 | obj_ice_effects(x, y, FALSE); |
| 5058 | unearth_objs(x, y); |
| 5059 | if (Underwater) |
| 5060 | vision_recalc(1); |
| 5061 | newsym(x, y); |
| 5062 | if (cansee(x, y) || u_at(x, y)) |
| 5063 | Norep("%s", msg); |
| 5064 | if ((otmp = sobj_at(BOULDER, x, y)) != 0) { |
| 5065 | if (cansee(x, y)) |
| 5066 | pline("%s settles...", An(xname(otmp))); |
| 5067 | do { |
| 5068 | obj_extract_self(otmp); /* boulder isn't being pushed */ |
| 5069 | if (!boulder_hits_pool(otmp, x, y, FALSE)) |
| 5070 | impossible("melt_ice: no pool?"); |
| 5071 | /* try again if there's another boulder and pool didn't fill */ |
| 5072 | } while (is_pool(x, y) && (otmp = sobj_at(BOULDER, x, y)) != 0); |
| 5073 | newsym(x, y); |
| 5074 | } |
| 5075 | if (u_at(x, y)) |
| 5076 | spoteffects(TRUE); /* possibly drown, notice objects */ |
| 5077 | else if (is_pool(x, y) && (mtmp = m_at(x, y)) != 0) |
| 5078 | (void) minliquid(mtmp); |
| 5079 | } |
| 5080 | |
| 5081 | #define MIN_ICE_TIME 50 |
| 5082 | #define MAX_ICE_TIME 2000 |
no test coverage detected