diff --git a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/damage/damage_multiply_fraction.cfg b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/damage/damage_multiply_fraction.cfg index 1b4cd52ce5174..a31c247c8afc4 100644 --- a/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/damage/damage_multiply_fraction.cfg +++ b/data/test/scenarios/wml_tests/UnitsWML/AbilitiesWML/damage/damage_multiply_fraction.cfg @@ -31,3 +31,40 @@ [/event] ) SIDE2_LEADER="Elvish Archer"} #endif + +#define TEST_DAMAGE_MULTIPLY_FRACTION TEST_CASE_INDEX BASE_VALUE MULTIPLIER EXPECTED +{COMMON_KEEP_A_B_UNIT_TEST "damage_multiply_fraction_{TEST_CASE_INDEX}" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = attack + set_damage={BASE_VALUE} + [/effect] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY_NO_VALUE damage (multiply={MULTIPLIER}) SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + + {ATTACK_AND_VALIDATE {EXPECTED} (DAMAGE_VALUE=) WEAPON_COUNT=2} + {SUCCEED} + [/event] +) SIDE2_LEADER="Elvish Archer"} +#enddef + +# baseline test with integer result +{TEST_DAMAGE_MULTIPLY_FRACTION 0 10 1 10} +{TEST_DAMAGE_MULTIPLY_FRACTION 1 10 1.1 11} +# rounding at middle point - round towards base value +{TEST_DAMAGE_MULTIPLY_FRACTION 2 1 1.5 2} +{TEST_DAMAGE_MULTIPLY_FRACTION 3 2 0.75 2} +{TEST_DAMAGE_MULTIPLY_FRACTION 4_2 1 1.51 2} +{TEST_DAMAGE_MULTIPLY_FRACTION 5_1 2 0.74 1} + +#undef TEST_DAMAGE_MULTIPLY_FRACTION diff --git a/wml_test_schedule b/wml_test_schedule index 9d1bb64e457af..6ef8fa988144e 100644 --- a/wml_test_schedule +++ b/wml_test_schedule @@ -861,6 +861,12 @@ 0 damage_multiply 0 damage_multiply_divide 0 damage_multiply_fraction +0 damage_multiply_fraction_0 +0 damage_multiply_fraction_1 +0 damage_multiply_fraction_ +0 damage_multiply_fraction_3 +0 damage_multiply_fraction_4_2 +0 damage_multiply_fraction_5_1 0 damage_no_value 0 damage_sub 0 damage_sub_divide