mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-18 19:57:04 +00:00
refactor test for remove illuminates abilities.
This commit is contained in:
parent
7d5663b379
commit
ee2bbc40cc
|
@ -49,35 +49,21 @@
|
|||
|
||||
[event]
|
||||
name=side 1 turn 1
|
||||
[do_command]
|
||||
[move]
|
||||
x=7,13
|
||||
y=3,4
|
||||
[/move]
|
||||
[attack]
|
||||
[source]
|
||||
x,y=13,4
|
||||
[/source]
|
||||
[destination]
|
||||
x,y=13,3
|
||||
[/destination]
|
||||
[/attack]
|
||||
[/do_command]
|
||||
[test_do_attack_by_id]
|
||||
attacker=alice
|
||||
defender=bob
|
||||
weapon=0
|
||||
[/test_do_attack_by_id]
|
||||
[end_turn][/end_turn]
|
||||
[/event]
|
||||
|
||||
[event]
|
||||
name=side 2 turn
|
||||
[do_command]
|
||||
[attack]
|
||||
[source]
|
||||
x,y=13,3
|
||||
[/source]
|
||||
[destination]
|
||||
x,y=13,4
|
||||
[/destination]
|
||||
[/attack]
|
||||
[/do_command]
|
||||
[test_do_attack_by_id]
|
||||
attacker=bob
|
||||
defender=alice
|
||||
weapon=0
|
||||
[/test_do_attack_by_id]
|
||||
[end_turn][/end_turn]
|
||||
[/event]
|
||||
#enddef
|
||||
|
@ -93,7 +79,7 @@
|
|||
# Expected end state:
|
||||
# The filtered event is triggered exactly once.
|
||||
#####
|
||||
{GENERIC_UNIT_TEST event_test_filter_ability (
|
||||
{COMMON_KEEP_A_B_UNIT_TEST event_test_filter_ability (
|
||||
{FILTER_ABILITY_TEST}
|
||||
[event]
|
||||
name=attack
|
||||
|
@ -114,7 +100,7 @@
|
|||
[/event]
|
||||
)}
|
||||
|
||||
{GENERIC_UNIT_TEST event_test_filter_ability_interval_number (
|
||||
{COMMON_KEEP_A_B_UNIT_TEST event_test_filter_ability_interval_number (
|
||||
{FILTER_ABILITY_TEST}
|
||||
[event]
|
||||
name=attack
|
||||
|
@ -145,7 +131,7 @@
|
|||
# Expected end state:
|
||||
# The filtered event is triggered exactly once.
|
||||
#####
|
||||
{GENERIC_UNIT_TEST event_test_filter_ability_neg_value (
|
||||
{COMMON_KEEP_A_B_UNIT_TEST event_test_filter_ability_neg_value (
|
||||
{FILTER_ABILITY_TEST DRAINS_VALUE=-25}
|
||||
[event]
|
||||
name=attack
|
||||
|
@ -177,7 +163,7 @@
|
|||
# Expected end state:
|
||||
# The filtered event is never triggered.
|
||||
#####
|
||||
{GENERIC_UNIT_TEST event_test_filter_ability_no_match (
|
||||
{COMMON_KEEP_A_B_UNIT_TEST event_test_filter_ability_no_match (
|
||||
{FILTER_ABILITY_TEST}
|
||||
[event]
|
||||
name=attack
|
||||
|
@ -207,7 +193,7 @@
|
|||
# Expected end state:
|
||||
# The filtered event is never triggered.
|
||||
#####
|
||||
{GENERIC_UNIT_TEST event_test_filter_ability_no_match_neg_prefix (
|
||||
{COMMON_KEEP_A_B_UNIT_TEST event_test_filter_ability_no_match_neg_prefix (
|
||||
{FILTER_ABILITY_TEST}
|
||||
[event]
|
||||
name=attack
|
||||
|
@ -235,7 +221,7 @@
|
|||
# Expected end state:
|
||||
# The filtered event is triggered exactly once.
|
||||
#####
|
||||
{GENERIC_UNIT_TEST event_test_filter_ability_wml (
|
||||
{COMMON_KEEP_A_B_UNIT_TEST event_test_filter_ability_wml (
|
||||
{FILTER_ABILITY_TEST}
|
||||
[event]
|
||||
name=attack
|
||||
|
@ -271,7 +257,7 @@
|
|||
# Expected end state:
|
||||
# The filtered event is never triggered.
|
||||
#####
|
||||
{GENERIC_UNIT_TEST event_test_filter_ability_wml_no_match (
|
||||
{COMMON_KEEP_A_B_UNIT_TEST event_test_filter_ability_wml_no_match (
|
||||
{FILTER_ABILITY_TEST}
|
||||
[event]
|
||||
name=attack
|
||||
|
@ -308,7 +294,7 @@
|
|||
# Expected end state:
|
||||
# The filtered event is triggered exactly once.
|
||||
#####
|
||||
{GENERIC_UNIT_TEST event_test_filter_ability_active (
|
||||
{COMMON_KEEP_A_B_UNIT_TEST event_test_filter_ability_active (
|
||||
{FILTER_ABILITY_TEST}
|
||||
[event]
|
||||
name=attack
|
||||
|
@ -336,29 +322,14 @@
|
|||
# Actions:
|
||||
# Use the common setup from FILTER_ABILITY_TEST.
|
||||
# Add an event with a filter matching Alice's drains ability, but only when it's active.
|
||||
# Give Alice the Illuminates ability, which makes it the wrong time of day for her drains ability.
|
||||
# Time of day for test is lawful, which makes it the wrong time of day for her drains ability.
|
||||
# The events in FILTER_ABILITY_TEST make Alice attacks Bob and then Bob attack Alice.
|
||||
##
|
||||
# Expected end state:
|
||||
# The filtered event is never triggered.
|
||||
#####
|
||||
{GENERIC_UNIT_TEST event_test_filter_ability_active_inactive (
|
||||
{COMMON_KEEP_A_B_UNIT_TEST event_test_filter_ability_active_inactive (
|
||||
{FILTER_ABILITY_TEST}
|
||||
[event]
|
||||
name=start
|
||||
[object]
|
||||
silent=yes
|
||||
[effect]
|
||||
apply_to=new_ability
|
||||
[abilities]
|
||||
{ABILITY_ILLUMINATES}
|
||||
[/abilities]
|
||||
[/effect]
|
||||
[filter]
|
||||
id=alice
|
||||
[/filter]
|
||||
[/object]
|
||||
[/event]
|
||||
|
||||
[event]
|
||||
name=attack
|
||||
|
@ -377,7 +348,7 @@
|
|||
name=turn 2
|
||||
{SUCCEED}
|
||||
[/event]
|
||||
)}
|
||||
) TIME=AFTERNOON}
|
||||
|
||||
#####
|
||||
# API(s) being tested: [event][filter_attack][filter_special]active=yes
|
||||
|
@ -390,7 +361,7 @@
|
|||
# Expected end state:
|
||||
# The filtered event is triggered exactly once.
|
||||
#####
|
||||
{GENERIC_UNIT_TEST event_test_filter_special_active (
|
||||
{COMMON_KEEP_A_B_UNIT_TEST event_test_filter_special_active (
|
||||
{FILTER_ABILITY_TEST}
|
||||
[event]
|
||||
name=attack
|
||||
|
@ -418,29 +389,14 @@
|
|||
# Actions:
|
||||
# Use the common setup from FILTER_ABILITY_TEST.
|
||||
# Add an event with a filter matching Alice's drains ability, but only when it's active.
|
||||
# Give Alice the Illuminates ability, which makes it the wrong time of day for her drains ability.
|
||||
# Time of day for test is lawful, which makes it the wrong time of day for her drains ability.
|
||||
# The events in FILTER_ABILITY_TEST make Alice attacks Bob and then Bob attack Alice.
|
||||
##
|
||||
# Expected end state:
|
||||
# The filtered event is never triggered.
|
||||
#####
|
||||
{GENERIC_UNIT_TEST event_test_filter_special_active_inactive (
|
||||
{COMMON_KEEP_A_B_UNIT_TEST event_test_filter_special_active_inactive (
|
||||
{FILTER_ABILITY_TEST}
|
||||
[event]
|
||||
name=start
|
||||
[object]
|
||||
silent=yes
|
||||
[effect]
|
||||
apply_to=new_ability
|
||||
[abilities]
|
||||
{ABILITY_ILLUMINATES}
|
||||
[/abilities]
|
||||
[/effect]
|
||||
[filter]
|
||||
id=alice
|
||||
[/filter]
|
||||
[/object]
|
||||
[/event]
|
||||
|
||||
[event]
|
||||
name=attack
|
||||
|
@ -459,7 +415,7 @@
|
|||
name=turn 2
|
||||
{SUCCEED}
|
||||
[/event]
|
||||
)}
|
||||
) TIME=AFTERNOON}
|
||||
|
||||
#####
|
||||
# API(s) being tested: [event][filter_attack][filter_special]
|
||||
|
@ -467,29 +423,14 @@
|
|||
# Actions:
|
||||
# Use the common setup from FILTER_ABILITY_TEST.
|
||||
# Add an event with a filter matching Alice's drains ability.
|
||||
# Give Alice the Illuminates ability, which makes it the wrong time of day for her drains ability.
|
||||
# Time of day for test is lawful, which makes it the wrong time of day for her drains ability.
|
||||
# The events in FILTER_ABILITY_TEST make Alice attacks Bob and then Bob attack Alice.
|
||||
##
|
||||
# Expected end state:
|
||||
# The filtered event is triggered exactly once.
|
||||
#####
|
||||
{GENERIC_UNIT_TEST event_test_filter_special_simple_check (
|
||||
{COMMON_KEEP_A_B_UNIT_TEST event_test_filter_special_simple_check (
|
||||
{FILTER_ABILITY_TEST}
|
||||
[event]
|
||||
name=start
|
||||
[object]
|
||||
silent=yes
|
||||
[effect]
|
||||
apply_to=new_ability
|
||||
[abilities]
|
||||
{ABILITY_ILLUMINATES}
|
||||
[/abilities]
|
||||
[/effect]
|
||||
[filter]
|
||||
id=alice
|
||||
[/filter]
|
||||
[/object]
|
||||
[/event]
|
||||
|
||||
[event]
|
||||
name=attack
|
||||
|
@ -508,7 +449,7 @@
|
|||
name=turn 2
|
||||
{RETURN ({VARIABLE_CONDITIONAL triggers equals 1})}
|
||||
[/event]
|
||||
)}
|
||||
) TIME=AFTERNOON}
|
||||
|
||||
#undef FILTER_ABILITY_TEST
|
||||
|
||||
|
@ -553,35 +494,21 @@
|
|||
|
||||
[event]
|
||||
name=side 1 turn 1
|
||||
[do_command]
|
||||
[move]
|
||||
x=7,13
|
||||
y=3,4
|
||||
[/move]
|
||||
[attack]
|
||||
[source]
|
||||
x,y=13,4
|
||||
[/source]
|
||||
[destination]
|
||||
x,y=13,3
|
||||
[/destination]
|
||||
[/attack]
|
||||
[/do_command]
|
||||
[test_do_attack_by_id]
|
||||
attacker=alice
|
||||
defender=bob
|
||||
weapon=0
|
||||
[/test_do_attack_by_id]
|
||||
[end_turn][/end_turn]
|
||||
[/event]
|
||||
|
||||
[event]
|
||||
name=side 2 turn
|
||||
[do_command]
|
||||
[attack]
|
||||
[source]
|
||||
x,y=13,3
|
||||
[/source]
|
||||
[destination]
|
||||
x,y=13,4
|
||||
[/destination]
|
||||
[/attack]
|
||||
[/do_command]
|
||||
[test_do_attack_by_id]
|
||||
attacker=bob
|
||||
defender=alice
|
||||
weapon=0
|
||||
[/test_do_attack_by_id]
|
||||
[end_turn][/end_turn]
|
||||
[/event]
|
||||
#enddef
|
||||
|
@ -597,7 +524,7 @@
|
|||
# Expected end state:
|
||||
# The filtered event is triggered exactly once.
|
||||
#####
|
||||
{GENERIC_UNIT_TEST event_test_filter_ability_with_value_by_default (
|
||||
{COMMON_KEEP_A_B_UNIT_TEST event_test_filter_ability_with_value_by_default (
|
||||
{FILTER_ABILITY_TEST_WITHOUT_VALUE}
|
||||
[event]
|
||||
name=attack
|
||||
|
@ -628,7 +555,7 @@
|
|||
# Expected end state:
|
||||
# The filtered event is never triggered.
|
||||
#####
|
||||
{GENERIC_UNIT_TEST event_test_filter_ability_no_match_by_default (
|
||||
{COMMON_KEEP_A_B_UNIT_TEST event_test_filter_ability_no_match_by_default (
|
||||
{FILTER_ABILITY_TEST_WITHOUT_VALUE}
|
||||
[event]
|
||||
name=attack
|
||||
|
@ -660,7 +587,7 @@
|
|||
# Expected end state:
|
||||
# The filtered event is triggered exactly once.
|
||||
#####
|
||||
{GENERIC_UNIT_TEST event_test_filter_ability_apply_to_resistance (
|
||||
{COMMON_KEEP_A_B_UNIT_TEST event_test_filter_ability_apply_to_resistance (
|
||||
[event]
|
||||
name=start
|
||||
# Make sure the attacks hit
|
||||
|
@ -694,35 +621,21 @@
|
|||
|
||||
[event]
|
||||
name=side 1 turn 1
|
||||
[do_command]
|
||||
[move]
|
||||
x=7,13
|
||||
y=3,4
|
||||
[/move]
|
||||
[attack]
|
||||
[source]
|
||||
x,y=13,4
|
||||
[/source]
|
||||
[destination]
|
||||
x,y=13,3
|
||||
[/destination]
|
||||
[/attack]
|
||||
[/do_command]
|
||||
[test_do_attack_by_id]
|
||||
attacker=alice
|
||||
defender=bob
|
||||
weapon=0
|
||||
[/test_do_attack_by_id]
|
||||
[end_turn][/end_turn]
|
||||
[/event]
|
||||
|
||||
[event]
|
||||
name=side 2 turn
|
||||
[do_command]
|
||||
[attack]
|
||||
[source]
|
||||
x,y=13,3
|
||||
[/source]
|
||||
[destination]
|
||||
x,y=13,4
|
||||
[/destination]
|
||||
[/attack]
|
||||
[/do_command]
|
||||
[test_do_attack_by_id]
|
||||
attacker=bob
|
||||
defender=alice
|
||||
weapon=0
|
||||
[/test_do_attack_by_id]
|
||||
[end_turn][/end_turn]
|
||||
[/event]
|
||||
[event]
|
||||
|
|
Loading…
Reference in New Issue
Block a user