From 90b3827f7598188e87ab7ade6874a010d6a3b5d3 Mon Sep 17 00:00:00 2001 From: newfrenchy83 Date: Mon, 7 Nov 2022 11:37:56 +0100 Subject: [PATCH] [1.17] Fix FORCE_CHANCE_TO_HIT macro FORCE_CHANCE_TO_HIT macro use overwrite_specials for overwrite chance_to_hit specials or abilities, but if abilities used like special own this attribute, it can't be overwrited. The use of filter_abilities in [effect]remove_ability authorize to remove all chance_to_hit ability using this attribute in fighter and potential leader. --- data/core/macros/utils.cfg | 6 ++++++ .../test_force_chance_to_hit_macro.cfg | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/data/core/macros/utils.cfg b/data/core/macros/utils.cfg index 67198574c7ea..31411043931c 100644 --- a/data/core/macros/utils.cfg +++ b/data/core/macros/utils.cfg @@ -552,6 +552,9 @@ cumulative=no affect_self=yes overwrite_specials=both_sides + [overwrite] + priority=1000 + [/overwrite] [filter_opponent] {SECOND_FILTER} [/filter_opponent] @@ -605,6 +608,9 @@ cumulative=no affect_self=yes overwrite_specials=both_sides + [overwrite] + priority=1000 + [/overwrite] [filter_opponent] {SECOND_FILTER} [/filter_opponent] diff --git a/data/test/scenarios/macro_tests/test_force_chance_to_hit_macro.cfg b/data/test/scenarios/macro_tests/test_force_chance_to_hit_macro.cfg index 74bdd5489ac3..e230bfa1f538 100644 --- a/data/test/scenarios/macro_tests/test_force_chance_to_hit_macro.cfg +++ b/data/test/scenarios/macro_tests/test_force_chance_to_hit_macro.cfg @@ -42,6 +42,15 @@ [/chance_to_hit] [/set_specials] [/effect] + [effect]#test if macro work when ability with overwrite_special is used + apply_to=new_ability + [abilities] + [chance_to_hit] + value=100 + overwrite_specials=one_side + [/chance_to_hit] + [/abilities] + [/effect] [filter] id=bob [/filter] @@ -64,6 +73,15 @@ [/chance_to_hit] [/set_specials] [/effect] + [effect]#test if macro work when ability with overwrite_special is used + apply_to=new_ability + [abilities] + [chance_to_hit] + value=100 + overwrite_specials=one_side + [/chance_to_hit] + [/abilities] + [/effect] [filter] id=alice [/filter]