From a3bc6cfa29a748003ae1e3b62fc1fd177393f33d Mon Sep 17 00:00:00 2001 From: newfrenchy83 Date: Sun, 22 Dec 2024 11:29:06 +0100 Subject: [PATCH] add test --- .../damage/damage_multiply_fraction.cfg | 34 +++++++++++++++++++ wml_test_schedule | 1 + 2 files changed, 35 insertions(+) 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..5b20847e774e4 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,37 @@ [/event] ) SIDE2_LEADER="Elvish Archer"} #endif + +##### +# API(s) being tested: [damage]value= +## +# Actions: +# Give the leaders a damage ability with multiply 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 both of which have 8 damage (4*1.95=7.8 rounded up to 8) +##### +{COMMON_KEEP_A_B_UNIT_TEST "damage_multiply_with_decimal" ( + [event] + name = start + + [modify_unit] + [filter] + [/filter] + [effect] + apply_to = attack + set_damage=4 + [/effect] + [effect] + apply_to = new_ability + [abilities] + {TEST_ABILITY_NO_VALUE damage (multiply=1.9999) SELF=yes} + [/abilities] + [/effect] + [/modify_unit] + + {ATTACK_AND_VALIDATE 8 (DAMAGE_VALUE=) WEAPON_COUNT=2} + {SUCCEED} + [/event] +) SIDE2_LEADER="Elvish Archer"} diff --git a/wml_test_schedule b/wml_test_schedule index 9d1bb64e457af..98ddb3ded323e 100644 --- a/wml_test_schedule +++ b/wml_test_schedule @@ -861,6 +861,7 @@ 0 damage_multiply 0 damage_multiply_divide 0 damage_multiply_fraction +0 damage_multiply_with_decimal 0 damage_no_value 0 damage_sub 0 damage_sub_divide