summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorJohanna Ploog <j-p-e-g@users.sourceforge.net>2009-12-15 17:36:46 +0100
committerJohanna Ploog <j-p-e-g@users.sourceforge.net>2009-12-16 00:37:56 +0100
commit381bd5c28bb04dacd4fe2f7e8c51a0bdebbdcc8a (patch)
tree184549093055839a8e89a855d4f221ba715936b8 /crawl-ref/source
parent4ae94589a31f96d5676242a643b9972671436feb (diff)
downloadcrawl-ref-381bd5c28bb04dacd4fe2f7e8c51a0bdebbdcc8a.tar.gz
crawl-ref-381bd5c28bb04dacd4fe2f7e8c51a0bdebbdcc8a.zip
Print the overview screen and skills in the acquirement statistics output.
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/chardump.cc20
-rw-r--r--crawl-ref/source/skills2.cc21
-rw-r--r--crawl-ref/source/skills2.h1
-rw-r--r--crawl-ref/source/wiz-item.cc17
4 files changed, 41 insertions, 18 deletions
diff --git a/crawl-ref/source/chardump.cc b/crawl-ref/source/chardump.cc
index 493fdcbf80..f71d4d3b15 100644
--- a/crawl-ref/source/chardump.cc
+++ b/crawl-ref/source/chardump.cc
@@ -911,26 +911,10 @@ static void _sdump_skills(dump_params &par)
text += " Skills:";
text += "\n";
- for (unsigned char i = 0; i < 50; i++)
- {
- if (you.skills[i] > 0)
- {
- text += ( (you.skills[i] == 27) ? " * " :
- (you.practise_skill[i]) ? " + "
- : " - " );
-
- text += "Level ";
- itoa( you.skills[i], tmp_quant, 10 );
- text += tmp_quant;
- text += " ";
- text += skill_name(i);
- text += "\n";
- }
- }
-
+ dump_skills(text);
text += "\n";
text += "\n";
-} // end dump_skills()
+}
//---------------------------------------------------------------
//
diff --git a/crawl-ref/source/skills2.cc b/crawl-ref/source/skills2.cc
index c9c0c0046e..534220621d 100644
--- a/crawl-ref/source/skills2.cc
+++ b/crawl-ref/source/skills2.cc
@@ -2178,3 +2178,24 @@ bool is_invalid_skill(int skill)
return (false);
}
+
+void dump_skills(std::string &text)
+{
+ char tmp_quant[20];
+ for (unsigned char i = 0; i < 50; i++)
+ {
+ if (you.skills[i] > 0)
+ {
+ text += ( (you.skills[i] == 27) ? " * " :
+ (you.practise_skill[i]) ? " + "
+ : " - " );
+
+ text += "Level ";
+ itoa( you.skills[i], tmp_quant, 10 );
+ text += tmp_quant;
+ text += " ";
+ text += skill_name(i);
+ text += "\n";
+ }
+ }
+}
diff --git a/crawl-ref/source/skills2.h b/crawl-ref/source/skills2.h
index c7daf44be8..361acace5b 100644
--- a/crawl-ref/source/skills2.h
+++ b/crawl-ref/source/skills2.h
@@ -33,5 +33,6 @@ unsigned int skill_exp_needed(int lev);
void show_skills();
void wield_warning(bool newWeapon = true);
bool is_invalid_skill(int skill);
+void dump_skills(std::string &text);
#endif
diff --git a/crawl-ref/source/wiz-item.cc b/crawl-ref/source/wiz-item.cc
index c7dd64f209..a3fdb7a2e4 100644
--- a/crawl-ref/source/wiz-item.cc
+++ b/crawl-ref/source/wiz-item.cc
@@ -28,7 +28,9 @@
#include "mon-stuff.h"
#include "mon-util.h"
#include "options.h"
+#include "output.h"
#include "religion.h"
+#include "skills2.h"
#include "spl-book.h"
#include "stash.h"
#include "stuff.h"
@@ -928,6 +930,15 @@ static void _debug_acquirement_stats(FILE *ostat)
return;
}
+ // Print the overview screen to get information about species
+ // and equipped items.
+ fprintf(ostat, "%s\n\n", dump_overview_screen(false).c_str());
+
+ // Also print the skills, in case they matter.
+ std::string skills = "Skills:\n";
+ dump_skills(skills);
+ fprintf(ostat, "%s\n\n", skills.c_str());
+
fprintf(ostat, "acquirement called %d times, total quantity = %d\n\n",
acq_calls, total_quant);
@@ -1015,11 +1026,16 @@ static void _debug_acquirement_stats(FILE *ostat)
}
fprintf(ostat, "\n\n");
}
+ else if (type == OBJ_BOOKS)
+ {
+ // TODO: Count themed books' main spell school.
+ }
item_def item;
item.quantity = 1;
item.base_type = type;
+ // First, get the maximum name length.
int max_width = 0;
for (int i = 0; i < 256; ++i)
{
@@ -1033,6 +1049,7 @@ static void _debug_acquirement_stats(FILE *ostat)
max_width = std::max(max_width, (int) name.length());
}
+ // Now output the sub types.
char format_str[80];
sprintf(format_str, "%%%ds: %%6.2f\n", max_width);