diff --git a/data/test/scenarios/macro_tests/test_force_chance_to_hit_macro_nested.cfg b/data/test/scenarios/macro_tests/test_force_chance_to_hit_macro_nested.cfg new file mode 100644 index 00000000000..073d533b152 --- /dev/null +++ b/data/test/scenarios/macro_tests/test_force_chance_to_hit_macro_nested.cfg @@ -0,0 +1,104 @@ +##### +# API(s) being tested: FORCE_CHANCE_TO_HIT,[event] +## +# Actions: +# Inside the start event, give alice and bob a 0% chance to hit each other with FORCE_CHANCE_TO_HIT. +# Give alice and bob a [chance_to_hit] weapon special that grants 100% hit chance. +# Give alice and bob 10 strikes each. +# Have alice attack bob. +## +# Expected end state: +# All strikes for both units miss. +##### +{COMMON_KEEP_A_B_UNIT_TEST "test_force_chance_to_hit_macro_nested" ( + [event] + name=start + + {FORCE_CHANCE_TO_HIT (id=bob) (id=alice) 0 ()} + {FORCE_CHANCE_TO_HIT (id=alice) (id=bob) 0 ()} + + [modify_unit] + [filter] + [/filter] + max_hitpoints=100 + hitpoints=100 + attacks_left=1 + [/modify_unit] + + [object] + silent=yes + [effect] + apply_to=attack + [set_specials] + mode=append + [attacks] + value=10 + [/attacks] + [damage] + value=1 + [/damage] + [chance_to_hit] + value=100 + [/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] + [/object] + + [object] + silent=yes + [effect] + apply_to=attack + [set_specials] + mode=append + [attacks] + value=10 + [/attacks] + [damage] + value=1 + [/damage] + [chance_to_hit] + value=100 + [/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] + [/object] + + [test_do_attack_by_id] + attacker=alice + defender=bob + weapon=0 + [/test_do_attack_by_id] + + {SUCCEED} + [/event] + + [event] + name=attacker hits,defender hits + first_time_only=no + {FAIL} + [/event] +)} 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_toplevel.cfg similarity index 95% rename from data/test/scenarios/macro_tests/test_force_chance_to_hit_macro.cfg rename to data/test/scenarios/macro_tests/test_force_chance_to_hit_macro_toplevel.cfg index e230bfa1f53..8c92fc18fe8 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_toplevel.cfg @@ -2,7 +2,7 @@ # API(s) being tested: FORCE_CHANCE_TO_HIT ## # Actions: -# Give alice and bob a 0% chance to hit each other with FORCE_CHANCE_TO_HIT. +# Using the macro outside an event, give alice and bob a 0% chance to hit each other with FORCE_CHANCE_TO_HIT. # Give alice and bob a [chance_to_hit] weapon special that grants 100% hit chance. # Give alice and bob 10 strikes each. # Have alice attack bob. @@ -10,7 +10,7 @@ # Expected end state: # All strikes for both units miss. ##### -{GENERIC_UNIT_TEST "test_force_chance_to_hit_macro" ( +{GENERIC_UNIT_TEST "test_force_chance_to_hit_macro_toplevel" ( {FORCE_CHANCE_TO_HIT (id=bob) (id=alice) 0 ()} {FORCE_CHANCE_TO_HIT (id=alice) (id=bob) 0 ()} diff --git a/wml_test_schedule b/wml_test_schedule index 0fb7c9e2eb8..1982ae602f3 100644 --- a/wml_test_schedule +++ b/wml_test_schedule @@ -368,7 +368,8 @@ 0 poison_opponent 0 unslowable_status_test 0 unpetrifiable_status_test -0 test_force_chance_to_hit_macro +0 test_force_chance_to_hit_macro_nested +0 test_force_chance_to_hit_macro_toplevel 0 trait_exclusion_test 0 trait_requirement_test 0 test_remove_ability_by_filter