Go to the documentation of this file.
19 #ifndef MONSTER_SPELL_H
20 #define MONSTER_SPELL_H
22 #include "monster.h"
25 /* none so far */
29 /* Spell type bitflags */
31  RST_NONE = 0x0000,
32  RST_BOLT = 0x0001,
33  RST_BALL = 0x0002, /* Ball spells, but also beams */
34  RST_BREATH = 0x0004,
35  RST_DIRECT = 0x0008, /* Direct (non-projectable) attacks */
36  RST_ANNOY = 0x0010, /* Irritant spells, usually non-fatal */
37  RST_HASTE = 0x0020, /* Relative speed advantage */
38  RST_HEAL = 0x0040,
39  RST_HEAL_OTHER = 0x0080,
40  RST_TACTIC = 0x0100, /* Get a better position */
41  RST_ESCAPE = 0x0200,
42  RST_SUMMON = 0x0400,
43  RST_INNATE = 0x0800,
44  RST_ARCHERY = 0x1000
45 };
50 #define rsf_has(f, flag) flag_has_dbg(f, RSF_SIZE, flag, #f, #flag)
51 #define rsf_next(f, flag) flag_next(f, RSF_SIZE, flag)
52 #define rsf_count(f) flag_count(f, RSF_SIZE)
53 #define rsf_is_empty(f) flag_is_empty(f, RSF_SIZE)
54 #define rsf_is_full(f) flag_is_full(f, RSF_SIZE)
55 #define rsf_is_inter(f1, f2) flag_is_inter(f1, f2, RSF_SIZE)
56 #define rsf_is_subset(f1, f2) flag_is_subset(f1, f2, RSF_SIZE)
57 #define rsf_is_equal(f1, f2) flag_is_equal(f1, f2, RSF_SIZE)
58 #define rsf_on(f, flag) flag_on_dbg(f, RSF_SIZE, flag, #f, #flag)
59 #define rsf_off(f, flag) flag_off(f, RSF_SIZE, flag)
60 #define rsf_wipe(f) flag_wipe(f, RSF_SIZE)
61 #define rsf_setall(f) flag_setall(f, RSF_SIZE)
62 #define rsf_negate(f) flag_negate(f, RSF_SIZE)
63 #define rsf_copy(f1, f2) flag_copy(f1, f2, RSF_SIZE)
64 #define rsf_union(f1, f2) flag_union(f1, f2, RSF_SIZE)
65 #define rsf_inter(f1, f2) flag_inter(f1, f2, RSF_SIZE)
66 #define rsf_diff(f1, f2) flag_diff(f1, f2, RSF_SIZE)
70 int breath_dam(int element, int hp);
71 const struct monster_spell *monster_spell_by_index(int index);
72 void do_mon_spell(int index, struct monster *mon, bool seen);
73 bool test_spells(bitflag *f, int types);
74 void ignore_spells(bitflag *f, int types);
75 void unset_spells(bitflag *spells, bitflag *flags, bitflag *pflags,
76  struct element_info *el, const struct monster *mon);
77 bool mon_spell_is_innate(int index);
78 void create_mon_spell_mask(bitflag *f, ...);
79 const char *mon_spell_lore_description(int index,
80  const struct monster_race *race);
81 int mon_spell_lore_damage(int index, const struct monster_race *race,
82  bool know_hp);
84 #endif /* MONSTER_SPELL_H */
void do_mon_spell(int index, struct monster *mon, bool seen)
Process a monster spell.
Definition: mon-spell.c:224
Monster "race" information, including racial memories.
Definition: monster.h:307
Definition: mon-spell.h:30
Definition: mon-spell.h:43
Monster information, for a specific monster.
Definition: monster.h:369
Definition: mon-spell.h:31
int breath_dam(int element, int hp)
Definition: mon-spell.c:444
Definition: mon-spell.h:41
Definition: mon-spell.h:34
const struct monster_spell * monster_spell_by_index(int index)
Definition: mon-spell.c:187
Definition: mon-spell.h:39
Definition: mon-spell.h:44
Monster spell types.
Definition: monster.h:186
bool mon_spell_is_innate(int index)
Definition: mon-spell.c:309
Definition: mon-spell.h:32
Definition: mon-spell.h:42
Definition: mon-spell.h:35
png_uint_32 int flags
Definition: libpng12/png.h:1681
Definition: mon-spell.h:37
byte bitflag
Definition: z-bitflag.h:27
Flags, structures and variables for monsters.
Definition: mon-spell.h:33
void unset_spells(bitflag *spells, bitflag *flags, bitflag *pflags, struct element_info *el, const struct monster *mon)
Turn off spells with a side effect or a proj_type that is resisted by something in flags...
Definition: mon-spell.c:357
Element info type.
Definition: object.h:114
bool test_spells(bitflag *f, int types)
Test a spell bitflag for a type of spell.
Definition: mon-spell.c:321
Definition: mon-spell.h:38
const char * mon_spell_lore_description(int index, const struct monster_race *race)
Definition: mon-spell.c:511
int mon_spell_lore_damage(int index, const struct monster_race *race, bool know_hp)
Definition: mon-spell.c:528
Definition: mon-spell.h:40
void ignore_spells(bitflag *f, int types)
Set a spell bitflag to ignore a specific set of spell types.
Definition: mon-spell.c:338
void create_mon_spell_mask(bitflag *f,...)
Create a mask of monster spell flags of a specific type.
Definition: mon-spell.c:487
int index
Definition: obj-info.c:68
Definition: mon-spell.h:36