Unit test cumulative resistance with a max_value

A surprising result on 1.18, the max_value attributes get added together.

In 1.19, 82499d0785 changes this to something
logical, using `min(each individual max_value)` and disregarding the cumulative
attributes.
This commit is contained in:
Steve Cotton 2024-04-12 09:27:24 +02:00 committed by Steve Cotton
parent 9b2016a4af
commit 9632febdb5
2 changed files with 38 additions and 0 deletions

View file

@ -0,0 +1,37 @@
# wmllint: no translatables
#####
# API(s) being tested: [resistance]cumulative=
##
# Actions:
# Give all units 20% resistance to all damage types with max_value=15 and cumulative=yes
# Give all units 30% resistance to all damage types with max_value=17 and cumulative=yes
# Give all units 20% resistance to all damage types with max_value=15 and cumulative=yes
# All abilities have unique ids
# Attack each other
##
# Expected end state:
# In 1.18, the cumulative effect is 30% resistance with a max_value of 47.
# The damage from the attack is reduced by 30%
#####
{COMMON_KEEP_A_B_UNIT_TEST "resistance_cumulative_max_value" (
[event]
name = start
[modify_unit]
[filter]
[/filter]
[effect]
apply_to = new_ability
[abilities]
{TEST_ABILITY resistance 20 (max_value=15) ID=1 CUMULATIVE=yes SELF=yes}
{TEST_ABILITY resistance 30 (max_value=17) ID=2 CUMULATIVE=yes SELF=yes}
{TEST_ABILITY resistance 20 (max_value=15) ID=3 CUMULATIVE=yes SELF=yes}
[/abilities]
[/effect]
[/modify_unit]
{ATTACK_AND_VALIDATE 70}
{SUCCEED}
[/event]
)}

View file

@ -602,6 +602,7 @@
0 resistance_two_cumulative_mixed_unique_id
0 resistance_two_cumulative_mixed_unique_id_skeletal
0 resistance_max_value
0 resistance_cumulative_max_value
0 resistance_negative_max_value
0 resistance_apply_to_blade
0 resistance_apply_to_non_blade