Add some more abilities' tests (hides, skirmisher, teleport)

This commit is contained in:
Pentarctagon 2024-01-01 05:34:08 -06:00 committed by GitHub
parent fb4ac0b5fb
commit d4b1e7e6c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 1051 additions and 6 deletions

View file

@ -122,6 +122,7 @@
{DEFAULT_KEY always_visible bool no}
{DEFAULT_KEY allow_vision bool yes}
{DEFAULT_KEY pass_allied_units bool yes}
{DEFAULT_KEY delayed_variable_substitution bool yes}
[/tag]
[/tag]
{BASED_ON_SPECIAL "attacks"}

View file

@ -79,10 +79,13 @@
{test/scenarios/wml_tests/UnitsWML}
{test/scenarios/wml_tests/UnitsWML/AbilitiesWML}
{test/scenarios/wml_tests/UnitsWML/AbilitiesWML/heals}
{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/regenerate}
{test/scenarios/wml_tests/UnitsWML/AbilitiesWML/resistance}
{test/scenarios/wml_tests/UnitsWML/AbilitiesWML/skirmisher}
{test/scenarios/wml_tests/UnitsWML/AbilitiesWML/teleport}
{test/scenarios/wml_tests/UnitsWML/Attacks}
{test/scenarios/wml_tests/WesnothFormulaLanguage}

View file

@ -16,6 +16,12 @@ Elvish Archer#endarg
#arg SIDE2_LEADER
Orcish Grunt#endarg
#arg SIDE1_CONTROLLER
human#endarg
#arg SIDE2_CONTROLLER
human#endarg
#arg TIME
DAWN#endarg
@ -31,7 +37,7 @@ DAWN#endarg
[side]
side=1
controller=human
controller={SIDE1_CONTROLLER}
name=_ "Alice"
type={SIDE1_LEADER}
id=alice
@ -40,7 +46,7 @@ DAWN#endarg
[/side]
[side]
side=2
controller=human
controller={SIDE2_CONTROLLER}
name=_ "Bob"
type={SIDE2_LEADER}
id=bob

View file

@ -40,3 +40,76 @@ no#endarg
{OTHER}
[/{ABIL}]
#enddef
#define TEST_ABILITY_NO_VALUE ABIL OTHER
#arg ID
1#endarg
#arg SELF
no#endarg
#arg ALLIES
no#endarg
#arg ENEMIES
no#endarg
#arg CUMULATIVE
no#endarg
[{ABIL}]
id = {ID}
name = _"test-{ABIL}_{ID}"
affect_self = {SELF}
affect_allies = {ALLIES}
affect_enemies = {ENEMIES}
cumulative = {CUMULATIVE}
{OTHER}
[/{ABIL}]
#enddef
#define CUSTOM_TUNNEL SOURCE TARGET FILTER
#arg ID
1#endarg
#arg BIDIR
yes#endarg
#arg VISION
yes#endarg
#arg PASS_ALLIED
yes#endarg
#arg DVS
yes#endarg
[tunnel]
id=custom_teleport-{ID}
bidirectional={BIDIR}
allow_vision={VISION}
pass_allied_units={PASS_ALLIED}
delayed_variable_substitution={DVS}
{SOURCE}
{TARGET}
{FILTER}
[/tunnel]
#enddef
#define VILLAGE_TUNNEL
{CUSTOM_TUNNEL (
[source]
terrain=*^V*
[/source]
) (
[target]
terrain=*^V*
[/target]
) (
[filter][/filter]
)}
#enddef

View file

