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_NONE = 0x000,
32  RST_BOLT = 0x001,
33  RST_BALL = 0x002,
34  RST_BREATH = 0x004,
35  RST_ATTACK = 0x008, /* Direct (non-projectable) attacks */
36  RST_ANNOY = 0x010, /* Irritant spells, usually non-fatal */
37  RST_HASTE = 0x020, /* Relative speed advantage */
38  RST_HEAL = 0x040,
39  RST_HEAL_OTHER = 0x080,
40  RST_TACTIC = 0x100, /* Get a better position */
41  RST_ESCAPE = 0x200,
42  RST_SUMMON = 0x400,
43  RST_INNATE = 0x800
44 };
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_count(f) flag_count(f, RSF_SIZE)
50 #define rsf_is_empty(f) flag_is_empty(f, RSF_SIZE)
51 #define rsf_is_full(f) flag_is_full(f, RSF_SIZE)
52 #define rsf_is_inter(f1, f2) flag_is_inter(f1, f2, RSF_SIZE)
53 #define rsf_is_subset(f1, f2) flag_is_subset(f1, f2, RSF_SIZE)
54 #define rsf_is_equal(f1, f2) flag_is_equal(f1, f2, RSF_SIZE)
55 #define rsf_on(f, flag) flag_on_dbg(f, RSF_SIZE, flag, #f, #flag)
56 #define rsf_off(f, flag) flag_off(f, RSF_SIZE, flag)
57 #define rsf_wipe(f) flag_wipe(f, RSF_SIZE)
58 #define rsf_setall(f) flag_setall(f, RSF_SIZE)
59 #define rsf_negate(f) flag_negate(f, RSF_SIZE)
60 #define rsf_copy(f1, f2) flag_copy(f1, f2, RSF_SIZE)
61 #define rsf_union(f1, f2) flag_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 const struct monster_spell *monster_spell_by_index(int index);
79 void do_mon_spell(int index, struct monster *mon, bool seen);
80 bool test_spells(bitflag *f, int types);
81 void ignore_spells(bitflag *f, int types);
82 int best_spell_power(const struct monster_race *race, int resist);
83 void unset_spells(bitflag *spells, bitflag *flags, bitflag *pflags,
84  struct element_info *el, const struct monster *mon);
85 bool mon_spell_is_innate(int index);
86 void create_mon_spell_mask(bitflag *f, ...);
87 const char *mon_spell_lore_description(int index,
88  const struct monster_race *race);
89 int mon_spell_lore_damage(int index, const struct monster_race *race,
90  bool know_hp);
91 
92 #endif /* MONSTER_SPELL_H */
void do_mon_spell(int index, struct monster *mon, bool seen)
Process a monster spell.
Definition: mon-spell.c:174
Monster "race" information, including racial memories.
Definition: monster.h:265
mon_spell_type
Variables.
Definition: mon-spell.h:30
Definition: mon-spell.h:43
Monster information, for a specific monster.
Definition: monster.h:323
Definition: mon-spell.h:31
int breath_dam(int element, int hp)
Functions.
Definition: mon-spell.c:381
Definition: mon-spell.h:41
Definition: mon-spell.h:35
Definition: mon-spell.h:34
const struct monster_spell * monster_spell_by_index(int index)
Definition: mon-spell.c:137
Definition: mon-spell.h:39
Monster spell types.
Definition: monster.h:168
bool mon_spell_is_innate(int index)
Definition: mon-spell.c:248
int best_spell_power(const struct monster_race *race, int resist)
Calculate a monster's maximum spell power.
Definition: mon-spell.c:423
Definition: mon-spell.h:32
Definition: mon-spell.h:42
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:296
Element info type.
Definition: object.h:108
bool test_spells(bitflag *f, int types)
Test a spell bitflag for a type of spell.
Definition: mon-spell.c:260
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:523
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:277
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