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

Function region_danger

src/region.c:1340–1363  ·  view source on GitHub ↗

for checking troubles during prayer; is hero at risk? */

Source from the content-addressed store, hash-verified

1338
1339/* for checking troubles during prayer; is hero at risk? */
1340boolean
1341region_danger(void)
1342{
1343 int i, f_indx, n = 0;
1344
1345 for (i = 0; i < svn.n_regions; i++) {
1346 /* only care about regions that hero is in */
1347 if (!hero_inside(gr.regions[i]))
1348 continue;
1349 f_indx = gr.regions[i]->inside_f;
1350 /* the only type of region we understand is gas_cloud */
1351 if (f_indx == INSIDE_GAS_CLOUD) {
1352 /* completely harmless if you don't need to breathe */
1353 if (nonliving(gy.youmonst.data) || Breathless)
1354 continue;
1355 /* minor inconvenience if you're poison resistant;
1356 not harmful enough to be a prayer-level trouble */
1357 if (Poison_resistance)
1358 continue;
1359 ++n;
1360 }
1361 }
1362 return n ? TRUE : FALSE;
1363}
1364
1365/* for fixing trouble at end of prayer;
1366 danger detected at start of prayer might have expired by now */

Callers 6

Amulet_onFunction · 0.85
Amulet_offFunction · 0.85
region_safetyFunction · 0.85
region_dialogueFunction · 0.85
nh_timeoutFunction · 0.85
in_troubleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected