#include <unit_types.hpp>

Public Member Functions | |
| attack_type (const config &cfg) | |
| ~attack_type () | |
| Default implementation, but defined out-of-line for efficiency reasons. | |
| 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< t_string > | special_tooltips (bool force=false) const |
| std::string | weapon_specials (bool force=false) const |
| void | set_specials_context (const map_location &aloc, const map_location &dloc, const unit_map &unitmap, bool attacker, const attack_type *other_attack) const |
| void | set_specials_context (const map_location &loc, const map_location &dloc, const unit &un, bool attacker=true) 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) const |
| bool | special_affects_opponent (const config &cfg) const |
| bool | special_affects_self (const config &cfg) const |
| const unit_animation * | animation (const display &disp, const map_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 | |
| map_location | aloc_ |
| map_location | dloc_ |
| bool | attacker_ |
| const unit_map * | unitmap_ |
| const attack_type * | other_attack_ |
Private Attributes | |
| config | cfg_ |
| 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 30 of file unit_types.hpp.
| attack_type::attack_type | ( | const config & | cfg | ) |
Definition at line 42 of file unit_types.cpp.
References description_, egettext(), t_string::empty(), icon_, and id_.

| attack_type::~attack_type | ( | ) |
Default implementation, but defined out-of-line for efficiency reasons.
Definition at line 73 of file unit_types.cpp.
| int attack_type::accuracy | ( | ) | const [inline] |
Definition at line 43 of file unit_types.hpp.
References accuracy_.
Referenced by attack_info(), and battle_context_unit_stats::battle_context_unit_stats().

| std::string attack_type::accuracy_parry_description | ( | ) | const |
Definition at line 77 of file unit_types.cpp.
References accuracy_, parry_, and utils::signed_percent().
Referenced by attack_info().


| const unit_animation* attack_type::animation | ( | const display & | disp, | |
| const map_location & | loc, | |||
| const unit * | my_unit, | |||
| const unit_animation::hit_type | hit, | |||
| const attack_type * | secondary_attack, | |||
| int | swing_num, | |||
| int | damage | |||
| ) | const |
| bool attack_type::apply_modification | ( | const config & | cfg, | |
| std::string * | description | |||
| ) |
Definition at line 120 of file unit_types.cpp.
References _, _n, accuracy_, config::add_child(), config::all_children_range(), utils::apply_modifier(), attack_weight_, config::any_child::cfg, cfg_, config::child(), config::child_or_add(), config::clear_children(), damage_, defense_weight_, description_, t_string::empty(), gui2::event::find(), id_, config::any_child::key, lexical_cast(), matches_filter(), num_attacks_, parry_, utils::signed_value(), utils::split(), and type_.

| double attack_type::attack_weight | ( | ) | const [inline] |
Definition at line 47 of file unit_types.hpp.
References attack_weight_.
Referenced by battle_context::choose_attacker_weapon().

| int attack_type::damage | ( | ) | const [inline] |
Definition at line 45 of file unit_types.hpp.
References damage_.
Referenced by attack_info(), battle_context_unit_stats::battle_context_unit_stats(), attack_type_callable::do_compare(), battle_prediction_pane::get_unit_strings(), attack_type_callable::get_value(), matches_filter(), and ai::readonly_context_impl::power_projection().

| double attack_type::defense_weight | ( | ) | const [inline] |
Definition at line 48 of file unit_types.hpp.
References defense_weight_.
Referenced by battle_context::choose_defender_weapon().

| bool attack_type::describe_modification | ( | const config & | cfg, | |
| std::string * | description | |||
| ) |
Definition at line 248 of file unit_types.cpp.
References _n, lexical_cast(), matches_filter(), and utils::signed_value().

| config& attack_type::get_cfg | ( | ) | [inline] |
Definition at line 64 of file unit_types.hpp.
References cfg_.
Referenced by attack::fire_event(), and attack::unit_killed().

| const config& attack_type::get_cfg | ( | ) | const [inline] |
Definition at line 65 of file unit_types.hpp.
References cfg_.
| bool attack_type::get_special_bool | ( | const std::string & | special, | |
| bool | force = false | |||
| ) | const |
Definition at line 465 of file unit_abilities.cpp.
References cfg_, config::child(), other_attack_, and special_active().
Referenced by battle_context_unit_stats::battle_context_unit_stats(), and matches_filter().


| unit_ability_list attack_type::get_specials | ( | const std::string & | special | ) | const |
Definition at line 492 of file unit_abilities.cpp.
References aloc_, attacker_, cfg_, unit_ability_list::cfgs, config::child(), dloc_, other_attack_, and special_active().
Referenced by attack_info(), battle_context_unit_stats::battle_context_unit_stats(), and battle_prediction_pane::get_unit_strings().


| const std::string& attack_type::icon | ( | ) | const [inline] |
Definition at line 40 of file unit_types.hpp.
References icon_.
Referenced by events::mouse_handler::show_attack_dialog().

| const std::string& attack_type::id | ( | ) | const [inline] |
Definition at line 38 of file unit_types.hpp.
References id_.
Referenced by attack_type_callable::do_compare(), attack_type_callable::get_value(), matches_filter(), and attack::perform().

| bool attack_type::matches_filter | ( | const config & | cfg, | |
| bool | self = false | |||
| ) | const |
Definition at line 93 of file unit_types.cpp.
References damage(), gui2::event::find(), get_special_bool(), id(), in_ranges(), utils::parse_ranges(), range(), utils::split(), and type().
Referenced by apply_modification(), describe_modification(), unit_animation::matches(), game_events::matches_special_filter(), and special_active().


| int attack_type::movement_used | ( | ) | const [inline] |
Definition at line 62 of file unit_types.hpp.
References cfg_.
| const t_string& attack_type::name | ( | ) | const [inline] |
Definition at line 37 of file unit_types.hpp.
References description_.
Referenced by attack_info(), battle_prediction_pane::get_unit_strings(), attack::perform(), events::mouse_handler::show_attack_dialog(), special_tooltips(), unit_weapons(), and weapon_specials().

| int attack_type::num_attacks | ( | ) | const [inline] |
Definition at line 46 of file unit_types.hpp.
References num_attacks_.
Referenced by attack_info(), battle_context_unit_stats::battle_context_unit_stats(), attack_type_callable::do_compare(), attack_type_callable::get_value(), and ai::readonly_context_impl::power_projection().

| int attack_type::parry | ( | ) | const [inline] |
Definition at line 44 of file unit_types.hpp.
References parry_.
Referenced by attack_info(), and battle_context_unit_stats::battle_context_unit_stats().

| const std::string& attack_type::range | ( | ) | const [inline] |
Definition at line 41 of file unit_types.hpp.
References range_.
Referenced by attack_info(), battle_context::choose_defender_weapon(), attack_type_callable::do_compare(), attack_type_callable::get_value(), matches_filter(), and events::mouse_handler::show_attack_dialog().

| void attack_type::set_specials_context | ( | const map_location & | aloc, | |
| const map_location & | dloc, | |||
| const unit_map & | unitmap, | |||
| bool | attacker, | |||
| const attack_type * | other_attack | |||
| ) | const |
Definition at line 755 of file unit_abilities.cpp.
References aloc_, attacker_, dloc_, other_attack_, and unitmap_.
Referenced by attack_info(), battle_context_unit_stats::battle_context_unit_stats(), battle_prediction_pane::get_unit_strings(), and events::mouse_handler::show_attack_dialog().

| void attack_type::set_specials_context | ( | const map_location & | loc, | |
| const map_location & | dloc, | |||
| const unit & | un, | |||
| bool | attacker = true | |||
| ) | const |
Definition at line 765 of file unit_abilities.cpp.
References aloc_, attacker_, dloc_, other_attack_, unitmap_, and resources::units.
| bool attack_type::special_active | ( | const config & | cfg, | |
| bool | self | |||
| ) | const |
Definition at line 569 of file unit_abilities.cpp.
References aloc_, attacker_, config::child(), config::child_range(), dloc_, unit_map::end(), unit_map::find(), get_adjacent_tiles(), terrain_filter::match(), matches_filter(), map_location::NDIRECTIONS, other_attack_, map_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 718 of file unit_abilities.cpp.
References attacker_.
Referenced by special_active().

| bool attack_type::special_affects_self | ( | const config & | cfg | ) | const |
Definition at line 739 of file unit_abilities.cpp.
References attacker_.
Referenced by special_active().

| std::vector< t_string > attack_type::special_tooltips | ( | bool | force = false |
) | const |
Definition at line 515 of file unit_abilities.cpp.
References config::all_children_range(), config::any_child::cfg, cfg_, config::child(), t_string::empty(), name(), and special_active().
Referenced by attack_info(), and attack_type_callable::get_value().


| const std::string& attack_type::type | ( | ) | const [inline] |
Definition at line 39 of file unit_types.hpp.
References type_.
Referenced by attack_info(), attack_type_callable::do_compare(), battle_prediction_pane::get_unit_strings(), attack_type_callable::get_value(), matches_filter(), unit_movement_type::resistance_against(), and unit::resistance_against().

| std::string attack_type::weapon_specials | ( | bool | force = false |
) | const |
Definition at line 540 of file unit_abilities.cpp.
References config::all_children_range(), config::any_child::cfg, cfg_, config::child(), name(), and special_active().
Referenced by attack_type_callable::do_compare(), and events::mouse_handler::show_attack_dialog().


int attack_type::accuracy_ [private] |
Definition at line 93 of file unit_types.hpp.
Referenced by accuracy(), accuracy_parry_description(), and apply_modification().
map_location attack_type::aloc_ [mutable] |
Definition at line 66 of file unit_types.hpp.
Referenced by get_specials(), set_specials_context(), and special_active().
double attack_type::attack_weight_ [private] |
Definition at line 90 of file unit_types.hpp.
Referenced by apply_modification(), and attack_weight().
bool attack_type::attacker_ [mutable] |
Definition at line 67 of file unit_types.hpp.
Referenced by get_specials(), set_specials_context(), special_active(), special_affects_opponent(), and special_affects_self().
config attack_type::cfg_ [private] |
Definition at line 82 of file unit_types.hpp.
Referenced by apply_modification(), get_cfg(), get_special_bool(), get_specials(), movement_used(), special_tooltips(), and weapon_specials().
int attack_type::damage_ [private] |
Definition at line 88 of file unit_types.hpp.
Referenced by apply_modification(), and damage().
double attack_type::defense_weight_ [private] |
Definition at line 91 of file unit_types.hpp.
Referenced by apply_modification(), and defense_weight().
t_string attack_type::description_ [private] |
Definition at line 83 of file unit_types.hpp.
Referenced by apply_modification(), attack_type(), and name().
map_location attack_type::dloc_ [mutable] |
Definition at line 66 of file unit_types.hpp.
Referenced by get_specials(), set_specials_context(), and special_active().
std::string attack_type::icon_ [private] |
Definition at line 86 of file unit_types.hpp.
Referenced by attack_type(), and icon().
std::string attack_type::id_ [private] |
Definition at line 84 of file unit_types.hpp.
Referenced by apply_modification(), attack_type(), and id().
int attack_type::num_attacks_ [private] |
Definition at line 89 of file unit_types.hpp.
Referenced by apply_modification(), and num_attacks().
const attack_type* attack_type::other_attack_ [mutable] |
Definition at line 69 of file unit_types.hpp.
Referenced by get_special_bool(), get_specials(), set_specials_context(), and special_active().
int attack_type::parry_ [private] |
Definition at line 94 of file unit_types.hpp.
Referenced by accuracy_parry_description(), apply_modification(), and parry().
std::string attack_type::range_ [private] |
Definition at line 87 of file unit_types.hpp.
Referenced by range().
std::string attack_type::type_ [private] |
Definition at line 85 of file unit_types.hpp.
Referenced by apply_modification(), and type().
const unit_map* attack_type::unitmap_ [mutable] |
Definition at line 68 of file unit_types.hpp.
Referenced by set_specials_context(), and special_active().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:13:09 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |