PerformAttack¶
What is an Attack?¶
An attack is a skill action that attempts to deal damage to one enemy in battle. In Cowculator, attacks are the primary way units inflict harm on enemy.
What is PerformAttack?¶
PerformAttack is the core action handler responsible for resolving skill actions of type attack in Cowculator. It encapsulates all logic related to damage computation.
There are two types of damage:
normal: Damage is affected by the target's defense and damage reduction.true: Damage ignores the target's defense and damage reduction.
See Damage Type for the differences, and damage-calculation for how each type affects the outcome.
Example (normal Attack)¶
{
"skill_id": "1001",
"name": "Squeezy Squeezy Dragon Claw",
"chance": 1.0,
"actions": [
{
"data": {
"type": "attack",
"damage_value": 1.1,
"damage_type": "normal" //(1)!
},
"name": "Attack",
"chance": 1.0,
"target_type": "single_enemy"
}
],
"energy_cost": 40
}
- Indicate it is a
normalattack type.