summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-08 14:01:16 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-08 14:01:16 +0000
commitc7ab36b8b51c2fa925fd5245d31e5f98cfa466e0 (patch)
treef121170da25495ab7f6deaedfeac493c4fb201e2 /crawl-ref/source/mon-util.cc
parentc0976eb78b1c1319e427b449073d532d033dee50 (diff)
downloadcrawl-ref-c7ab36b8b51c2fa925fd5245d31e5f98cfa466e0.tar.gz
crawl-ref-c7ab36b8b51c2fa925fd5245d31e5f98cfa466e0.zip
Ghosts can use ensorcelled hibernation. Breaks saves, needs some work on PC sleep and wake-up correctness.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2377 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r--crawl-ref/source/mon-util.cc19
1 files changed, 13 insertions, 6 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 38291386ec..396d2811e1 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -1962,6 +1962,7 @@ bool ms_waste_of_time( const monsters *mon, spell_type monspell )
bool ret = false;
int intel, est_magic_resist, power, diff;
+ const actor *foe = mon->get_foe();
// Eventually, we'll probably want to be able to have monsters
// learn which of their elemental bolts were resisted and have those
// handled here as well. -- bwr
@@ -1969,11 +1970,10 @@ bool ms_waste_of_time( const monsters *mon, spell_type monspell )
{
case SPELL_BACKLIGHT:
{
- const actor *foe = mon->get_foe();
- ret = !foe || foe->backlit() || foe->invisible();
+ ret = !foe || foe->backlit();
break;
}
-
+
case SPELL_BERSERKER_RAGE:
if (!mon->needs_berserk(false))
ret = true;
@@ -2021,6 +2021,10 @@ bool ms_waste_of_time( const monsters *mon, spell_type monspell )
case SPELL_BANISHMENT:
case SPELL_DISINTEGRATE:
case SPELL_PARALYSE:
+ case SPELL_SLEEP:
+ if (monspell == SPELL_SLEEP && (!foe || foe->asleep()))
+ return (true);
+
// occasionally we don't estimate... just fire and see:
if (one_chance_in(5))
return (false);
@@ -2039,9 +2043,7 @@ bool ms_waste_of_time( const monsters *mon, spell_type monspell )
if (mon->foe == MHITYOU)
est_magic_resist = player_res_magic();
else
- {
est_magic_resist = mons_resist_magic(&menv[mon->foe]);
- }
// now randomize (normal intels less accurate than high):
if (intel == I_NORMAL)
@@ -4884,7 +4886,12 @@ void monsters::put_to_sleep(int)
add_ench(ENCH_SLEEPY);
add_ench(ENCH_SLEEP_WARY);
}
-
+
+void monsters::check_awaken(int)
+{
+ // XXX
+}
+
/////////////////////////////////////////////////////////////////////////
// mon_enchant