@ -0,0 +1,50 @@
# wmllint: no translatables
#####
# API(s) being tested: [hides]
##
# Actions:
# Give all units a hides ability that is active on all terrain but applies to nobody
# Move the side 1 leader 1 hex away from the side 2 leader
# The AI moves the side 1 leader adjacent to the side 2 leader
##
# Expected end state:
# The side 1 leader does not have the uncovered status
# The side 2 leader does not have the uncovered status
#####
{COMMON_KEEP_A_B_UNIT_TEST "hides_nobody" (
[event]
name = start
[modify_unit]
[filter]
[/filter]
[effect]
apply_to = new_ability
[abilities]
{TEST_ABILITY_NO_VALUE hides ()}
[/abilities]
[/effect]
[/modify_unit]
[move_unit]
id=alice
to_x=3
to_y=3
[/move_unit]
[/event]
[event]
name=moveto
[store_unit]
[filter]
[/filter]
variable=temp
[/store_unit]
{ASSERT {VARIABLE_CONDITIONAL temp[0].status.uncovered boolean_equals no}}
{ASSERT {VARIABLE_CONDITIONAL temp[1].status.uncovered boolean_equals no}}
{SUCCEED}
[/event]
) SIDE1_CONTROLLER=ai}

View file

@ -0,0 +1,50 @@
# wmllint: no translatables
#####
# API(s) being tested: [hides]
##
# Actions:
# Give all units a hides ability that is active on all terrain
# Move the side 1 leader 1 hex away from the side 2 leader
# The AI moves the side 1 leader adjacent to the side 2 leader
##
# Expected end state:
# The side 1 leader does not have the uncovered status
# The side 2 leader does have the uncovered status
#####
{COMMON_KEEP_A_B_UNIT_TEST "hides_self" (
[event]
name = start
[modify_unit]
[filter]
[/filter]
[effect]
apply_to = new_ability
[abilities]
{TEST_ABILITY_NO_VALUE hides () SELF=yes}
[/abilities]
[/effect]
[/modify_unit]
[move_unit]
id=alice
to_x=3
to_y=3
[/move_unit]
[/event]
[event]
name=moveto
[store_unit]
[filter]
[/filter]
variable=temp
[/store_unit]
{ASSERT {VARIABLE_CONDITIONAL temp[0].status.uncovered boolean_equals no}}
{ASSERT {VARIABLE_CONDITIONAL temp[1].status.uncovered boolean_equals yes}}
{SUCCEED}
[/event]
) SIDE1_CONTROLLER=ai}

View file

@ -0,0 +1,30 @@
# wmllint: no translatables
#####
# API(s) being tested: N/A
##
# Actions:
# Move the side 1 leader 1 hex away from the side 2 leader
# The AI moves the side 1 leader adjacent to the side 2 leader
##
# Expected end state:
# The side 1 leader has no movement left
#####
{COMMON_KEEP_A_B_UNIT_TEST "no_skirmisher" (
[event]
name = start
[move_unit]
id=alice
to_x=3
to_y=3
[/move_unit]
[/event]
[event]
name=moveto
{ASSERT {VARIABLE_CONDITIONAL unit.moves numerical_equals 0}}
{SUCCEED}
[/event]
) SIDE1_LEADER="Mage" SIDE1_CONTROLLER=ai}

View file

@ -0,0 +1,43 @@
# wmllint: no translatables
#####
# API(s) being tested: [skirmisher]
##
# Actions:
# Give side 1 the skirmisher ability
# Move the side 1 leader 1 hex away from the side 2 leader
# The AI moves the side 1 leader adjacent to the side 2 leader
##
# Expected end state:
# The side 1 leader has movement left
#####
{COMMON_KEEP_A_B_UNIT_TEST "skirmisher" (
[event]
name = start
[modify_unit]
[filter]
side=1
[/filter]
[effect]
apply_to = new_ability
[abilities]
{TEST_ABILITY_NO_VALUE skirmisher () SELF=yes}
[/abilities]
[/effect]
[/modify_unit]
[move_unit]
id=alice
to_x=3
to_y=3
[/move_unit]
[/event]
[event]
name=moveto
{ASSERT {VARIABLE_CONDITIONAL unit.moves numerical_equals 4}}
{SUCCEED}
[/event]
) SIDE1_LEADER="Mage" SIDE1_CONTROLLER=ai}

View file

