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.
Allow to partially check the activity of a special weapon in [has att…
…ack] When using [filter][has_attack]special_id/type_active, if a unit has the special in question and it is still active, it is detected, but if any filter like [filter_self/student] is used, the detection does not work anymore because the weapon is considered as still inactive, no information about the user or the opponent being available. This PR partially fixes this lack by including the information about the filtered unit but not about the opponent or if active only in attack or defense An unexpected change is that when [abilities][damage_type]replacement_type= is used with the filter[filter_student][has_attack]type=blade on a unit that has multiple attacks including one type=blade, if the selected attack is blade, the ability works, but if another attack is selected, it is the new type that is detected now, and therefore the other attacks are no longer affected
- Loading branch information
1 parent
8cccfb1
commit 7034805
Showing
6 changed files
with
115 additions
and
24 deletions.
There are no files selected for viewing
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
47 changes: 47 additions & 0 deletions
47
...enarioWML/EventWML/ActionWML/ConditionalActionsWML/filter_special_id_active_no_active.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,47 @@ | ||
#textdomain wesnoth-test | ||
|
||
##### | ||
# API(s) being tested: [has_attack]special_id_active= | ||
## | ||
# Actions: | ||
# Give bob a weapon special with an id active if owner is an elf. | ||
## | ||
# Expected end state: | ||
# special_id_active cannot finds a unit with that weapon special id, because bob don't match conditions for special be active | ||
##### | ||
{GENERIC_UNIT_TEST "filter_special_id_active_when_no_active" ( | ||
[event] | ||
name=start | ||
|
||
[object] | ||
silent=yes | ||
[effect] | ||
apply_to=attack | ||
[set_specials] | ||
[chance_to_hit] | ||
id=test_cth | ||
value=100 | ||
[filter_self] | ||
race=elf | ||
[/filter_self] | ||
[/chance_to_hit] | ||
[/set_specials] | ||
[/effect] | ||
[filter] | ||
id=bob | ||
[/filter] | ||
[/object] | ||
|
||
{ASSERT ( | ||
[not] | ||
[have_unit] | ||
[has_attack] | ||
special_id_active=test_cth | ||
[/has_attack] | ||
[/have_unit] | ||
[/not] | ||
)} | ||
|
||
{SUCCEED} | ||
[/event] | ||
)} |
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
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