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

Function rank_to_xlev

src/botl.c:314–329  ·  view source on GitHub ↗

convert rank index (0..8) to experience level (1..30) */

Source from the content-addressed store, hash-verified

312
313/* convert rank index (0..8) to experience level (1..30) */
314int
315rank_to_xlev(int rank)
316{
317 /*
318 * 0 => 1..2
319 * 1 => 3..5
320 * 2 => 6..9
321 * 3 => 10..13
322 * ...
323 * 7 => 26..29
324 * 8 => 30
325 * We return the low end of each range.
326 */
327 return (rank < 1) ? 1 : (rank < 2) ? 3
328 : (rank < 8) ? ((rank * 4) - 2) : 30;
329}
330
331const char *
332rank_of(int lev, short monnum, boolean female)

Callers 3

show_achievementsFunction · 0.85
record_achievementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected