diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-05-19 20:51:51 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-05-19 20:51:51 +0000 |
commit | 5e05ffc14e57fff49b1f8a9700fa3623b4f1f343 (patch) | |
tree | 2cb6bb13f8b3c7b0af877542b1325ee7e3d1bc6e /crawl-ref/source/hiscores.cc | |
parent | 3ecc52d48d75321c18bd0969f461f26e253c6537 (diff) | |
download | crawl-ref-5e05ffc14e57fff49b1f8a9700fa3623b4f1f343.tar.gz crawl-ref-5e05ffc14e57fff49b1f8a9700fa3623b4f1f343.zip |
monam(), moname() and ptr_monam() are gone.
The replacement is str_monam() and mons_type_name().
str_monam() should probably be folded into actor::name. I think.
Deaths from zombies, skeletons and simulacra will not handle the
name correctly; needs a further hack.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1484 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/hiscores.cc')
-rw-r--r-- | crawl-ref/source/hiscores.cc | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc index ca0136afcb..6def50115d 100644 --- a/crawl-ref/source/hiscores.cc +++ b/crawl-ref/source/hiscores.cc @@ -768,7 +768,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()); + fields->add_field("killer", death_source_desc().c_str()); fields->add_field("kaux", "%s", auxkilldata.c_str()); @@ -945,8 +945,6 @@ void scorefile_entry::init_death_cause(int dam, int dsrc, // but now we pass it in as a string through the scorefile // entry to be appended in hiscores_format_single in long or // medium scorefile formats. - // It still isn't used in monam for anything but flying weapons - // though if (death_type == KILLED_BY_MONSTER && monster->inv[MSLOT_WEAPON] != NON_ITEM) { @@ -977,9 +975,7 @@ void scorefile_entry::init_death_cause(int dam, int dsrc, auxkilldata = mitm[monster->inv[MSLOT_WEAPON]].name(DESC_NOCAP_A); } - death_source_name = - monam( monster, monster->number, monster->type, true, - DESC_NOCAP_A, monster->inv[MSLOT_WEAPON] ); + death_source_name = str_monam(*monster, DESC_NOCAP_A, true); } } else @@ -1196,14 +1192,14 @@ const char *scorefile_entry::damage_verb() const "Annihilated"; } -const char *scorefile_entry::death_source_desc() const +std::string scorefile_entry::death_source_desc() const { if (death_type != KILLED_BY_MONSTER && death_type != KILLED_BY_BEAM) return (""); + // XXX no longer handles mons_num correctly! FIXME return (!death_source_name.empty()? - death_source_name.c_str() - : monam( NULL, mon_num, death_source, true, DESC_NOCAP_A ) ); + death_source_name : mons_type_name(death_source, DESC_NOCAP_A)); } std::string scorefile_entry::damage_string(bool terse) const @@ -1498,14 +1494,12 @@ scorefile_entry::death_description(death_desc_verbosity verbosity) const if (terse) desc += death_source_desc(); else if (oneline) - desc += std::string("slain by ") + death_source_desc(); + desc += "slain by " + death_source_desc(); else { - snprintf( scratch, sizeof scratch, "%s by %s", - damage_verb(), - death_source_desc() ); - - desc += scratch; + desc += damage_verb(); + desc += " by "; + desc += death_source_desc(); } // put the damage on the weapon line if there is one |