summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-11 17:27:07 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-11 17:27:07 +0000
commitd202b326dc267f90d667bc97e1ea14dea2acebe8 (patch)
tree01a5fbb640787c5e1abad905d77e76e761448c0b /crawl-ref/source/monstuff.cc
parentcfa399b13fcb495a5e55b2557c75665b048ff14a (diff)
downloadcrawl-ref-d202b326dc267f90d667bc97e1ea14dea2acebe8.tar.gz
crawl-ref-d202b326dc267f90d667bc97e1ea14dea2acebe8.zip
* Fix some bugs for the autoexclusion I forgot to commit last weekend.
* Mermaids now call nearby aquatic monsters (i.e. other merfolk and fish). * A few more songs for the Singing Sword. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7216 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 2af65b8093..1f0c4d66d7 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -2026,8 +2026,13 @@ void behaviour_event(monsters *mon, int event, int src,
case ME_DISTURB:
// Assumes disturbed by noise...
if (mons_is_sleeping(mon))
+ {
mon->behaviour = BEH_WANDER;
+ if (mons_near(mon))
+ remove_auto_exclude(mon, true);
+ }
+
// A bit of code to make Project Noise actually do
// something again. Basically, dumb monsters and
// monsters who aren't otherwise occupied will at
@@ -2058,6 +2063,9 @@ void behaviour_event(monsters *mon, int event, int src,
mon->foe = src;
+ if (mons_is_sleeping(mon) && mons_near(mon))
+ remove_auto_exclude(mon, true);
+
if (!mons_is_cornered(mon))
mon->behaviour = BEH_SEEK;
@@ -2078,6 +2086,9 @@ void behaviour_event(monsters *mon, int event, int src,
if (mons_friendly(mon) && mon->is_patrolling())
break;
+ if (mons_is_sleeping(mon) && mons_near(mon))
+ remove_auto_exclude(mon, true);
+
// Will alert monster to <src> and turn them
// against them, unless they have a current foe.
// It won't turn friends hostile either.
@@ -2089,6 +2100,15 @@ void behaviour_event(monsters *mon, int event, int src,
if (mon->foe == MHITNOT)
mon->foe = src;
+
+ if (src_pos != coord_def()
+ && (mon->foe == MHITNOT || mons_is_wandering(mon)))
+ {
+ if (mon->is_patrolling())
+ break;
+
+ mon->target = src_pos;
+ }
break;
case ME_SCARE:
@@ -4215,8 +4235,11 @@ static bool _handle_special_ability(monsters *monster, bolt & beem)
int walls = num_feats_between(you.pos(), monster->pos(),
DNGN_UNSEEN, DNGN_MAXWALL);
+ noisy(12, monster->pos(), NULL, true);
+
if (walls > 0)
{
+ // Since when do transparent walls block sound? (jpeg)
simple_monster_message(monster, " appears to sing, but you "
"can't hear her.");
break;