Skip to content

PerformHeal

A heal action restores health or energy to each resolved target. Add it to a skill's actions array with type: "heal".

The caster is the fighter using the skill. The target is selected by the action's target_type. For target_type: "self", the caster and target are the same fighter.

Heal types

Choose a heal type based on the resource to restore and the value that should determine the amount.

Health healing types

health.type Heal amount
flat The configured health.value
current_health_percent Target's current health × health.value
maximum_health_percent Target's maximum health × health.value
attack_percent Caster's current effective attack × health.value
initial_attack_percent Caster's original configured attack × health.value

Energy heal types

energy.type Heal amount
flat The configured energy.value
current_energy_percent Target's current energy × energy.value
maximum_energy_percent Target's maximum energy × energy.value
attack_percent Caster's current effective attack × energy.value
initial_attack_percent Caster's original configured attack × energy.value

For percentage types, value is a multiplier: 0.25 means 25% and 0.5 means 50%. Current effective attack includes active stat increases and reductions when the heal resolves. Original configured attack is the caster's attack before battle statuses modify it.

For flat healing, value is the requested whole number of health or energy points. Fractional flat values are rejected.

Resolution order

Cowculator resolves a heal action in this order:

  1. Check the action's chance once.
  2. Resolve the action's target set.
  3. Calculate the requested healing from the selected heal type.
  4. Round percentage-based healing half up.
  5. Restore the resource up to the target's maximum.

If the action's chance check fails, no target receives healing. With target_type: "all", a successful chance check processes both fighters, but the amount restored can differ because of their current resources and limits.

Configure a heal action

Put the selected heal type and its value inside the resource it restores:

  • Use health to restore health
  • Use energy to restore energy

A single action restores one resource, so include one of these objects rather than both.

Health-healing example

This action restores 25% of the target's maximum health:

{
  "type": "heal",
  "name": "Recover",
  "chance": 1.0,
  "target_type": "self",
  "health": {
    "type": "maximum_health_percent",
    "value": 0.25
  }
}

If the target has 1,000 maximum health, the requested heal is:

1,000 × 0.25 = 250 health

Energy-healing example

This action restores half of the target's maximum energy:

{
  "type": "heal",
  "name": "Recharge",
  "chance": 1.0,
  "target_type": "self",
  "energy": {
    "type": "maximum_energy_percent",
    "value": 0.5
  }
}

If the target has 100 maximum energy, the requested heal is:

100 × 0.5 = 50 energy

Rounding and resource limits

Cowculator rounds percentage-based healing to a whole point using round-half-up. For example, 10.5 becomes 11.

Healing cannot raise health or energy above the target's maximum. If a fighter has 950 of 1,000 health and receives a requested heal of 100, only 50 is applied. The heal event records both values so clients can distinguish the requested heal from the amount that restored the resource.

Looking for exact fields?

Use the OpenAPI reference for the complete heal action schema, supported types, and validation rules.