#include <statistics.hpp>
Public Types | |
enum | hit_result { MISSES, HITS, KILLS } |
Public Member Functions | |
attack_context (const unit &a, const unit &d, int a_cth, int d_cth) | |
~attack_context () | |
void | attack_expected_damage (double attacker_inflict, double defender_inflict) |
void | attack_result (hit_result res, int cth, int damage, int drain) |
void | defend_result (hit_result res, int cth, int damage, int drain) |
Private Member Functions | |
stats & | attacker_stats () |
stats & | defender_stats () |
Private Attributes | |
std::string | attacker_type |
std::string | defender_type |
std::string | attacker_side |
std::string | defender_side |
int | chance_to_hit_defender |
int | chance_to_hit_attacker |
std::string | attacker_res |
std::string | defender_res |
Definition at line 94 of file statistics.hpp.
Enumerator | |
---|---|
MISSES | |
HITS | |
KILLS |
Definition at line 99 of file statistics.hpp.
Definition at line 526 of file statistics.cpp.
statistics::attack_context::~attack_context | ( | ) |
Definition at line 539 of file statistics.cpp.
References attacker_res, attacker_stats(), statistics::stats::attacks_inflicted, statistics::stats::attacks_taken, chance_to_hit_attacker, chance_to_hit_defender, defender_res, defender_stats(), statistics::stats::defends_inflicted, and statistics::stats::defends_taken.
void statistics::attack_context::attack_expected_damage | ( | double | attacker_inflict, |
double | defender_inflict | ||
) |
Definition at line 561 of file statistics.cpp.
References attacker_stats(), statistics::stats::decimal_shift, defender_stats(), statistics::stats::expected_damage_inflicted, statistics::stats::expected_damage_taken, statistics::stats::turn_expected_damage_inflicted, and statistics::stats::turn_expected_damage_taken.
Referenced by battle_context::choose_defender_weapon().
void statistics::attack_context::attack_result | ( | hit_result | res, |
int | cth, | ||
int | damage, | ||
int | drain | ||
) |
Definition at line 577 of file statistics.cpp.
References attacker_res, attacker_stats(), statistics::stats::by_cth_inflicted, statistics::stats::damage_inflicted, statistics::stats::damage_taken, defender_stats(), defender_type, statistics::stats::killed, KILLS, MISSES, statistics::stats::turn_by_cth_inflicted, statistics::stats::turn_damage_inflicted, and statistics::stats::turn_damage_taken.
Referenced by battle_context::choose_defender_weapon().
|
private |
Definition at line 551 of file statistics.cpp.
References attacker_side, and get_stats().
Referenced by attack_expected_damage(), attack_result(), defend_result(), and ~attack_context().
void statistics::attack_context::defend_result | ( | hit_result | res, |
int | cth, | ||
int | damage, | ||
int | drain | ||
) |
Definition at line 612 of file statistics.cpp.
References attacker_stats(), attacker_type, statistics::stats::by_cth_taken, statistics::stats::damage_inflicted, statistics::stats::damage_taken, statistics::stats::deaths, defender_res, defender_stats(), KILLS, MISSES, statistics::stats::turn_by_cth_taken, statistics::stats::turn_damage_inflicted, and statistics::stats::turn_damage_taken.
Referenced by battle_context::choose_defender_weapon().
|
private |
Definition at line 556 of file statistics.cpp.
References defender_side, and get_stats().
Referenced by attack_expected_damage(), attack_result(), defend_result(), and ~attack_context().
|
private |
Definition at line 110 of file statistics.hpp.
Referenced by attack_result(), and ~attack_context().
|
private |
Definition at line 108 of file statistics.hpp.
Referenced by attacker_stats().
|
private |
Definition at line 107 of file statistics.hpp.
Referenced by defend_result().
|
private |
Definition at line 109 of file statistics.hpp.
Referenced by ~attack_context().
|
private |
Definition at line 109 of file statistics.hpp.
Referenced by ~attack_context().
|
private |
Definition at line 110 of file statistics.hpp.
Referenced by defend_result(), and ~attack_context().
|
private |
Definition at line 108 of file statistics.hpp.
Referenced by defender_stats().
|
private |
Definition at line 107 of file statistics.hpp.
Referenced by attack_result().