@ -0,0 +1,43 @@
# wmllint: no translatables
#####
# API(s) being tested: [skirmisher]
##
# Actions:
# Give side 2 the skirmisher ability, but it only affects adjacent
# Move the side 1 leader 1 hex away from the side 2 leader
# The AI moves the side 1 leader adjacent to the side 2 leader
##
# Expected end state:
# The side 1 leader has no movement left
#####
{COMMON_KEEP_A_B_UNIT_TEST "skirmisher_adjacent" (
[event]
name = start
[modify_unit]
[filter]
side=2
[/filter]
[effect]
apply_to = new_ability
[abilities]
{TEST_ABILITY_NO_VALUE skirmisher ([affect_adjacent][/affect_adjacent])}
[/abilities]
[/effect]
[/modify_unit]
[move_unit]
id=alice
to_x=3
to_y=3
[/move_unit]
[/event]
[event]
name=moveto
{ASSERT {VARIABLE_CONDITIONAL unit.moves numerical_equals 0}}
{SUCCEED}
[/event]
) SIDE1_LEADER="Mage" SIDE1_CONTROLLER=ai}

View file

@ -0,0 +1,43 @@
# wmllint: no translatables
#####
# API(s) being tested: [skirmisher]
##
# Actions:
# Give side 2 the skirmisher ability, but it only affects adjacent enemies
# Move the side 1 leader 1 hex away from the side 2 leader
# The AI moves the side 1 leader adjacent to the side 2 leader
##
# Expected end state:
# The side 1 leader has movement left
#####
{COMMON_KEEP_A_B_UNIT_TEST "skirmisher_adjacent_enemies" (
[event]
name = start
[modify_unit]
[filter]
side=2
[/filter]
[effect]
apply_to = new_ability
[abilities]
{TEST_ABILITY_NO_VALUE skirmisher ([affect_adjacent][/affect_adjacent]) ENEMIES=yes}
[/abilities]
[/effect]
[/modify_unit]
[move_unit]
id=alice
to_x=3
to_y=3
[/move_unit]
[/event]
[event]
name=moveto
{ASSERT {VARIABLE_CONDITIONAL unit.moves numerical_equals 4}}
{SUCCEED}
[/event]
) SIDE1_LEADER="Mage" SIDE1_CONTROLLER=ai}

View file

@ -0,0 +1,52 @@
# wmllint: no translatables
#####
# API(s) being tested: [teleport]
##
# Actions:
# Move side 1's leader to the edge of the map
# Place a village next to side 1's leader and side 2's leader
# Reduce side 1's leader's movement so that it can't reach side 2's leader without teleporting
# Make side 1 be AI controlled since a decision needs to be made while playing to teleport from one village to another which can't otherwise be simulated
##
# Expected end state:
# Side 1's leader is not able to attack side 2's leader
#####
{COMMON_KEEP_A_B_UNIT_TEST "no_teleport" (
[event]
name = start
[modify_unit]
[filter]
side=1
[/filter]
moves=2
max_moves=2
[/modify_unit]
[move_unit]
id=alice
to_x=1
to_y=1
[/move_unit]
[terrain]
x,y=1,2
terrain=Dd^Vda
[/terrain]
[terrain]
x,y=4,2
terrain=Dd^Vda
[/terrain]
[/event]
[event]
name=attack
{FAIL}
[/event]
[event]
name=side 2 turn 1
{SUCCEED}
[/event]
) SIDE1_CONTROLLER=ai}

View file

@ -0,0 +1,71 @@
# wmllint: no translatables
#####
# API(s) being tested: [teleport]
##
# Actions:
# Give side 1 units the ability to teleport that applies to adjacent allied units
# Move side 1's leader to the edge of the map
# Place a village next to side 1's leader and side 2's leader
# Reduce side 1's leader's movement to 0 so it can't move
# Spawn a side 1 Mage on the village next to side 1's leader and reduce its movement so it can only get to side 2's leader by teleporting
# Make side 1 be AI controlled since a decision needs to be made while playing to teleport from one village to another which can't otherwise be simulated
##
# Expected end state:
# Side 1's Mage is able to attack side 2's leader
#####
{COMMON_KEEP_A_B_UNIT_TEST "teleport_adjacent_allies" (
[event]
name = start
[modify_unit]
[filter]
side=1
[/filter]
[effect]
apply_to = new_ability
[abilities]
{TEST_ABILITY_NO_VALUE teleport ({VILLAGE_TUNNEL}
[affect_adjacent][/affect_adjacent]) ALLIES=yes}
[/abilities]
[/effect]
moves=0
max_moves=0
[/modify_unit]
{NOTRAIT_UNIT 1 Mage 1 2}
[modify_unit]
[filter]
type=Mage
[/filter]
moves=1
max_moves=1
[/modify_unit]
[move_unit]
id=alice
to_x=1
to_y=1
[/move_unit]
[terrain]
x,y=1,2
terrain=Dd^Vda
[/terrain]
[terrain]
x,y=4,2
terrain=Dd^Vda
[/terrain]
[/event]
[event]
name=attack
{SUCCEED}
[/event]
[event]
name=side 2 turn 1
{FAIL}
[/event]
) SIDE1_CONTROLLER=ai}

