petrifies tests
This commit is contained in:
parent
81229241bb
commit
9e756f9fc5
7 changed files with 728 additions and 0 deletions
|
@ -91,6 +91,7 @@
|
|||
{test/scenarios/wml_tests/UnitsWML/AbilitiesWML/hides}
|
||||
{test/scenarios/wml_tests/UnitsWML/AbilitiesWML/illuminates}
|
||||
{test/scenarios/wml_tests/UnitsWML/AbilitiesWML/leadership}
|
||||
{test/scenarios/wml_tests/UnitsWML/AbilitiesWML/petrifies}
|
||||
{test/scenarios/wml_tests/UnitsWML/AbilitiesWML/regenerate}
|
||||
{test/scenarios/wml_tests/UnitsWML/AbilitiesWML/resistance}
|
||||
{test/scenarios/wml_tests/UnitsWML/AbilitiesWML/skirmisher}
|
||||
|
|
|
@ -0,0 +1,110 @@
|
|||
#textdomain wesnoth-test
|
||||
|
||||
#####
|
||||
# API(s) being tested: [petrifies]
|
||||
##
|
||||
# Actions:
|
||||
# Give the leaders a petrifies ability
|
||||
# Have side 1's leader attack side 2's leader with their first weapon
|
||||
# Unpetrify side 2's leader
|
||||
# Have side 1's leader attack side 2's leader with their second weapon
|
||||
##
|
||||
# Expected end state:
|
||||
# Both weapons petrify side 2's leader
|
||||
#####
|
||||
{COMMON_KEEP_A_B_UNIT_TEST "petrifies_ability" (
|
||||
[event]
|
||||
name = start
|
||||
|
||||
[modify_unit]
|
||||
[filter]
|
||||
[/filter]
|
||||
[effect]
|
||||
apply_to = new_ability
|
||||
[abilities]
|
||||
{TEST_ABILITY_NO_VALUE petrifies () SELF=yes}
|
||||
[/abilities]
|
||||
[/effect]
|
||||
[/modify_unit]
|
||||
|
||||
[modify_unit]
|
||||
[filter]
|
||||
id=alice,bob
|
||||
[/filter]
|
||||
[effect]
|
||||
apply_to=attack
|
||||
[set_specials]
|
||||
mode=append
|
||||
[attacks]
|
||||
value=1
|
||||
[/attacks]
|
||||
[damage]
|
||||
value=1
|
||||
[/damage]
|
||||
[chance_to_hit]
|
||||
value=100
|
||||
[/chance_to_hit]
|
||||
[/set_specials]
|
||||
[/effect]
|
||||
[/modify_unit]
|
||||
|
||||
[test_do_attack_by_id]
|
||||
attacker=alice
|
||||
defender=bob
|
||||
weapon=0
|
||||
resupply_attacks_left=1
|
||||
[/test_do_attack_by_id]
|
||||
|
||||
{ASSERT (
|
||||
[have_unit]
|
||||
side = 2
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
)}
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 1
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
[unpetrify]
|
||||
side = 2
|
||||
[/unpetrify]
|
||||
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 2
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
[test_do_attack_by_id]
|
||||
attacker=alice
|
||||
defender=bob
|
||||
weapon=1
|
||||
resupply_attacks_left=1
|
||||
[/test_do_attack_by_id]
|
||||
|
||||
{ASSERT (
|
||||
[have_unit]
|
||||
side = 2
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
)}
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 1
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
{SUCCEED}
|
||||
[/event]
|
||||
)}
|
|
@ -0,0 +1,165 @@
|
|||
# wmllint: no translatables
|
||||
|
||||
#####
|
||||
# API(s) being tested: [attacks]affect_allies=
|
||||
##
|
||||
# Actions:
|
||||
# Give the side 1 leader a petrifies ability that only affects adjacent allies' weapons
|
||||
# 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:
|
||||
# Both of side 2's weapons petrify side 3's leader
|
||||
# Neither of side 1's weapons petrify side 4's leader
|
||||
#####
|
||||
{COMMON_KEEP_A_B_C_D_UNIT_TEST "petrifies_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_NO_VALUE petrifies ([affect_adjacent][/affect_adjacent]) ALLIES=yes}
|
||||
[/abilities]
|
||||
[/effect]
|
||||
[/modify_unit]
|
||||
|
||||
[modify_unit]
|
||||
[filter]
|
||||
[/filter]
|
||||
[effect]
|
||||
apply_to=attack
|
||||
[set_specials]
|
||||
mode=append
|
||||
[attacks]
|
||||
value=1
|
||||
[/attacks]
|
||||
[damage]
|
||||
value=1
|
||||
[/damage]
|
||||
[chance_to_hit]
|
||||
value=100
|
||||
[/chance_to_hit]
|
||||
[/set_specials]
|
||||
[/effect]
|
||||
[/modify_unit]
|
||||
|
||||
# side 2 attacks side 3
|
||||
[test_do_attack_by_id]
|
||||
attacker=bob
|
||||
defender=charlie
|
||||
weapon=0
|
||||
resupply_attacks_left=1
|
||||
[/test_do_attack_by_id]
|
||||
|
||||
{ASSERT (
|
||||
[have_unit]
|
||||
side = 3
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
)}
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 2
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
[unpetrify]
|
||||
side = 3
|
||||
[/unpetrify]
|
||||
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 3
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
[test_do_attack_by_id]
|
||||
attacker=bob
|
||||
defender=charlie
|
||||
weapon=1
|
||||
resupply_attacks_left=1
|
||||
[/test_do_attack_by_id]
|
||||
|
||||
{ASSERT (
|
||||
[have_unit]
|
||||
side = 3
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
)}
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 2
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
# side 1 attacks side 4
|
||||
[test_do_attack_by_id]
|
||||
attacker=alice
|
||||
defender=dave
|
||||
weapon=0
|
||||
resupply_attacks_left=1
|
||||
[/test_do_attack_by_id]
|
||||
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 4
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 1
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
[test_do_attack_by_id]
|
||||
attacker=alice
|
||||
defender=dave
|
||||
weapon=1
|
||||
resupply_attacks_left=1
|
||||
[/test_do_attack_by_id]
|
||||
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 4
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 1
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
{SUCCEED}
|
||||
[/event]
|
||||
) SIDE_LEADER="Elvish Archer"}
|
|
@ -0,0 +1,109 @@
|
|||
# wmllint: no translatables
|
||||
|
||||
#####
|
||||
# API(s) being tested: [attacks]affect_enemies=
|
||||
##
|
||||
# Actions:
|
||||
# Give the side 1 leader a petrifies ability that only affects adjacent enemies
|
||||
# Have the side 2 leader attack the side 1 leader with both its weapons
|
||||
##
|
||||
# Expected end state:
|
||||
# Both of side 2's weapons petrify side 1's leader
|
||||
#####
|
||||
{COMMON_KEEP_A_B_UNIT_TEST "petrifies_affect_enemies" (
|
||||
[event]
|
||||
name = start
|
||||
|
||||
[modify_unit]
|
||||
[filter]
|
||||
side=1
|
||||
[/filter]
|
||||
[effect]
|
||||
apply_to = new_ability
|
||||
[abilities]
|
||||
{TEST_ABILITY_NO_VALUE petrifies ([affect_adjacent][/affect_adjacent]) ENEMIES=yes}
|
||||
[/abilities]
|
||||
[/effect]
|
||||
[/modify_unit]
|
||||
|
||||
[modify_unit]
|
||||
[filter]
|
||||
[/filter]
|
||||
[effect]
|
||||
apply_to=attack
|
||||
[set_specials]
|
||||
mode=append
|
||||
[attacks]
|
||||
value=1
|
||||
[/attacks]
|
||||
[damage]
|
||||
value=1
|
||||
[/damage]
|
||||
[chance_to_hit]
|
||||
value=100
|
||||
[/chance_to_hit]
|
||||
[/set_specials]
|
||||
[/effect]
|
||||
[/modify_unit]
|
||||
|
||||
# side 2 attacks side 1
|
||||
[test_do_attack_by_id]
|
||||
attacker=alice
|
||||
defender=bob
|
||||
weapon=0
|
||||
resupply_attacks_left=1
|
||||
[/test_do_attack_by_id]
|
||||
|
||||
{ASSERT (
|
||||
[have_unit]
|
||||
side = 1
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
)}
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 2
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
[unpetrify]
|
||||
side = 1
|
||||
[/unpetrify]
|
||||
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 1
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
[test_do_attack_by_id]
|
||||
attacker=alice
|
||||
defender=bob
|
||||
weapon=1
|
||||
resupply_attacks_left=1
|
||||
[/test_do_attack_by_id]
|
||||
|
||||
{ASSERT (
|
||||
[have_unit]
|
||||
side = 1
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
)}
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 2
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
{SUCCEED}
|
||||
[/event]
|
||||
) SIDE2_LEADER="Elvish Archer"}
|
|
@ -0,0 +1,239 @@
|
|||
# wmllint: no translatables
|
||||
|
||||
#####
|
||||
# API(s) being tested: [attacks]affect_allies=
|
||||
##
|
||||
# Actions:
|
||||
# Give the side 1 leader a petrifies 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 petrifies the side 3 leader
|
||||
# The side 2 leader has 2 weapons each of which petrifies the side 4 leader
|
||||
# The side 4 leader has 2 weapons each of which petrifies the side 1 leader
|
||||
#####
|
||||
{COMMON_KEEP_A_B_C_D_UNIT_TEST "petrifies_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_NO_VALUE petrifies ([affect_adjacent][/affect_adjacent]) ENEMIES=yes SELF=yes ALLIES=yes}
|
||||
[/abilities]
|
||||
[/effect]
|
||||
[/modify_unit]
|
||||
|
||||
[modify_unit]
|
||||
[filter]
|
||||
[/filter]
|
||||
[effect]
|
||||
apply_to=attack
|
||||
[set_specials]
|
||||
mode=append
|
||||
[attacks]
|
||||
value=1
|
||||
[/attacks]
|
||||
[damage]
|
||||
value=1
|
||||
[/damage]
|
||||
[chance_to_hit]
|
||||
value=100
|
||||
[/chance_to_hit]
|
||||
[/set_specials]
|
||||
[/effect]
|
||||
[/modify_unit]
|
||||
|
||||
# side 1 attacks side 3
|
||||
[test_do_attack_by_id]
|
||||
attacker=alice
|
||||
defender=charlie
|
||||
weapon=0
|
||||
resupply_attacks_left=1
|
||||
[/test_do_attack_by_id]
|
||||
|
||||
{ASSERT (
|
||||
[have_unit]
|
||||
side = 3
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
)}
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 1
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
[unpetrify]
|
||||
side = 3
|
||||
[/unpetrify]
|
||||
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 3
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
[test_do_attack_by_id]
|
||||
attacker=alice
|
||||
defender=charlie
|
||||
weapon=1
|
||||
resupply_attacks_left=1
|
||||
[/test_do_attack_by_id]
|
||||
|
||||
{ASSERT (
|
||||
[have_unit]
|
||||
side = 3
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
)}
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 1
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
# side 2 attacks side 4
|
||||
[test_do_attack_by_id]
|
||||
attacker=bob
|
||||
defender=dave
|
||||
weapon=0
|
||||
resupply_attacks_left=1
|
||||
[/test_do_attack_by_id]
|
||||
|
||||
{ASSERT (
|
||||
[have_unit]
|
||||
side = 4
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
)}
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 2
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
[unpetrify]
|
||||
side = 4
|
||||
[/unpetrify]
|
||||
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 4
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
[test_do_attack_by_id]
|
||||
attacker=bob
|
||||
defender=dave
|
||||
weapon=1
|
||||
resupply_attacks_left=1
|
||||
[/test_do_attack_by_id]
|
||||
|
||||
{ASSERT (
|
||||
[have_unit]
|
||||
side = 4
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
)}
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 2
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
[unpetrify]
|
||||
side = 4
|
||||
[/unpetrify]
|
||||
|
||||
# side 4 attacks side 1
|
||||
[test_do_attack_by_id]
|
||||
attacker=dave
|
||||
defender=alice
|
||||
weapon=0
|
||||
resupply_attacks_left=1
|
||||
[/test_do_attack_by_id]
|
||||
|
||||
{ASSERT (
|
||||
[have_unit]
|
||||
side = 1
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
)}
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 4
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
[unpetrify]
|
||||
side = 1
|
||||
[/unpetrify]
|
||||
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 1
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
[test_do_attack_by_id]
|
||||
attacker=dave
|
||||
defender=alice
|
||||
weapon=1
|
||||
resupply_attacks_left=1
|
||||
[/test_do_attack_by_id]
|
||||
|
||||
{ASSERT (
|
||||
[have_unit]
|
||||
side = 1
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
)}
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 4
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
{SUCCEED}
|
||||
[/event]
|
||||
) SIDE_LEADER="Elvish Archer"}
|
|
@ -0,0 +1,98 @@
|
|||
# wmllint: no translatables
|
||||
|
||||
#####
|
||||
# API(s) being tested: [petrifies]affect_self=
|
||||
##
|
||||
# Actions:
|
||||
# Give the leaders a petrifies ability that doesn't affect themselves.
|
||||
# Have the side 1 leader attack the side 2 leader with both its weapons
|
||||
##
|
||||
# Expected end state:
|
||||
# Neither leader is petrified
|
||||
#####
|
||||
{COMMON_KEEP_A_B_UNIT_TEST "petrifies_affect_self_no" (
|
||||
[event]
|
||||
name = start
|
||||
|
||||
[modify_unit]
|
||||
[filter]
|
||||
[/filter]
|
||||
[effect]
|
||||
apply_to = new_ability
|
||||
[abilities]
|
||||
{TEST_ABILITY_NO_VALUE petrifies ()}
|
||||
[/abilities]
|
||||
[/effect]
|
||||
[/modify_unit]
|
||||
|
||||
[modify_unit]
|
||||
[filter]
|
||||
[/filter]
|
||||
[effect]
|
||||
apply_to=attack
|
||||
[set_specials]
|
||||
mode=append
|
||||
[attacks]
|
||||
value=1
|
||||
[/attacks]
|
||||
[damage]
|
||||
value=1
|
||||
[/damage]
|
||||
[chance_to_hit]
|
||||
value=100
|
||||
[/chance_to_hit]
|
||||
[/set_specials]
|
||||
[/effect]
|
||||
[/modify_unit]
|
||||
|
||||
[test_do_attack_by_id]
|
||||
attacker=alice
|
||||
defender=bob
|
||||
weapon=0
|
||||
resupply_attacks_left=1
|
||||
[/test_do_attack_by_id]
|
||||
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 1
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 2
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
[test_do_attack_by_id]
|
||||
attacker=alice
|
||||
defender=bob
|
||||
weapon=1
|
||||
resupply_attacks_left=1
|
||||
[/test_do_attack_by_id]
|
||||
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 1
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
{ASSERT (
|
||||
[not]
|
||||
[have_unit]
|
||||
side = 2
|
||||
status = "petrified"
|
||||
[/have_unit]
|
||||
[/not]
|
||||
)}
|
||||
|
||||
{SUCCEED}
|
||||
[/event]
|
||||
) SIDE2_LEADER="Elvish Archer"}
|
|
@ -973,6 +973,12 @@
|
|||
0 heal_on_hit_overwrite_specials_two_both_sides
|
||||
0 heal_on_hit_overwrite_specials_two_one_side
|
||||
0 heal_on_hit_overwrite_specials_mixed
|
||||
# petrifies tests
|
||||
0 petrifies_ability
|
||||
0 petrifies_affect_allies
|
||||
0 petrifies_affect_self_no
|
||||
0 petrifies_affect_enemies
|
||||
0 petrifies_affect_everybody
|
||||
# Warnings about WML
|
||||
0 unknown_scenario_false_positives
|
||||
0 unknown_scenario_interpolated
|
||||
|
|
Loading…
Add table
Reference in a new issue