Angband
player-spell.h
Go to the documentation of this file.
1 
19 void player_spells_init(struct player *p);
20 void player_spells_free(struct player *p);
21 struct magic_realm *class_magic_realms(const struct player_class *c,
22  int *count);
23 const struct class_book *object_kind_to_book(const struct object_kind *kind);
24 const struct class_book *player_object_to_book(struct player *p,
25  const struct object *obj);
26 const struct class_spell *spell_by_index(int index);
27 int spell_collect_from_book(const struct object *obj, int **spells);
28 int spell_book_count_spells(const struct object *obj,
29  bool (*tester)(int spell_index));
30 bool spell_okay_list(bool (*spell_test)(int spell_index), const int spells[],
31  int n_spells);
32 bool spell_okay_to_cast(int spell_index);
33 bool spell_okay_to_study(int spell_index);
34 bool spell_okay_to_browse(int spell_index);
35 s16b spell_chance(int spell_index);
36 void spell_learn(int spell_index);
37 bool spell_cast(int spell_index, int dir);
38 
39 extern void get_spell_info(int index, char *buf, size_t len);
40 extern bool cast_spell(int tval, int index, int dir);
41 extern bool spell_needs_aim(int spell_index);
43 
struct magic_realm * class_magic_realms(const struct player_class *c, int *count)
Make a list of the spell realms the player's class has books from.
Definition: player-spell.c:157
expression_base_value_f spell_value_base_by_name(const char *name)
Definition: player-spell.c:710
A structure to hold class-dependent information on spell books.
Definition: player.h:282
Structure for magic realms.
Definition: player.h:251
bool spell_okay_to_browse(int spell_index)
True if the spell is browsable.
Definition: player-spell.c:334
Information about object kinds, including player knowledge.
Definition: object.h:163
bool spell_needs_aim(int spell_index)
Definition: player-spell.c:543
bool spell_cast(int spell_index, int dir)
Cast the specified spell.
Definition: player-spell.c:479
void get_spell_info(int index, char *buf, size_t len)
Definition: player-spell.c:637
Player class info.
Definition: player.h:305
int spell_book_count_spells(const struct object *obj, bool(*tester)(int spell_index))
png_bytep buf
Definition: libpng12/png.h:2815
void player_spells_free(struct player *p)
Free player spells.
Definition: player-spell.c:148
s32b(* expression_base_value_f)(void)
Definition: z-expression.h:34
const char ** p[]
Definition: name.c:40
int16_t s16b
Definition: h-basic.h:170
const struct class_book * object_kind_to_book(const struct object_kind *kind)
Get the spellbook structure from any object which is a book.
Definition: player-spell.c:205
A structure to hold class-dependent information on spells.
Definition: player.h:264
bool cast_spell(int tval, int index, int dir)
bool spell_okay_to_study(int spell_index)
True if the spell can be studied.
Definition: player-spell.c:324
bool spell_okay_to_cast(int spell_index)
True if the spell is castable.
Definition: player-spell.c:316
int spell_collect_from_book(const struct object *obj, int **spells)
Collect spells from a book into the spells[] array, allocating appropriate memory.
Definition: player-spell.c:260
const struct class_spell * spell_by_index(int index)
Definition: player-spell.c:239
bool spell_okay_list(bool(*spell_test)(int spell_index), const int spells[], int n_spells)
Intialize random names
Definition: init.c:838
void player_spells_init(struct player *p)
Initialise player spells.
Definition: player-spell.c:129
Most of the "player" information goes here.
Definition: player.h:489
s16b spell_chance(int spell_index)
Returns chance of failure for a spell.
Definition: player-spell.c:361
int index
Definition: obj-info.c:68
void spell_learn(int spell_index)
Learn the specified spell.
Definition: player-spell.c:439
const struct class_book * player_object_to_book(struct player *p, const struct object *obj)
Get the spellbook structure from an object which is a book the player can cast from.
Definition: player-spell.c:226