View file

@ -0,0 +1,61 @@
# wmllint: no translatables
#####
# API(s) being tested: [teleport]
##
# Actions:
# Give side 1 units the ability to teleport but that has no tunnel defined
# Move side 1's leader to the edge of the map
# Place a village next to side 1's leader and side 2's leader
# Reduce side 1's leader's movement so that it can't reach side 2's leader without teleporting
# Make side 1 be AI controlled since a decision needs to be made while playing to teleport from one village to another which can't otherwise be simulated
##
# Expected end state:
# Side 1's leader is not able to attack side 2's leader
#####
#ifndef SCHEMA_VALIDATION
{COMMON_KEEP_A_B_UNIT_TEST "teleport_no_tunnel" (
[event]
name = start
[modify_unit]
[filter]
side=1
[/filter]
[effect]
apply_to = new_ability
[abilities]
{TEST_ABILITY_NO_VALUE teleport () SELF=yes}
[/abilities]
[/effect]
moves=2
max_moves=2
[/modify_unit]
[move_unit]
id=alice
to_x=1
to_y=1
[/move_unit]
[terrain]
x,y=1,2
terrain=Dd^Vda
[/terrain]
[terrain]
x,y=4,2
terrain=Dd^Vda
[/terrain]
[/event]
[event]
name=attack
{FAIL}
[/event]
[event]
name=side 2 turn 1
{SUCCEED}
[/event]
) SIDE1_CONTROLLER=ai}
#endif

View file

@ -0,0 +1,59 @@
# wmllint: no translatables
#####
# API(s) being tested: [teleport]
##
# Actions:
# Give side 1 units the ability to teleport that applies to themselves between villages
# Move side 1's leader to the edge of the map
# Place a village next to side 1's leader and side 2's leader
# Reduce side 1's leader's movement so that it can't reach side 2's leader without teleporting
# Make side 1 be AI controlled since a decision needs to be made while playing to teleport from one village to another which can't otherwise be simulated
##
# Expected end state:
# Side 1's leader is able to attack side 2's leader
#####
{COMMON_KEEP_A_B_UNIT_TEST "teleport_simple" (
[event]
name = start
[modify_unit]
[filter]
side=1
[/filter]
[effect]
apply_to = new_ability
[abilities]
{TEST_ABILITY_NO_VALUE teleport ({VILLAGE_TUNNEL}) SELF=yes}
[/abilities]
[/effect]
moves=2
max_moves=2
[/modify_unit]
[move_unit]
id=alice
to_x=1
to_y=1
[/move_unit]
[terrain]
x,y=1,2
terrain=Dd^Vda
[/terrain]
[terrain]
x,y=4,2
terrain=Dd^Vda
[/terrain]
[/event]
[event]
name=attack
{SUCCEED}
[/event]
[event]
name=side 2 turn 1
{FAIL}
[/event]
) SIDE1_CONTROLLER=ai}

View file

