Public Member Functions | Public Attributes

battle_context_unit_stats Struct Reference

Structure describing the statistics of a unit involved in the battle. More...

#include <actions.hpp>

Collaboration diagram for battle_context_unit_stats:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

Structure describing the statistics of a unit involved in the battle.

Definition at line 130 of file actions.hpp.


Constructor & Destructor Documentation

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 
)
battle_context_unit_stats::~battle_context_unit_stats (  ) 

Definition at line 1174 of file actions.cpp.


Member Function Documentation

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

Here is the caller graph for this function:


Member Data Documentation

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

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

Attack has firststrike special.

Definition at line 147 of file actions.hpp.

Referenced by battle_context_unit_stats(), dump(), combatant::fight(), and attack::perform().

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

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

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

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

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 documentation for this struct was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:11:41 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs