MCPcopy Create free account
hub / github.com/NetHack/NetHack / escape_tomb

Function escape_tomb

src/dig.c:2240–2270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2238}
2239
2240void
2241escape_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
2272void
2273bury_obj(otmp)

Callers

nothing calls this directly

Calls 6

rn2Function · 0.85
YouFunction · 0.85
doteleFunction · 0.85
surfaceFunction · 0.85
digholeFunction · 0.85
unearth_youFunction · 0.85

Tested by

no test coverage detected