summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/wiz-item.cc
diff options
context:
space:
mode:
authorJohanna Ploog <j-p-e-g@users.sourceforge.net>2009-12-15 22:05:51 +0100
committerJohanna Ploog <j-p-e-g@users.sourceforge.net>2009-12-16 00:37:56 +0100
commit499f07fc517ae167f5a230a398568def9622e3e3 (patch)
treeb0b0c0f94a600c2facc994fa42c22c5354b35835 /crawl-ref/source/wiz-item.cc
parent381bd5c28bb04dacd4fe2f7e8c51a0bdebbdcc8a (diff)
downloadcrawl-ref-499f07fc517ae167f5a230a398568def9622e3e3.tar.gz
crawl-ref-499f07fc517ae167f5a230a398568def9622e3e3.zip
Count primary disciplines in themed randart book acquirement statistics.
Diffstat (limited to 'crawl-ref/source/wiz-item.cc')
-rw-r--r--crawl-ref/source/wiz-item.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/crawl-ref/source/wiz-item.cc b/crawl-ref/source/wiz-item.cc
index a3fdb7a2e4..75bbd4cf32 100644
--- a/crawl-ref/source/wiz-item.cc
+++ b/crawl-ref/source/wiz-item.cc
@@ -32,6 +32,7 @@
#include "religion.h"
#include "skills2.h"
#include "spl-book.h"
+#include "spl-util.h"
#include "stash.h"
#include "stuff.h"
#include "terrain.h"
@@ -905,7 +906,14 @@ static void _debug_acquirement_stats(FILE *ostat)
total_plus += item.plus + item.plus2;
if (is_artefact(item))
+ {
num_arts++;
+ if (type == OBJ_BOOKS && item.sub_type == BOOK_RANDART_THEME)
+ {
+ const int disc1 = item.plus & 0xFF;
+ ego_quants[disc1]++;
+ }
+ }
else if (type == OBJ_ARMOUR) // Exclude artefacts when counting egos.
ego_quants[get_armour_ego_type(item)]++;
@@ -945,6 +953,9 @@ static void _debug_acquirement_stats(FILE *ostat)
fprintf(ostat, "%5.2f%% artefacts.\n",
100.0 * (float) num_arts / (float) acq_calls);
+ // TODO: For spellbooks, for each spell discipline list the number of
+ // known spells and castable seen/unseen spells
+
if (type == OBJ_WEAPONS)
{
fprintf(ostat, "Maximum combined pluses: %d\n", max_plus);
@@ -1029,6 +1040,33 @@ static void _debug_acquirement_stats(FILE *ostat)
else if (type == OBJ_BOOKS)
{
// TODO: Count themed books' main spell school.
+ fprintf(ostat, "Primary disciplines of themed randart books:\n");
+
+ const char* names[] = {
+ "conjuration",
+ "enchantment",
+ "fire magic",
+ "ice magic",
+ "transmutation",
+ "necromancy",
+ "summoning",
+ "divination",
+ "translocation",
+ "poison magic",
+ "earth magic",
+ "air magic",
+ "holy magic"
+ };
+
+ for (int i = 0; i < SPTYP_LAST_EXPONENT; ++i)
+ {
+ if (ego_quants[i] > 0)
+ {
+ fprintf(ostat, "%17s: %5.2f\n", names[i],
+ 100.0 * (float) ego_quants[i] / (float) num_arts);
+ }
+ }
+ fprintf(ostat, "\n\n");
}
item_def item;