@ -0,0 +1,72 @@
# wmllint: no translatables
#####
# API(s) being tested: [teleport][tunnel]
##
# Actions:
# Give side 1 units the ability to teleport but that has a tunnel defined that uses teleport_unit in its filter
# Move side 1's leader to the edge of the map
# Place a village next to side 1's leader and side 2's leader
# Reduce side 1's leader's movement so that it can't reach side 2's leader without teleporting
# Make side 1 be AI controlled since a decision needs to be made while playing to teleport from one village to another which can't otherwise be simulated
##
# Expected end state:
# Side 1's leader is not able to attack side 2's leader since teleport_unit doesn't exist for the filter to use, therefore the filter doesn't match
#####
{COMMON_KEEP_A_B_UNIT_TEST "tunnel_filter_teleport_unit" (
[event]
name = start
[modify_unit]
[filter]
side=1
[/filter]
[effect]
apply_to = new_ability
[abilities]
{TEST_ABILITY_NO_VALUE teleport ({CUSTOM_TUNNEL
(
[source]
terrain=*^V*
[/source]
) (
[target]
terrain=*^V*
[/target]
) (
[filter]
type = "$|teleport_unit.type"
[/filter]
)}) SELF=yes}
[/abilities]
[/effect]
moves=2
max_moves=2
[/modify_unit]
[move_unit]
id=alice
to_x=1
to_y=1
[/move_unit]
[terrain]
x,y=1,2
terrain=Dd^Vda
[/terrain]
[terrain]
x,y=4,2
terrain=Dd^Vda
[/terrain]
[/event]
[event]
name=attack
{FAIL}
[/event]
[event]
name=side 2 turn 1
{SUCCEED}
[/event]
) SIDE1_CONTROLLER=ai}

View file

@ -0,0 +1,76 @@
# wmllint: no translatables
#####
# API(s) being tested: [teleport][tunnel]
##
# Actions:
# Give side 1 units the ability to teleport but that has a tunnel defined that uses teleport_unit in its source and target
# Move side 1's leader to the edge of the map
# Place a village next to side 1's leader and side 2's leader
# Reduce side 1's leader's movement so that it can't reach side 2's leader without teleporting
# Make side 1 be AI controlled since a decision needs to be made while playing to teleport from one village to another which can't otherwise be simulated
##
# Expected end state:
# Side 1's leader is able to attack side 2's leader since the source and target villages are owned by side 1
#####
{COMMON_KEEP_A_B_UNIT_TEST "tunnel_source_target_teleport_unit" (
[event]
name = start
[modify_unit]
[filter]
side=1
[/filter]
[effect]
apply_to = new_ability
[abilities]
{TEST_ABILITY_NO_VALUE teleport ({CUSTOM_TUNNEL
(
[source]
terrain=*^V*
formula="owner_side = teleport_unit.side_number"
[/source]
) (
[target]
terrain=*^V*
formula="owner_side = teleport_unit.side_number"
[/target]
) (
[filter][/filter]
)}) SELF=yes}
[/abilities]
[/effect]
moves=2
max_moves=2
[/modify_unit]
[move_unit]
id=alice
to_x=1
to_y=1
[/move_unit]
[terrain]
x,y=1,2
terrain=Dd^Vda
[/terrain]
[terrain]
x,y=4,2
terrain=Dd^Vda
[/terrain]
[capture_village]
side=1
[/capture_village]
[/event]
[event]
name=attack
{SUCCEED}
[/event]
[event]
name=side 2 turn 1
{FAIL}
[/event]
) SIDE1_CONTROLLER=ai}

View file

