#include <unit_types.hpp>
Public Member Functions | |
attack_type (const config &cfg) | |
const t_string & | name () const |
const std::string & | id () const |
const std::string & | type () const |
const std::string & | icon () const |
const std::string & | range () const |
std::string | accuracy_parry_description () const |
int | accuracy () const |
int | parry () const |
int | damage () const |
int | num_attacks () const |
double | attack_weight () const |
double | defense_weight () const |
bool | get_special_bool (const std::string &special, bool force=false) const |
unit_ability_list | get_specials (const std::string &special) const |
std::vector< std::string > | special_tooltips (bool force=false) const |
std::string | weapon_specials (bool force=false) const |
void | set_specials_context (const gamemap::location &aloc, const gamemap::location &dloc, const unit_map *unitmap, const gamemap *map, const gamestatus *game_status, const std::vector< team > *teams, bool attacker, const attack_type *other_attack) const |
void | set_specials_context (const gamemap::location &loc, const gamemap::location &dloc, const unit &un, bool attacker=true) const |
bool | has_special_by_id (const std::string &special) const |
bool | matches_filter (const config &cfg, bool self=false) const |
bool | apply_modification (const config &cfg, std::string *description) |
bool | describe_modification (const config &cfg, std::string *description) |
int | movement_used () const |
config & | get_cfg () |
const config & | get_cfg () const |
bool | special_active (const config &cfg, bool self, bool report=false) const |
bool | special_affects_opponent (const config &cfg) const |
bool | special_affects_self (const config &cfg) const |
const unit_animation * | animation (const game_display &disp, const gamemap::location &loc, const unit *my_unit, const unit_animation::hit_type hit, const attack_type *secondary_attack, int swing_num, int damage) const |
Public Attributes | |
gamemap::location | aloc_ |
gamemap::location | dloc_ |
bool | attacker_ |
const unit_map * | unitmap_ |
const gamemap * | map_ |
const gamestatus * | game_status_ |
const std::vector< team > * | teams_ |
const attack_type * | other_attack_ |
config | cfg_ |
std::vector< unit_animation > | animation_ |
Private Attributes | |
t_string | description_ |
std::string | id_ |
std::string | type_ |
std::string | icon_ |
std::string | range_ |
int | damage_ |
int | num_attacks_ |
double | attack_weight_ |
double | defense_weight_ |
int | accuracy_ |
int | parry_ |
Definition at line 36 of file unit_types.hpp.
attack_type::attack_type | ( | const config & | cfg | ) |
Definition at line 42 of file unit_types.cpp.
References accuracy_, attack_weight_, cfg_, damage_, defense_weight_, description_, egettext(), t_string::empty(), game_status_, icon_, id_, map_, num_attacks_, other_attack_, parry_, range_, teams_, type_, and unitmap_.
const t_string& attack_type::name | ( | ) | const [inline] |
Definition at line 41 of file unit_types.hpp.
References description_.
Referenced by attack::attack(), events::mouse_handler::attack_enemy_(), special_tooltips(), and weapon_specials().
const std::string& attack_type::id | ( | ) | const [inline] |
Definition at line 42 of file unit_types.hpp.
References id_.
Referenced by attack::fire_event(), and matches_filter().
const std::string& attack_type::type | ( | ) | const [inline] |
Definition at line 43 of file unit_types.hpp.
References type_.
Referenced by matches_filter(), unit_movement_type::resistance_against(), unit::resistance_against(), and unit::resistance_filter_matches().
const std::string& attack_type::icon | ( | ) | const [inline] |
Definition at line 44 of file unit_types.hpp.
References icon_.
Referenced by events::mouse_handler::attack_enemy_().
const std::string& attack_type::range | ( | ) | const [inline] |
Definition at line 45 of file unit_types.hpp.
References range_.
Referenced by events::mouse_handler::attack_enemy_(), battle_context::choose_defender_weapon(), and matches_filter().
std::string attack_type::accuracy_parry_description | ( | ) | const |
int attack_type::accuracy | ( | ) | const [inline] |
Definition at line 47 of file unit_types.hpp.
References accuracy_.
Referenced by battle_context::unit_stats::unit_stats().
int attack_type::parry | ( | ) | const [inline] |
Definition at line 48 of file unit_types.hpp.
References parry_.
Referenced by battle_context::unit_stats::unit_stats().
int attack_type::damage | ( | ) | const [inline] |
Definition at line 49 of file unit_types.hpp.
References damage_.
Referenced by battle_context::unit_stats::unit_stats().
int attack_type::num_attacks | ( | ) | const [inline] |
Definition at line 50 of file unit_types.hpp.
References num_attacks_.
Referenced by battle_context::unit_stats::unit_stats().
double attack_type::attack_weight | ( | ) | const [inline] |
Definition at line 51 of file unit_types.hpp.
References attack_weight_.
Referenced by battle_context::choose_attacker_weapon().
double attack_type::defense_weight | ( | ) | const [inline] |
Definition at line 52 of file unit_types.hpp.
References defense_weight_.
Referenced by battle_context::choose_defender_weapon().
bool attack_type::get_special_bool | ( | const std::string & | special, | |
bool | force = false | |||
) | const |
Definition at line 514 of file unit_abilities.cpp.
References cfg_, config::child(), config::get_children(), other_attack_, and special_active().
Referenced by matches_filter(), and battle_context::unit_stats::unit_stats().
unit_ability_list attack_type::get_specials | ( | const std::string & | special | ) | const |
Definition at line 539 of file unit_abilities.cpp.
References aloc_, attacker_, cfg_, unit_ability_list::cfgs, config::child(), dloc_, config::get_children(), other_attack_, and special_active().
Referenced by battle_context::unit_stats::unit_stats().
std::vector< std::string > attack_type::special_tooltips | ( | bool | force = false |
) | const |
Definition at line 566 of file unit_abilities.cpp.
References config::all_children(), cfg_, config::child(), name(), and special_active().
std::string attack_type::weapon_specials | ( | bool | force = false |
) | const |
Definition at line 595 of file unit_abilities.cpp.
References config::all_children(), cfg_, config::child(), name(), and special_active().
Referenced by events::mouse_handler::attack_enemy_().
void attack_type::set_specials_context | ( | const gamemap::location & | aloc, | |
const gamemap::location & | dloc, | |||
const unit_map * | unitmap, | |||
const gamemap * | map, | |||
const gamestatus * | game_status, | |||
const std::vector< team > * | teams, | |||
bool | attacker, | |||
const attack_type * | other_attack | |||
) | const |
Definition at line 810 of file unit_abilities.cpp.
References aloc_, attacker_, dloc_, game_status_, map_, other_attack_, teams_, and unitmap_.
Referenced by events::mouse_handler::attack_enemy_(), and battle_context::unit_stats::unit_stats().
void attack_type::set_specials_context | ( | const gamemap::location & | loc, | |
const gamemap::location & | dloc, | |||
const unit & | un, | |||
bool | attacker = true | |||
) | const |
Definition at line 825 of file unit_abilities.cpp.
References aloc_, attacker_, dloc_, game_status_, unit::gamestatus_, unit::map_, map_, other_attack_, unit::teams_, teams_, unitmap_, and unit::units_.
bool attack_type::has_special_by_id | ( | const std::string & | special | ) | const |
Definition at line 268 of file unit_types.cpp.
References config::all_children(), cfg_, and config::child().
bool attack_type::matches_filter | ( | const config & | cfg, | |
bool | self = false | |||
) | const |
Definition at line 101 of file unit_types.cpp.
References get_special_bool(), id(), range(), utils::split(), and type().
Referenced by apply_modification(), describe_modification(), unit_animation::matches(), and special_active().
bool attack_type::apply_modification | ( | const config & | cfg, | |
std::string * | description | |||
) |
Definition at line 123 of file unit_types.cpp.
References _n, accuracy_, config::add_child(), utils::apply_modifier(), attack_weight_, cfg_, config::child(), config::clear_children(), damage_, defense_weight_, description_, t_string::empty(), config::get_attribute(), id_, matches_filter(), num_attacks_, config::ordered_begin(), config::ordered_end(), parry_, utils::split(), type_, and value.
bool attack_type::describe_modification | ( | const config & | cfg, | |
std::string * | description | |||
) |
int attack_type::movement_used | ( | ) | const [inline] |
config& attack_type::get_cfg | ( | ) | [inline] |
const config& attack_type::get_cfg | ( | ) | const [inline] |
bool attack_type::special_active | ( | const config & | cfg, | |
bool | self, | |||
bool | report = false | |||
) | const |
Definition at line 628 of file unit_abilities.cpp.
References aloc_, attacker_, config::child(), dloc_, unit_map::end(), unit_map::find(), game_status_, get_adjacent_tiles(), config::get_children(), map_, terrain_filter::match(), matches_filter(), gamemap::location::NDIRECTIONS, other_attack_, gamemap::location::parse_direction(), special_affects_opponent(), special_affects_self(), utils::split(), and unitmap_.
Referenced by get_special_bool(), get_specials(), special_tooltips(), and weapon_specials().
bool attack_type::special_affects_opponent | ( | const config & | cfg | ) | const |
Definition at line 773 of file unit_abilities.cpp.
References attacker_.
Referenced by special_active().
bool attack_type::special_affects_self | ( | const config & | cfg | ) | const |
Definition at line 794 of file unit_abilities.cpp.
References attacker_.
Referenced by special_active().
const unit_animation* attack_type::animation | ( | const game_display & | disp, | |
const gamemap::location & | loc, | |||
const unit * | my_unit, | |||
const unit_animation::hit_type | hit, | |||
const attack_type * | secondary_attack, | |||
int | swing_num, | |||
int | damage | |||
) | const |
gamemap::location attack_type::aloc_ [mutable] |
Definition at line 76 of file unit_types.hpp.
Referenced by get_specials(), set_specials_context(), and special_active().
gamemap::location attack_type::dloc_ [mutable] |
Definition at line 76 of file unit_types.hpp.
Referenced by get_specials(), set_specials_context(), and special_active().
bool attack_type::attacker_ [mutable] |
Definition at line 77 of file unit_types.hpp.
Referenced by get_specials(), set_specials_context(), special_active(), special_affects_opponent(), and special_affects_self().
const unit_map* attack_type::unitmap_ [mutable] |
Definition at line 78 of file unit_types.hpp.
Referenced by attack_type(), set_specials_context(), and special_active().
const gamemap* attack_type::map_ [mutable] |
Definition at line 79 of file unit_types.hpp.
Referenced by attack_type(), set_specials_context(), and special_active().
const gamestatus* attack_type::game_status_ [mutable] |
Definition at line 80 of file unit_types.hpp.
Referenced by attack_type(), set_specials_context(), and special_active().
const std::vector<team>* attack_type::teams_ [mutable] |
Definition at line 81 of file unit_types.hpp.
Referenced by attack_type(), and set_specials_context().
const attack_type* attack_type::other_attack_ [mutable] |
Definition at line 82 of file unit_types.hpp.
Referenced by attack_type(), get_special_bool(), get_specials(), set_specials_context(), and special_active().
Definition at line 90 of file unit_types.hpp.
Referenced by apply_modification(), attack_type(), get_cfg(), get_special_bool(), get_specials(), has_special_by_id(), movement_used(), special_tooltips(), and weapon_specials().
std::vector<unit_animation> attack_type::animation_ |
Definition at line 94 of file unit_types.hpp.
t_string attack_type::description_ [private] |
Definition at line 96 of file unit_types.hpp.
Referenced by apply_modification(), attack_type(), and name().
std::string attack_type::id_ [private] |
Definition at line 97 of file unit_types.hpp.
Referenced by apply_modification(), attack_type(), and id().
std::string attack_type::type_ [private] |
Definition at line 98 of file unit_types.hpp.
Referenced by apply_modification(), attack_type(), and type().
std::string attack_type::icon_ [private] |
std::string attack_type::range_ [private] |
int attack_type::damage_ [private] |
Definition at line 101 of file unit_types.hpp.
Referenced by apply_modification(), attack_type(), and damage().
int attack_type::num_attacks_ [private] |
Definition at line 102 of file unit_types.hpp.
Referenced by apply_modification(), attack_type(), and num_attacks().
double attack_type::attack_weight_ [private] |
Definition at line 103 of file unit_types.hpp.
Referenced by apply_modification(), attack_type(), and attack_weight().
double attack_type::defense_weight_ [private] |
Definition at line 104 of file unit_types.hpp.
Referenced by apply_modification(), attack_type(), and defense_weight().
int attack_type::accuracy_ [private] |
Definition at line 106 of file unit_types.hpp.
Referenced by accuracy(), accuracy_parry_description(), apply_modification(), and attack_type().
int attack_type::parry_ [private] |
Definition at line 107 of file unit_types.hpp.
Referenced by accuracy_parry_description(), apply_modification(), attack_type(), and parry().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |