summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-09 12:58:58 -0600
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-09 12:58:58 -0600
commitfa2f65b7a853195fa69612e5cc4de6e5fc54ae85 (patch)
treece36ef7aad84d941ad0ef0dc95332324564a287b
parent5204dd771008a235eeec188fd6e6613b0c6a63ed (diff)
downloadcrawl-ref-fa2f65b7a853195fa69612e5cc4de6e5fc54ae85.tar.gz
crawl-ref-fa2f65b7a853195fa69612e5cc4de6e5fc54ae85.zip
Add spell flag SPFLAG_CHAOTIC, and mark all chaotic spells with it.
The list of chaotic spells is now generalized instead of being hardcoded in is_chaotic_spell(). This is modeled somewhat after SPFLAG_UNHOLY.
-rw-r--r--crawl-ref/source/goditem.cc12
-rw-r--r--crawl-ref/source/spl-cast.h23
-rw-r--r--crawl-ref/source/spl-data.h14
3 files changed, 23 insertions, 26 deletions
diff --git a/crawl-ref/source/goditem.cc b/crawl-ref/source/goditem.cc
index f51d67d2eb..d8e547339f 100644
--- a/crawl-ref/source/goditem.cc
+++ b/crawl-ref/source/goditem.cc
@@ -252,7 +252,7 @@ bool is_evil_spell(spell_type spell, god_type god)
{
UNUSED(god);
- unsigned int flags = get_spell_flags(spell);
+ unsigned int flags = get_spell_flags(spell);
unsigned int disciplines = get_spell_disciplines(spell);
return ((flags & SPFLAG_UNHOLY) || (is_evil_discipline(disciplines)));
@@ -262,13 +262,9 @@ bool is_chaotic_spell(spell_type spell, god_type god)
{
UNUSED(god);
- return (spell == SPELL_POLYMORPH_OTHER
- || spell == SPELL_CORPSE_ROT
- || spell == SPELL_ALTER_SELF
- || spell == SPELL_SUMMON_UGLY_THING
- || spell == SPELL_MIASMA
- || spell == SPELL_SUMMON_DRAKES
- || spell == SPELL_PORKALATOR);
+ unsigned int flags = get_spell_flags(spell);
+
+ return (flags & SPFLAG_CHAOTIC);
}
bool is_hasty_spell(spell_type spell, god_type god)
diff --git a/crawl-ref/source/spl-cast.h b/crawl-ref/source/spl-cast.h
index d4ecf8a111..60088d64e8 100644
--- a/crawl-ref/source/spl-cast.h
+++ b/crawl-ref/source/spl-cast.h
@@ -21,19 +21,20 @@ enum spflag_type
SPFLAG_HELPFUL = 0x00010, // TARG_FRIENDS used
SPFLAG_NEUTRAL = 0x00020, // TARG_ANY used
SPFLAG_NOT_SELF = 0x00040, // aborts on isMe
- SPFLAG_UNHOLY = 0x00080, // counts at "unholy"
- SPFLAG_MAPPING = 0x00100, // a mapping spell of some kind
- SPFLAG_ESCAPE = 0x00200, // useful for running away
- SPFLAG_RECOVERY = 0x00400, // healing or recovery spell
- SPFLAG_AREA = 0x00800, // area affect
- SPFLAG_BATTLE = 0x01000, // a non-Conjuration spell that
+ SPFLAG_UNHOLY = 0x00080, // counts as "unholy"
+ SPFLAG_CHAOTIC = 0x00100, // counts as "chaotic"
+ SPFLAG_MAPPING = 0x00200, // a mapping spell of some kind
+ SPFLAG_ESCAPE = 0x00400, // useful for running away
+ SPFLAG_RECOVERY = 0x00800, // healing or recovery spell
+ SPFLAG_AREA = 0x01000, // area affect
+ SPFLAG_BATTLE = 0x02000, // a non-Conjuration spell that
// is still a battle spell
- SPFLAG_CARD = 0x02000, // a card effect spell
- SPFLAG_MONSTER = 0x04000, // monster-only spell
- SPFLAG_INNATE = 0x08000, // an innate spell, even if
+ SPFLAG_CARD = 0x04000, // a card effect spell
+ SPFLAG_MONSTER = 0x08000, // monster-only spell
+ SPFLAG_INNATE = 0x10000, // an innate spell, even if
// use by a priest/wizard
- SPFLAG_NOISY = 0x10000, // makes noise, even if innate
- SPFLAG_TESTING = 0x20000 // a testing/debugging spell
+ SPFLAG_NOISY = 0x20000, // makes noise, even if innate
+ SPFLAG_TESTING = 0x40000 // a testing/debugging spell
};
enum spret_type
diff --git a/crawl-ref/source/spl-data.h b/crawl-ref/source/spl-data.h
index 02fff3b101..bc168a3b2b 100644
--- a/crawl-ref/source/spl-data.h
+++ b/crawl-ref/source/spl-data.h
@@ -181,7 +181,7 @@
{
SPELL_POLYMORPH_OTHER, "Polymorph Other",
SPTYP_TRANSMUTATION, // removed enchantment, wasn't needed -- bwr
- SPFLAG_DIR_OR_TARGET | SPFLAG_NOT_SELF,
+ SPFLAG_DIR_OR_TARGET | SPFLAG_NOT_SELF | SPFLAG_CHAOTIC,
5,
200,
LOS_RADIUS, LOS_RADIUS,
@@ -1055,7 +1055,7 @@
{
SPELL_CORPSE_ROT, "Corpse Rot",
SPTYP_NECROMANCY,
- SPFLAG_AREA | SPFLAG_NEUTRAL,
+ SPFLAG_AREA | SPFLAG_NEUTRAL | SPFLAG_CHAOTIC,
2,
0,
-1, -1,
@@ -1302,7 +1302,7 @@
{
SPELL_ALTER_SELF, "Alter Self",
SPTYP_TRANSMUTATION,
- SPFLAG_NONE,
+ SPFLAG_CHAOTIC,
7,
0,
-1, -1,
@@ -1978,7 +1978,7 @@
{
SPELL_SUMMON_UGLY_THING, "Summon Ugly Thing",
SPTYP_SUMMONING,
- SPFLAG_NONE,
+ SPFLAG_CHAOTIC,
5,
200,
-1, -1,
@@ -2202,7 +2202,7 @@
{
SPELL_MIASMA, "Miasma",
SPTYP_CONJURATION,
- SPFLAG_DIR_OR_TARGET | SPFLAG_MONSTER,
+ SPFLAG_DIR_OR_TARGET | SPFLAG_CHAOTIC | SPFLAG_MONSTER,
6,
0,
6, 6,
@@ -2215,7 +2215,7 @@
{
SPELL_SUMMON_DRAKES, "Summon Drakes",
SPTYP_SUMMONING,
- SPFLAG_UNHOLY | SPFLAG_MONSTER,
+ SPFLAG_UNHOLY | SPFLAG_CHAOTIC | SPFLAG_MONSTER,
6,
0,
-1, -1,
@@ -2332,7 +2332,7 @@
{
SPELL_PORKALATOR, "Porkalator",
SPTYP_ENCHANTMENT | SPTYP_TRANSMUTATION,
- SPFLAG_DIR_OR_TARGET,
+ SPFLAG_DIR_OR_TARGET | SPFLAG_CHAOTIC,
5,
200,
LOS_RADIUS, LOS_RADIUS,