Modding: Combat Abilities

This article is updated for Update 14.

Combat abilities are defined in the file Abilities.txt.

In this file you can define what each ability does, how many times it can be used in combat, and other parameters.

**Note**: Every ability must have it's display name defined in the localization file Texts.txt using the following format:

```
abilities.protectionspell.name=Protection Spell

```

## Ability Icon

You may define the name of the icon to represent the ability in the toolbar. This value is optional, and defaults to "ability\_hex" where hex is the ability's ID.

Format:

```
abilities.entity.fraggrenade.sprite=ability_grenade

```

In the example above, the image named "ability\_grenade" will be used to represent the "fraggrenade" ability. This is useful when several abilities use the same action.

Ability images are normally 256x256 pixels.

See Modding: Adding Images to Mods for more information on how to add new images.

## Target Mode

Each ability defines what kind of targets are valid for it:

```
abilities.entity.vodoodoll.targetmode=Enemy

```

Valid target modes are:

* "AnyUnit" - any unit may be targeted
* "Enemy" - only enemy units may be targeted
* "Ally" - only allied units may be selected
* "Tile" - any position on the map may be selected whether someone is on it or not
* "Self" - the target is the user of the ability, no target selection required

## Ability Properties

Abilities may have any of the following properties:

Example:

```
abilities.entity.fraggrenade.properties.damage=30
abilities.entity.fraggrenade.properties.aoe=2
abilities.entity.fraggrenade.properties.range=4

```

Frag grenade has a throw range of 4 tiles, and an area of effect of 2 tiles, and it does 30 damage to units within that area.

## Ability Effects

Abilities may apply status effects on units within the area of effect:

```
abilities.entity.flashbang.effect.flashbang=30

```

In this example, the "flashbang" ability applies a "flashbang" status effect for 30 seconds.

See Modding: Status Effects for more information on defining status effects.

## Visual and Audio Effects

You may define the visual and audio effects that take place when using an ability:

```
abilities.entity.flashbang.performanimation=Handling
abilities.entity.flashbang.triggeranimation=Throwing
abilities.entity.flashbang.effectprefabs=GrenadeProjectilePrefab,FlashbangExplosionPrefab
abilities.entity.flashbang.effectsounds=grenade_throw,grenade_explode

```

When performing the "flashbang" ability, a survivor will first do the "Handling" animation for the perform duration, followed by a "Throwing" animation.

After the survivor animations, a "GrenadeProjectilePrefab" effect will appear followed by a "FlashbangExplosionPrefab" effect. The sound effects "grenade\_throw" and "grenade\_explode" will be played timed with the visual effects.

See the original configuration files for available prefab, animation, and sound values.

See Modding: Adding Audio to Mods for more information on adding custom sounds.

## Ability Class

The ability class defines how it selects its targets. There are two options:

* SingleTargetAbility - the ability will only affect it's target. Should not be used with "Tile" targeting mode.
* GrenadeAbility - the ability will affect any unit within it's area of effect. Can be used with any targeting mode.