From da83861b79bf8d6b41f3dc394fc2d625b97cd145 Mon Sep 17 00:00:00 2001 From: newfrenchy83 Date: Wed, 24 Mar 2021 19:53:20 +0100 Subject: [PATCH] rename has_special_and_abilities to has_special_or_abilities --- src/actions/attack.cpp | 10 +++++----- src/units/abilities.cpp | 4 ++-- src/units/attack_type.cpp | 4 ++-- src/units/attack_type.hpp | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/actions/attack.cpp b/src/actions/attack.cpp index abfd12cebdf..cdaad08673f 100644 --- a/src/actions/attack.cpp +++ b/src/actions/attack.cpp @@ -143,14 +143,14 @@ battle_context_unit_stats::battle_context_unit_stats(nonempty_unit_const_ptr up, opp_ctx.emplace(opp_weapon->specials_context(oppp, up, opp_loc, u_loc, !attacking, weapon)); } - slows = weapon->has_special_and_abilities("slow"); - drains = !opp.get_state("undrainable") && weapon->has_special_and_abilities("drains"); - petrifies = weapon->has_special_and_abilities("petrifies"); - poisons = !opp.get_state("unpoisonable") && weapon->has_special_and_abilities("poison") && !opp.get_state(unit::STATE_POISONED); + slows = weapon->has_special_or_abilities("slow"); + drains = !opp.get_state("undrainable") && weapon->has_special_or_abilities("drains"); + petrifies = weapon->has_special_or_abilities("petrifies"); + poisons = !opp.get_state("unpoisonable") && weapon->has_special_or_abilities("poison") && !opp.get_state(unit::STATE_POISONED); backstab_pos = is_attacker && backstab_check(u_loc, opp_loc, units, resources::gameboard->teams()); rounds = weapon->get_specials_and_abilities("berserk").highest("value", 1).first; - firststrike = weapon->has_special_and_abilities("firststrike"); + firststrike = weapon->has_special_or_abilities("firststrike"); { const int distance = distance_between(u_loc, opp_loc); diff --git a/src/units/abilities.cpp b/src/units/abilities.cpp index c836a873672..b764fccc2ab 100644 --- a/src/units/abilities.cpp +++ b/src/units/abilities.cpp @@ -1359,7 +1359,7 @@ bool attack_type::has_weapon_ability(const std::string& special, bool special_id return false; } -bool attack_type::has_special_and_abilities(const std::string& special, bool special_id, bool special_tags) const +bool attack_type::has_special_or_abilities(const std::string& special, bool special_id, bool special_tags) const { return (has_special(special, false, special_id, special_tags) || has_weapon_ability(special, special_id, special_tags)); } @@ -1456,7 +1456,7 @@ bool attack_type::special_active_impl(const_attack_ptr self_attack, const_attack return false; } if (tag_name == "firststrike" && !is_attacker && other_attack && - other_attack->has_special_and_abilities("firststrike")) { + other_attack->has_special_or_abilities("firststrike")) { return false; } diff --git a/src/units/attack_type.cpp b/src/units/attack_type.cpp index 5e7dfbba826..d34667cd5bf 100644 --- a/src/units/attack_type.cpp +++ b/src/units/attack_type.cpp @@ -180,7 +180,7 @@ static bool matches_simple_filter(const attack_type & attack, const config & fil if(!filter_special_id_active.empty()) { bool found = false; for(auto& special : filter_special_id_active) { - if(attack.has_special_and_abilities(special, true, false)) { + if(attack.has_special_or_abilities(special, true, false)) { found = true; break; } @@ -204,7 +204,7 @@ static bool matches_simple_filter(const attack_type & attack, const config & fil if(!filter_special_type_active.empty()) { bool found = false; for(auto& special : filter_special_type_active) { - if(attack.has_special_and_abilities(special, false)) { + if(attack.has_special_or_abilities(special, false)) { found = true; break; } diff --git a/src/units/attack_type.hpp b/src/units/attack_type.hpp index 47132a3168d..37b50ed20d7 100644 --- a/src/units/attack_type.hpp +++ b/src/units/attack_type.hpp @@ -105,7 +105,7 @@ public: * @param special_id If true, match @a special against the @c id of special tags. * @param special_tags If true, match @a special against the tag name of special tags. */ - bool has_special_and_abilities(const std::string& special, bool special_id=true, bool special_tags=true) const; + bool has_special_or_abilities(const std::string& special, bool special_id=true, bool special_tags=true) const; // In unit_types.cpp: