3 * Summary: Spell casting functions.
4 * Written by: Linley Henzell
15 SPFLAG_NONE
= 0x000000,
16 SPFLAG_DIR_OR_TARGET
= 0x000001, // use DIR_NONE targeting
17 SPFLAG_TARGET
= 0x000002, // use DIR_TARGET targeting
18 SPFLAG_GRID
= 0x000004, // use DIR_GRID targeting
19 SPFLAG_DIR
= 0x000008, // use DIR_DIR targeting
20 SPFLAG_TARG_OBJ
= 0x000010, // use DIR_TARGET_OBJECT targ.
21 SPFLAG_TARGETING_MASK
= 0x00001f, // used to test for targeting
22 SPFLAG_HELPFUL
= 0x000020, // TARG_FRIENDS used
23 SPFLAG_NEUTRAL
= 0x000040, // TARG_ANY used
24 SPFLAG_NOT_SELF
= 0x000080, // aborts on isMe
25 SPFLAG_UNHOLY
= 0x000100, // counts as "unholy"
26 SPFLAG_UNCLEAN
= 0x000200, // counts as "unclean"
27 SPFLAG_CHAOTIC
= 0x000400, // counts as "chaotic"
28 SPFLAG_HASTY
= 0x000800, // counts as "hasty"
29 SPFLAG_MAPPING
= 0x001000, // a mapping spell of some kind
30 SPFLAG_ESCAPE
= 0x002000, // useful for running away
31 SPFLAG_RECOVERY
= 0x004000, // healing or recovery spell
32 SPFLAG_AREA
= 0x008000, // area affect
33 SPFLAG_BATTLE
= 0x010000, // a non-Conjuration spell that
34 // is still a battle spell
35 SPFLAG_CARD
= 0x020000, // a card effect spell
36 SPFLAG_MONSTER
= 0x040000, // monster-only spell
37 SPFLAG_INNATE
= 0x080000, // an innate spell, even if
38 // use by a priest/wizard
39 SPFLAG_NOISY
= 0x100000, // makes noise, even if innate
40 SPFLAG_TESTING
= 0x200000, // a testing/debugging spell
41 SPFLAG_CORPSE_VIOLATING
= 0x400000, // Conduct violation for Fedhas
42 SPFLAG_ALLOW_SELF
= 0x800000, // Not helpful, but may want to
48 SPRET_ABORT
= 0, // should be left as 0
51 SPRET_NONE
, // spell was not handled
54 typedef bool (*spell_selector
)(spell_type spell
);
56 int list_spells(bool toggle_with_I
= true, bool viewing
= false,
57 bool allow_preselect
= true, int minRange
= -1,
58 spell_selector selector
= NULL
);
59 int spell_fail(spell_type spell
);
60 int calc_spell_power(spell_type spell
, bool apply_intel
,
61 bool fail_rate_chk
= false, bool cap_power
= true,
63 int calc_spell_range(spell_type spell
, int power
= 0,
64 bool real_cast
= false, bool rod
= false);
65 int spell_enhancement(unsigned int typeflags
);
67 bool cast_a_spell(bool check_range
, spell_type spell
= SPELL_NO_SPELL
);
69 void inspect_spells();
70 void do_cast_spell_cmd(bool force
);
72 spret_type
your_spells(spell_type spell
, int powc
= 0, bool allow_fail
= true,
73 bool check_range
= true, int range_power
= 0);
75 const char* failure_rate_to_string(int fail
);
77 int spell_power_colour(spell_type spell
);
78 int spell_power_bars(spell_type spell
, bool rod
);
79 std::string
spell_power_string(spell_type spell
, bool rod
= false);
80 std::string
spell_range_string(spell_type spell
, bool rod
= false);
81 std::string
spell_schools_string(spell_type spell
);
82 const char* spell_hunger_string(spell_type spell
, bool rod
= false);
83 std::string
spell_noise_string(spell_type spell
);
85 bool is_prevented_teleport(spell_type spell
);
87 bool spell_is_uncastable(spell_type spell
, std::string
&message
);