summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-19 06:20:51 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-19 06:20:51 +0000
commit33005dad6d50d774bc4fe6b6afcd5b60c55cd0b6 (patch)
treec2f5fa8878e1237ff9d9f0bfcdb71ed7f72e0cc0 /crawl-ref/source/monstuff.cc
parent8f82bd1f8aca60f4d15e3966933dc10cbe019574 (diff)
downloadcrawl-ref-33005dad6d50d774bc4fe6b6afcd5b60c55cd0b6.tar.gz
crawl-ref-33005dad6d50d774bc4fe6b6afcd5b60c55cd0b6.zip
Simplify the code that issues the "comes into view" monster interrupt message,
so we don't have to check in multiple places to make sure that "comes into view" is given before any of the other monster messages. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8572 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc21
1 files changed, 4 insertions, 17 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 2529eca193..8f0f2d793d 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -4885,17 +4885,6 @@ bool mons_avoids_cloud(const monsters *monster, int cloud_num,
careful_friendly));
}
-// Make sure the "comes into view" type messages are displayed before
-// special/nearby abilites are used.
-void _flush_monster_alerts(const monsters* mons)
-{
- if (!(mons->flags & MF_WAS_IN_VIEW) && player_monster_visible(mons)
- && you_are_delayed())
- {
- fire_monster_alerts();
- }
-}
-
//---------------------------------------------------------------
//
// handle_nearby_ability
@@ -4977,12 +4966,9 @@ static void _handle_nearby_ability(monsters *monster)
&& !_is_player_or_mon_sanct(monster))
{
if (you.can_see(monster) && you.can_see(foe))
- {
- _flush_monster_alerts(monster);
mprf("%s stares at %s.",
monster->name(DESC_CAP_THE).c_str(),
foe->name(DESC_NOCAP_THE).c_str());
- }
// Subtly different from old paralysis behaviour, but
// it'll do.
@@ -4998,7 +4984,6 @@ static void _handle_nearby_ability(monsters *monster)
&& !mons_is_pacified(monster)
&& !_is_player_or_mon_sanct(monster))
{
- _flush_monster_alerts(monster);
simple_monster_message(monster, " stares at you.");
dec_mp(5 + random2avg(13, 3));
@@ -5121,8 +5106,6 @@ static bool _handle_special_ability(monsters *monster, bolt & beem)
return (false);
}
- _flush_monster_alerts(monster);
-
const msg_channel_type spl = (mons_friendly(monster) ? MSGCH_FRIEND_SPELL
: MSGCH_MONSTER_SPELL);
@@ -8723,6 +8706,10 @@ void seen_monster(monsters *monster)
if (need_auto_exclude(monster) && !is_exclude_root(monster->pos()))
toggle_exclude(monster->pos());
+ // Monster was viewed this turn
+ monster->flags |= MF_WAS_IN_VIEW;
+ monster->seen_context.clear();
+
if (monster->flags & MF_SEEN)
return;