diff options
author | Johanna Ploog <j-p-e-g@users.sourceforge.net> | 2009-12-15 23:45:48 +0100 |
---|---|---|
committer | Johanna Ploog <j-p-e-g@users.sourceforge.net> | 2009-12-16 00:37:57 +0100 |
commit | 4bfec609443811edfe82f02a6969942ee72f8a9d (patch) | |
tree | 04fee0d1761f5171e2e6235456d4dabdd5e2d7af /crawl-ref/source/wiz-item.cc | |
parent | cccc238366d220a2e21bb9d2321e84e4f82425fa (diff) | |
download | crawl-ref-4bfec609443811edfe82f02a6969942ee72f8a9d.tar.gz crawl-ref-4bfec609443811edfe82f02a6969942ee72f8a9d.zip |
Also handle fixed level randart books in acquirement statistics.
Diffstat (limited to 'crawl-ref/source/wiz-item.cc')
-rw-r--r-- | crawl-ref/source/wiz-item.cc | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/crawl-ref/source/wiz-item.cc b/crawl-ref/source/wiz-item.cc index c66bc4a2f3..d933581639 100644 --- a/crawl-ref/source/wiz-item.cc +++ b/crawl-ref/source/wiz-item.cc @@ -909,10 +909,18 @@ static void _debug_acquirement_stats(FILE *ostat) if (is_artefact(item)) { num_arts++; - if (type == OBJ_BOOKS && item.sub_type == BOOK_RANDART_THEME) + if (type == OBJ_BOOKS) { - const int disc1 = item.plus & 0xFF; - ego_quants[disc1]++; + if (item.sub_type == BOOK_RANDART_THEME) + { + const int disc1 = item.plus & 0xFF; + ego_quants[disc1]++; + } + else if (item.sub_type == BOOK_RANDART_LEVEL) + { + const int level = item.plus; + ego_quants[SPTYP_LAST_EXPONENT + level]++; + } } } else if (type == OBJ_ARMOUR) // Exclude artefacts when counting egos. @@ -940,7 +948,7 @@ static void _debug_acquirement_stats(FILE *ostat) } // Print acquirement base type. - fprintf(ostat, "Acquiring %s for: ", + fprintf(ostat, "Acquiring %s for:\n\n", type == OBJ_WEAPONS ? "weapons" : type == OBJ_ARMOUR ? "armour" : type == OBJ_JEWELLERY ? "jewellery" : @@ -956,8 +964,9 @@ static void _debug_acquirement_stats(FILE *ostat) if (you.religion != GOD_NO_GOD) godname += " of " + god_name(you.religion); - fprintf(ostat, "%s the %s, %s %s%s\n\n", + fprintf(ostat, "%s the %s, Level %d %s %s%s\n\n", you.your_name.c_str(), player_title().c_str(), + you.experience_level, species_name(you.species, you.experience_level).c_str(), you.class_name, godname.c_str()); @@ -1162,6 +1171,15 @@ static void _debug_acquirement_stats(FILE *ostat) 100.0 * (float) ego_quants[i] / (float) num_arts); } } + for (int i = 1; i < 9; ++i) + { + const int k = SPTYP_LAST_EXPONENT + i; + if (ego_quants[k] > 0) + { + fprintf(ostat, "%15s %d: %5.2f\n", "level", i, + 100.0 * (float) ego_quants[i] / (float) num_arts); + } + } fprintf(ostat, "\n\n"); } |