Difference between revisions of "AbilitiesWML"
m (→Common keys and tags for every ability: language) |
(→Common keys and tags for every ability: multiple [affect_adjacent]s) |
||
Line 33: | Line 33: | ||
* '''[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]''': [[StandardUnitFilter]] If the unit owning the ability does not match this filter, the ability will be inactive. | * '''[filter]''': [[StandardUnitFilter]] If the unit owning the ability does not match this filter, the ability will be inactive. | ||
− | * '''[affect_adjacent]''': an adjacent unit that does not match this filter will not receive its effects. | + | * '''[affect_adjacent]''': an adjacent unit that does not match this filter will not receive its effects. There can be multiple [affect_adjacent] tags in a single ability; a unit needs to match any one of these to receive the effects. If there are no [affect_adjacent] tags, then no adjacent units will receive the effects. |
** '''adjacent''': a comma separated list of any combination of these directions: '''n''','''ne''','''se''','''s''','''sw''','''nw'''. | ** '''adjacent''': a comma separated list of any combination of these directions: '''n''','''ne''','''se''','''s''','''sw''','''nw'''. | ||
** '''[filter]''': a [[StandardUnitFilter]]. | ** '''[filter]''': a [[StandardUnitFilter]]. |
Revision as of 23:42, 21 October 2012
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 Extra tags used by the [teleport] ability
- 2.9 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 of 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 (for example [dummy]), but will result in an ability that does nothing but report it's there. These tags still use the same common keys and tags as every other ability. Note: a dummy ability must have an id for the name and description to display.
Common keys and tags for every ability
- name: the (translatable) name of the ability.
- female_name: the (translatable) name of the ability when possessed by a female unit. (Defaults to name=.)
- name_inactive: the (translatable) name of the ability when inactive.
- female_name_inactive: the (translatable) name of the ability when inactive and possessed by a female unit. (Defaults to name_inactive=.)
- description: the (translatable) description of the ability.
- description_inactive: the (translatable) 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. Must be present if cumulative is anything other than 'yes'.
- [adjacent_description]: contains all four of the above keys, which are used when an adjacent unit receives the ability.
- [filter]: StandardUnitFilter If the unit owning the ability does not match this filter, the ability will be inactive.
- [affect_adjacent]: an adjacent unit that does not match this filter will not receive its effects. There can be multiple [affect_adjacent] tags in a single ability; a unit needs to match any one of these to receive the effects. If there are no [affect_adjacent] tags, then no adjacent units will receive the effects.
- adjacent: a comma separated list of any combination of these directions: n,ne,se,s,sw,nw.
- [filter]: a StandardUnitFilter.
- [filter_self]: if the owner of the ability does not match this filter, it will not receive the effects of the ability. [filter_self] takes a StandardUnitFilter as argument.
- [filter_base_value]: filters on the value before any modifications; uses the keys equals, not_equals, etc. If several keys are used all have to match.
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. This value must be set in order for [resistance] to function.
- add: adds to resistance.
- sub: subtracts from resistance.
- multiply: multiplies resistance value.
- divide: divides 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.
- min_value: the minimum percentage bonus given.
Extra keys used by the [hides] ability
- alert: the displayed text when the unit is discovered. Default "Ambushed!".
Extra tags used by the [teleport] ability
- [tunnel] - a tunnel tag (see DirectActionsWML) (without the remove key) defining the tunneling source and target hexes, and maybe other conditions. (It automatically applies only to the unit with the ability.) You may use $teleport_unit inside the tunnel tag for filtering purposes.
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:
- [attacks]: modifies the number of attacks of a weapon
- [berserk]: pushes the attack for more than one combat round
- [chance_to_hit]: modifies the chance to hit of a weapon
- [damage]: modifies the damage of a weapon
- [drains]: heals the attacker half of the damage dealt
- [firststrike]: forces the weapon to always strike first
- [heal_on_hit]: heals the attacker when an attack connects Template:DevFeature1.11
- [petrifies]: turns the target to stone
- [plague]: when used to kill an enemy, a friendly unit takes its place
- [poison]: poisons the target
- [slow]: slows the target
- [swarm]: number of strikes decreases as the unit loses hitpoints
Any other name is valid, but will result in an special that does nothing but report it is there.
Common keys and tags for every weapon special
- name: the (translatable) name of the special.
- name_inactive: the (translatable) name of the special when inactive.
- description: the (translatable) description of the special.
- description_inactive: the (translatable) description of the special when inactive.
- id: this ability will not be cumulative with other specials using this id.
- active_on: one of defense or offense; if left out, the special is active on both.
- apply_to: one of self,opponent,attacker,defender,both (default: self). Determines who the effects of this special are applied to.
- [filter_adjacent]: StandardUnitFilter, 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 StandardUnitFilter (SUF).
- [filter_weapon]: a standard weapon filter, excluding special= (Template:DevFeature1.11 including special=).
- [filter_opponent]: the special will only be active if the opponent matches this SUF.
- [filter_weapon]: a standard weapon filter, excluding special= (Template:DevFeature1.11 including special=)..
- [filter_attacker]: the special will only be active if the attacker matches this SUF.
- [filter_weapon]: a standard weapon filter, excluding special= (Template:DevFeature1.11 including special=)..
- [filter_defender] the special will only be active if the defender matches this SUF.
- [filter_weapon]: a standard weapon filter, excluding special= (Template:DevFeature1.11 including special=)..
Common keys and tags for specials with a value
The [damage], [attacks], and [chance_to_hit] specials take values that specify how those specials modify their respective base values. Template:DevFeature1.11 The [drains] special takes a value specifying the percentage of damage drained (default 50) and [heal_on_hit] takes the amount to heal (default 0; negative values will harm the attacker, but not kill).
- value: the value to be used.
- add: the number to add to the base value.
- sub: the number to subtract from the base value.
- multiply: this multiplies the base value.
- divide: this divides the base value.
- cumulative: if set to 'yes', this special will be cumulative with the base value.
- backstab: if set to 'yes', this special will only apply to the attacker, and only when there is an enemy on the target's opposite side (i.e. when the standard backstab special applies).
- [filter_base_value]: filters on the value before any modifications; uses the keys equals, not_equals, etc.
Extra keys used by the [berserk] special
- value: the maximum number of combat rounds (default 1).
- cumulative: if set to 'yes', this special will be cumulative with other active berserk specials (on the current combatant, not with an opponent's berserk).
Extra keys used by the [plague] special
- type: the unit type to be spawned on kill.
Extra keys used by the [swarm] special
- swarm_attacks_max: the maximum number of attacks for the swarm. Defaults to the base number of attacks. (In Template:DevFeature1.11, defaults to the base number of attacks modified by any applicable [attacks] specials.) If this is specified, then the base number of attacks is ignored.
- swarm_attacks_min: the minimum number of attacks for the swarm. Defaults to zero. Template:DevFeature1.11 This can be set higher than swarm_attacks_max to cause a unit to gain attacks as health decreases.
The ratio of the unit's current to maximum hit points will be used to scale the number of attacks between these two values.
Prior to version 1.11, a [swarm] special will cause [attacks] specials to be ignored. In 1.11 and later, [attacks] specials are applied before [swarm].
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