forked from wesnoth/wesnoth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add recursion_guard in [filter_(second_)weapon] for [leadership] and …
…[resistance] abilities. In moving recursion_guard from matches_filter() to special_unit_matches() i has forgotten what [leadership] abilities called directly matches_filter().
- Loading branch information
1 parent
b905c1a
commit a8c1a10
Showing
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
.../test/scenarios/wml_tests/UnitsWML/AbilitiesWML/ability_cycle_filter_weapon_recursion.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#textdomain wesnoth-test | ||
|
||
##### | ||
# API(s) being tested: [filter_self]ability_id_active= | ||
## | ||
# Actions: | ||
# Alice and Bob are both of type Test Melee Quintain. | ||
# Give Alice a leadership_test_recursion ability, which is active only if it is itself active. | ||
# Have Alice attack with his weapon. | ||
## | ||
# Expected end state: | ||
# Deterministic end state, without crashing, but BROKE STRICT. | ||
# All abilities are inactive. | ||
# Bob takes 10 damage. | ||
##### | ||
{COMMON_KEEP_A_B_UNIT_TEST "leadership_filter_weapon_cycle_recursion" ( | ||
[event] | ||
name=start | ||
|
||
[modify_unit] | ||
[filter] | ||
id=alice | ||
[/filter] | ||
[effect] | ||
apply_to=new_ability | ||
[abilities] | ||
[leadership] | ||
id=leadership_test_recursion | ||
value=50 | ||
cumulative=no | ||
affect_self=yes | ||
[filter_weapon] | ||
special_id_active=leadership_test_recursion | ||
[/filter_weapon] | ||
[/leadership] | ||
[/abilities] | ||
[/effect] | ||
[/modify_unit] | ||
|
||
[test_do_attack_by_id] | ||
attacker=alice | ||
defender=bob | ||
weapon=0 | ||
[/test_do_attack_by_id] | ||
|
||
[store_unit] | ||
[filter] | ||
id=bob | ||
[/filter] | ||
variable=bob | ||
[/store_unit] | ||
|
||
{ASSERT ({VARIABLE_CONDITIONAL bob.hitpoints equals 90})} | ||
|
||
{SUCCEED} | ||
[/event] | ||
) SIDE1_LEADER="Test Melee Quintain" SIDE2_LEADER="Test Melee Quintain"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters