summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-14 04:42:59 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-14 04:42:59 +0000
commitb83cbbcaed12c8df8422b0fda6465189757ce1c9 (patch)
tree478cf974880cda69e8e1ba40fed3919e8fad0303
parent92decbef354a4d0ccb93285a8ee52288d9e254ef (diff)
downloadcrawl-ref-b83cbbcaed12c8df8422b0fda6465189757ce1c9.tar.gz
crawl-ref-b83cbbcaed12c8df8422b0fda6465189757ce1c9.zip
When generating stats on acquirement items, note the percent of artefacts
created, and for weapons/armour the frequency of the various brands/egos. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8448 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/debug.cc83
1 files changed, 83 insertions, 0 deletions
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index 3af02954bc..e3c37053cb 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -2646,9 +2646,13 @@ static void _debug_acquirement_stats(FILE *ostat)
int total_quant = 0;
int max_plus = -127;
int total_plus = 0;
+ int num_arts = 0;
int subtype_quants[256];
+ int ego_quants[SPWPN_RANDART_I];
+
memset(subtype_quants, 0, sizeof(subtype_quants));
+ memset(ego_quants, 0, sizeof(ego_quants));
for (int i = 0; i < num_itrs; i++)
{
@@ -2678,6 +2682,14 @@ static void _debug_acquirement_stats(FILE *ostat)
max_plus = std::max(max_plus, item.plus + item.plus2);
total_plus += item.plus + item.plus2;
+ if (is_artefact(item))
+ num_arts++;
+
+ if (type == OBJ_WEAPONS)
+ ego_quants[get_weapon_brand(item)]++;
+ else if (type == OBJ_ARMOUR)
+ ego_quants[get_armour_ego_type(item)]++;
+
destroy_item(item_index, true);
int curr_percent = acq_calls * 100 / num_itrs;
@@ -2698,17 +2710,88 @@ static void _debug_acquirement_stats(FILE *ostat)
fprintf(ostat, "acquirement called %d times, total quantity = %d\n\n",
acq_calls, total_quant);
+ fprintf(ostat, "%5.2f%% artefacts.\n",
+ 100.0 * (float) num_arts / (float) acq_calls);
+
if (type == OBJ_WEAPONS)
{
fprintf(ostat, "Maximum combined pluses: %d\n", max_plus);
fprintf(ostat, "Average combined pluses: %5.2f\n\n",
(float) total_plus / (float) acq_calls);
+
+ fprintf(ostat, "Egos (including artefacts):\n");
+
+ const char* names[] = {
+ "normal",
+ "flaming",
+ "freezing",
+ "holy wrath",
+ "electrocution",
+ "orc slaying",
+ "dragon slaying",
+ "venom",
+ "protection",
+ "draning",
+ "speed",
+ "vorpal",
+ "flame",
+ "frost",
+ "vampiricism",
+ "pain",
+ "distortion",
+ "reaching",
+ "returning",
+ "chaos",
+ "confusion",
+ };
+
+ for (int i = 0; i <= SPWPN_CONFUSE; i++)
+ {
+ if (ego_quants[i] > 0)
+ fprintf(ostat, "%14s: %5.2f\n", names[i],
+ 100.0 * (float) ego_quants[i] / (float) acq_calls);
+ }
+ fprintf(ostat, "\n\n");
}
else if (type == OBJ_ARMOUR)
{
fprintf(ostat, "Maximum plus: %d\n", max_plus);
fprintf(ostat, "Average plus: %5.2f\n\n",
(float) total_plus / (float) acq_calls);
+
+ fprintf(ostat, "Egos (excluding artefacts):\n");
+
+ const char* names[] = {
+ "normal",
+ "running",
+ "fire resistance",
+ "cold resistance",
+ "poison resistance",
+ "see invis",
+ "darkness",
+ "strength",
+ "dexterity",
+ "intelligence",
+ "ponderous",
+ "levitation",
+ "magic reistance",
+ "protection",
+ "stealth",
+ "resistance",
+ "positive energy",
+ "archmagi",
+ "preservation",
+ "reflection"
+ };
+
+ const int non_art = acq_calls - num_arts;
+ for (int i = 0; i <= SPARM_REFLECTION; i++)
+ {
+ if (ego_quants[i] > 0)
+ fprintf(ostat, "%17s: %5.2f\n", names[i],
+ 100.0 * (float) ego_quants[i] / (float) non_art);
+ }
+ fprintf(ostat, "\n\n");
}
item_def item;