mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-28 14:36:22 +00:00
rename has_special_and_abilities to has_special_or_abilities
This commit is contained in:
parent
6b40f8a537
commit
da83861b79
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user