attack Class Reference

Executes an attack. More...

#include <actions.hpp>

Collaboration diagram for attack:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 attack (game_display &gui, const gamemap &map, std::vector< team > &teams, gamemap::location attacker, gamemap::location defender, int attack_with, int defend_with, unit_map &units, const gamestatus &state, bool update_display=true)
 Battle logic.
 ~attack ()

Private Member Functions

void fire_event (const std::string &n)
void refresh_bc ()

Private Attributes

game_displaygui_
const gamemapmap_
std::vector< team > & teams_
gamemap::location attacker_
gamemap::location defender_
int attack_with_
int defend_with_
unit_mapunits_
const gamestatusstate_
unit_map::iterator a_
unit_map::iterator d_
std::string a_id_
std::string d_id_
std::stringstream errbuf_
battle_contextbc_
const battle_context::unit_statsa_stats_
const battle_context::unit_statsd_stats_
int orig_attacks_
int orig_defends_
int n_attacks_
int n_defends_
int attacker_cth_
int defender_cth_
int attacker_damage_
int defender_damage_
int attackerxp_
int defenderxp_
bool update_display_
bool OOS_error_
end_level_exceptiondelayed_exception

Classes

class  attack_end_exception


Detailed Description

Executes an attack.

Definition at line 165 of file actions.hpp.


Constructor & Destructor Documentation

attack::attack ( game_display gui,
const gamemap map,
std::vector< team > &  teams,
gamemap::location  attacker,
gamemap::location  defender,
int  attack_with,
int  defend_with,
unit_map units,
const gamestatus state,
bool  update_display = true 
)

Battle logic.

Definition at line 841 of file actions.cpp.

References _, a_, a_id_, a_stats_, unit_map::add(), config::add_child(), unit::add_modification(), statistics::attack_context::attack_excepted_damage(), statistics::attack_context::attack_result(), attack_with_, attacker_, attacker_cth_, attacker_damage_, attackerxp_, bc_, cfg, battle_context::unit_stats::chance_to_hit, d_, d_id_, d_stats_, battle_context::unit_stats::damage, DBG_NG, statistics::attack_context::defend_result(), defend_with_, defender_, defender_cth_, defender_damage_, defenderxp_, DELAY_END_LEVEL, delayed_exception, battle_context::unit_stats::drains, game_display::draw(), preferences::encountered_units(), boost::foreach_detail_::end(), unit_map::end(), lg::engine, unit_map::erase(), errbuf_, unit_map::find(), game_events::fire(), fire_event(), battle_context::unit_stats::firststrike, battle_context::get_attacker_stats(), battle_context::get_defender_stats(), get_random(), get_random_results(), gui_, unit::heal_all(), statistics::attack_context::HITS, game_display::invalidate(), display::invalidate_all(), game_display::invalidate_unit(), game_config::kill_experience, statistics::attack_context::KILLS, lexical_cast(), LOG_NG, log_scope2, map_, game_events::entity_location::matches_unit(), statistics::attack_context::MISSES, n_attacks_, n_defends_, attack_type::name(), battle_context::unit_stats::num_blows, OOS_error_, orig_attacks_, orig_defends_, battle_context::unit_stats::plague_type, battle_context::unit_stats::plagues, battle_context::unit_stats::poisons, recalculate_fog(), display::recalculate_minimap(), refresh_bc(), battle_context::unit_stats::rounds, unit::set_attacks(), set_random_results(), battle_context::unit_stats::slow_damage, battle_context::unit_stats::slows, state_, battle_context::unit_stats::stones, utils::string_bool(), teams_, THROW_END_LEVEL, replay::throw_error(), unit::type_id(), unit_type_data::types(), unit_display::unit_attack(), unit_display::unit_die(), unit_dump(), units_, update_display_, and battle_context::unit_stats::weapon.

attack::~attack (  ) 

Definition at line 833 of file actions.cpp.

References bc_, and delayed_exception.


Member Function Documentation

void attack::fire_event ( const std::string &  n  )  [private]

void attack::refresh_bc (  )  [private]


Member Data Documentation

Definition at line 181 of file actions.hpp.

Referenced by attack(), and fire_event().

const gamemap& attack::map_ [private]

Definition at line 182 of file actions.hpp.

Referenced by attack(), fire_event(), and refresh_bc().

std::vector<team>& attack::teams_ [private]

Definition at line 183 of file actions.hpp.

Referenced by attack(), fire_event(), and refresh_bc().

Definition at line 184 of file actions.hpp.

Referenced by attack(), fire_event(), and refresh_bc().

Definition at line 185 of file actions.hpp.

Referenced by attack(), fire_event(), and refresh_bc().

int attack::attack_with_ [private]

Definition at line 186 of file actions.hpp.

Referenced by attack(), and refresh_bc().

int attack::defend_with_ [private]

Definition at line 187 of file actions.hpp.

Referenced by attack(), and refresh_bc().

Definition at line 188 of file actions.hpp.

Referenced by attack(), fire_event(), and refresh_bc().

const gamestatus& attack::state_ [private]

Definition at line 189 of file actions.hpp.

Referenced by attack(), and refresh_bc().

Definition at line 190 of file actions.hpp.

Referenced by attack(), fire_event(), and refresh_bc().

Definition at line 190 of file actions.hpp.

Referenced by attack(), fire_event(), and refresh_bc().

std::string attack::a_id_ [private]

Definition at line 191 of file actions.hpp.

Referenced by attack(), and fire_event().

std::string attack::d_id_ [private]

Definition at line 191 of file actions.hpp.

Referenced by attack(), and fire_event().

std::stringstream attack::errbuf_ [private]

Definition at line 192 of file actions.hpp.

Referenced by attack().

Definition at line 193 of file actions.hpp.

Referenced by attack(), refresh_bc(), and ~attack().

Definition at line 194 of file actions.hpp.

Referenced by attack(), fire_event(), and refresh_bc().

Definition at line 195 of file actions.hpp.

Referenced by attack(), fire_event(), and refresh_bc().

int attack::orig_attacks_ [private]

Definition at line 196 of file actions.hpp.

Referenced by attack().

int attack::orig_defends_ [private]

Definition at line 196 of file actions.hpp.

Referenced by attack().

int attack::n_attacks_ [private]

Definition at line 197 of file actions.hpp.

Referenced by attack().

int attack::n_defends_ [private]

Definition at line 197 of file actions.hpp.

Referenced by attack().

int attack::attacker_cth_ [private]

Definition at line 198 of file actions.hpp.

Referenced by attack(), and refresh_bc().

int attack::defender_cth_ [private]

Definition at line 198 of file actions.hpp.

Referenced by attack(), and refresh_bc().

int attack::attacker_damage_ [private]

Definition at line 199 of file actions.hpp.

Referenced by attack(), and refresh_bc().

int attack::defender_damage_ [private]

Definition at line 199 of file actions.hpp.

Referenced by attack(), and refresh_bc().

int attack::attackerxp_ [private]

Definition at line 200 of file actions.hpp.

Referenced by attack().

int attack::defenderxp_ [private]

Definition at line 200 of file actions.hpp.

Referenced by attack().

bool attack::update_display_ [private]

Definition at line 202 of file actions.hpp.

Referenced by attack(), and fire_event().

bool attack::OOS_error_ [private]

Definition at line 203 of file actions.hpp.

Referenced by attack().

Definition at line 204 of file actions.hpp.

Referenced by attack(), fire_event(), and ~attack().


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