# Battle Engine

Battle is broken into rounds. During each round, each hero performs an action, so long as they are not knocked out. At the start of each round, all heroes roll for Initiative. This will determine the action order for this round. Each hero rolls between 1 and their Dexterity stat. These Initiative values are then stack ranked and the heroes take turns taking their action one at a time. If a hero is knocked out before their turn, they do not take an action.&#x20;

The specific action a hero takes on their turn is determined by their Attack Pattern, as described previously.

Anatomy of an Attack

The Basic Attack is the most common action that a hero takes during their turn. A basic attack has 2 pieces of metadata associated with it as well as a damage quantity. The metadata determines how the target receives and attempts to counter the attack.

### Attack Affinity

The attacker’s Affinity trait determines the Affinity of the attack. Based on the Affinity of the attack and the defender, the attack may deal bonus or reduced damage for a strength or weakness bonus.&#x20;

For example, Water Affinity is strong against Fire Affinity. So when a Water hero attacks a Fire hero, their attack will deal 20% more damage (or whatever the configured affinity bonus is set to).

### Damage Types

Damage Type is determined by a hero’s Class trait. Based on the type of damage the attack is, the defender will either try to Parry, Absorb or Deflect the attack. Each of these actions tests a different Stat so heroes with different traits are strong and weak against attacks of different types. These are the Damage types:

* Warrior Class - Physical attack type
* Mage Class - Magic attack type
* Engineer Class - Machine attack type

A hero's Class trait also determines what stat they use to determine base damage for their attack.

* Warrior Class - base damage is 100% of Strength stat
* Mage Class - base damage is 100% of Magic stat
* Engineer Class - base damage is 100% of their Mind stat
