summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-util.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-29 05:16:39 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-29 05:16:39 +0000
commit6e8c4b9c5c42d35f71c444b524a9bb366f70e9cd (patch)
treeb888e9f208d93a196908516417fa99a21a1f0573 /crawl-ref/source/spl-util.cc
parent020b21eee05af9a8e23d9f1f4053a3f1c06519aa (diff)
downloadcrawl-ref-6e8c4b9c5c42d35f71c444b524a9bb366f70e9cd.tar.gz
crawl-ref-6e8c4b9c5c42d35f71c444b524a9bb366f70e9cd.zip
Bug 2005002: Allow friendly and neutral-good monsters to cast spells while in
sanctuary, and allow hostile and neutral monsters to cast spells once outside of sanctuary as long as it won't harm anything inside of sanctuary. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6205 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spl-util.cc')
-rw-r--r--crawl-ref/source/spl-util.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc
index ac35b94fbe..4dcf356d95 100644
--- a/crawl-ref/source/spl-util.cc
+++ b/crawl-ref/source/spl-util.cc
@@ -240,6 +240,37 @@ bool spell_needs_foe(spell_type spell)
return (!_seekspell(spell)->ms_utility);
}
+bool spell_harms_target(spell_type spell)
+{
+ const unsigned int flags = _seekspell(spell)->flags;
+
+ if (flags & (SPFLAG_HELPFUL | SPFLAG_NEUTRAL))
+ return false;
+
+ if (flags & SPFLAG_TARGETING_MASK)
+ return true;
+
+ return false;
+}
+
+bool spell_harms_area(spell_type spell)
+{
+ const unsigned int flags = _seekspell(spell)->flags;
+
+ if (flags & (SPFLAG_HELPFUL | SPFLAG_NEUTRAL))
+ return false;
+
+ if (flags & SPFLAG_AREA)
+ return true;
+
+ return false;
+}
+
+bool spell_sanctuary_castable(spell_type spell)
+{
+ return false;
+}
+
// applied to spell misfires (more power = worse) and triggers
// for Xom acting (more power = more likely to grab his attention) {dlb}
int spell_mana(spell_type which_spell)