Test fire_event of kill unit on recall list (#7283)

This commit is contained in:
Toranks 2023-01-16 13:25:09 +01:00 committed by GitHub
parent d9be724690
commit 092fd23758
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,44 @@
# wmllint: no translatables
#####
# API(s) being tested: [kill]fire_event=yes
##
# Actions:
# Create a last breath and die events. Put Alice to the recall list. Kill Bob and Alice, and detect with a variable which events have been triggered for whom.
##
# Expected end state:
# A last breath event and a die event are triggered for Bob but not for Alice.
#####
{GENERIC_UNIT_TEST "kill_fires_events" (
[event]
name=last_breath
first_time_only=no
[set_variable]
name=$unit.id|_breath
value=yes
[/set_variable]
[/event]
[event]
name=die
first_time_only=no
[set_variable]
name=$unit.id|_die
value=yes
[/set_variable]
[/event]
[event]
name=start
[put_to_recall_list]
id=alice
[/put_to_recall_list]
[kill]
id=alice,bob
fire_event=yes
[/kill]
{ASSERT ({VARIABLE_CONDITIONAL bob_die boolean_equals yes})}
{ASSERT ({VARIABLE_CONDITIONAL alice_die boolean_not_equals yes})}
{ASSERT ({VARIABLE_CONDITIONAL bob_breath boolean_equals yes})}
{ASSERT ({VARIABLE_CONDITIONAL alice_breath boolean_not_equals yes})}
{SUCCEED}
[/event]
)}

View File

@ -423,6 +423,7 @@
0 order_of_variable_events3
0 premature_end_turn1
2 premature_end_turn2
0 kill_fires_events
# Game mechanics
0 heal
# Warnings about WML