@ -0,0 +1,71 @@
# wmllint: no translatables
#####
# API(s) being tested: [teleport][tunnel]
##
# Actions:
# Give side 1 units the ability to teleport but that has a tunnel defined that requires the source village to be owned by side 1
# Move side 1's leader to the edge of the map
# Place a village next to side 1's leader and side 2's leader
# Reduce side 1's leader's movement so that it can't reach side 2's leader without teleporting
# Make side 1 be AI controlled since a decision needs to be made while playing to teleport from one village to another which can't otherwise be simulated
##
# Expected end state:
# Side 1's leader isn't able to attack side 2's leader since the source village isn't owned by side 1
#####
{COMMON_KEEP_A_B_UNIT_TEST "tunnel_source_teleport_unit_fail" (
[event]
name = start
[modify_unit]
[filter]
side=1
[/filter]
[effect]
apply_to = new_ability
[abilities]
{TEST_ABILITY_NO_VALUE teleport ({CUSTOM_TUNNEL
(
[source]
terrain=*^V*
formula="owner_side = teleport_unit.side_number"
[/source]
) (
[target]
terrain=*^V*
[/target]
) (
[filter][/filter]
)}) SELF=yes}
[/abilities]
[/effect]
moves=2
max_moves=2
[/modify_unit]
[move_unit]
id=alice
to_x=1
to_y=1
[/move_unit]
[terrain]
x,y=1,2
terrain=Dd^Vda
[/terrain]
[terrain]
x,y=4,2
terrain=Dd^Vda
[/terrain]
[/event]
[event]
name=attack
{FAIL}
[/event]
[event]
name=side 2 turn 1
{SUCCEED}
[/event]
) SIDE1_CONTROLLER=ai}

View file

@ -0,0 +1,76 @@
# wmllint: no translatables
#####
# API(s) being tested: [teleport][tunnel]
##
# Actions:
# Give side 1 units the ability to teleport but that has a tunnel defined that uses teleport_unit in its source
# Move side 1's leader to the edge of the map
# Place a village next to side 1's leader and side 2's leader
# Reduce side 1's leader's movement so that it can't reach side 2's leader without teleporting
# Make side 1 be AI controlled since a decision needs to be made while playing to teleport from one village to another which can't otherwise be simulated
##
# Expected end state:
# Side 1's leader is able to attack side 2's leader since the source village is owned by side 1
#####
{COMMON_KEEP_A_B_UNIT_TEST "tunnel_source_teleport_unit_succeed" (
[event]
name = start
[modify_unit]
[filter]
side=1
[/filter]
[effect]
apply_to = new_ability
[abilities]
{TEST_ABILITY_NO_VALUE teleport ({CUSTOM_TUNNEL
(
[source]
terrain=*^V*
formula="owner_side = teleport_unit.side_number"
[/source]
) (
[target]
terrain=*^V*
[/target]
) (
[filter][/filter]
)}) SELF=yes}
[/abilities]
[/effect]
moves=2
max_moves=2
[/modify_unit]
[move_unit]
id=alice
to_x=1
to_y=1
[/move_unit]
[terrain]
x,y=1,2
terrain=Dd^Vda
[/terrain]
[terrain]
x,y=4,2
terrain=Dd^Vda
[/terrain]
[capture_village]
side=1
x,y=1,2
[/capture_village]
[/event]
[event]
name=attack
{SUCCEED}
[/event]
[event]
name=side 2 turn 1
{FAIL}
[/event]
) SIDE1_CONTROLLER=ai}

View file

@ -0,0 +1,71 @@
# wmllint: no translatables
#####
# API(s) being tested: [teleport][tunnel]
##
# Actions:
# Give side 1 units the ability to teleport but that has a tunnel defined that uses teleport_unit in its target
# Move side 1's leader to the edge of the map
# Place a village next to side 1's leader and side 2's leader
# Reduce side 1's leader's movement so that it can't reach side 2's leader without teleporting
# Make side 1 be AI controlled since a decision needs to be made while playing to teleport from one village to another which can't otherwise be simulated
##
# Expected end state:
# Side 1's leader is not able to attack side 2's leader since the target village isn't owned by side 1
#####
{COMMON_KEEP_A_B_UNIT_TEST "tunnel_target_teleport_unit_fail" (
[event]
name = start
[modify_unit]
[filter]
side=1
[/filter]
[effect]
apply_to = new_ability
[abilities]
{TEST_ABILITY_NO_VALUE teleport ({CUSTOM_TUNNEL
(
[source]
terrain=*^V*
[/source]
) (
[target]
terrain=*^V*
formula="owner_side = teleport_unit.side_number"
[/target]
) (
[filter][/filter]
)}) SELF=yes}
[/abilities]
[/effect]
moves=2
max_moves=2
[/modify_unit]
[move_unit]
id=alice
to_x=1
to_y=1
[/move_unit]
[terrain]
x,y=1,2
terrain=Dd^Vda
[/terrain]
[terrain]
x,y=4,2
terrain=Dd^Vda
[/terrain]
[/event]
[event]
name=attack
{FAIL}
[/event]
[event]
name=side 2 turn 1
{SUCCEED}
[/event]
) SIDE1_CONTROLLER=ai}

