summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-27 16:43:21 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-27 16:43:21 +0000
commit0c7d47c22ef69e9ff065f835a5036245c0d750f4 (patch)
tree401e24c5963e5bb59f51fb7d9b1d4888d5e0453a /crawl-ref/source/mon-util.cc
parentabf7c1d0cea6abcb088d42e0a79099eb30ff1423 (diff)
downloadcrawl-ref-0c7d47c22ef69e9ff065f835a5036245c0d750f4.tar.gz
crawl-ref-0c7d47c22ef69e9ff065f835a5036245c0d750f4.zip
Implemented dispel undead for monsters.
Cold resistance was broken, fixed. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3349 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, 19 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index c49abd1bd9..655c8f429a 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -2015,6 +2015,25 @@ bool ms_waste_of_time( const monsters *mon, spell_type monspell )
// handled here as well. -- bwr
switch (monspell)
{
+ case SPELL_BOLT_OF_DRAINING:
+ case SPELL_AGONY:
+ case SPELL_SYMBOL_OF_TORMENT:
+ {
+ if (!foe)
+ return (true);
+
+ // Check if the foe *appears* to be immune to negative energy.
+ // We can't just use foe->res_negative_energy() because
+ // that'll mean monsters can just "know" the player is fully
+ // life-protected if he has triple life protection.
+ const mon_holy_type holy = foe->holiness();
+ return (holy == MH_UNDEAD || holy == MH_DEMONIC
+ || holy == MH_NONLIVING || holy == MH_PLANT);
+ }
+
+ case SPELL_DISPEL_UNDEAD:
+ return (!foe || foe->holiness() != MH_UNDEAD);
+
case SPELL_BACKLIGHT:
{
ret = !foe || foe->backlit();