return the lowest level explored in the game*/
| 1336 | |
| 1337 | /* return the lowest level explored in the game*/ |
| 1338 | xint16 |
| 1339 | deepest_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 */ |
no test coverage detected