summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-11-24 23:01:23 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-24 23:06:26 +0100
commit6a8fd2eaff54894b85f71ba5580de967c8037e74 (patch)
tree4498d5cf26e7cc98cab78b4ac40b8c1ea3be353c /crawl-ref/source
parent4f9a9aa77bc073af76876932dc0244b42eabfbff (diff)
downloadcrawl-ref-6a8fd2eaff54894b85f71ba5580de967c8037e74.tar.gz
crawl-ref-6a8fd2eaff54894b85f71ba5580de967c8037e74.zip
Add new targetting flag SPFLAG_TARG_OBJ for object targetting.
Also make apportation use this. Apportation now doesn't target out-of-sight objects anymore.
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/spl-cast.cc10
-rw-r--r--crawl-ref/source/spl-cast.h37
-rw-r--r--crawl-ref/source/spl-data.h4
3 files changed, 26 insertions, 25 deletions
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index 1c970443ff..356ca36636 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -1177,11 +1177,11 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail)
targ = TARG_ANY;
targetting_type dir =
- ((spell == SPELL_APPORTATION) ? DIR_TARGET_OBJECT :
- testbits(flags, SPFLAG_TARGET) ? DIR_TARGET :
- testbits(flags, SPFLAG_GRID) ? DIR_TARGET :
- testbits(flags, SPFLAG_DIR) ? DIR_DIR :
- DIR_NONE );
+ (testbits(flags, SPFLAG_TARG_OBJ) ? DIR_TARGET_OBJECT :
+ testbits(flags, SPFLAG_TARGET) ? DIR_TARGET :
+ testbits(flags, SPFLAG_GRID) ? DIR_TARGET :
+ testbits(flags, SPFLAG_DIR) ? DIR_DIR :
+ DIR_NONE);
const char *prompt = get_spell_target_prompt(spell);
if (spell == SPELL_EVAPORATE)
diff --git a/crawl-ref/source/spl-cast.h b/crawl-ref/source/spl-cast.h
index 83f56e8fc0..406bf9384c 100644
--- a/crawl-ref/source/spl-cast.h
+++ b/crawl-ref/source/spl-cast.h
@@ -17,26 +17,27 @@ enum spflag_type
SPFLAG_TARGET = 0x000002, // use DIR_TARGET targetting
SPFLAG_GRID = 0x000004, // use DIR_GRID targetting
SPFLAG_DIR = 0x000008, // use DIR_DIR targetting
- SPFLAG_TARGETTING_MASK = 0x00000f, // used to test for targetting
- SPFLAG_HELPFUL = 0x000010, // TARG_FRIENDS used
- SPFLAG_NEUTRAL = 0x000020, // TARG_ANY used
- SPFLAG_NOT_SELF = 0x000040, // aborts on isMe
- SPFLAG_UNHOLY = 0x000080, // counts as "unholy"
- SPFLAG_UNCLEAN = 0x000100, // counts as "unclean"
- SPFLAG_CHAOTIC = 0x000200, // counts as "chaotic"
- SPFLAG_HASTY = 0x000400, // counts as "hasty"
- SPFLAG_MAPPING = 0x000800, // a mapping spell of some kind
- SPFLAG_ESCAPE = 0x001000, // useful for running away
- SPFLAG_RECOVERY = 0x002000, // healing or recovery spell
- SPFLAG_AREA = 0x004000, // area affect
- SPFLAG_BATTLE = 0x008000, // a non-Conjuration spell that
+ SPFLAG_TARG_OBJ = 0x000010, // use DIR_TARGET_OBJECT targ.
+ SPFLAG_TARGETTING_MASK = 0x00001f, // used to test for targetting
+ SPFLAG_HELPFUL = 0x000020, // TARG_FRIENDS used
+ SPFLAG_NEUTRAL = 0x000040, // TARG_ANY used
+ SPFLAG_NOT_SELF = 0x000080, // aborts on isMe
+ SPFLAG_UNHOLY = 0x000100, // counts as "unholy"
+ SPFLAG_UNCLEAN = 0x000200, // counts as "unclean"
+ SPFLAG_CHAOTIC = 0x000400, // counts as "chaotic"
+ SPFLAG_HASTY = 0x000800, // counts as "hasty"
+ SPFLAG_MAPPING = 0x001000, // a mapping spell of some kind
+ SPFLAG_ESCAPE = 0x002000, // useful for running away
+ SPFLAG_RECOVERY = 0x004000, // healing or recovery spell
+ SPFLAG_AREA = 0x008000, // area affect
+ SPFLAG_BATTLE = 0x010000, // a non-Conjuration spell that
// is still a battle spell
- SPFLAG_CARD = 0x010000, // a card effect spell
- SPFLAG_MONSTER = 0x020000, // monster-only spell
- SPFLAG_INNATE = 0x040000, // an innate spell, even if
+ SPFLAG_CARD = 0x020000, // a card effect spell
+ SPFLAG_MONSTER = 0x040000, // monster-only spell
+ SPFLAG_INNATE = 0x080000, // an innate spell, even if
// use by a priest/wizard
- SPFLAG_NOISY = 0x080000, // makes noise, even if innate
- SPFLAG_TESTING = 0x100000 // a testing/debugging spell
+ SPFLAG_NOISY = 0x100000, // makes noise, even if innate
+ SPFLAG_TESTING = 0x200000 // a testing/debugging spell
};
enum spret_type
diff --git a/crawl-ref/source/spl-data.h b/crawl-ref/source/spl-data.h
index 279c4e980f..d775c75b3f 100644
--- a/crawl-ref/source/spl-data.h
+++ b/crawl-ref/source/spl-data.h
@@ -62,9 +62,9 @@
},
{
- SPELL_APPORTATION, "Apportation",
+ SPELL_APPORTATION, "Apportation",
SPTYP_TRANSLOCATION,
- SPFLAG_GRID | SPFLAG_NOT_SELF,
+ SPFLAG_TARG_OBJ | SPFLAG_NOT_SELF,
1,
1000,
LOS_RADIUS, LOS_RADIUS,