#include <abilities.hpp>
Classes | |
| struct | self_and_other_red_t |
| struct | specials_combatant |
Public Member Functions | |
| specials_context_t (specials_context_t &&)=delete | |
| specials_context_t (const specials_context_t &)=delete | |
| specials_context_t (specials_combatant &&att, specials_combatant &&def) | |
| ~specials_context_t () | |
| void | set_for_listing (bool for_listing) |
| self_and_other_red_t | self_and_other (const attack_type &self_att) const |
| self_and_other_red_t | self_and_other (const unit &self_un) const |
| const specials_combatant & | other (const specials_combatant &self) const |
| active_ability_list | get_active_specials (const attack_type &at, const std::string &tag) const |
| active_ability_list | get_abilities_weapons (const std::string &tag, const unit &un) const |
| bool | has_active_special (const attack_type &at, const std::string &tag) const |
| Returns whether or not *this has a special ability with a tag or id equal to special. More... | |
| bool | has_active_special_id (const attack_type &at, const std::string &id) const |
| bool | has_active_special_matching_filter (const attack_type &at, const config &filter) const |
| bool | is_special_active (const specials_combatant &wep, const unit_ability_t &ab, unit_ability_t::affects_t whom) const |
| Returns whether or not the given special is active for the specified unit, based on the current context (see set_specials_context). More... | |
| void | add_formula_context (wfl::map_formula_callable &callable) const |
| std::vector< unit_ability_t::tooltip_info > | special_tooltips (const attack_type &at, boost::dynamic_bitset<> &active_list) const |
| Returns a vector of names and descriptions for the specials of *this. More... | |
| std::vector< unit_ability_t::tooltip_info > | abilities_special_tooltips (const attack_type &at, boost::dynamic_bitset<> &active_list) const |
| std::string | describe_weapon_specials (const attack_type &at) const |
| Returns a comma-separated string of active names for the specials of *this. More... | |
| std::string | describe_weapon_specials_value (const attack_type &at, const std::set< std::string > &checking_tags) const |
| active_ability_list | get_active_combat_teachers (const attack_type &at) const |
Static Public Member Functions | |
| static specials_context_t | make (specials_combatant &&self, specials_combatant &&other, bool attacking) |
Public Attributes | |
| specials_combatant | attacker |
| specials_combatant | defender |
| bool | is_for_listing |
Definition at line 256 of file abilities.hpp.
|
delete |
|
delete |
| specials_context_t::specials_context_t | ( | specials_combatant && | att, |
| specials_combatant && | def | ||
| ) |
Definition at line 1008 of file abilities.cpp.
References specials_context_t::specials_combatant::at, attacker, and defender.
| specials_context_t::~specials_context_t | ( | ) |
Definition at line 1020 of file abilities.cpp.
References specials_context_t::specials_combatant::at, attacker, and defender.
| std::vector< unit_ability_t::tooltip_info > specials_context_t::abilities_special_tooltips | ( | const attack_type & | at, |
| boost::dynamic_bitset<> & | active_list | ||
| ) | const |
Definition at line 1358 of file abilities.cpp.
References schema_validation::at(), is_special_active(), loc, other(), unit_ability_t::SELF, and self_and_other().
Referenced by attack_info().
| void specials_context_t::add_formula_context | ( | wfl::map_formula_callable & | callable | ) | const |
Definition at line 867 of file abilities.cpp.
References wfl::map_formula_callable::add().
| std::string specials_context_t::describe_weapon_specials | ( | const attack_type & | at | ) | const |
Returns a comma-separated string of active names for the specials of *this.
Empty names are skipped.
Whether or not a special is active depends on the current context (see set_specials_context)
Definition at line 1044 of file abilities.cpp.
References schema_validation::at(), unit_ability_t::EITHER, font::INACTIVE_COLOR, is_enemy(), is_special_active(), utils::join(), loc, other(), unit_ability_t::SELF, self_and_other(), unit::side(), and markup::span_color().
| std::string specials_context_t::describe_weapon_specials_value | ( | const attack_type & | at, |
| const std::set< std::string > & | checking_tags | ||
| ) | const |
Definition at line 1087 of file abilities.cpp.
References _(), schema_validation::at(), utils::decayed_is_same, is_enemy(), utils::join(), other(), and self_and_other().
| active_ability_list specials_context_t::get_abilities_weapons | ( | const std::string & | tag, |
| const unit & | un | ||
| ) | const |
Definition at line 1610 of file abilities.cpp.
References utils::erase_if(), unit::get_abilities(), i, is_special_active(), loc, other(), unit_ability_t::SELF, and self_and_other().
Referenced by attack_type::effective_damage_type(), and under_leadership().
| active_ability_list specials_context_t::get_active_combat_teachers | ( | const attack_type & | at | ) | const |
Definition at line 1553 of file abilities.cpp.
References schema_validation::at(), is_special_active(), loc, specials_context_t::specials_combatant::loc, other(), unit_ability_t::SELF, self_and_other(), and specials_context_t::specials_combatant::un.
| active_ability_list specials_context_t::get_active_specials | ( | const attack_type & | at, |
| const std::string & | tag | ||
| ) | const |
Definition at line 1586 of file abilities.cpp.
References schema_validation::at(), active_ability_list::emplace_back(), loc, other(), and self_and_other().
Referenced by attack_type::get_specials_and_abilities().
| bool specials_context_t::has_active_special | ( | const attack_type & | at, |
| const std::string & | tag_name | ||
| ) | const |
Returns whether or not *this has a special ability with a tag or id equal to special.
the Check is for a special ability active in the current context (see set_specials_context), including specials obtained from the opponent's attack.
Definition at line 1524 of file abilities.cpp.
References schema_validation::at(), other(), and self_and_other().
Referenced by attack_type::has_special_or_ability().
| bool specials_context_t::has_active_special_id | ( | const attack_type & | at, |
| const std::string & | id | ||
| ) | const |
Definition at line 1535 of file abilities.cpp.
References schema_validation::at(), other(), and self_and_other().
Referenced by attack_type::has_active_special_or_ability_id().
| bool specials_context_t::has_active_special_matching_filter | ( | const attack_type & | at, |
| const config & | filter | ||
| ) | const |
Definition at line 1837 of file abilities.cpp.
References schema_validation::at(), utils::views::filter, other(), and self_and_other().
Referenced by attack_type::has_special_or_ability_with_filter().
| bool specials_context_t::is_special_active | ( | const specials_combatant & | self, |
| const unit_ability_t & | ab, | ||
| unit_ability_t::affects_t | whom | ||
| ) | const |
Returns whether or not the given special is active for the specified unit, based on the current context (see set_specials_context).
| self | this combatant |
| ab | the ability |
| whom | specifies which combatant we care about |
Definition at line 1882 of file abilities.cpp.
References unit_ability_t::active_on_matches(), unit_ability_t::apply_to(), schema_validation::at(), specials_context_t::specials_combatant::at, attacker, unit_ability_t::both, defender, unit_ability_t::EITHER, unit_map::find(), map_location::get_relative_dir(), unit_map::iterator_base< iter_types >::get_shared_ptr(), unit_ability_t::in_specials_tag(), is_for_listing, loc, specials_context_t::specials_combatant::loc, unit_ability_t::OTHER, other(), unit_ability_t::SELF, unit_ability_t::tag(), specials_context_t::specials_combatant::un, and unit_map::iterator_base< iter_types >::valid().
Referenced by abilities_special_tooltips(), describe_weapon_specials(), get_abilities_weapons(), get_active_combat_teachers(), attack_type::special_active(), and special_tooltips().
|
inlinestatic |
Definition at line 271 of file abilities.hpp.
References other().
Referenced by attack_info(), battle_context_unit_stats::battle_context_unit_stats(), attack_type::fallback_context(), game_events::filter_attack::operator()(), gui2::dialogs::attack_predictions::set_data(), events::mouse_handler::show_attack_dialog(), and unit_display::unit_attack().
|
inline |
Definition at line 301 of file abilities.hpp.
References attacker, and defender.
Referenced by abilities_special_tooltips(), describe_weapon_specials(), describe_weapon_specials_value(), get_abilities_weapons(), get_active_combat_teachers(), get_active_specials(), has_active_special(), has_active_special_id(), has_active_special_matching_filter(), is_special_active(), make(), and special_tooltips().
|
inline |
Definition at line 292 of file abilities.hpp.
References specials_context_t::specials_combatant::at, attacker, and defender.
Referenced by abilities_special_tooltips(), describe_weapon_specials(), describe_weapon_specials_value(), attack_type::effective_damage_type(), get_abilities_weapons(), get_active_combat_teachers(), get_active_specials(), has_active_special(), has_active_special_id(), has_active_special_matching_filter(), attack_type::modified_chance_to_hit(), attack_type::overwrite_special_checking(), attack_type::select_alternative_type(), attack_type::special_active(), and special_tooltips().
|
inline |
Definition at line 296 of file abilities.hpp.
References attacker, defender, and specials_context_t::specials_combatant::un.
|
inline |
Definition at line 282 of file abilities.hpp.
References is_for_listing.
Referenced by attack_info().
| std::vector< unit_ability_t::tooltip_info > specials_context_t::special_tooltips | ( | const attack_type & | at, |
| boost::dynamic_bitset<> & | active_list | ||
| ) | const |
Returns a vector of names and descriptions for the specials of *this.
Each std::pair in the vector has first = name and second = description.
This uses either the active or inactive name/description for each special, based on the current context (see set_specials_context), provided active_list is not nullptr. Otherwise specials are assumed active. If the appropriate name is empty, the special is skipped.
Definition at line 1285 of file abilities.cpp.
References schema_validation::at(), unit_ability_t::EITHER, is_special_active(), other(), and self_and_other().
| specials_combatant specials_context_t::attacker |
Definition at line 306 of file abilities.hpp.
Referenced by attack_type::effective_damage_type(), is_special_active(), other(), attack_type::overwrite_special_checking(), self_and_other(), specials_context_t(), and ~specials_context_t().
| specials_combatant specials_context_t::defender |
Definition at line 307 of file abilities.hpp.
Referenced by is_special_active(), other(), self_and_other(), specials_context_t(), and ~specials_context_t().
| bool specials_context_t::is_for_listing |
Definition at line 308 of file abilities.hpp.
Referenced by is_special_active(), and set_for_listing().