summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-cast.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-25 22:33:46 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-25 22:33:46 +0000
commitfe66a480da9ae461070c73f7690922b240ff3ace (patch)
tree059cfa84673453ef3b2b19196ff72ae76fb32ce4 /crawl-ref/source/spl-cast.cc
parent9703c86777b2d8acabc5a25f407c9ee0d045b0e1 (diff)
downloadcrawl-ref-fe66a480da9ae461070c73f7690922b240ff3ace.tar.gz
crawl-ref-fe66a480da9ae461070c73f7690922b240ff3ace.zip
Since demonspawn players have demonic holiness, keep them from
memorizing and casting holy spells. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6993 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spl-cast.cc')
-rw-r--r--crawl-ref/source/spl-cast.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index adb8493576..f5865ae038 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -666,15 +666,15 @@ bool cast_a_spell()
// "Utility" spells for the sake of simplicity are currently ones with
// enchantments, translocations, or divinations.
-static bool _spell_is_utility_spell( spell_type spell_id )
+static bool _spell_is_utility_spell(spell_type spell_id)
{
- return (spell_typematch( spell_id,
- SPTYP_ENCHANTMENT | SPTYP_TRANSLOCATION | SPTYP_DIVINATION ));
+ return (spell_typematch(spell_id,
+ SPTYP_ENCHANTMENT | SPTYP_TRANSLOCATION | SPTYP_DIVINATION));
}
-static bool _spell_is_unholy( spell_type spell_id )
+static bool _spell_is_unholy(spell_type spell_id)
{
- return (testbits( get_spell_flags( spell_id ), SPFLAG_UNHOLY ));
+ return (testbits(get_spell_flags(spell_id), SPFLAG_UNHOLY));
}
bool maybe_identify_staff(item_def &item, spell_type spell)
@@ -792,7 +792,7 @@ static void _spellcasting_side_effects(spell_type spell, bool idonly = false)
// Self-banishment gets a special exemption - you're there to spread light
if (_spell_is_unholy(spell) && !you.banished)
- did_god_conduct( DID_UNHOLY, 10 + spell_difficulty(spell) );
+ did_god_conduct(DID_UNHOLY, 10 + spell_difficulty(spell));
// Linley says: Condensation Shield needs some disadvantages to keep
// it from being a no-brainer... this isn't much, but its a start -- bwr
@@ -801,7 +801,7 @@ static void _spellcasting_side_effects(spell_type spell, bool idonly = false)
if (spell_typematch(spell, SPTYP_NECROMANCY))
{
- did_god_conduct( DID_NECROMANCY, 10 + spell_difficulty(spell) );
+ did_god_conduct(DID_NECROMANCY, 10 + spell_difficulty(spell));
if (spell == SPELL_NECROMUTATION && is_good_god(you.religion))
excommunication();
@@ -841,9 +841,10 @@ static bool _vampire_cannot_cast(spell_type spell)
static bool _spell_is_uncastable(spell_type spell)
{
- if (you.is_undead && spell_typematch(spell, SPTYP_HOLY))
+ if ((you.is_undead || you.species == SP_DEMONSPAWN)
+ && spell_typematch(spell, SPTYP_HOLY))
{
- mpr( "You can't use this type of magic!" );
+ mpr("You can't use this type of magic!");
return (true);
}