summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/chardump.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-03-17 13:12:11 +0100
committerAdam Borowski <kilobyte@angband.pl>2013-03-17 21:01:42 +0100
commitf6a8ec43dbf3eca8d8a47ed986f92ba18e0d7335 (patch)
treefdaba605665dc52f868e7cb7c5f5967e9896255f /crawl-ref/source/chardump.cc
parent4831c0482cccb23b6da8fb1b2d547c8178bcad81 (diff)
downloadcrawl-ref-f6a8ec43dbf3eca8d8a47ed986f92ba18e0d7335.tar.gz
crawl-ref-f6a8ec43dbf3eca8d8a47ed986f92ba18e0d7335.zip
Count stabs on the action dump.
This implementation breaks them down by UCAT_type, which is probably too detailed. Ideally, I'd want just two categories: sleep/para stabs (ie, those with no roll that deal massive damage) and the rest (a bit of extra damage). It doesn't matter where we coalesce them, though, so it'd be easy to combine the data at output time.
Diffstat (limited to 'crawl-ref/source/chardump.cc')
-rw-r--r--crawl-ref/source/chardump.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/crawl-ref/source/chardump.cc b/crawl-ref/source/chardump.cc
index cc0d86f74b..39c2f9c8f9 100644
--- a/crawl-ref/source/chardump.cc
+++ b/crawl-ref/source/chardump.cc
@@ -29,6 +29,7 @@
#include "describe.h"
#include "dgn-overview.h"
#include "dungeon.h"
+#include "fight.h"
#include "files.h"
#include "godprayer.h"
#include "hiscores.h"
@@ -1146,11 +1147,28 @@ static string _describe_action(caction_type type)
return "Evoke";
case CACT_USE:
return " Use";
+ case CACT_STAB:
+ return " Stab";
default:
return "Error";
}
}
+static const char* _stab_names[] =
+{
+ "Normal",
+ "Distracted",
+ "Confused",
+ "Fleeing",
+ "Invisible",
+ "Held in net/web",
+ "Petrifying", // could be nice to combine the two
+ "Petrified",
+ "Paralysed",
+ "Sleeping",
+ "Betrayed ally",
+};
+
static string _describe_action_subtype(caction_type type, int subtype)
{
switch (type)
@@ -1200,6 +1218,10 @@ static string _describe_action_subtype(caction_type type, int subtype)
}
case CACT_USE:
return uppercase_first(base_type_string((object_class_type)subtype));
+ case CACT_STAB:
+ COMPILE_CHECK(ARRAYSZ(_stab_names) == NUM_UCAT);
+ ASSERT(subtype >= 1 && subtype < NUM_UCAT);
+ return _stab_names[subtype];
default:
return "Error";
}