Public Member Functions | Public Attributes | Private Attributes

attack_type Class Reference

#include <unit_types.hpp>

Collaboration diagram for attack_type:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 attack_type (const config &cfg)
 ~attack_type ()
 Default implementation, but defined out-of-line for efficiency reasons.
const t_stringname () 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_stringspecial_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
configget_cfg ()
const configget_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_animationanimation (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_mapunitmap_
const attack_typeother_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_

Detailed Description

Definition at line 30 of file unit_types.hpp.


Constructor & Destructor Documentation

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_.

Here is the call graph for this function:

attack_type::~attack_type (  ) 

Default implementation, but defined out-of-line for efficiency reasons.

Definition at line 73 of file unit_types.cpp.


Member Function Documentation

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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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 
)
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().

Here is the caller graph for this function:

int attack_type::damage (  )  const [inline]
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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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]
int attack_type::num_attacks (  )  const [inline]
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().

Here is the caller graph for this function:

const std::string& attack_type::range (  )  const [inline]
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
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
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

const std::string& attack_type::type (  )  const [inline]
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().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

int attack_type::accuracy_ [private]

Definition at line 93 of file unit_types.hpp.

Referenced by accuracy(), accuracy_parry_description(), and apply_modification().

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]
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().

Definition at line 83 of file unit_types.hpp.

Referenced by apply_modification(), attack_type(), and name().

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().

Definition at line 89 of file unit_types.hpp.

Referenced by apply_modification(), and num_attacks().

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().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:13:09 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs