Damage Calculation

* Any **boosts** combine additively. (e.g. 60% boost and 30% boost = 90% boost).
* Any **resistances** combine diminishingly. (e.g. 40% resistance and 50% resistance = 70% resistance)
* Any **weaknesses** combine additively with eachother.

Damage is calculated at two points. Once when the unit sends **outgoing damage**, and once when the damage hits the target unit (**incoming damage**). Outgoing damage is first calculated by taking the base damage of the attack or spell and adding up all the boosts. This damage is then sent out to the target. When the damage hits the target, weaknesses and resistances get applied to the damage, then the final damage is dealt to that unit.

### Calculations

#### Outgoing Damage

Outgoing damage first takes the damage of the unit, adds up all the boosts additively, then multiplies that boost into the damage to calculate outgoing damage.

e.g. A unit casts 300 magic damage spell, with a 50% magic damage boost and a 20% ability damage boost:

O
u
t
g
o
i
n
g
D
a
m
a
g
# e
b
a
s
e
D
a
m
a
g
e
∗
b
o
o
s
t
F
a
c
t
o
r

{\displaystyle OutgoingDamage=baseDamage\*boostFactor}

b
o
o
s
t
F
a
c
t
o
# r
1
∑
b
o
o
s
t
# s
1
0.5
# 0.2
1.7

{\displaystyle boostFactor=1+\sum boosts=1+0.5+0.2=1.7}

O
u
t
g
o
i
n
g
D
a
m
a
g
# e
300
∗
# 1.7
510

{\displaystyle OutgoingDamage=300\*1.7=510}

#### Incoming Damage

Incoming damage takes the damage that hits the unit, adds up resistances diminishingly and weaknesses additively, then multiplies these factors to calculate the final damage.

e.g. A unit is about to take 510 magic damage. This unit has 20% magic resistance, 50% damage resistance, and has a 100% weakness to magic damage.

I
n
c
o
m
i
n
g
D
a
m
a
g
# e
b
a
s
e
D
a
m
a
g
e
∗
r
e
s
i
s
t
a
n
c
e
F
a
c
t
o
r
∗
b
o
o
s
t
F
a
c
t
o
r

{\displaystyle IncomingDamage=baseDamage\*resistanceFactor\*boostFactor}

r
e
s
i
s
t
a
n
c
e
F
a
c
t
o
# r
1
∗
Π
(
1
−
r
e
s
i
s
t
a
n
c
e
s
# )
(
1
−
0.2
)
(
1
−
0.5
# )
0.4

{\displaystyle resistanceFactor=1\*\Pi (1-resistances)=(1-0.2)(1-0.5)=0.4}

b
o
o
s
t
F
a
c
t
o
# r
1
∑
b
o
o
s
t
# s
1
# 1
2

{\displaystyle boostFactor=1+\sum boosts=1+1=2}

I
n
c
o
m
i
n
g
D
a
m
a
g
# e
510
∗
0.4
∗
# 2
408

{\displaystyle IncomingDamage=510\*0.4\*2=408}

## Maximizing Damage

While boosts on outgoing damage and weaknesses to incoming damage combine with themselves additively, they'll effectively combine with **eachother** multiplicatively.

For example, consider a unit with a 500 magic damage spell. The unit has a 100% boost to their ability damage, and another 100% boost to magic damage. This means that the outgoing damage will be 1500, and thus the final damage on a vanilla target is 1500.

Now, instead consider the same unit with a 500 magic damage spell with a 100% ability damage boost. However, instead of having an additional 100% magic damage boost, their target has a 100% magic damage weakness. This means that the outgoing damage will be 1000 damage, but the incoming damage will be doubled due to the weakness, creating a final damage of 2000.

This means that in order to maximize damage, you need an **equal spread of weaknesses on the enemy, as well as boosts** on your unit.