Angband
|
structures and functions for monster spells More...
#include "monster.h"
Go to the source code of this file.
Enumerations | |
enum | mon_spell_type { RST_NONE = 0x0000, RST_BOLT = 0x0001, RST_BALL = 0x0002, RST_BREATH = 0x0004, RST_DIRECT = 0x0008, RST_ANNOY = 0x0010, RST_HASTE = 0x0020, RST_HEAL = 0x0040, RST_HEAL_OTHER = 0x0080, RST_TACTIC = 0x0100, RST_ESCAPE = 0x0200, RST_SUMMON = 0x0400, RST_INNATE = 0x0800, RST_ARCHERY = 0x1000 } |
Variables. More... | |
Functions | |
int | breath_dam (int element, int hp) |
Functions. More... | |
const struct monster_spell * | monster_spell_by_index (int index) |
void | do_mon_spell (int index, struct monster *mon, bool seen) |
Process a monster spell. More... | |
bool | test_spells (bitflag *f, int types) |
Test a spell bitflag for a type of spell. More... | |
void | ignore_spells (bitflag *f, int types) |
Set a spell bitflag to ignore a specific set of spell types. More... | |
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, subject to intelligence and chance. More... | |
bool | mon_spell_is_innate (int index) |
void | create_mon_spell_mask (bitflag *f,...) |
Create a mask of monster spell flags of a specific type. More... | |
const char * | mon_spell_lore_description (int index, const struct monster_race *race) |
int | mon_spell_lore_damage (int index, const struct monster_race *race, bool know_hp) |
structures and functions for monster spells
Copyright (c) 2011 Chris Carr
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.
#define rsf_count | ( | f | ) | flag_count(f, RSF_SIZE) |
Referenced by lore_append_spell_clause().
Referenced by lore_append_spells(), and monster_has_non_innate_spells().
#define rsf_has | ( | f, | |
flag | |||
) | flag_has_dbg(f, RSF_SIZE, flag, #f, #flag) |
Macros.
Referenced by choose_attack_spell(), ignore_spells(), lore_learn_spell_if_has(), project_monster_breath(), project_monster_handler_CHAOS(), project_monster_handler_FORCE(), project_monster_handler_GRAVITY(), project_monster_handler_LIGHT(), project_monster_handler_NETHER(), remove_bad_spells(), test_spells(), and unset_spells().
#define rsf_is_empty | ( | f | ) | flag_is_empty(f, RSF_SIZE) |
#define rsf_is_full | ( | f | ) | flag_is_full(f, RSF_SIZE) |
Referenced by mon_pit_hook().
Referenced by mon_pit_hook().
#define rsf_negate | ( | f | ) | flag_negate(f, RSF_SIZE) |
Referenced by lore_append_spell_clause(), and monster_change_shape().
Referenced by ignore_spells(), remove_bad_spells(), and unset_spells().
#define rsf_on | ( | f, | |
flag | |||
) | flag_on_dbg(f, RSF_SIZE, flag, #f, #flag) |
#define rsf_setall | ( | f | ) | flag_setall(f, RSF_SIZE) |
Referenced by finish_parse_lore(), and parse_monster_spells().
Referenced by create_mon_spell_mask().
#define RST_DAMAGE (RST_BOLT | RST_BALL | RST_BREATH | RST_DIRECT) |
Referenced by make_ranged_attack(), and mon_spell_has_damage().
enum mon_spell_type |
Functions.
Functions.
type | is the attack element type |
hp | is the monster's hp |
References projection::damage_cap, projection::divisor, projections, and mon_spell_info::type.
Referenced by effect_handler_BREATH(), and mon_spell_dam().
Create a mask of monster spell flags of a specific type.
f | is the flag array we're filling |
... | is the list of flags we're looking for |
N.B. RST_NONE must be the last item in the ... list
References args, i, mon_spell_info::index, mon_spell_types, rsf_on, rsf_wipe, RST_NONE, and mon_spell_info::type.
Referenced by lore_append_spells(), monster_breathes(), monster_change_shape(), monster_has_innate_spells(), monster_has_non_innate_spells(), and monster_loves_archery().
Process a monster spell.
index | is the monster spell flag (RSF_FOO) |
mon | is the attacking monster |
seen | is whether the player can see the monster at this moment |
References cave, cave_monster(), check_hit(), check_hit_monster(), CONF_HIT_REDUCTION, disturb(), monster_spell::effect, effect_do(), monster_spell::hit, monster_spell::level, monster_race::level, MAX, target::midx, monster::midx, monster_effect_level(), monster_spell_by_index(), msg, monster_spell_level::next, monster_spell_level::power, monster::race, randint0, monster_spell_level::save_message, SKILL_SAVE, player_state::skills, source_monster(), spell_check_for_fail_rune(), spell_message(), monster_race::spell_power, player::state, and monster::target.
Referenced by do_cmd_mon_command(), and make_ranged_attack().
Set a spell bitflag to ignore a specific set of spell types.
f | is the set of spell flags we're pruning |
types | is the spell type(s) we're ignoring |
References mon_spell_info::index, mon_spell_types, rsf_has, rsf_off, and mon_spell_info::type.
Referenced by make_ranged_attack().
bool mon_spell_is_innate | ( | int | index | ) |
References mon_spell_info::index, mon_spell_types, RST_INNATE, and mon_spell_info::type.
Referenced by choose_attack_spell(), do_cmd_mon_command(), and make_ranged_attack().
int mon_spell_lore_damage | ( | int | index, |
const struct monster_race * | race, | ||
bool | know_hp | ||
) |
References monster_race::avg_hp, MAXIMISE, mon_spell_dam(), mon_spell_has_damage(), and mon_spell_is_valid().
Referenced by lore_append_spell_clause().
const char* mon_spell_lore_description | ( | int | index, |
const struct monster_race * | race | ||
) |
const struct monster_spell* monster_spell_by_index | ( | int | index | ) |
References monster_spell::index, monster_spells, and monster_spell::next.
Referenced by do_mon_spell(), mon_spell_dam(), mon_spell_lore_description(), monster_change_shape(), spell_color(), and unset_spells().
Test a spell bitflag for a type of spell.
Returns true if any desired type is among the flagset
f | is the set of spell flags we're testing |
types | is the spell type(s) we're looking for |
References mon_spell_info::index, mon_spell_types, rsf_has, and mon_spell_info::type.
Referenced by make_ranged_attack().
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, subject to intelligence and chance.
spells | is the set of spells we're pruning |
flags | is the set of object flags we're testing |
pflags | is the set of player flags we're testing |
el | is what we know about the monster's elemental resists |
race | is the monster type we're operating on |
References effect, monster_spell::effect, timed_effect_data::fail, effect::index, mon_spell_info::index, mon_spell_types, monster_is_smart(), monster_spell_by_index(), effect::next, of_has, one_in_, pf_has, randint0, element_info::res_level, rsf_has, rsf_off, RST_BALL, RST_BOLT, RST_BREATH, effect::subtype, timed_effects, and mon_spell_info::type.
Referenced by remove_bad_spells().