summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-05 06:45:19 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-05 06:45:19 +0000
commitdc942d2989c077985d1ba2ca9c87801ef58da35f (patch)
tree89d8a1c479f98937c157e9759b8b5db7c2295397 /crawl-ref/source/mon-util.cc
parentbd2206a5ad858042e9e712e5dd6874200a0d001d (diff)
downloadcrawl-ref-dc942d2989c077985d1ba2ca9c87801ef58da35f.tar.gz
crawl-ref-dc942d2989c077985d1ba2ca9c87801ef58da35f.zip
Oops, forgot to remove "@to_foe@" and "@at_foe@" when the target of the monster
message is the player. When ENCH_ABJ times out and a new ENCH_ABJ is put back in before calling monster_die(), set it's duration to -1 so that monster_die() can tell that the monster "died" from being abjured or having its time run out. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8234 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r--crawl-ref/source/mon-util.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 8451b50e37..356e837316 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -6455,7 +6455,10 @@ void monsters::remove_enchantment_effect(const mon_enchant &me, bool quiet)
}
case ENCH_ABJ:
case ENCH_SHORT_LIVED:
- add_ench(mon_enchant(ENCH_ABJ));
+ // Set duration to -1 so that monster_die() and any of its
+ // callees can tell that the monster ran out of time or was
+ // abjured.
+ add_ench(mon_enchant(ENCH_ABJ, 0, KC_OTHER, -1));
if (this->has_ench(ENCH_BERSERK))
simple_monster_message(this, " is no longer berserk.");
@@ -7969,6 +7972,9 @@ std::string do_mon_str_replacements(const std::string &in_msg,
{
foe_species = species_name(you.species, 1, true);
+ msg = replace_all(msg, " @to_foe@", "");
+ msg = replace_all(msg, " @at_foe@", "");
+
msg = replace_all(msg, "@player_only@", "");
msg = replace_all(msg, " @foe,@", ",");