From 464c6c2079869fd86514eaa3942f9d4eb565f763 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Mon, 5 Jan 2009 07:25:56 +0000 Subject: Oops, forgot to special-case "@says@ @to_foe@". git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8237 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/mon-util.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 356e837316..dbf7be1ae9 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -7964,6 +7964,9 @@ std::string do_mon_str_replacements(const std::string &in_msg, const monsters* m_foe = (foe && foe->atype() == ACT_MONSTER) ? dynamic_cast(foe) : NULL; + if (s_type < 0 || s_type >= NUM_LOUDNESS || s_type == NUM_SHOUTS) + s_type = mons_shouts(monster->type); + std::string foe_species; if (foe == NULL) @@ -8007,6 +8010,11 @@ std::string do_mon_str_replacements(const std::string &in_msg, else foe_name = "something"; + std::string prep = "at"; + if (s_type == S_SILENT || s_type == S_SHOUT || s_type == S_NORMAL) + prep = "to"; + msg = replace_all(msg, "@says@ @to_foe@", "@says@ " + prep + " @foe@"); + msg = replace_all(msg, " @to_foe@", " to @foe@"); msg = replace_all(msg, " @at_foe@", " at @foe@"); msg = replace_all(msg, "@foe,@", "@foe@,"); @@ -8223,9 +8231,6 @@ std::string do_mon_str_replacements(const std::string &in_msg, "screams" // S_VERY_LOUD }; - if (s_type < 0 || s_type >= NUM_LOUDNESS || s_type == NUM_SHOUTS) - s_type = mons_shouts(monster->type); - if (s_type < 0 || s_type >= NUM_LOUDNESS || s_type == NUM_SHOUTS) { mpr("Invalid @says@ type.", MSGCH_DIAGNOSTICS); -- cgit v1.2.3-54-g00ecf