summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorJohanna Ploog <j-p-e-g@users.sourceforge.net>2009-12-08 00:32:31 +0100
committerJohanna Ploog <j-p-e-g@users.sourceforge.net>2009-12-08 00:32:31 +0100
commitfc9d8a0f6c2a414efcd746b196e8eaea85d65055 (patch)
tree51475bb9310140d33e4f8ebd7d7928a03baedc86 /crawl-ref
parent389bb3b9bce97d135307b650eb95d3ea1ad1e557 (diff)
downloadcrawl-ref-fc9d8a0f6c2a414efcd746b196e8eaea85d65055.tar.gz
crawl-ref-fc9d8a0f6c2a414efcd746b196e8eaea85d65055.zip
Add command for wizmode Xom debugging to main.cc. Whoops!
Looks like whoever committed my patch didn't actually try whether it worked. ;) Also prompt for the number of iterations as is done for the item and fight statistics.
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/main.cc5
-rw-r--r--crawl-ref/source/xom.cc18
2 files changed, 20 insertions, 3 deletions
diff --git a/crawl-ref/source/main.cc b/crawl-ref/source/main.cc
index b7d74f0d29..508bab53ce 100644
--- a/crawl-ref/source/main.cc
+++ b/crawl-ref/source/main.cc
@@ -489,6 +489,7 @@ static void _do_wizard_command(int wiz_command, bool silent_fail)
return;
}
+ case CONTROL('B'): you.teleport(true, false, true); break;
case CONTROL('D'): wizard_edit_durations(); break;
case CONTROL('F'): debug_fight_statistics(false, true); break;
case CONTROL('G'): debug_ghosts(); break;
@@ -496,7 +497,7 @@ static void _do_wizard_command(int wiz_command, bool silent_fail)
case CONTROL('I'): debug_item_statistics(); break;
case CONTROL('L'): wizard_set_xl(); break;
case CONTROL('T'): debug_terp_dlua(); break;
- case CONTROL('B'): you.teleport(true, false, true); break;
+ case CONTROL('X'): debug_xom_effects(); break;
case 'O': debug_test_explore(); break;
case 'S': wizard_set_skill_level(); break;
@@ -1884,7 +1885,7 @@ void process_command( command_type cmd )
}
else if (you.level_type == LEVEL_LABYRINTH)
{
- mpr("No exploration algorithm can help you here.");
+ mpr("No exploration algorithm can help you here.");
break;
}
// Start exploring
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index ba4d299b9e..7b0eda06f8 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -13,6 +13,9 @@
#include "branch.h"
#include "coordit.h"
#include "database.h"
+#ifdef WIZARD
+#include "dbg-util.h"
+#endif
#include "delay.h"
#include "directn.h"
#include "effects.h"
@@ -3836,13 +3839,22 @@ static const char* _xom_effect_to_name(int effect)
return (result.c_str());
}
+#ifdef WIZARD
// Loops over the entire piety spectrum and calls xom_acts() multiple
// times for each value, then prints the results into a file.
// TODO: Allow specification of niceness, tension, boredness, and repeats.
void debug_xom_effects()
{
+ const int N = debug_prompt_for_int("How many iterations? ", true);
+
+ if (N == 0)
+ {
+ canned_msg( MSG_OK );
+ return;
+ }
+
// Repeat N times.
- const int N = 10;
+// const int N = 10;
FILE *ostat = fopen("xom_debug.stat", "a");
if (!ostat)
@@ -3866,6 +3878,8 @@ void debug_xom_effects()
fprintf(ostat, "You are under Xom's penance!\n");
else if (_xom_is_bored())
fprintf(ostat, "Xom is BORED.\n");
+ fprintf(ostat, "\nRunning %d times through entire mood cycle.\n", N);
+ fprintf(ostat, "---- OUTPUT EFFECT PERCENTAGES ----\n");
std::vector<int> mood_effects;
std::vector<std::vector<int> > all_effects;
@@ -3979,4 +3993,6 @@ void debug_xom_effects()
you.piety = real_piety;
you.religion = real_god;
}
+#endif // WIZARD
+
#endif