Skip to content

PerformHeal

What is a Heal?

In Cowculator, a heal is a skill action that restores either health (HP) or energy to a player during battle. Healing helps players recover from damage or replenish energy spent on skills.

What is PerformHeal?

PerformHeal is the action handler responsible for resolving skill actions of type heal in Cowculator.

The type of healing performed is determined by the heal_type field, which can specify either health or energy healing.

Supported Heal Types

Health Healing (heal_type from HealthHealTypeEnum)

  • health_flat: Restore a fixed amount of HP.
  • health_curent_percent: Restore a percentage of the target’s current HP.
  • health_max_percent: Restore a percentage of the target’s max HP.
  • health_attack_percent: Restore HP based on the caster’s current attack stat.
  • health_initial_attack_percent: Restore HP based on the caster’s attack stat at the time the heal was applied.

Energy Healing (heal_type from EnerygyHealTypeEnum)

  • energy_flat: Restore a fixed amount of energy.
  • energy_curent_percent: Restore a percentage of the target’s current energy.
  • energy_max_percent: Restore a percentage of the target’s max energy.
  • energy_attack_percent: Restore energy based on the caster’s current attack stat.
  • energy_initial_attack_percent: Restore energy based on the caster’s attack stat at the time the heal was applied.

Example "Health Heal"

{
    "skill_id": "1002",
    "name": "Undying Xiao Qiang",
    "chance": 1.0,
    "actions": [
        {
            "data": {
                "type": "heal",
                "heal_value": 0.5,
                "heal_type": "health_curent_percent"
            },
            "name": "Heal",
            "chance": 1.0,
            "target_type": "self"
        }
    ],
    "energy_cost": 20
}

Example "Energy Heal"

{
    "skill_id": "1003",
    "name": "Charge Like Xiao Qiang",
    "chance": 1.0,
    "actions": [
        {
            "data": {
                "type": "heal",
                "heal_value": 0.5,
                "heal_type": "energy_max_percent"
            },
            "name": "Heal",
            "chance": 1.0,
            "target_type": "self"
        }
    ],
    "energy_cost": 20
}