wesnoth/data/schema/units/abilities.cfg
newfrenchy83 ce4fb82173 Filter weapon in [filter student/opponent/etc] rework (pr #4678)
All weapon specials can now be used in [abilities] to effect all weapons of the unit that pass the filter given in [filter_student][filter_weapon].

Explanation: filter_student filters on the unit that is  under the effect of the ability (which is usually the unit itself, but not always if [affect_adjacent] is used).  [filter_student][filter_weapon] filters on the active weapon of that unit (the student) in a specific combat.

[filter_weapon] is now supported in all filter_opponent, filter_student, filter_attacker, filter_defender

Note that constructs like [filter_student][or][filter_weapon] are not suported, [filter_weapon] must be a direct subtag of the four just mentioned tags.
 
[filter_second_weapon] is no longer used for abilities that come from weapon specials.

implements #4629 , #4475 , #4389

Co-authored-by: gfgtdf <daniel.gfgtdf@gmail.com>
2020-01-05 00:27:55 +01:00

142 lines
3.4 KiB
INI

#define BASED_ON_SPECIAL NAME
[tag]
name={NAME}
max=infinite
super="units/unit_type/abilities/~generic~,units/unit_type/attack/specials/" + {NAME}
{FILTER_TAG "filter_student" unit {FILTER_TAG "filter_weapon" weapon ()}}
[/tag]
#enddef
[tag]
# Using invalid characters to ensure it doesn't match a real tag.
name="~generic~"
max=0
{SIMPLE_KEY name t_string}
{SIMPLE_KEY female_name t_string}
{SIMPLE_KEY name_inactive t_string}
{SIMPLE_KEY female_name_inactive t_string}
{SIMPLE_KEY description t_string}
{SIMPLE_KEY description_inactive t_string}
{SIMPLE_KEY affect_self bool}
{SIMPLE_KEY affect_allies bool}
{SIMPLE_KEY affect_enemies bool}
{SIMPLE_KEY cumulative bool}
{SIMPLE_KEY id string}
{FILTER_TAG "filter" unit ()}
[tag]
name="affect_adjacent"
[key]
name="adjacent"
type="dir_list"
[/key]
{FILTER_TAG "filter" unit ()}
[/tag]
{FILTER_TAG "filter_self" unit ()}
{FILTER_TAG "filter_adjacent" adjacent ()}
{FILTER_TAG "filter_adjacent_location" adjacent_location ()}
{FILTER_TAG "filter_base_value" base_value ()}
{WML_MERGE_KEYS}
[/tag]
[tag]
name="heals"
max=infinite
super="units/unit_type/abilities/~generic~"
{SIMPLE_KEY value f_int}
{SIMPLE_KEY add f_int}
{SIMPLE_KEY sub f_int}
{SIMPLE_KEY poison string} # TODO: Enum
[/tag]
[tag]
name="regenerate"
max=infinite
super="units/unit_type/abilities/heals"
[/tag]
[tag]
# Using invalid characters to ensure it doesn't match a real tag.
name="~value~"
max=0
super="units/unit_type/abilities/~generic~"
{SIMPLE_KEY value f_int}
{SIMPLE_KEY max_value f_int}
{SIMPLE_KEY add f_int}
{SIMPLE_KEY sub f_int}
{SIMPLE_KEY multiply f_int}
{SIMPLE_KEY divide f_int}
{SIMPLE_KEY apply_to string}
{SIMPLE_KEY active_on ability_context}
[/tag]
# Defense not currently supported though.
# May never be? Not sure
[tag]
name="defense"
max=infinite
super="units/unit_type/abilities/~value~"
[/tag]
[tag]
name="resistance"
max=infinite
super="units/unit_type/abilities/~value~"
{FILTER_TAG "filter_weapon" weapon ()}
{FILTER_TAG "filter_second_weapon" weapon ()}
[/tag]
[tag]
name="leadership"
max=infinite
super="units/unit_type/abilities/~generic~"
{SIMPLE_KEY value f_int}
{FILTER_TAG "filter_weapon" weapon ()}
{FILTER_TAG "filter_second_weapon" weapon ()}
[/tag]
[tag]
name="illuminates"
max=infinite
super="units/unit_type/abilities/~generic~"
{SIMPLE_KEY value f_int}
{SIMPLE_KEY max_value f_int}
{SIMPLE_KEY min_value f_int}
[/tag]
[tag]
name="hides"
max=infinite
super="units/unit_type/abilities/~generic~"
{SIMPLE_KEY alert t_string}
[/tag]
[tag]
name="teleport"
max=infinite
super="units/unit_type/abilities/~generic~"
[tag]
name="tunnel"
min=1
{SIMPLE_KEY id string}
{FILTER_TAG "filter" unit min=1}
{FILTER_TAG "source" location min=1}
{FILTER_TAG "target" location min=1}
{DEFAULT_KEY bidirectional bool yes}
{DEFAULT_KEY always_visible bool no}
{DEFAULT_KEY allow_vision bool yes}
{DEFAULT_KEY pass_allied_units bool yes}
[/tag]
[/tag]
{BASED_ON_SPECIAL "attacks"}
{BASED_ON_SPECIAL "swarm"}
{BASED_ON_SPECIAL "chance_to_hit"}
{BASED_ON_SPECIAL "damage"}
{BASED_ON_SPECIAL "drains"}
{BASED_ON_SPECIAL "heal_on_hit"}
{BASED_ON_SPECIAL "berserk"}
{BASED_ON_SPECIAL "plague"}
{BASED_ON_SPECIAL "firststrike"}
{BASED_ON_SPECIAL "poison"}
{BASED_ON_SPECIAL "slow"}
{BASED_ON_SPECIAL "petrifies"}
[tag]
name="*"
max=infinite
super="units/unit_type/abilities/~generic~"
[/tag]
#undef BASED_ON_SPECIAL