summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/hiscores.cc
diff options
context:
space:
mode:
authorSamuel Bronson <naesten@gmail.com>2013-12-25 19:09:25 -0500
committerSamuel Bronson <naesten@gmail.com>2013-12-25 19:10:27 -0500
commit108ffb468b733b9c59a8306492639ff7aecb12f3 (patch)
tree234eded42a2b55334ad17778cba053e75efd252e /crawl-ref/source/hiscores.cc
parenta19d258bbb9fe2037c3e38376e9b78037d1830ef (diff)
downloadcrawl-ref-108ffb468b733b9c59a8306492639ff7aecb12f3.tar.gz
crawl-ref-108ffb468b733b9c59a8306492639ff7aecb12f3.zip
hiscores: log whether killer is a unique
Diffstat (limited to 'crawl-ref/source/hiscores.cc')
-rw-r--r--crawl-ref/source/hiscores.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc
index 516822dff1..bae0134775 100644
--- a/crawl-ref/source/hiscores.cc
+++ b/crawl-ref/source/hiscores.cc
@@ -694,6 +694,7 @@ void scorefile_entry::init_from(const scorefile_entry &se)
death_type = se.death_type;
death_source = se.death_source;
death_source_name = se.death_source_name;
+ death_source_flags = se.death_source_flags;
auxkilldata = se.auxkilldata;
indirectkiller = se.indirectkiller;
killerpath = se.killerpath;
@@ -899,6 +900,7 @@ void scorefile_entry::init_with_fields()
death_type = _str_to_kill_method(fields->str_field("ktyp"));
death_source_name = fields->str_field("killer");
+ // XXX: death_source_flags not loaded
auxkilldata = fields->str_field("kaux");
indirectkiller = fields->str_field("ikiller");
if (indirectkiller.empty())
@@ -1052,6 +1054,14 @@ void scorefile_entry::set_score_fields() const
const string killer = death_source_desc();
fields->add_field("killer", "%s", killer.c_str());
+ if (!death_source_flags.empty())
+ {
+ const string kflags = comma_separated_line(
+ death_source_flags.begin(),
+ death_source_flags.end(),
+ " ", " ");
+ fields->add_field("killer_flags", "%s", kflags.c_str());
+ }
fields->add_field("dam", "%d", damage);
fields->add_field("sdam", "%d", source_damage);
fields->add_field("tdam", "%d", turn_damage);
@@ -1212,6 +1222,9 @@ void scorefile_entry::init_death_cause(int dam, int dsrc,
if (mons->type == MONS_PANDEMONIUM_LORD)
death_source_name += " the pandemonium lord";
+ if (mons_is_unique(mons->type))
+ death_source_flags.insert("unique");
+
if (mons->props.exists("blame"))
{
const CrawlVector& blame = mons->props["blame"].get_vector();