summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/Kills.cc
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-10 16:23:13 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-10 16:23:13 +0000
commitabec3e39f39b3f598c90b645a45bb43097b8e5cb (patch)
tree6050a955d8385bd0c2d46d12776702c62d585b4e /crawl-ref/source/Kills.cc
parent87616cef0d3617cd349edb6641d32d71cdd96b22 (diff)
downloadcrawl-ref-abec3e39f39b3f598c90b645a45bb43097b8e5cb.tar.gz
crawl-ref-abec3e39f39b3f598c90b645a45bb43097b8e5cb.zip
[2495836] Show names for friendly uniques during arena mode. Also, add a tile_tag_pref option.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8383 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/Kills.cc')
-rw-r--r--crawl-ref/source/Kills.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/crawl-ref/source/Kills.cc b/crawl-ref/source/Kills.cc
index 6da4e56a28..b40e6b3a39 100644
--- a/crawl-ref/source/Kills.cc
+++ b/crawl-ref/source/Kills.cc
@@ -229,6 +229,20 @@ void KillMaster::add_kill_info(std::string &killtext,
}
}
+long KillMaster::num_kills(const monsters *mon, kill_category cat) const
+{
+ return categorized_kills[cat].num_kills(mon);
+}
+
+long KillMaster::num_kills(const monsters *mon) const
+{
+ long total = 0;
+ for (int cat = 0; cat < KC_NCATEGORIES; cat++)
+ total += categorized_kills[cat].num_kills(mon);
+
+ return total;
+}
+
///////////////////////////////////////////////////////////////////////////
bool Kills::empty() const
@@ -344,6 +358,22 @@ void Kills::record_ghost_kill(const struct monsters *mon)
ghosts.push_back(ghostk);
}
+int Kills::num_kills(const monsters *mon) const
+{
+ kill_monster_desc desc(mon);
+ kill_map::const_iterator iter = kills.find(desc);
+ int total = (iter == kills.end() ? 0 : iter->second.kills);
+
+ if (desc.modifier == kill_monster_desc::M_SHAPESHIFTER)
+ {
+ desc.modifier = kill_monster_desc::M_NORMAL;
+ iter = kills.find(desc);
+ total += (iter == kills.end() ? 0 : iter->second.kills);
+ }
+
+ return total;
+}
+
kill_def::kill_def(const struct monsters *mon) : kills(0), exp(0)
{
exp = exper_value(mon);