Difference between revisions of "AbilitiesWML"
From The Battle for Wesnoth Wiki
(→The ''[specials]'' tag) |
(Revove DevFeature, highlight attributes) |
||
Line 8: | Line 8: | ||
The following tags are used to describe an ability in WML: | The following tags are used to describe an ability in WML: | ||
− | * ''[heals]'' modifies the hitpoints of a unit at the beginning the healer's turn | + | * '''[heals]''': modifies the hitpoints of a unit at the beginning the healer's turn |
− | * ''[regenerate]'' modifies the hitpoints of a unit at the beginning of the unit's turn | + | * '''[regenerate]''': modifies the hitpoints of a unit at the beginning of the unit's turn |
− | * ''[resistance]'' modifies the resistance of a unit to damage | + | * '''[resistance]''': modifies the resistance of a unit to damage |
− | * ''[leadership]'' modifies the damage of a unit | + | * '''[leadership]''': modifies the damage of a unit |
− | * ''[skirmisher]'' negates enemy zones of control | + | * '''[skirmisher]''': negates enemy zones of control |
− | * ''[illuminates]'' modifies the time of day adjacent to the affected units | + | * '''[illuminates]''': modifies the time of day adjacent to the affected units |
− | * ''[teleport]'' allows the unit to teleport | + | * '''[teleport]''': allows the unit to teleport |
− | * ''[hides]'' renders the unit invisible to enemies | + | * '''[hides]''': renders the unit invisible to enemies |
Any other name is valid, but will result in an ability that does nothing but report it's there. | Any other name is valid, but will result in an ability that does nothing but report it's there. | ||
=== Common keys and tags for every ability === | === Common keys and tags for every ability === | ||
− | * ''name'' the name of the ability. | + | * '''name''': the name of the ability. |
− | * ''name_inactive'' the name of the ability when inactive. | + | * '''name_inactive''': the name of the ability when inactive. |
− | * ''description'' the description of the ability. | + | * '''description''': the description of the ability. |
− | * ''description_inactive'' the description of the ability when inactive. | + | * '''description_inactive''': the description of the ability when inactive. |
− | * ''affect_self'' if equal to 'yes', the ability will affect the unit that has it. | + | * '''affect_self''': if equal to 'yes', the ability will affect the unit that has it. |
− | * ''affect_allies'' if equal to 'yes', the ability will affect allies in the specified adjacent hexes. | + | * '''affect_allies''': if equal to 'yes', the ability will affect allies in the specified adjacent hexes. |
− | * ''affect_enemies'' if equal to 'yes', the ability will affect enemies in the specified adjacent hexes. | + | * '''affect_enemies''': if equal to 'yes', the ability will affect enemies in the specified adjacent hexes. |
− | * ''cumulative'' if set to 'yes', this ability will be cumulative with the base value for this ability. | + | * '''cumulative''': if set to 'yes', this ability will be cumulative with the base value for this ability. |
− | * ''id'' this ability will not be cumulative with other abilities using this id. | + | * '''id''': this ability will not be cumulative with other abilities using this id. |
− | * '''[adjacent_description]''' contains all four of the above keys, which are used when an adjacent unit receives the ability. | + | * '''[adjacent_description]''': contains all four of the above keys, which are used when an adjacent unit receives the ability. |
− | * '''[filter]''' Standard Unit Filter: If the unit owning the ability does not match this filter, the ability will be inactive. | + | * '''[filter]''': Standard Unit Filter: If the unit owning the ability does not match this filter, the ability will be inactive. |
− | * '''[filter_adjacent]''' Standard Unit Filter, which takes an extra key ''adjacent'', which is used to specify which adjacent hexes to filter on. ''adjacent'' is a comma | + | * '''[filter_adjacent]''': Standard Unit Filter, which takes an extra key '''adjacent''':, which is used to specify which adjacent hexes to filter on. '''adjacent''': is a comma-separated list of any combination of these directions: '''n''','''ne''','''se''','''s''','''sw''','''nw'''. |
− | * '''[filter_adjacent_location]''' like [filter_adjacent], except that it filters on the locations rather than the units. | + | * '''[filter_adjacent_location]''': like [filter_adjacent], except that it filters on the locations rather than the units. |
− | * '''[affect_adjacent]''' each adjacent unit that does not match this filter will not receive its effects. | + | * '''[affect_adjacent]''': each adjacent unit that does not match this filter will not receive its effects. |
− | ** ''adjacent'' a comma seperated list of any combination of these directions: ''n'',''ne'',''se'',''s'',''sw'',''nw''. | + | ** '''adjacent''': a comma seperated list of any combination of these directions: '''n''','''ne''','''se''','''s''','''sw''','''nw'''. |
− | ** '''[filter]''' a standard unit filter. | + | ** '''[filter]''': a standard unit filter. |
− | * '''[filter_self]''' if the owner of the ability does not match this filter, it will not receive the effects of the ability. | + | * '''[filter_self]''': if the owner of the ability does not match this filter, it will not receive the effects of the ability. |
− | * '''[filter_base_value]''' filters on the value before any modifications; uses the keys 'equals', 'not_equals', etc. | + | * '''[filter_base_value]''': filters on the value before any modifications; uses the keys '''equals''', '''not_equals''', etc. |
=== Extra keys used by the ''[heals]'' ability === | === Extra keys used by the ''[heals]'' ability === | ||
− | * ''value'' the amount healed. | + | * '''value''': the amount healed. |
− | * ''poison'' can be one of ''slowed'',''cured''. | + | * '''poison''': can be one of ''slowed'',''cured''. |
=== Extra keys used by the ''[regenerate]'' ability === | === Extra keys used by the ''[regenerate]'' ability === | ||
− | * ''value'' the amount healed. | + | * '''value''': the amount healed. |
− | * ''poison'' can be one of ''slowed'',''cured''. | + | * '''poison''': can be one of ''slowed'',''cured''. |
=== Extra keys and tags used by the ''[resistance]'' ability === | === Extra keys and tags used by the ''[resistance]'' ability === | ||
− | * ''value'' set resistance to this value. | + | * '''value''': set resistance to this value. |
− | * ''max_value'' maximum resistance value. | + | * '''max_value''': maximum resistance value. |
− | * ''add'' adds to resistance. | + | * '''add''': adds to resistance. |
− | * ''multiply'' multiplies resistance value. | + | * '''multiply''': multiplies resistance value. |
− | * ''apply_to'' a list of damage types; if left out, the ability applies to all types. | + | * '''apply_to''': a list of damage types; if left out, the ability applies to all types. |
− | * ''active_on'' one of 'defense' or 'offense'; if left out, the ability is active on both. | + | * '''active_on''': one of 'defense' or 'offense'; if left out, the ability is active on both. |
=== Extra keys used by the ''[leadership]'' ability === | === Extra keys used by the ''[leadership]'' ability === | ||
− | * ''value'' the percentage bonus to damage. | + | * '''value''': the percentage bonus to damage. |
=== Extra keys used by the ''[illuminates]'' ability === | === Extra keys used by the ''[illuminates]'' ability === | ||
− | * ''value'' the percentage bonus to lawful units. | + | * '''value''': the percentage bonus to lawful units. |
− | * ''max_value'' the maximum percentage bonus given. | + | * '''max_value''': the maximum percentage bonus given. |
=== Extra keys used by the ''[hides]'' ability === | === Extra keys used by the ''[hides]'' ability === | ||
− | * ''alert'' | + | * '''alert''': the displayed text when the unit is discovered. Default "Ambushed!". |
=== Macros for common abilities === | === Macros for common abilities === | ||
Line 89: | Line 89: | ||
The '''[specials]''' tag goes inside the '''[attack]''' tag. It can contain the following tags: | The '''[specials]''' tag goes inside the '''[attack]''' tag. It can contain the following tags: | ||
− | * ''[damage]'' modifies the damage of a weapon | + | * '''[damage]''': modifies the damage of a weapon |
− | * ''[attacks]'' modifies the number of attacks of a weapon | + | * '''[attacks]''': modifies the number of attacks of a weapon |
− | * ''[chance_to_hit]'' modifies the chance to hit of a weapon | + | * '''[chance_to_hit]''': modifies the chance to hit of a weapon |
− | * ''[slow]'' | + | * '''[slow]''' |
− | * ''[poison]'' | + | * '''[poison]''' |
− | * ''[stones]'' | + | * '''[stones]''' |
− | * ''[berserk]'' | + | * '''[berserk]''' |
− | * ''[firststrike]'' | + | * '''[firststrike]''' |
− | * ''[drains]'' | + | * '''[drains]''' |
− | * ''[plague]'' | + | * '''[plague]''' |
Any other name is valid, but will result in an special that does nothing but report it's there. | Any other name is valid, but will result in an special that does nothing but report it's there. | ||
=== Common keys and tags for every weapon special === | === Common keys and tags for every weapon special === | ||
− | * ''name'' the name of the special. | + | * '''name''': the name of the special. |
− | * ''name_inactive'' the name of the special when inactive. | + | * '''name_inactive''': the name of the special when inactive. |
− | * ''description'' the description of the special. | + | * '''description''': the description of the special. |
− | * ''description_inactive'' the description of the special when inactive. | + | * '''description_inactive''': the description of the special when inactive. |
− | * ''active_on'' one of 'defense','offense'; if left out, it uses both. | + | * '''active_on''': one of '''defense''','''offense'''; if left out, it uses both. |
− | * ''value'' the value to be used. Applies to ''[damage]'', ''[attacks]'', ''[chance_to_hit]'' and ''[berserk]'' (the maximum number of combat rounds). | + | * '''value''': the value to be used. Applies to '''[damage]''', '''[attacks]''', '''[chance_to_hit]''' and '''[berserk]''' (the maximum number of combat rounds). |
* ''add'' the number to add to the base value. | * ''add'' the number to add to the base value. | ||
− | * ''multiply'' same as ''value'', except that this multiplies the base value. | + | * '''multiply''': same as '''value''', except that this multiplies the base value. |
− | * ''cumulative'' if set to 'yes', this special will be cumulative with the base value. | + | * '''cumulative''': if set to 'yes', this special will be cumulative with the base value. |
− | * ''type'' only usable in ''[plague]'', where it defines the unit type to be spawned on kill. | + | * '''type''': only usable in '''[plague]''', where it defines the unit type to be spawned on kill. |
− | * ''id'' this ability will not be cumulative with other specials using this id. | + | * '''id''': this ability will not be cumulative with other specials using this id. |
− | * ''active_on'' one of 'defense' or 'offense'; if left out, the ability is active on both. | + | * '''active_on''': one of '''defense''' or '''offense'''; if left out, the ability is active on both. |
− | * ''apply_to'' one of 'self','opponent','attacker','defender','both'. Determines who the effects of this special are applied to. | + | * '''apply_to''': one of '''self''','''opponent''','''attacker''','''defender''','''both'''. Determines who the effects of this special are applied to. |
− | * '''[filter_adjacent]''' Standard Unit Filter, which takes an extra key ''adjacent'', which is used to specify which adjacent hexes to filter on. ''adjacent'' is a comma seperated list | + | * '''[filter_adjacent]''': Standard Unit Filter, which takes an extra key '''adjacent''', which is used to specify which adjacent hexes to filter on. '''adjacent''' is a comma seperated list of any combination of these directions: '''n''','''ne''','''se''','''s''','''sw''','''nw'''. |
− | * '''[filter_adjacent_location]''' like [filter_adjacent], except that it filters on the locations rather than the units. | + | * '''[filter_adjacent_location]''': like [filter_adjacent], except that it filters on the locations rather than the units. |
− | * '''[filter_self]''' the special will only be active if the owner matches this filter. | + | * '''[filter_self]''': the special will only be active if the owner matches this filter. |
− | ** '''[filter_weapon]''' a standard weapon filter. | + | ** '''[filter_weapon]''': a standard weapon filter. |
− | * '''[filter_opponent]''' the special will only be active if the opponent matches this filter. | + | * '''[filter_opponent]''': the special will only be active if the opponent matches this filter. |
− | ** '''[filter_weapon]''' a standard weapon filter. | + | ** '''[filter_weapon]''': a standard weapon filter. |
− | * '''[filter_attacker]''' the special will only be active if the attacker matches this filter. | + | * '''[filter_attacker]''': the special will only be active if the attacker matches this filter. |
− | ** '''[filter_weapon]''' a standard weapon filter. | + | ** '''[filter_weapon]''': a standard weapon filter. |
* '''[filter_defender]''' the special will only be active if the defender matches this filter. | * '''[filter_defender]''' the special will only be active if the defender matches this filter. | ||
− | ** '''[filter_weapon]''' a standard weapon filter. | + | ** '''[filter_weapon]''': a standard weapon filter. |
− | * '''[filter_base_value]''' filters on the value before any modifications; uses the keys 'equals', 'not_equals', | + | * '''[filter_base_value]''': filters on the value before any modifications; uses the keys '''equals''', '''not_equals''', etc. |
=== Macros for common weapon specials === | === Macros for common weapon specials === |
Revision as of 18:04, 15 February 2008
Contents
- 1 Abilities and their effects
- 2 The [abilities] tag
- 2.1 Common keys and tags for every ability
- 2.2 Extra keys used by the [heals] ability
- 2.3 Extra keys used by the [regenerate] ability
- 2.4 Extra keys and tags used by the [resistance] ability
- 2.5 Extra keys used by the [leadership] ability
- 2.6 Extra keys used by the [illuminates] ability
- 2.7 Extra keys used by the [hides] ability
- 2.8 Macros for common abilities
- 3 The [specials] tag
- 4 See Also
Abilities and their effects
There are two types of abilities: ones that apply to units (called abilities) and ones that only apply when using a particular attack (called specials or weapon specials). A unit may have multiple abilities and an attack can have multiple specials, but by convention only one weapon special should be assigned to any given attack.
The [abilities] tag
The following tags are used to describe an ability in WML:
- [heals]: modifies the hitpoints of a unit at the beginning the healer's turn
- [regenerate]: modifies the hitpoints of a unit at the beginning of the unit's turn
- [resistance]: modifies the resistance of a unit to damage
- [leadership]: modifies the damage of a unit
- [skirmisher]: negates enemy zones of control
- [illuminates]: modifies the time of day adjacent to the affected units
- [teleport]: allows the unit to teleport
- [hides]: renders the unit invisible to enemies
Any other name is valid, but will result in an ability that does nothing but report it's there.
Common keys and tags for every ability
- name: the name of the ability.
- name_inactive: the name of the ability when inactive.
- description: the description of the ability.
- description_inactive: the description of the ability when inactive.
- affect_self: if equal to 'yes', the ability will affect the unit that has it.
- affect_allies: if equal to 'yes', the ability will affect allies in the specified adjacent hexes.
- affect_enemies: if equal to 'yes', the ability will affect enemies in the specified adjacent hexes.
- cumulative: if set to 'yes', this ability will be cumulative with the base value for this ability.
- id: this ability will not be cumulative with other abilities using this id.
- [adjacent_description]: contains all four of the above keys, which are used when an adjacent unit receives the ability.
- [filter]: Standard Unit Filter: If the unit owning the ability does not match this filter, the ability will be inactive.
- [filter_adjacent]: Standard Unit Filter, which takes an extra key adjacent:, which is used to specify which adjacent hexes to filter on. adjacent: is a comma-separated list of any combination of these directions: n,ne,se,s,sw,nw.
- [filter_adjacent_location]: like [filter_adjacent], except that it filters on the locations rather than the units.
- [affect_adjacent]: each adjacent unit that does not match this filter will not receive its effects.
- adjacent: a comma seperated list of any combination of these directions: n,ne,se,s,sw,nw.
- [filter]: a standard unit filter.
- [filter_self]: if the owner of the ability does not match this filter, it will not receive the effects of the ability.
- [filter_base_value]: filters on the value before any modifications; uses the keys equals, not_equals, etc.
Extra keys used by the [heals] ability
- value: the amount healed.
- poison: can be one of slowed,cured.
Extra keys used by the [regenerate] ability
- value: the amount healed.
- poison: can be one of slowed,cured.
Extra keys and tags used by the [resistance] ability
- value: set resistance to this value.
- max_value: maximum resistance value.
- add: adds to resistance.
- multiply: multiplies resistance value.
- apply_to: a list of damage types; if left out, the ability applies to all types.
- active_on: one of 'defense' or 'offense'; if left out, the ability is active on both.
Extra keys used by the [leadership] ability
- value: the percentage bonus to damage.
Extra keys used by the [illuminates] ability
- value: the percentage bonus to lawful units.
- max_value: the maximum percentage bonus given.
Extra keys used by the [hides] ability
- alert: the displayed text when the unit is discovered. Default "Ambushed!".
Macros for common abilities
- ABILITY_AMBUSH
- ABILITY_CURES
- ABILITY_HEALS
- ABILITY_ILLUMINATES
- ABILITY_LEADERSHIP_LEVEL_1 to ABILITY_LEADERSHIP_LEVEL_5
- ABILITY_NIGHTSTALK
- ABILITY_REGENERATES
- ABILITY_SKIRMISHER
- ABILITY_STEADFAST
- ABILITY_SUBMERGE
- ABILITY_TELEPORT
The [specials] tag
The [specials] tag goes inside the [attack] tag. It can contain the following tags:
- [damage]: modifies the damage of a weapon
- [attacks]: modifies the number of attacks of a weapon
- [chance_to_hit]: modifies the chance to hit of a weapon
- [slow]
- [poison]
- [stones]
- [berserk]
- [firststrike]
- [drains]
- [plague]
Any other name is valid, but will result in an special that does nothing but report it's there.
Common keys and tags for every weapon special
- name: the name of the special.
- name_inactive: the name of the special when inactive.
- description: the description of the special.
- description_inactive: the description of the special when inactive.
- active_on: one of defense,offense; if left out, it uses both.
- value: the value to be used. Applies to [damage], [attacks], [chance_to_hit] and [berserk] (the maximum number of combat rounds).
- add the number to add to the base value.
- multiply: same as value, except that this multiplies the base value.
- cumulative: if set to 'yes', this special will be cumulative with the base value.
- type: only usable in [plague], where it defines the unit type to be spawned on kill.
- id: this ability will not be cumulative with other specials using this id.
- active_on: one of defense or offense; if left out, the ability is active on both.
- apply_to: one of self,opponent,attacker,defender,both. Determines who the effects of this special are applied to.
- [filter_adjacent]: Standard Unit Filter, which takes an extra key adjacent, which is used to specify which adjacent hexes to filter on. adjacent is a comma seperated list of any combination of these directions: n,ne,se,s,sw,nw.
- [filter_adjacent_location]: like [filter_adjacent], except that it filters on the locations rather than the units.
- [filter_self]: the special will only be active if the owner matches this filter.
- [filter_weapon]: a standard weapon filter.
- [filter_opponent]: the special will only be active if the opponent matches this filter.
- [filter_weapon]: a standard weapon filter.
- [filter_attacker]: the special will only be active if the attacker matches this filter.
- [filter_weapon]: a standard weapon filter.
- [filter_defender] the special will only be active if the defender matches this filter.
- [filter_weapon]: a standard weapon filter.
- [filter_base_value]: filters on the value before any modifications; uses the keys equals, not_equals, etc.
Macros for common weapon specials
- WEAPON_SPECIAL_BACKSTAB
- WEAPON_SPECIAL_BERSERK
- WEAPON_SPECIAL_CHARGE
- WEAPON_SPECIAL_DRAIN
- WEAPON_SPECIAL_FIRSTSTRIKE
- WEAPON_SPECIAL_MAGICAL
- WEAPON_SPECIAL_MARKSMAN
- WEAPON_SPECIAL_PLAGUE
- WEAPON_SPECIAL_PLAGUE_TYPE TYPE
- WEAPON_SPECIAL_POISON
- WEAPON_SPECIAL_SLOW
- WEAPON_SPECIAL_STONE
- WEAPON_SPECIAL_SWARM