#include <ai.hpp>
Public Member Functions | |
void | analyze (const gamemap &map, unit_map &units, const std::vector< team > &teams, const gamestatus &status, class ai &ai_obj, const move_map &dstsrc, const move_map &srcdst, const move_map &enemy_dstsrc, double aggression) |
double | rating (double aggression, class ai &ai_obj) const |
variant | get_value (const std::string &key) const |
void | get_inputs (std::vector< game_logic::formula_input > *inputs) const |
Public Attributes | |
gamemap::location | target |
std::vector< std::pair < gamemap::location, gamemap::location > > | movements |
double | target_value |
The value of the unit being targeted. | |
double | avg_losses |
The value on average, of units lost in the combat. | |
double | chance_to_kill |
Estimated % chance to kill the unit. | |
double | avg_damage_inflicted |
The average hitpoints damage inflicted. | |
int | target_starting_damage |
double | avg_damage_taken |
The average hitpoints damage taken. | |
double | resources_used |
The sum of the values of units used in the attack. | |
double | terrain_quality |
The weighted average of the % chance to hit each attacking unit. | |
double | alternative_terrain_quality |
The weighted average of the % defense of the best possible terrain that the attacking units could reach this turn, without attacking (good for comparison to see just how good/bad 'terrain_quality' is). | |
double | vulnerability |
The vulnerability is the power projection of enemy units onto the hex we're standing on. | |
double | support |
bool | leader_threat |
Is true if the unit is a threat to our leader. | |
bool | uses_leader |
Is true if this attack sequence makes use of the leader. | |
bool | is_surrounded |
Is true if the units involved in this attack sequence are surrounded. |
Definition at line 130 of file ai.hpp.
void ai::attack_analysis::analyze | ( | const gamemap & | map, | |
unit_map & | units, | |||
const std::vector< team > & | teams, | |||
const gamestatus & | status, | |||
class ai & | ai_obj, | |||
const move_map & | dstsrc, | |||
const move_map & | srcdst, | |||
const move_map & | enemy_dstsrc, | |||
double | aggression | |||
) |
Definition at line 269 of file ai_attack.cpp.
References unit_map::add(), alternative_terrain_quality, combatant::average_hp(), avg_damage_inflicted, avg_damage_taken, avg_losses, ai::best_defensive_position(), ai::defensive_position::chance_to_hit, chance_to_kill, ai_interface::current_team(), unit_map::end(), unit_map::extract(), unit_map::find(), get_adjacent_tiles(), battle_context::get_attacker_combatant(), battle_context::get_attacker_stats(), battle_context::get_defender_combatant(), battle_context::get_defender_stats(), gamemap::gives_healing(), combatant::hp_dist, team::is_enemy(), gamemap::is_village(), game_config::kill_experience, leader_threat, movements, game_config::poison_amount, resources_used, target_starting_damage, target_value, terrain_quality, ai::unit_stats_cache_, and uses_leader.
Referenced by ai::do_attack_analysis().
double ai::attack_analysis::rating | ( | double | aggression, | |
class ai & | ai_obj | |||
) | const |
Definition at line 471 of file ai_attack.cpp.
References alternative_terrain_quality, ai::attack_close(), avg_damage_inflicted, avg_damage_taken, avg_losses, team::caution(), chance_to_kill, ai_interface::current_team(), team::gold(), is_surrounded, ai::leader_can_reach_keep(), leader_threat, LOG_AI, ai_interface::log_message(), movements, resources_used, str_cast(), support, target_starting_damage, target_value, terrain_quality, uses_leader, value, and vulnerability.
Referenced by ai::do_attack_analysis().
variant ai::attack_analysis::get_value | ( | const std::string & | key | ) | const [virtual] |
Implements game_logic::formula_callable.
Definition at line 2276 of file ai.cpp.
References alternative_terrain_quality, avg_damage_inflicted, avg_damage_taken, avg_losses, chance_to_kill, is_surrounded, leader_threat, movements, resources_used, support, target_starting_damage, target_value, terrain_quality, uses_leader, and vulnerability.
void ai::attack_analysis::get_inputs | ( | std::vector< game_logic::formula_input > * | inputs | ) | const [virtual] |
Reimplemented from game_logic::formula_callable.
Definition at line 2331 of file ai.cpp.
References game_logic::FORMULA_READ_ONLY.
Definition at line 143 of file ai.hpp.
Referenced by ai::analyze_targets(), and formula_ai::execute_variant().
std::vector<std::pair<gamemap::location,gamemap::location> > ai::attack_analysis::movements |
Definition at line 144 of file ai.hpp.
Referenced by analyze(), ai::do_attack_analysis(), formula_ai::execute_variant(), get_value(), and rating().
The value on average, of units lost in the combat.
Definition at line 150 of file ai.hpp.
Referenced by analyze(), get_value(), and rating().
The average hitpoints damage inflicted.
Definition at line 156 of file ai.hpp.
Referenced by analyze(), get_value(), and rating().
The average hitpoints damage taken.
Definition at line 161 of file ai.hpp.
Referenced by analyze(), get_value(), and rating().
The weighted average of the % defense of the best possible terrain that the attacking units could reach this turn, without attacking (good for comparison to see just how good/bad 'terrain_quality' is).
Definition at line 172 of file ai.hpp.
Referenced by analyze(), get_value(), and rating().
The vulnerability is the power projection of enemy units onto the hex we're standing on.
support is the power projection of friendly units.
Definition at line 176 of file ai.hpp.
Referenced by ai::analyze_targets(), ai::do_attack_analysis(), get_value(), and rating().
double ai::attack_analysis::support |
Definition at line 176 of file ai.hpp.
Referenced by ai::analyze_targets(), ai::do_attack_analysis(), get_value(), and rating().
Is true if the units involved in this attack sequence are surrounded.
Definition at line 185 of file ai.hpp.
Referenced by ai::do_attack_analysis(), get_value(), and rating().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |