wesnoth/data/schema/units/abilities.cfg
newfrenchy83 b5805eca8f
Add priority and filter to overwrite specials (#7746)
using overwrite_specials alone means that we have only two possibilities, either one_side is chosen and in this case if the ability used as a weapon carrying the attribute is applied to the unit (apply_to=self), the other abilities are the same type applied also to 'self' not carrying the attribute will be overwritten, but those of the opponent with apply_to=opponent will be kept in the list; or else both_sides is chosen and all abilities of the same type that do not carry the attribute will be overwritten. To be able to use the attribute in abilities like [damage] for example, it is necessary to be able to be even more selective as for a 'charge' type leadership with multiply=2.5 but which must not be combined with the classic charge and without overwriting the aute [damage] as backstab, [overwrite_filter] to only match damage with apply_to=both and active_on=offense is then interesting.

adding priority allows you to select that it ability can use its overwrite_specials attribute while the others can be overwritten in the same way as an ability without the attribute. Finally, this system makes it unnecessary to limit the use of the attribute to abilities used as weapons but also to special weapons.
2023-10-08 10:09:31 -05:00

157 lines
3.8 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 special_note 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}
{SIMPLE_KEY halo_image string}
{SIMPLE_KEY halo_image_self string}
{SIMPLE_KEY overlay_image string}
{SIMPLE_KEY overlay_image_self 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}
{SIMPLE_KEY add f_int}
{SIMPLE_KEY sub f_int}
{SIMPLE_KEY multiply f_int}
{SIMPLE_KEY divide 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]
[tag]
name="tailwind"
max=infinite
super="units/unit_type/abilities/~generic~"
{SIMPLE_KEY value f_int}
[/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