diff --git a/data/test/_main.cfg b/data/test/_main.cfg index 652784fb76c..08d1322a7d9 100644 --- a/data/test/_main.cfg +++ b/data/test/_main.cfg @@ -78,6 +78,7 @@ {test/scenarios/wml_tests/TerrainWML} {test/scenarios/wml_tests/UnitsWML} {test/scenarios/wml_tests/UnitsWML/AbilitiesWML} +{test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks} {test/scenarios/wml_tests/UnitsWML/AbilitiesWML/heals} {test/scenarios/wml_tests/UnitsWML/AbilitiesWML/hides} {test/scenarios/wml_tests/UnitsWML/AbilitiesWML/illuminates} diff --git a/data/test/macros/wml_unit_test_macros.cfg b/data/test/macros/wml_unit_test_macros.cfg index 6b969f11ffa..d5525b1b710 100644 --- a/data/test/macros/wml_unit_test_macros.cfg +++ b/data/test/macros/wml_unit_test_macros.cfg @@ -153,3 +153,96 @@ bob#endarg {CLEAR_VARIABLE temp} #enddef + +# checks the number of strikes of all weapons a unit has +# they are expected to have the same number of strikes on all weapons +#define CHECK_STRIKES WEAPONS STRIKES RESULT + +#arg ID1 +alice#endarg + +#arg ID2 +bob#endarg + +#arg COMPARE +numerical_equals#endarg + + [event] + name = start + + [modify_unit] + [filter] + id={ID1},{ID2} + [/filter] + [effect] + apply_to=attack + [set_specials] + mode=append + [damage] + value=1 + [/damage] + [chance_to_hit] + value=100 + [/chance_to_hit] + [/set_specials] + [/effect] + [/modify_unit] + + {VARIABLE {ID1}_{ID2}_count 0} + + [for] + variable=i + start=0 + step=1 + end="$({WEAPONS}-1)" + [do] + [test_do_attack_by_id] + attacker={ID1} + defender={ID2} + weapon=$i + resupply_attacks_left=5 + [/test_do_attack_by_id] + [/do] + [/for] + [/event] + + [event] + name=pre attack + first_time_only=no + + [filter] + id={ID1} + [/filter] + + {VARIABLE {ID1}_{ID2}_strikes 0} + [/event] + + [event] + name=attacker hits, attacker misses + first_time_only=no + + [filter] + id={ID1} + [/filter] + + {VARIABLE_OP {ID1}_{ID2}_strikes add 1} + [/event] + + [event] + name=attack end + first_time_only=no + + [filter] + id={ID1} + [/filter] + + {ASSERT {VARIABLE_CONDITIONAL {ID1}_{ID2}_strikes {COMPARE} {STRIKES}}} + {VARIABLE_OP {ID1}_{ID2}_count add 1} + [if] + {VARIABLE_CONDITIONAL {ID1}_{ID2}_count numerical_equals {WEAPONS}} + [then] + {RESULT} + [/then] + [/if] + [/event] +#enddef diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_add.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_add.cfg new file mode 100644 index 00000000000..7eea3d91ca4 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_add.cfg @@ -0,0 +1,30 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]value= +## +# Actions: +# Give the leaders an attacks ability with both the value and add attributes +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons each of which now has 6 strikes (5+1) +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_add" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 5 (add=1) SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 6 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_add_divide.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_add_divide.cfg new file mode 100644 index 00000000000..07075db6291 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_add_divide.cfg @@ -0,0 +1,31 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]value= +## +# Actions: +# Give the leaders an attacks ability with both the value, add, and divide attributes +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons each of which now has 3 strikes ((5+1)/2) +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_add_divide" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 5 (add=1 + divide=2) SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 3 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_add_multiply.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_add_multiply.cfg new file mode 100644 index 00000000000..eb3e4d2c2a3 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_add_multiply.cfg @@ -0,0 +1,31 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]value= +## +# Actions: +# Give the leaders an attacks ability with both the value, add, and multiply attributes +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons each of which now has 12 strikes ((5+1)*2) +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_add_multiply" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 5 (add=1 + multiply=2) SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 12 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_add_sub.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_add_sub.cfg new file mode 100644 index 00000000000..ee597909731 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_add_sub.cfg @@ -0,0 +1,31 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]value= +## +# Actions: +# Give the leaders an attacks ability with both the value, add, and sub attributes +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons each of which now has 3 strikes (5-2), add is ignored +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_add_sub" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 5 (add=1 + sub=2) SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 3 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_affect_allies.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_affect_allies.cfg new file mode 100644 index 00000000000..ec082706709 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_affect_allies.cfg @@ -0,0 +1,39 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]affect_allies= +## +# Actions: +# Give the side 1 leader an attacks ability that only affects adjacent allies +# Have the side 2 leader attack the side 3 leader with both its weapons +# Have the side 1 leader attack the side 4 leader with both its weapons +## +# Expected end state: +# The side 2 leader has 2 weapons each of which now has 5 strikes +# The side 1 leader has two weapons neither of which has been modified to have 5 strikes +##### +{COMMON_KEEP_A_B_C_D_UNIT_TEST "attacks_affect_allies" ( + [event] + name = start + + [modify_side] + side=1,2 + team_name=allies + [/modify_side] + + [modify_unit] + [filter] + side=1 + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 5 ([affect_adjacent][/affect_adjacent]) ALLIES=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 5 () ID1=bob ID2=charlie} + {CHECK_STRIKES 2 5 ({SUCCEED}) ID1=alice ID2=dave COMPARE=numerical_not_equals} +) SIDE_LEADER="Elvish Archer"} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_affect_enemies.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_affect_enemies.cfg new file mode 100644 index 00000000000..7c08d928c64 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_affect_enemies.cfg @@ -0,0 +1,34 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]affect_enemies= +## +# Actions: +# Give the side 1 leader an attacks ability that only affects adjacent enemies +# Have the side 2 leader attack the side 1 leader with both its weapons +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 2 leader has 2 weapons each of which now has 5 strikes +# The side 1 leader has two weapons neither of which has been modified to have 5 strikes +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_affect_enemies" ( + [event] + name = start + + [modify_unit] + [filter] + side=1 + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 5 ([affect_adjacent][/affect_adjacent]) ENEMIES=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 5 () COMPARE=numerical_not_equals} + {CHECK_STRIKES 2 5 ({SUCCEED}) ID1=bob ID2=alice} +) SIDE2_LEADER="Elvish Archer"} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_affect_everybody.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_affect_everybody.cfg new file mode 100644 index 00000000000..825e67ca29c --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_affect_everybody.cfg @@ -0,0 +1,43 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]affect_allies= +## +# Actions: +# Give the side 1 leader an attacks ability with affect_allies, affect_enemies, and affect_self +# Make side 1 and side 2 allies +# Have the side 1 leader attack the side 3 leader with both its weapons +# Have the side 2 leader attack the side 4 leader with both its weapons +# Have the side 4 leader attack the side 1 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons each of which now has 5 strikes +# The side 2 leader has 2 weapons each of which now has 5 strikes +# The side 4 leader has 2 weapons each of which now has 5 strikes +##### +{COMMON_KEEP_A_B_C_D_UNIT_TEST "attacks_affect_everybody" ( + [event] + name = start + + [modify_side] + side=1,2 + team_name=allies + [/modify_side] + + [modify_unit] + [filter] + side = 1 + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 5 ([affect_adjacent][/affect_adjacent]) ENEMIES=yes SELF=yes ALLIES=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 5 () ID1=alice ID2=charlie} + {CHECK_STRIKES 2 5 () ID1=bob ID2=dave} + {CHECK_STRIKES 2 5 ({SUCCEED}) ID1=dave ID2=alice} +) SIDE_LEADER="Elvish Archer"} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_affect_self_no.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_affect_self_no.cfg new file mode 100644 index 00000000000..425ebe56ff5 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_affect_self_no.cfg @@ -0,0 +1,30 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]affect_self= +## +# Actions: +# Give the leaders an attacks ability that doesn't affect themselves. +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons neither of which has 5 strikes +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_affect_self_no" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 5 ()} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 5 ({SUCCEED}) COMPARE=numerical_not_equals} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_divide.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_divide.cfg new file mode 100644 index 00000000000..f429ffb2fdb --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_divide.cfg @@ -0,0 +1,30 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]value= +## +# Actions: +# Give the leaders an attacks ability with both the value and divide attributes +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons both of which have 3 strikes +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_divide" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 6 (divide=2) SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 3 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_high_fraction.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_high_fraction.cfg new file mode 100644 index 00000000000..249592dec87 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_high_fraction.cfg @@ -0,0 +1,32 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]value= +## +# Actions: +# Give the leaders an attacks ability with a value of 3.8. +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons both of which have 3 strikes +##### +#ifndef SCHEMA_VALIDATION +{COMMON_KEEP_A_B_UNIT_TEST "attacks_high_fraction" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 3.8 () SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 3 ({SUCCEED})} +)} +#endif diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_low_fraction.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_low_fraction.cfg new file mode 100644 index 00000000000..1e83b26263e --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_low_fraction.cfg @@ -0,0 +1,32 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]value= +## +# Actions: +# Give the leaders an attacks ability with a value of 3.2. +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons both of which have 3 strikes +##### +#ifndef SCHEMA_VALIDATION +{COMMON_KEEP_A_B_UNIT_TEST "attacks_low_fraction" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 3.2 () SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 3 ({SUCCEED})} +)} +#endif diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_max_value.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_max_value.cfg new file mode 100644 index 00000000000..df0b6dfcce2 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_max_value.cfg @@ -0,0 +1,33 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]value= +## +# Actions: +# Give the leaders an attacks ability with both the value and add attributes +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# max_value does nothing. +# The side 1 leader has 2 weapons both of which have 3 strikes +##### +#ifndef SCHEMA_VALIDATION +{COMMON_KEEP_A_B_UNIT_TEST "attacks_max_value" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 3 (max_value=1) SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 3 ({SUCCEED})} +)} +#endif diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_multiply.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_multiply.cfg new file mode 100644 index 00000000000..3d29c237f62 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_multiply.cfg @@ -0,0 +1,30 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]value= +## +# Actions: +# Give the leaders an attacks ability with both the value and multiply attributes +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons both of which have 8 strikes (2*4) +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_multiply" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 4 (multiply=2) SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 8 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_multiply_divide.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_multiply_divide.cfg new file mode 100644 index 00000000000..cc238064392 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_multiply_divide.cfg @@ -0,0 +1,31 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]value= +## +# Actions: +# Give the leaders an attacks ability with both the value, multiply, and divide attributes +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons both of which have 6 strikes ((4*3)/2) +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_multiply_divide" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 4 (multiply=3 + divide=2) SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 6 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_multiply_fraction.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_multiply_fraction.cfg new file mode 100644 index 00000000000..7150529a228 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_multiply_fraction.cfg @@ -0,0 +1,32 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]value= +## +# Actions: +# Give the leaders an attacks ability with both the value and multiply attributes +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons both of which have 4 strikes (2*2, the .5 is truncated) +##### +#ifndef SCHEMA_VALIDATION +{COMMON_KEEP_A_B_UNIT_TEST "attacks_multiply_fraction" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 2.5 (multiply=2) SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 4 ({SUCCEED})} +)} +#endif diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_negative_value.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_negative_value.cfg new file mode 100644 index 00000000000..50adce262ad --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_negative_value.cfg @@ -0,0 +1,31 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]value= +## +# Actions: +# Give the leaders an attacks ability with a value of -10. +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The number of strikes is not changed. +# Errors are logged about the negative value for strikes. +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_negative_value" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks -10 () SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 -10 ({SUCCEED}) COMPARE=numerical_not_equals} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_no_value.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_no_value.cfg new file mode 100644 index 00000000000..63253a9d714 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_no_value.cfg @@ -0,0 +1,38 @@ +#textdomain wesnoth-test + +##### +# API(s) being tested: [attacks]value= +## +# Actions: +# Give the leaders an attacks ability missing the value attribute. +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The number of strikes is not changed. +# No errors are logged. +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_no_value" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + [attacks] + id = "test-attacks" + name = _"test-attacks" + affect_self = yes + affect_allies = no + affect_enemies = no + cumulative = no + [/attacks] + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 5 ({SUCCEED}) COMPARE=numerical_not_equals} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_overwrite_specials_both_sides.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_overwrite_specials_both_sides.cfg new file mode 100644 index 00000000000..891f09b9435 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_overwrite_specials_both_sides.cfg @@ -0,0 +1,33 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]overwrite_specials= +## +# Actions: +# Give the side 1 leader an attacks ability with the overwrite_specials=both_sides attribute +# Give the side 1 leader an attacks ability without the overwrite_specials attribute +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons each of which now has 5 strikes, since the 5 strike ability takes priority due to overwrite_specials +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_overwrite_specials_both_sides" ( + [event] + name = start + + [modify_unit] + [filter] + side=1 + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 5 (overwrite_specials=both_sides) SELF=yes} + {TEST_ABILITY attacks 7 () SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 5 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_overwrite_specials_mixed.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_overwrite_specials_mixed.cfg new file mode 100644 index 00000000000..dd18103af2d --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_overwrite_specials_mixed.cfg @@ -0,0 +1,33 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]overwrite_specials= +## +# Actions: +# Give the side 1 leader an attacks ability with the overwrite_specials=one_side attribute +# Give the side 1 leader another attacks ability with the overwrite_specials=both_sides attribute +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons each of which now has 7 strikes, since the the higher value ability is used +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_overwrite_specials_mixed" ( + [event] + name = start + + [modify_unit] + [filter] + side=1 + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 5 (overwrite_specials=one_side) SELF=yes} + {TEST_ABILITY attacks 7 (overwrite_specials=both_sides) SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 7 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_overwrite_specials_one_side.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_overwrite_specials_one_side.cfg new file mode 100644 index 00000000000..844928f7d74 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_overwrite_specials_one_side.cfg @@ -0,0 +1,33 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]overwrite_specials= +## +# Actions: +# Give the side 1 leader an attacks ability with the overwrite_specials=one_side attribute +# Give the side 1 leader an attacks ability without the overwrite_specials attribute +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons each of which now has 5 strikes, since the 5 strike ability takes priority due to overwrite_specials +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_overwrite_specials_one_side" ( + [event] + name = start + + [modify_unit] + [filter] + side=1 + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 5 (overwrite_specials=one_side) SELF=yes} + {TEST_ABILITY attacks 7 () SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 5 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_overwrite_specials_two_both_sides.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_overwrite_specials_two_both_sides.cfg new file mode 100644 index 00000000000..6bb622ac771 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_overwrite_specials_two_both_sides.cfg @@ -0,0 +1,33 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]overwrite_specials= +## +# Actions: +# Give the side 1 leader an attacks ability with the overwrite_specials=both_sides attribute +# Give the side 1 leader another attacks ability with the overwrite_specials=both_sides attribute +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons each of which now has 7 strikes, since the the higher value ability is used +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_overwrite_specials_two_both_sides" ( + [event] + name = start + + [modify_unit] + [filter] + side=1 + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 7 (overwrite_specials=both_sides) SELF=yes} + {TEST_ABILITY attacks 5 (overwrite_specials=both_sides) SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 7 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_overwrite_specials_two_one_side.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_overwrite_specials_two_one_side.cfg new file mode 100644 index 00000000000..f0f394ec29b --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_overwrite_specials_two_one_side.cfg @@ -0,0 +1,33 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]overwrite_specials= +## +# Actions: +# Give the side 1 leader an attacks ability with the overwrite_specials=one_side attribute +# Give the side 1 leader another attacks ability with the overwrite_specials=one_side attribute +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons each of which now has 7 strikes, since the the higher value ability is used +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_overwrite_specials_two_one_side" ( + [event] + name = start + + [modify_unit] + [filter] + side=1 + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 5 (overwrite_specials=one_side) SELF=yes} + {TEST_ABILITY attacks 7 (overwrite_specials=one_side) SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 7 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_sub.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_sub.cfg new file mode 100644 index 00000000000..0d00884754a --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_sub.cfg @@ -0,0 +1,30 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]value= +## +# Actions: +# Give the leaders an attacks ability with both the value and sub attributes +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons both of which have 1 strike (3-2) +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_sub" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 3 (sub=2) SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 1 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_sub_divide.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_sub_divide.cfg new file mode 100644 index 00000000000..74c4cf34408 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_sub_divide.cfg @@ -0,0 +1,31 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]value= +## +# Actions: +# Give the leaders an attacks ability with both the value, sub, and divide attributes +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons both of which have 1 strike ((3-1)/2) +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_sub_divide" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 3 (sub=1 + divide=2) SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 1 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_sub_multiply.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_sub_multiply.cfg new file mode 100644 index 00000000000..6ccc6d7bb9e --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_sub_multiply.cfg @@ -0,0 +1,31 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]value= +## +# Actions: +# Give the leaders an attacks ability with both the value, sub, and multiply attributes +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons both of which have 4 strikes ((3-1)*2) +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_sub_multiply" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 3 (sub=1 + multiply=2) SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 4 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_two_cumulative_mixed_same_id.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_two_cumulative_mixed_same_id.cfg new file mode 100644 index 00000000000..6eb2af3c450 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_two_cumulative_mixed_same_id.cfg @@ -0,0 +1,31 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]cumulative= +## +# Actions: +# Give the leaders an attacks ability with non-unique IDs, one with cumulative=yes, and one with cumulative=no +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons both of which have 6 strikes +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_two_cumulative_mixed_same_id" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 6 () ID=1 CUMULATIVE=yes SELF=yes} + {TEST_ABILITY attacks 4 () ID=1 CUMULATIVE=no SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 6 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_two_cumulative_mixed_unique_id.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_two_cumulative_mixed_unique_id.cfg new file mode 100644 index 00000000000..a3e8a4c6529 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_two_cumulative_mixed_unique_id.cfg @@ -0,0 +1,31 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]cumulative= +## +# Actions: +# Give the leaders an attacks ability with unique IDs, one with cumulative=yes, and one with cumulative=no +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons both of which have 6 strikes +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_two_cumulative_mixed_unique_id" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 6 () ID=1 CUMULATIVE=yes SELF=yes} + {TEST_ABILITY attacks 4 () ID=2 CUMULATIVE=no SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 6 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_two_cumulative_no_same_id.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_two_cumulative_no_same_id.cfg new file mode 100644 index 00000000000..85b50473da9 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_two_cumulative_no_same_id.cfg @@ -0,0 +1,31 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]cumulative= +## +# Actions: +# Give the leaders an attacks ability with non-unique IDs and cumulative=no +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons both of which have 6 strikes +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_two_cumulative_no_same_id" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 6 () ID=1 CUMULATIVE=no SELF=yes} + {TEST_ABILITY attacks 4 () ID=1 CUMULATIVE=no SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 6 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_two_cumulative_no_unique_id.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_two_cumulative_no_unique_id.cfg new file mode 100644 index 00000000000..83b0dd98009 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_two_cumulative_no_unique_id.cfg @@ -0,0 +1,31 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]cumulative= +## +# Actions: +# Give the leaders an attacks ability with unique IDs and cumulative=no +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons both of which have 6 strikes +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_two_cumulative_no_unique_id" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 6 () ID=1 CUMULATIVE=no SELF=yes} + {TEST_ABILITY attacks 4 () ID=2 CUMULATIVE=no SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 6 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_two_cumulative_yes_same_id.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_two_cumulative_yes_same_id.cfg new file mode 100644 index 00000000000..ea4e09c9501 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_two_cumulative_yes_same_id.cfg @@ -0,0 +1,31 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]cumulative= +## +# Actions: +# Give the leaders an attacks ability with non-unique IDs and cumulative=yes +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons both of which have 6 strikes +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_two_cumulative_yes_same_id" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 6 () ID=1 CUMULATIVE=yes SELF=yes} + {TEST_ABILITY attacks 4 () ID=1 CUMULATIVE=yes SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 6 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_two_cumulative_yes_unique_id.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_two_cumulative_yes_unique_id.cfg new file mode 100644 index 00000000000..1b07f07c41b --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_two_cumulative_yes_unique_id.cfg @@ -0,0 +1,31 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]cumulative= +## +# Actions: +# Give the leaders an attacks ability with unique IDs and cumulative=yes +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons both of which have 6 strikes +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_two_cumulative_yes_unique_id" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 6 () ID=1 CUMULATIVE=yes SELF=yes} + {TEST_ABILITY attacks 4 () ID=2 CUMULATIVE=yes SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 6 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_wfl_other.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_wfl_other.cfg new file mode 100644 index 00000000000..fb53a069059 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_wfl_other.cfg @@ -0,0 +1,30 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]value= +## +# Actions: +# Give the leaders an attacks ability that gives a quarter of the max hp of the other unit as strikes. +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons both of which have 7 strikes (29/4), other is the attacker +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_wfl_other" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks "(other.max_hitpoints/4)" () SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 7 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_wfl_self.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_wfl_self.cfg new file mode 100644 index 00000000000..ed6bc4a3093 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_wfl_self.cfg @@ -0,0 +1,30 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]value= +## +# Actions: +# Give the leaders an attacks ability that attacks half its own max hp. +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons both of which have 7 strikes (29/4), self is the attacker +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_wfl_self" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks "(max_hitpoints/4)" () SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 7 ({SUCCEED})} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_zero.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_zero.cfg new file mode 100644 index 00000000000..994f07584a2 --- /dev/null +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/attacks/attacks_zero.cfg @@ -0,0 +1,31 @@ +# wmllint: no translatables + +##### +# API(s) being tested: [attacks]value= +## +# Actions: +# Give the leaders an attacks ability with a value of 0. +# Have the side 1 leader attack the side 2 leader with both its weapons +## +# Expected end state: +# The side 1 leader has 2 weapons both of which don't have 0 strikes +# No errors are logged +##### +{COMMON_KEEP_A_B_UNIT_TEST "attacks_zero" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY attacks 0 ()} + [/abilities] + [/effect] + [/modify_unit] + [/event] + + {CHECK_STRIKES 2 0 ({SUCCEED}) COMPARE=numerical_not_equals} +)} diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/regenerate/regenerate_affect_allies.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/regenerate/regenerate_affect_allies.cfg index de3c42bdc08..d6df9ce10a4 100644 --- a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/regenerate/regenerate_affect_allies.cfg +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/regenerate/regenerate_affect_allies.cfg @@ -22,6 +22,7 @@ [modify_unit] [filter] + side=1 [/filter] [effect] apply_to = new_ability diff --git a/wml_test_schedule b/wml_test_schedule index db3c91b23ec..685b60ba091 100644 --- a/wml_test_schedule +++ b/wml_test_schedule @@ -675,6 +675,40 @@ 0 tunnel_target_teleport_unit_succeed 0 tunnel_source_teleport_unit_fail 0 tunnel_source_teleport_unit_succeed +# attacks ability tests +9 attacks_negative_value +0 attacks_zero +0 attacks_add +0 attacks_add_divide +0 attacks_add_multiply +0 attacks_add_sub +0 attacks_affect_self_no +0 attacks_affect_enemies +0 attacks_affect_everybody +0 attacks_divide +0 attacks_high_fraction +0 attacks_low_fraction +0 attacks_multiply +0 attacks_multiply_divide +0 attacks_multiply_fraction +0 attacks_no_value +0 attacks_sub +0 attacks_sub_divide +0 attacks_sub_multiply +0 attacks_wfl_other +0 attacks_wfl_self +0 attacks_two_cumulative_yes_same_id +0 attacks_two_cumulative_yes_unique_id +0 attacks_two_cumulative_no_same_id +0 attacks_two_cumulative_no_unique_id +0 attacks_two_cumulative_mixed_same_id +0 attacks_two_cumulative_mixed_unique_id +0 attacks_max_value +0 attacks_overwrite_specials_one_side +0 attacks_overwrite_specials_both_sides +0 attacks_overwrite_specials_two_both_sides +0 attacks_overwrite_specials_two_one_side +0 attacks_overwrite_specials_mixed # Warnings about WML 0 unknown_scenario_false_positives 0 unknown_scenario_interpolated