Structure describing the statistics of a unit involved in the battle. More...
#include <actions.hpp>

Public Member Functions | |
| battle_context_unit_stats (const unit &u, const map_location &u_loc, int u_attack_num, bool attacking, const unit &opp, const map_location &opp_loc, const attack_type *opp_weapon, const unit_map &units) | |
| ~battle_context_unit_stats () | |
| void | dump () const |
| Dumps the statistics of a unit on stdout. | |
Public Attributes | |
| const attack_type * | weapon |
| The weapon used by the unit to attack the opponent, or NULL if there is none. | |
| int | attack_num |
| Index into unit->attacks() or -1 for none. | |
| bool | is_attacker |
| True if the unit is the attacker. | |
| bool | is_poisoned |
| True if the unit is poisoned at the beginning of the battle. | |
| bool | is_slowed |
| True if the unit is slowed at the beginning of the battle. | |
| bool | slows |
| Attack slows opponent when it hits. | |
| bool | drains |
| Attack drains opponent when it hits. | |
| bool | petrifies |
| Attack petrifies opponent when it hits. | |
| bool | plagues |
| Attack turns opponent into a zombie when fatal. | |
| bool | poisons |
| Attack poisons opponent when it hits. | |
| bool | backstab_pos |
| True if the attacker is in *position* to backstab the defender (this is used to determine whether to apply the backstab bonus in case the attacker has backstab). | |
| bool | swarm |
| Attack has swarm special. | |
| bool | firststrike |
| Attack has firststrike special. | |
| unsigned int | experience |
| unsigned int | max_experience |
| unsigned int | level |
| unsigned int | rounds |
| Berserk special can force us to fight more than one round. | |
| unsigned int | hp |
| Hitpoints of the unit at the beginning of the battle. | |
| unsigned int | max_hp |
| Maximum hitpoints of the unit. | |
| unsigned int | chance_to_hit |
| Effective chance to hit as a percentage (all factors accounted for). | |
| int | damage |
| Effective damage of the weapon (all factors accounted for). | |
| int | slow_damage |
| Effective damage if unit becomes slowed (== damage, if already slowed). | |
| int | drain_percent |
| Percentage of damage recovered as health. | |
| int | drain_constant |
| Base HP drained regardless of damage dealt. | |
| unsigned int | num_blows |
| Effective number of blows, takes swarm into account. | |
| unsigned int | swarm_min |
| Minimum number of blows with swarm (equal to num_blows if swarm isn't used). | |
| unsigned int | swarm_max |
| Maximum number of blows with swarm (equal to num_blows if swarm isn't used). | |
| std::string | plague_type |
| The plague type used by the attack, if any. | |
Structure describing the statistics of a unit involved in the battle.
Definition at line 130 of file actions.hpp.
| battle_context_unit_stats::battle_context_unit_stats | ( | const unit & | u, | |
| const map_location & | u_loc, | |||
| int | u_attack_num, | |||
| bool | attacking, | |||
| const unit & | opp, | |||
| const map_location & | opp_loc, | |||
| const attack_type * | opp_weapon, | |||
| const unit_map & | units | |||
| ) |
Definition at line 1015 of file actions.cpp.
References attack_type::accuracy(), unit::alignment(), attack_num, unit::attacks(), backstab_check(), backstab_pos, unit_ability_list::cfgs, chance_to_hit, combat_modifier(), damage, attack_type::damage(), unit::damage_from(), unit::defense_modifier(), drain_constant, drain_percent, drains, unit_ability_list::empty(), ERR_NG, firststrike, resources::game_map, unit_abilities::effect::get_composite_value(), attack_type::get_special_bool(), attack_type::get_specials(), unit::get_state(), unit_ability_list::highest(), unit::hitpoints(), hp, is_attacker, unit::is_fearless(), is_slowed, LOG_CF, unit::max_hitpoints(), max_hp, attack_type::num_attacks(), num_blows, attack_type::parry(), petrifies, plague_type, plagues, poisons, round_damage(), rounds, attack_type::set_specials_context(), slow_damage, slows, unit::STATE_POISONED, swarm, swarm_max, swarm_min, resources::teams, unit::type_id(), unit::undead_variation(), under_leadership(), map_location::valid(), and weapon.

| battle_context_unit_stats::~battle_context_unit_stats | ( | ) |
Definition at line 1174 of file actions.cpp.
| void battle_context_unit_stats::dump | ( | ) | const |
Dumps the statistics of a unit on stdout.
Remove it eventually.
Definition at line 1178 of file actions.cpp.
References backstab_pos, chance_to_hit, damage, drain_constant, drain_percent, drains, firststrike, hp, is_attacker, is_poisoned, is_slowed, max_hp, num_blows, petrifies, poisons, rounds, slow_damage, slows, swarm, swarm_max, and swarm_min.
Referenced by combatant::fight().

Index into unit->attacks() or -1 for none.
Definition at line 133 of file actions.hpp.
Referenced by events::mouse_handler::attack_enemy_(), battle_context_unit_stats(), battle_context::choose_attacker_weapon(), battle_context::choose_defender_weapon(), game_logic::attack_callable::defender_weapon(), and game_logic::attack_callable::weapon().
True if the attacker is in *position* to backstab the defender (this is used to determine whether to apply the backstab bonus in case the attacker has backstab).
Definition at line 142 of file actions.hpp.
Referenced by battle_context_unit_stats(), dump(), and battle_prediction_pane::get_unit_strings().
| unsigned int battle_context_unit_stats::chance_to_hit |
Effective chance to hit as a percentage (all factors accounted for).
Definition at line 154 of file actions.hpp.
Referenced by combatant::adjust_hitchance(), ai::attack_analysis::analyze(), battle_context_unit_stats(), battle_context::choose_defender_weapon(), dump(), battle_prediction_pane::get_unit_strings(), attack::perform(), attack::refresh_bc(), events::mouse_handler::show_attack_dialog(), and unit_weapons().
Effective damage of the weapon (all factors accounted for).
Definition at line 155 of file actions.hpp.
Referenced by battle_context_unit_stats(), battle_context::choose_defender_weapon(), combatant::complex_fight(), dump(), combatant::fight(), battle_prediction_pane::get_unit_strings(), combatant::no_death_fight(), combatant::one_strike_fight(), attack::perform(), attack::refresh_bc(), events::mouse_handler::show_attack_dialog(), and unit_weapons().
Base HP drained regardless of damage dealt.
Definition at line 158 of file actions.hpp.
Referenced by battle_context_unit_stats(), combatant::complex_fight(), dump(), and attack::perform_hit().
Percentage of damage recovered as health.
Definition at line 157 of file actions.hpp.
Referenced by battle_context_unit_stats(), combatant::complex_fight(), dump(), and attack::perform_hit().
Attack drains opponent when it hits.
Definition at line 138 of file actions.hpp.
Referenced by battle_context_unit_stats(), dump(), combatant::fight(), and attack::perform_hit().
| unsigned int battle_context_unit_stats::experience |
Definition at line 148 of file actions.hpp.
Referenced by combatant::complex_fight(), combatant::no_death_fight(), and combatant::one_strike_fight().
Attack has firststrike special.
Definition at line 147 of file actions.hpp.
Referenced by battle_context_unit_stats(), dump(), combatant::fight(), and attack::perform().
| unsigned int battle_context_unit_stats::hp |
Hitpoints of the unit at the beginning of the battle.
Definition at line 152 of file actions.hpp.
Referenced by combatant::adjust_hitchance(), battle_context_unit_stats(), combatant::complex_fight(), dump(), battle_prediction_pane::get_hp_distrib_surface(), combatant::min_hp(), combatant::no_death_fight(), and combatant::one_strike_fight().
True if the unit is the attacker.
Definition at line 134 of file actions.hpp.
Referenced by battle_context_unit_stats(), dump(), and battle_prediction_pane::get_unit_strings().
True if the unit is poisoned at the beginning of the battle.
Definition at line 135 of file actions.hpp.
Referenced by combatant::combatant(), and dump().
True if the unit is slowed at the beginning of the battle.
Definition at line 136 of file actions.hpp.
Referenced by battle_context_unit_stats(), combatant::combatant(), combatant::complex_fight(), dump(), and battle_prediction_pane::get_unit_strings().
| unsigned int battle_context_unit_stats::level |
Definition at line 149 of file actions.hpp.
Referenced by events::mouse_handler::attack_enemy_(), combatant::complex_fight(), combatant::no_death_fight(), and combatant::one_strike_fight().
| unsigned int battle_context_unit_stats::max_experience |
Definition at line 148 of file actions.hpp.
Referenced by combatant::complex_fight(), combatant::no_death_fight(), and combatant::one_strike_fight().
| unsigned int battle_context_unit_stats::max_hp |
Maximum hitpoints of the unit.
Definition at line 153 of file actions.hpp.
Referenced by combatant::adjust_hitchance(), combatant::average_hp(), battle_context_unit_stats(), combatant::complex_fight(), dump(), combatant::hp_dist_size(), combatant::no_death_fight(), and combatant::one_strike_fight().
| unsigned int battle_context_unit_stats::num_blows |
Effective number of blows, takes swarm into account.
Definition at line 159 of file actions.hpp.
Referenced by battle_context_unit_stats(), battle_context::choose_defender_weapon(), dump(), battle_prediction_pane::get_unit_strings(), attack::perform(), events::mouse_handler::show_attack_dialog(), and unit_weapons().
Attack petrifies opponent when it hits.
Definition at line 139 of file actions.hpp.
Referenced by battle_context_unit_stats(), combatant::complex_fight(), dump(), combatant::fight(), battle_prediction_pane::get_hp_distrib_surface(), and attack::perform_hit().
| std::string battle_context_unit_stats::plague_type |
The plague type used by the attack, if any.
Definition at line 163 of file actions.hpp.
Referenced by battle_context_unit_stats(), and attack::unit_killed().
Attack turns opponent into a zombie when fatal.
Definition at line 140 of file actions.hpp.
Referenced by ai::attack_analysis::analyze(), battle_context_unit_stats(), and attack::unit_killed().
Attack poisons opponent when it hits.
Definition at line 141 of file actions.hpp.
Referenced by battle_context_unit_stats(), dump(), and attack::perform_hit().
| unsigned int battle_context_unit_stats::rounds |
Berserk special can force us to fight more than one round.
Definition at line 151 of file actions.hpp.
Referenced by battle_context_unit_stats(), dump(), combatant::fight(), and attack::perform().
Effective damage if unit becomes slowed (== damage, if already slowed).
Definition at line 156 of file actions.hpp.
Referenced by battle_context_unit_stats(), combatant::complex_fight(), and dump().
Attack slows opponent when it hits.
Definition at line 137 of file actions.hpp.
Referenced by battle_context_unit_stats(), combatant::complex_fight(), dump(), combatant::fight(), and attack::perform_hit().
Attack has swarm special.
Definition at line 146 of file actions.hpp.
Referenced by battle_context_unit_stats(), and dump().
| unsigned int battle_context_unit_stats::swarm_max |
Maximum number of blows with swarm (equal to num_blows if swarm isn't used).
Definition at line 161 of file actions.hpp.
Referenced by combatant::adjust_hitchance(), battle_context_unit_stats(), and dump().
| unsigned int battle_context_unit_stats::swarm_min |
Minimum number of blows with swarm (equal to num_blows if swarm isn't used).
Definition at line 160 of file actions.hpp.
Referenced by combatant::adjust_hitchance(), battle_context_unit_stats(), and dump().
The weapon used by the unit to attack the opponent, or NULL if there is none.
Definition at line 132 of file actions.hpp.
Referenced by battle_context_unit_stats(), battle_prediction_pane::battle_prediction_pane(), attack::fire_event(), battle_prediction_pane::get_unit_strings(), attack::perform(), attack::perform_hit(), events::mouse_handler::show_attack_dialog(), attack::unit_killed(), and unit_weapons().
| Generated by doxygen 1.7.1 on Fri May 25 2012 01:11:41 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |