Angband
mon-spell.h
Go to the documentation of this file.
1 
19 #ifndef MONSTER_SPELL_H
20 #define MONSTER_SPELL_H
21 
22 #include "monster.h"
23 
25 /* none so far */
26 
29 /* Spell type bitflags */
31  RST_BOLT = 0x001,
32  RST_BALL = 0x002,
33  RST_BREATH = 0x004,
34  RST_ATTACK = 0x008, /* Direct (non-projectable) attacks */
35  RST_ANNOY = 0x010, /* Irritant spells, usually non-fatal */
36  RST_HASTE = 0x020, /* Relative speed advantage */
37  RST_HEAL = 0x040,
38  RST_TACTIC = 0x080, /* Get a better position */
39  RST_ESCAPE = 0x100,
40  RST_SUMMON = 0x200
41 };
42 
43 /* Minimum flag which can fail - needs fixing NRM */
44 #define MIN_NONINNATE_SPELL (FLAG_START + 26)
45 
47 #define rsf_has(f, flag) flag_has_dbg(f, RSF_SIZE, flag, #f, #flag)
48 #define rsf_next(f, flag) flag_next(f, RSF_SIZE, flag)
49 #define rsf_is_empty(f) flag_is_empty(f, RSF_SIZE)
50 #define rsf_is_full(f) flag_is_full(f, RSF_SIZE)
51 #define rsf_is_inter(f1, f2) flag_is_inter(f1, f2, RSF_SIZE)
52 #define rsf_is_subset(f1, f2) flag_is_subset(f1, f2, RSF_SIZE)
53 #define rsf_is_equal(f1, f2) flag_is_equal(f1, f2, RSF_SIZE)
54 #define rsf_on(f, flag) flag_on_dbg(f, RSF_SIZE, flag, #f, #flag)
55 #define rsf_off(f, flag) flag_off(f, RSF_SIZE, flag)
56 #define rsf_wipe(f) flag_wipe(f, RSF_SIZE)
57 #define rsf_setall(f) flag_setall(f, RSF_SIZE)
58 #define rsf_negate(f) flag_negate(f, RSF_SIZE)
59 #define rsf_copy(f1, f2) flag_copy(f1, f2, RSF_SIZE)
60 #define rsf_union(f1, f2) flag_union(f1, f2, RSF_SIZE)
61 #define rsf_comp_union(f1, f2) flag_comp_union(f1, f2, RSF_SIZE)
62 #define rsf_inter(f1, f2) flag_inter(f1, f2, RSF_SIZE)
63 #define rsf_diff(f1, f2) flag_diff(f1, f2, RSF_SIZE)
64 
68 #define RSF_BREATH_MASK \
69  RSF_BR_ACID, RSF_BR_ELEC, RSF_BR_FIRE, RSF_BR_COLD, \
70  RSF_BR_POIS, RSF_BR_PLAS, RSF_BR_LIGHT, RSF_BR_DARK, \
71  RSF_BR_SOUN, RSF_BR_SHAR, RSF_BR_INER, RSF_BR_GRAV, \
72  RSF_BR_WALL, RSF_BR_NEXU, RSF_BR_NETH, RSF_BR_CHAO, \
73  RSF_BR_DISE, RSF_BR_TIME, RSF_BR_MANA
74 
75 
77 int breath_dam(int element, int hp);
78 void do_mon_spell(int index, struct monster *m_ptr, bool seen);
79 bool test_spells(bitflag *f, int types);
80 void set_spells(bitflag *f, int types);
81 int best_spell_power(const monster_race *r_ptr, int resist);
82 void unset_spells(bitflag *spells, bitflag *flags, bitflag *pflags,
83  struct element_info *el, const monster_race *r_ptr);
84 const char *mon_spell_lore_description(int index);
85 int mon_spell_lore_damage(int index, const monster_race *race, bool know_hp);
86 
87 #endif /* MONSTER_SPELL_H */