Angband
|
Spell and prayer casting/praying. More...
Go to the source code of this file.
Functions | |
void | player_spells_init (struct player *p) |
Initialise player spells. More... | |
void | player_spells_free (struct player *p) |
Free player spells. More... | |
const struct class_book * | object_to_book (const struct object *obj) |
Get the spellbook structure from an object which is a book the player can cast from. More... | |
const struct class_spell * | spell_by_index (int index) |
int | spell_collect_from_book (const struct object *obj, int **spells) |
Collect spells from a book into the spells[] array, allocating appropriate memory. More... | |
int | spell_book_count_spells (const struct object *obj, bool(*tester)(int spell_index)) |
bool | spell_okay_list (bool(*spell_test)(int spell_index), const int spells[], int n_spells) |
bool | spell_okay_to_cast (int spell_index) |
True if the spell is castable. More... | |
bool | spell_okay_to_study (int spell_index) |
True if the spell can be studied. More... | |
bool | spell_okay_to_browse (int spell_index) |
True if the spell is browsable. More... | |
s16b | spell_chance (int spell_index) |
Returns chance of failure for a spell. More... | |
void | spell_learn (int spell_index) |
Learn the specified spell. More... | |
bool | spell_cast (int spell_index, int dir) |
Cast the specified spell. More... | |
void | get_spell_info (int index, char *buf, size_t len) |
bool | cast_spell (int tval, int index, int dir) |
bool | spell_needs_aim (int spell_index) |
expression_base_value_f | spell_value_base_by_name (const char *name) |
Spell and prayer casting/praying.
Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
This work is free software; you can redistribute it and/or modify it under the terms of either:
a) the GNU General Public License as published by the Free Software Foundation, version 2, or
b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.
References spell_append_value_info().
Referenced by spell_menu_display().
const struct class_book* object_to_book | ( | const struct object * | obj | ) |
Get the spellbook structure from an object which is a book the player can cast from.
References class_magic::books, player::class, i, player_class::magic, NULL, class_magic::num_books, class_book::sval, object::sval, class_book::tval, and object::tval.
Referenced by do_cmd_study_book(), player_book_has_unlearned_spells(), spell_book_count_spells(), and spell_collect_from_book().
Free player spells.
References mem_free(), player::spell_flags, and player::spell_order.
Referenced by cleanup_player().
Initialise player spells.
References player::class, i, player_class::magic, mem_zalloc(), player::spell_flags, player::spell_order, and class_magic::total_spells.
Referenced by do_cmd_accept_character(), and rd_player_spells().
const struct class_spell* spell_by_index | ( | int | index | ) |
References class_magic::books, player::class, player_class::magic, NULL, class_book::num_spells, class_book::spells, and class_magic::total_spells.
Referenced by calc_spells(), do_cmd_cast(), spell_append_value_info(), spell_cast(), spell_chance(), spell_learn(), spell_menu_browser(), spell_menu_display(), spell_needs_aim(), spell_okay_to_browse(), and spell_okay_to_study().
Cast the specified spell.
References beam_chance(), player::csp, player::csp_frac, class_spell::effect, effect_do(), EVENT_INPUT_FLUSH, event_signal(), mem_free(), mem_zalloc(), msg, NULL, player_exp_gain(), player_inc_timed(), player_stat_dec(), PR_MANA, PR_OBJECT, PY_SPELL_WORKED, randint0, randint1, player_upkeep::redraw, class_spell::sexp, class_spell::slevel, class_spell::smana, sound(), source_player(), spell_by_index(), spell_chance(), player::spell_flags, player::upkeep, and void().
Referenced by do_cmd_cast().
Returns chance of failure for a spell.
References player::class, player::csp, fail_adjust(), player_state::icky_wield, player::lev, player_class::magic, min_fail(), player_has, player_of_has(), class_spell::sfail, class_spell::slevel, class_spell::smana, spell_by_index(), class_magic::spell_realm, player::state, and player::timed.
Referenced by spell_cast(), and spell_menu_display().
Collect spells from a book into the spells[] array, allocating appropriate memory.
References i, mem_zalloc(), class_book::num_spells, object_to_book(), class_spell::sidx, and class_book::spells.
Referenced by spell_menu_new().
Learn the specified spell.
References player::class, i, player_class::magic, msg, msgt(), player_upkeep::new_spells, PLURAL, PR_OBJECT, PR_STUDY, PY_SPELL_LEARNED, player_upkeep::redraw, spell_by_index(), player::spell_flags, magic_realm::spell_noun, player::spell_order, class_magic::spell_realm, class_magic::total_spells, and player::upkeep.
Referenced by do_cmd_study_book(), and do_cmd_study_spell().
bool spell_needs_aim | ( | int | spell_index | ) |
References class_spell::effect, effect_aim(), and spell_by_index().
Referenced by do_cmd_cast().
bool spell_okay_to_browse | ( | int | spell_index | ) |
True if the spell is browsable.
References class_spell::slevel, and spell_by_index().
Referenced by textui_book_browse().
bool spell_okay_to_cast | ( | int | spell_index | ) |
True if the spell is castable.
References PY_SPELL_LEARNED, and player::spell_flags.
Referenced by do_cmd_cast(), and obj_can_cast_from().
bool spell_okay_to_study | ( | int | spell_index | ) |
True if the spell can be studied.
References player::lev, PY_SPELL_LEARNED, class_spell::slevel, spell_by_index(), and player::spell_flags.
Referenced by do_cmd_study_book(), do_cmd_study_spell(), obj_can_study(), and player_book_has_unlearned_spells().
expression_base_value_f spell_value_base_by_name | ( | const char * | name | ) |
References my_stricmp(), name, NULL, spell_value_base_dungeon_level(), spell_value_base_food_faint(), spell_value_base_food_starve(), spell_value_base_max_sight(), spell_value_base_player_level(), spell_value_base_spell_power(), and spell_value_base_weapon_damage().
Referenced by parse_act_expr(), parse_class_expr(), parse_curse_expr(), parse_mon_spell_expr(), parse_object_expr(), parse_trap_expr(), and parse_trap_expr_xtra().