| 2238 | } |
| 2239 | |
| 2240 | void |
| 2241 | escape_tomb(void) |
| 2242 | { |
| 2243 | debugpline0("escape_tomb"); |
| 2244 | if ((Teleportation || can_teleport(gy.youmonst.data)) |
| 2245 | && (Teleport_control || rn2(3) < Luck+2)) { |
| 2246 | You("attempt a teleport spell."); |
| 2247 | (void) dotele(FALSE); /* calls unearth_you() */ |
| 2248 | } else if (u.uburied) { /* still buried after 'port attempt */ |
| 2249 | boolean good; |
| 2250 | |
| 2251 | if (amorphous(gy.youmonst.data) || Passes_walls |
| 2252 | || noncorporeal(gy.youmonst.data) |
| 2253 | || (unsolid(gy.youmonst.data) |
| 2254 | && gy.youmonst.data != &mons[PM_WATER_ELEMENTAL]) |
| 2255 | || (tunnels(gy.youmonst.data) && !needspick(gy.youmonst.data))) { |
| 2256 | You("%s up through the %s.", |
| 2257 | (tunnels(gy.youmonst.data) && !needspick(gy.youmonst.data)) |
| 2258 | ? "try to tunnel" |
| 2259 | : (amorphous(gy.youmonst.data)) |
| 2260 | ? "ooze" |
| 2261 | : "phase", |
| 2262 | surface(u.ux, u.uy)); |
| 2263 | |
| 2264 | good = (tunnels(gy.youmonst.data) && !needspick(gy.youmonst.data)) |
| 2265 | ? dighole(TRUE, FALSE, (coord *) 0) : TRUE; |
| 2266 | if (good) |
| 2267 | unearth_you(); |
| 2268 | } |
| 2269 | } |
| 2270 | } |
| 2271 | |
| 2272 | void |
| 2273 | bury_obj(otmp) |