Skip to content

PerformAttack

An attack action deals direct damage to each resolved target. Add it to a skill's actions array with type: "attack".

Damage strength

damage_value scales the attacker's effective attack. For example, damage_value: 1.5 starts with 150% of the attacker's effective attack before the damage type, critical hit, and other modifiers are applied.

base_damage = damage_value × attacker.attack × attacker.damage_multiplier

Damage types

normal
Applies defence and damage reduction.
true
Ignores defence and damage reduction.

Both damage types can produce critical hits and are absorbed by shields. True damage ignores only defence and damage reduction.

See Damage calculation for the complete formulas and rounding rules.

Resolution order

Cowculator resolves an attack action in this order:

  1. Resolve the action's targets.
  2. Check the action's chance independently for each target.
  3. Calculate the hit's damage and critical chance.
  4. Apply the target's shields, then reduce health with any remaining damage.
  5. Restore health through lifesteal when the attacker has an active lifesteal buff.

A missed target takes no damage. If the attacker has an active double_attack buff, a successful attack action performs up to two hits against that target. Each hit recalculates its damage and critical chance, but the action's initial chance check is not repeated.

See Attack modifier buffs for lifesteal and double-attack behavior.

Example

This active skill performs a normal attack against the opposing fighter:

{
  "skill_id": "heavy-strike",
  "name": "Heavy Strike",
  "chance": 1.0,
  "actions": [
    {
      "type": "attack",
      "name": "Heavy hit",
      "chance": 1.0,
      "target_type": "enemy",
      "damage_value": 1.5,
      "damage_type": "normal"
    }
  ],
  "energy_cost": 40
}

Looking for exact fields?

Use the OpenAPI reference for the complete attack action schema and validation rules.