View file

@ -0,0 +1,76 @@
# wmllint: no translatables
#####
# API(s) being tested: [teleport][tunnel]
##
# Actions:
# Give side 1 units the ability to teleport but that has a tunnel defined that uses teleport_unit in its target
# Move side 1's leader to the edge of the map
# Place a village next to side 1's leader and side 2's leader
# Reduce side 1's leader's movement so that it can't reach side 2's leader without teleporting
# Make side 1 be AI controlled since a decision needs to be made while playing to teleport from one village to another which can't otherwise be simulated
##
# Expected end state:
# Side 1's leader is able to attack side 2's leader since the target village is owned by side 1
#####
{COMMON_KEEP_A_B_UNIT_TEST "tunnel_target_teleport_unit_succeed" (
[event]
name = start
[modify_unit]
[filter]
side=1
[/filter]
[effect]
apply_to = new_ability
[abilities]
{TEST_ABILITY_NO_VALUE teleport ({CUSTOM_TUNNEL
(
[source]
terrain=*^V*
[/source]
) (
[target]
terrain=*^V*
formula="owner_side = teleport_unit.side_number"
[/target]
) (
[filter][/filter]
)}) SELF=yes}
[/abilities]
[/effect]
moves=2
max_moves=2
[/modify_unit]
[move_unit]
id=alice
to_x=1
to_y=1
[/move_unit]
[terrain]
x,y=1,2
terrain=Dd^Vda
[/terrain]
[terrain]
x,y=4,2
terrain=Dd^Vda
[/terrain]
[capture_village]
side=1
x,y=4,2
[/capture_village]
[/event]
[event]
name=attack
{SUCCEED}
[/event]
[event]
name=side 2 turn 1
{FAIL}
[/event]
) SIDE1_CONTROLLER=ai}

View file

@ -502,7 +502,7 @@
0 heal_two_cumulative_mixed_same_id
0 heal_two_cumulative_mixed_unique_id
0 heal_max_value
# regenerate abilities tests
# regenerate ability tests
0 regenerate_positive_value
0 regenerate_negative_value
0 regenerate_zero
@ -535,7 +535,7 @@
0 regenerate_two_cumulative_mixed_same_id
0 regenerate_two_cumulative_mixed_unique_id
0 regenerate_max_value
# resistance abilities tests
# resistance ability tests
0 resistance_negative_value
0 resistance_zero
0 resistance_add
@ -574,7 +574,7 @@
0 resistance_no_max_value
0 resistance_no_value_no_max_value
0 resistance_no_value_no_max_value_add
# leadership abilities tests
# leadership ability tests
0 leadership_negative_value
0 leadership_zero
0 leadership_add
@ -605,7 +605,7 @@
0 leadership_max_value
0 leadership_active_on_offense
0 leadership_active_on_defense
# illuminates abilities tests
# illuminates ability tests
0 illuminates_active_on_defense
0 illuminates_active_on_offense
0 illuminates_add
@ -649,6 +649,24 @@
0 illuminates_value_day_capped
0 illuminates_value_night
0 illuminates_value_deep
# skirmisher ability tests
0 skirmisher
0 no_skirmisher
0 skirmisher_adjacent_enemies
0 skirmisher_adjacent
# hides ability tests
0 hides_self
0 hides_nobody
# teleport ability tests
0 teleport_simple
0 no_teleport
0 teleport_no_tunnel
0 teleport_adjacent_allies
0 tunnel_filter_teleport_unit
0 tunnel_target_teleport_unit_fail
0 tunnel_target_teleport_unit_succeed
0 tunnel_source_teleport_unit_fail
0 tunnel_source_teleport_unit_succeed
# Warnings about WML
0 unknown_scenario_false_positives
0 unknown_scenario_interpolated