Go to the documentation of this file.
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, struct command *cmd);
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);
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:730
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:343
Information about object kinds, including player knowledge.
Definition: object.h:182
The struct command type is used to return details of the command the game should carry out...
Definition: cmd-core.h:176
bool spell_needs_aim(int spell_index)
Definition: player-spell.c:554
void get_spell_info(int index, char *buf, size_t len)
Definition: player-spell.c:667
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:162
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 spell_cast(int spell_index, int dir, struct command *cmd)
Cast the specified spell.
Definition: player-spell.c:484
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:332
bool spell_okay_to_cast(int spell_index)
True if the spell is castable.
Definition: player-spell.c:324
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:1084
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:503
s16b spell_chance(int spell_index)
Returns chance of failure for a spell.
Definition: player-spell.c:371
int index
Definition: obj-info.c:68
void spell_learn(int spell_index)
Learn the specified spell.
Definition: player-spell.c:444
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