summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/monstuff.cc14
-rw-r--r--crawl-ref/source/view.cc2
2 files changed, 11 insertions, 5 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index e915034ebc..580bec1dcf 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -4777,12 +4777,14 @@ static void _handle_movement(monsters *monster)
if (crawl_state.arena)
return;
- // If the player can't see us it doesn't matter.
- if (!(monster->flags & MF_WAS_IN_VIEW))
+ // Did we just shout?
+ if (monster->seen_context != "just shouted")
return;
- // Only monsters seeking the player will shout.
- if (!mons_is_seeking(monster) || monster->foe != MHITYOU)
+ monster->seen_context.clear();
+
+ // If the player can't see us it doesn't matter.
+ if (!(monster->flags & MF_WAS_IN_VIEW))
return;
const coord_def old_pos = monster->pos();
@@ -4798,6 +4800,7 @@ static void _handle_movement(monsters *monster)
// Try to find a move that brings us closer to the player while keeping us
// in view.
+ int matches = 0;
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
{
@@ -4812,7 +4815,8 @@ static void _handle_movement(monsters *monster)
if (grid_distance(you.pos(), tmp) < old_dist && see_grid(tmp))
{
- mmov = delta;
+ if (one_chance_in(++matches))
+ mmov = delta;
break;
}
}
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index d155f10004..376017b82b 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -1196,6 +1196,8 @@ void handle_monster_shouts(monsters* monster, bool force)
const int noise_level = get_shout_noise_level(s_type);
if (noise_level > 0)
noisy(noise_level, monster->pos());
+
+ monster->seen_context = "just shouted";
}
#ifdef WIZARD