Combat Mechanics

## When a unit attacks

When a unit starts attacking is of course primarily based on its attack cooldown, determined by its attack speed.

The attack cooldown always starts after a unit's attack animation finished completely. In case of ranged or magic attacks, this means when the projectile has hit its target. If it has multiple targets, all of them need to finish first. A Melee attack always takes 0.33s per target (all targets are attacked after another). The length of Ranged attacks depends on the distance to the target. For a target directly in front, it's 0.2s. A Magic attack works the same as a Ranged attack but has an additional 0.3s hold time at the start.

All targets of an attack can not start an attack themselves until the whole attack is finished. In case of multiple targets, this is after all targets have been attacked. This also applies if the target is a friendly unit e.g. for a Heal. They can however still finish an already started attack and their attack cooldown still counts down.

Additionally, in each fight, only one attack can start every 0.3s and during that time frame, attack cooldowns don't count down.

Furthermore, a unit can't attack for 0.05s after it received damage (also applies to Bleeding or Poison). In case of Melee attacks, this is irrelevant because the unit can't attack anyway until the attacker returned to its starting position to finish the attack animation.

A unit's attack cooldown also doesn't count down while it's getting dragged.

In case of ties, the unit that initiated the fight always goes first. If the fight was initiated by dragging Villagers onto an enemy, the initiator is the first unit in the stack. The order then goes through all units *created* after the initiator, then continuous with the oldest unit and then all units created after it. Since enemies are generally always "created" after Villagers, this means it's beneficial to have the oldest unit as the first card in the stack, so that all villagers are after it and therefore before all enemies. However, this only matters in case an enemy has the same attack speed as a villager and only on the very first attack.

## How an Attack is resolved

1. Determine if Hit Chance was met.
2. If hit, determine if a Special Hit (e.g. a Stun or Heal provided by Equipment) triggers. Only one Special Hit can be chosen. For example, if a unit has a 20% Stun chance and a 10% chance to Heal, it has a 70% chance to do a regular hit, a 20% chance to stun and a 10% chance to heal.
3. Determine targets. If not overridden by a Special Hit, the target is a random enemy in the same proportional position. For example, if the attacker is the first unit in its team and the team has 4 units, it occupies the first 25% of its team and attacks a random enemy in the first 25% of the enemy team.
4. There's a 50% chance the damage is increased by 1.
5. Reduce the damage by the block value determined from the defender's Defense.
6. If the attack is effective it deals 40% more damage. Ranged units are effective against Melees, Melees against Magic, and Magic against Ranged.
7. If the attack is completely blocked, there's a 50% chance it deals 1 damage anyway (unless the target is Invulnerable).
8. Round the damage to a whole number
9. If the attack is a Critical Hit, the damage is now doubled (i.e. after it was reduced by the blocked amount and rounded).

## Special Hits

All Special Hits that target enemies also deal damage in addition to applying their effect. If the effect is *Damage* or *Critical Hit* it only deals damage once though.

*See also: Cards that apply Special Hits.*

### Apply Bleeding

Deals 1 damage every 2s for 10s (i.e. 5 times). If the target is already bleeding, nothing happens.

*See also: Cards that apply Bleeding*

### Apply Frenzy

Increases the units Attack Speed by one level (e.g. from *Normal* to *Fast*) for 10s. This can't exceed the maximum speed, so if the target is already at *Extremely Fast*, this is useless. If the target already has Frenzy, its timer is reset to 10s.

*See also: Cards that apply Frenzy*

### Apply Invulnerable

Makes the unit immune against attack damage for 10s. If the target is already invulnerable, nothing happens.

*See also: Cards that apply Invulnerable*

### Apply Poisoned

*See also: Cards that Poison*

Repeatedly deals 3 damage every 60s until the unit dies or is healed with Charcoal. If the target is already poisoned, nothing happens.

### Apply Stunned

Prevents the target from starting an attack for 5s. It's attack cooldown still counts down though. If the target is already stunned, the stun timer is reset to 5s.

*See also: Cards that Stun*

### Critical Hit

Deals twice as much damage (after block).

*See also: How an Attack is resolved and Cards that allow Critical Hits*

### Damage

Leads to a different target being attacked (either a random or all enemies depending on the Special Hit). Due to a bug, this currently also deals double damage (though this isn't shown on the hit damage indicator).

*See also: Cards that have Damage Special Hits*

### Heal

Heals the target by 2, though not more than their Max Health.

*See also: Cards that Heal*

### Lifesteal

Heals the attacker by the amount of damage dealt, though not more than their Max Health. The attack heals for the full damage amount, even if the target has less health and dies with leftover damage.

*See also: Cards that allow Lifesteal*

## Leaving a fight

Units can be pulled out of a fight if the fight was initiated by the player i.e. by dragging Villagers onto an enemy. In that case, it is even possible to completely remove all Villagers from the fight and stop it. This can be useful to pull out Villagers that are getting low on health to prevent them from dying or to pause a fight while a unit is stunned (or possibly all of them e.g. when fighting the Demon).

## Stats

All stats except Health have 6 different possible values named a *Very Weak*, *Weak*, *Normal*, *Strong*, *Very Strong*, *Extremely Strong* (or a variation of this).

For the highest DPS, it's best to increase Damage at least to *Normal* (i.e. +1 since Villagers already start at *Weak*) and then prioritize Attack Speed since it always gives the most DPS increase after that. If Attack Speed is maxed out, Damage gives the next most amount. The DPS increase per Hit Chance level is extremely low in comparison.

Since a *Weak*, *Strong*, and *Extremely Strong* Defense block the same amount of damage as *Very Weak*, *Normal*, and *Very Strong* respectively, it only makes sense to aim for *Very Weak*, *Normal*, and *Very Strong*.

### Attack Speed

How much time has to pass after the previous attack (including animation) finished before the next attack is possible. Villager base speed is Slow.

### Hit Chance

How likely it is that an attack will succeed. Special Effects are only possible on success. Villager base chance is Normal.

### Damage

How much base damage is dealt on a successful hit. There is 50% chance on any attack to deal 1 more damage. Villager base damage is Weak.

### Defense

One damage is blocked for every two points of defense on incoming hits, rounded up. Even if all damage is blocked, there is still a 50% chance to receive 1 damage anyway. Villager base defense is Weak.

 Weak
 Normal
 Strong
 Very Strong
 Extremely Strong

### Relative Damage

How much damage is dealt after factoring enemy defense. If damage is fully blocked there is a 50% chance to deal 1 damage. Also there is 50% chance on any attack to deal 1 more damage.

## See also

* Combat Level
* Rumor: Combat