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)
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< 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
configget_cfg ()
const configget_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_animationanimation (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_mapunitmap_
const gamemapmap_
const gamestatusgame_status_
const std::vector< team > * teams_
const attack_typeother_attack_
config cfg_
std::vector< unit_animationanimation_

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_


Detailed Description

Definition at line 36 of file unit_types.hpp.


Constructor & Destructor Documentation

attack_type::attack_type ( const config cfg  ) 


Member Function Documentation

const t_string& attack_type::name (  )  const [inline]

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]

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]

std::string attack_type::accuracy_parry_description (  )  const

Definition at line 76 of file unit_types.cpp.

References accuracy_, and parry_.

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

unit_ability_list attack_type::get_specials ( const std::string &  special  )  const

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

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

void attack_type::set_specials_context ( const gamemap::location loc,
const gamemap::location dloc,
const unit un,
bool  attacker = true 
) const

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

bool attack_type::apply_modification ( const config cfg,
std::string *  description 
)

bool attack_type::describe_modification ( const config cfg,
std::string *  description 
)

Definition at line 238 of file unit_types.cpp.

References _n, and matches_filter().

int attack_type::movement_used (  )  const [inline]

Definition at line 72 of file unit_types.hpp.

References cfg_.

config& attack_type::get_cfg (  )  [inline]

Definition at line 74 of file unit_types.hpp.

References cfg_.

const config& attack_type::get_cfg (  )  const [inline]

Definition at line 75 of file unit_types.hpp.

References cfg_.

bool attack_type::special_active ( const config cfg,
bool  self,
bool  report = false 
) const

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


Member Data Documentation

Definition at line 76 of file unit_types.hpp.

Referenced by get_specials(), set_specials_context(), and special_active().

Definition at line 76 of file unit_types.hpp.

Referenced by get_specials(), set_specials_context(), and special_active().

bool attack_type::attacker_ [mutable]

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

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

Definition at line 94 of file unit_types.hpp.

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]

Definition at line 99 of file unit_types.hpp.

Referenced by attack_type(), and icon().

std::string attack_type::range_ [private]

Definition at line 100 of file unit_types.hpp.

Referenced by attack_type(), and range().

int attack_type::damage_ [private]

Definition at line 101 of file unit_types.hpp.

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

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]

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


The documentation for this class was generated from the following files:

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs