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

Function soko_allow_web

src/monmove.c:1251–1265  ·  view source on GitHub ↗

reject webs which interfere with solving Sokoban */

Source from the content-addressed store, hash-verified

1249
1250/* reject webs which interfere with solving Sokoban */
1251staticfn boolean
1252soko_allow_web(struct monst *mon)
1253{
1254 stairway *stway;
1255
1256 /* for a non-Sokoban level or a solved Sokoban level, no restriction */
1257 if (!Sokoban)
1258 return TRUE;
1259 /* not-yet-solved Sokoban level: allow web only when spinner can see
1260 the stairs up [we really want 'is in same chamber as stairs up'] */
1261 stway = stairway_find_dir(TRUE); /* stairs up */
1262 if (stway && m_cansee(mon, stway->sx, stway->sy))
1263 return TRUE;
1264 return FALSE;
1265}
1266
1267/* monster might spin a web */
1268staticfn void

Callers 1

maybe_spin_webFunction · 0.85

Calls 1

stairway_find_dirFunction · 0.85

Tested by

no test coverage detected