From 6ebca64acc17bc928125005fdcdb8b4dddca2c12 Mon Sep 17 00:00:00 2001 From: newfrenchy83 Date: Sun, 11 Aug 2024 18:21:34 +0200 Subject: [PATCH] add [disable] abilityto abilities used like weapon special --- data/schema/units/abilities.cfg | 1 + data/schema/units/specials.cfg | 5 +++++ src/units/unit.hpp | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/data/schema/units/abilities.cfg b/data/schema/units/abilities.cfg index 474b2d9a182..04568d2b931 100644 --- a/data/schema/units/abilities.cfg +++ b/data/schema/units/abilities.cfg @@ -120,6 +120,7 @@ {DEFAULT_KEY delayed_variable_substitution bool yes} [/tag] [/tag] +{BASED_ON_SPECIAL "disable"} {BASED_ON_SPECIAL "attacks"} {BASED_ON_SPECIAL "swarm"} {BASED_ON_SPECIAL "chance_to_hit"} diff --git a/data/schema/units/specials.cfg b/data/schema/units/specials.cfg index 9b36d2979e9..90bb1d84b4e 100644 --- a/data/schema/units/specials.cfg +++ b/data/schema/units/specials.cfg @@ -31,6 +31,11 @@ max=infinite super="units/unit_type/attack/specials/~generic~" [/tag] +[tag] + name="disable" + max=infinite + super="units/unit_type/attack/specials/~generic~" +[/tag] [tag] name="slow" max=infinite diff --git a/src/units/unit.hpp b/src/units/unit.hpp index 2fb5650d18b..3e7b0389bf4 100644 --- a/src/units/unit.hpp +++ b/src/units/unit.hpp @@ -1865,7 +1865,7 @@ public: private: - const std::set checking_tags_{"attacks", "damage", "chance_to_hit", "berserk", "swarm", "drains", "heal_on_hit", "plague", "slow", "petrifies", "firststrike", "poison", "damage_type"}; + const std::set checking_tags_{"disable", "attacks", "damage", "chance_to_hit", "berserk", "swarm", "drains", "heal_on_hit", "plague", "slow", "petrifies", "firststrike", "poison", "damage_type"}; /** * Check if an ability is active. * @param ability The type (tag name) of the ability