summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r--crawl-ref/source/mon-util.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 0c47414cab..7821d0c1e8 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -21,7 +21,9 @@
#include "goditem.h"
#include "itemname.h"
#include "kills.h"
+#include "mislead.h"
#include "mon-behv.h"
+#include "mon-iter.h"
#include "mon-place.h"
#include "coord.h"
#include "mon-stuff.h"
@@ -2233,6 +2235,17 @@ static bool _beneficial_beam_flavour(beam_type flavour)
}
}
+// For SUMMON_PLAYER_GHOST.
+bool _find_players_ghost ()
+{
+ bool found = false;
+ for (monster_iterator mi; mi; ++mi)
+ if (mi->type == MONS_PLAYER_GHOST && mi->mname == you.your_name)
+ found = true;
+
+ return found;
+}
+
bool mons_should_fire(struct bolt &beam)
{
#ifdef DEBUG_DIAGNOSTICS
@@ -2582,6 +2595,25 @@ bool ms_waste_of_time( const monsters *mon, spell_type monspell )
break;
}
+ case SPELL_MISLEAD:
+ if (you.duration[DUR_MISLED] > 10 && one_chance_in(3))
+ ret = true;
+
+ break;
+
+ case SPELL_SUMMON_PLAYER_GHOST:
+ // Only ever want one at a time.
+ if (_find_players_ghost())
+ ret = true;
+
+ break;
+
+ case SPELL_FAKE_MARA_SUMMON:
+ if (count_mara_fakes() == 2)
+ ret = true;
+
+ break;
+
case SPELL_NO_SPELL:
ret = true;
break;