# AbilityBuilder

# Description

Allows to build abilities that can be cast in battles.

# Methods

# OnReceiveDamage(function)

Is called when the player with the ability receives damage.

AbilityBuilder

# OnDealDamage(function)

Is called when the player with the ability deals damage.

AbilityBuilder

# OnTargetWithSpell(function)

Is called when the player with the ability targets someone with any spell.

AbilityBuilder

# OnTargetedBySpell(function)

Is called when the player with the ability is targeted by someone with any spell.

AbilityBuilder

# OnCalculateStats(function)

Is called when the stats of the player are calculated. This might be called frequently.

AbilityBuilder

# OnNextTurn(function)

Is called when next turn starts

AbilityBuilder

# AbilityOnUse(function)

Is called when the ability used and handles the main part of your ability logic

AbilityBuilder

# AbilityCanUse(function)

Helps to define if the ability currently can be cast or not. If not the ability will be hidden in the ability selection.

AbilityBuilder

# OnTurnEnd(function)

Is called when the turn ends

AbilityBuilder

# CategoryId(categoryId)

Defines the category the ability is grouped in menus. Defaults to ability if not set.

  • categoryId (string) the category

AbilityBuilder

# ManaCost(cost)

Sets the amount of mana required to use the function.

  • cost (int) must be >= 0

AbilityBuilder

# TargetType(type)

The target type. Values are:

  • 0 = FriendlySingle
  • 1 = FriendlyGroup
  • 2 = EnemyGroup
  • 3 = EnemySingle
  • 4 = EnemyAll
  • 5 = All
  • type (int) the target type

AbilityBuilder

# AllowDeadTargets(allow)

Used to define if this ability can target dead participants. If not set the ability will not allow targeting dead.

  • allow (bool) allow to target dead participants

AbilityBuilder

# AllowLivingTargets(allow)

Used to define if this ability can target living participants. If not set the ability will allow targeting living.

  • allow (bool) allow to target living participants

AbilityBuilder

# Build()

Builds the ability to a useable format.

IAbility