diff options
Diffstat (limited to 'crawl-ref/source/hiscores.cc')
-rw-r--r-- | crawl-ref/source/hiscores.cc | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc index de083a6752..dd06f0a0c7 100644 --- a/crawl-ref/source/hiscores.cc +++ b/crawl-ref/source/hiscores.cc @@ -718,6 +718,7 @@ void scorefile_entry::set_score_fields() const fields->add_field("sc", "%ld", points); fields->add_field("ktyp", ::kill_method_name(kill_method_type(death_type))); fields->add_field("killer", death_source_desc().c_str()); + fields->add_field("dam", "%d", damage); fields->add_field("kaux", "%s", auxkilldata.c_str()); @@ -846,6 +847,14 @@ void scorefile_entry::init_death_cause(int dam, int dsrc, mon_num = 0; death_source_name[0] = 0; } + + if (death_type == KILLED_BY_WEAKNESS + || death_type == KILLED_BY_STUPIDITY + || death_type == KILLED_BY_CLUMSINESS) + { + if (auxkilldata == "") + auxkilldata = "unknown source"; + } } void scorefile_entry::reset() @@ -935,11 +944,23 @@ void scorefile_entry::init() if (you.inv[d].base_type == OBJ_MISCELLANY && you.inv[d].sub_type == MISC_RUNE_OF_ZOT) { - if (rune_array[ you.inv[d].plus ] == 0) + num_runes += you.inv[d].quantity; + + // Don't assert in rune_array[] due to buggy runes, + // since checks for buggy runes are already done + // elsewhere. + if (you.inv[d].plus < 0 || you.inv[d].plus >= NUM_RUNE_TYPES) + { + mpr("WARNING: Buggy rune in pack!"); + // Be nice and assume the buggy rune was originally + // different from any of the other rune types. num_diff_runes++; + continue; + } - num_runes += you.inv[d].quantity; rune_array[ you.inv[d].plus ] += you.inv[d].quantity; + if (rune_array[ you.inv[d].plus ] == 0) + num_diff_runes++; } } } @@ -1626,6 +1647,31 @@ scorefile_entry::death_description(death_desc_verbosity verbosity) const break; } // end switch + switch (death_type) + { + case KILLED_BY_STUPIDITY: + case KILLED_BY_WEAKNESS: + case KILLED_BY_CLUMSINESS: + if (terse) + { + desc += " ("; + desc += auxkilldata; + desc += ")"; + } + else + { + desc += "\n"; + desc += " "; + desc += "... caused by "; + desc += auxkilldata; + } + break; + + default: + break; + } + + if (oneline && desc.length() > 2) desc[1] = tolower(desc[1]); |