summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-behv.cc
diff options
context:
space:
mode:
authorDracoOmega <draco_omega@live.com>2014-01-18 00:04:20 -0330
committerDracoOmega <draco_omega@live.com>2014-01-18 00:17:13 -0330
commitf961c8d6bcfd24a92695328fa459159c24c5a94e (patch)
tree4b820478966a473fcd643317c7f6077a3b035ec7 /crawl-ref/source/mon-behv.cc
parent0b9d51a0edee0bbeed1b0f492b5f46a5b11e1083 (diff)
downloadcrawl-ref-f961c8d6bcfd24a92695328fa459159c24c5a94e.tar.gz
crawl-ref-f961c8d6bcfd24a92695328fa459159c24c5a94e.zip
Actually remove ENCH_FEAR when hitting a fleeing monster (and give a better message)
Performing a melee attack against a fleeing monster has always made it stop fleeing, but didn't remove the fear enchant at the same time, which made it fear-immune for a while (it also didn't give any message at all). Now a suitable message is explicitly given and fear properly removed. It's arguable that a mere attack attempt shouldn't automatically break it - at the very least, perhaps it shouldn't happen if you miss?
Diffstat (limited to 'crawl-ref/source/mon-behv.cc')
-rw-r--r--crawl-ref/source/mon-behv.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-behv.cc b/crawl-ref/source/mon-behv.cc
index 898c79ca61..bdc15d88c6 100644
--- a/crawl-ref/source/mon-behv.cc
+++ b/crawl-ref/source/mon-behv.cc
@@ -1302,6 +1302,16 @@ void behaviour_event(monster* mon, mon_event_type event, const actor *src,
{
mon->behaviour = BEH_RETREAT;
}
+ else if (mons_is_fleeing(mon))
+ {
+ if (you.can_see(mon))
+ {
+ mprf("%s attack snaps %s out of its fear.",
+ src->name(DESC_ITS).c_str(),
+ mon->name(DESC_THE).c_str());
+ }
+ mon->del_ench(ENCH_FEAR, true);
+ }
else if (!mons_is_cornered(mon) && mon->hit_points > fleeThreshold)
mon->behaviour = BEH_SEEK;
else if (mon->asleep())