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

Function deepest_lev_reached

src/dungeon.c:1338–1371  ·  view source on GitHub ↗

return the lowest level explored in the game*/

Source from the content-addressed store, hash-verified

1336
1337/* return the lowest level explored in the game*/
1338xint16
1339deepest_lev_reached(boolean noquest)
1340{
1341 /* this function is used for three purposes: to provide a factor
1342 * of difficulty in monster generation; to provide a factor of
1343 * difficulty in experience calculations (botl.c and end.c); and
1344 * to insert the deepest level reached in the game in the topten
1345 * display. the 'noquest' arg switch is required for the latter.
1346 *
1347 * from the player's point of view, going into the Quest is _not_
1348 * going deeper into the dungeon -- it is going back "home", where
1349 * the dungeon starts at level 1. given the setup in dungeon.def,
1350 * the depth of the Quest (thought of as starting at level 1) is
1351 * never lower than the level of entry into the Quest, so we exclude
1352 * the Quest from the topten "deepest level reached" display
1353 * calculation. _However_ the Quest is a difficult dungeon, so we
1354 * include it in the factor of difficulty calculations.
1355 */
1356 int i;
1357 d_level tmp;
1358 xint16 ret = 0;
1359
1360 for (i = 0; i < svn.n_dgns; i++) {
1361 if (noquest && i == quest_dnum)
1362 continue;
1363 tmp.dlevel = svd.dungeons[i].dunlev_ureached;
1364 if (tmp.dlevel == 0)
1365 continue;
1366 tmp.dnum = i;
1367 if (depth(&tmp) > ret)
1368 ret = depth(&tmp);
1369 }
1370 return ret;
1371}
1372
1373/* return a bookkeeping level number for purpose of comparisons and
1374 save/restore */

Callers 4

really_doneFunction · 0.85
toptenFunction · 0.85
level_difficultyFunction · 0.85
botl_scoreFunction · 0.85

Calls 1

depthFunction · 0.85

Tested by

no test coverage detected