From 6e8c4b9c5c42d35f71c444b524a9bb366f70e9cd Mon Sep 17 00:00:00 2001 From: zelgadis Date: Sun, 29 Jun 2008 05:16:39 +0000 Subject: 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 --- crawl-ref/source/spl-util.cc | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'crawl-ref/source/spl-util.cc') 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) -- cgit v1.2.3-54-g00ecf