# Calculate damage when attacker has bonus but defender has resist

Let's say an archer does base damage of 50. But their equipment provides +30% bow damage to make the damage 65.

The archer is attacking a creature with 20% bow damage resistance.

Is the damage now 52 50 * 1.3 * 0.8

Or is the damage now 55 50+10% because the %30 bonus - 20% resist = 10% bonus.

• The damage is whatever you want it to be. But 52 makes more sense since even the base of attack is done by a bow, no? Or would your attacker get the benefit of +30% bow dmg when he attacks with his offhand dagger? Commented Jan 12 at 7:25
• It can go either way, whichever you prefer. I personally choose the 52 one because that makes resistance easier to understand. Else they'll act more as additive values rather than percentage values. A percentage-based resistance usually blocks more damage the higher the damage is. Commented Jan 12 at 7:38

It would be more logical for the damage to be 52. The damage resistance would apply to whatever damage is dealt to the creature, no mather what bonus the damage has, since the damage resistance bonus of the creature is logically independant of the damage bonus of the player.

In the end, it remains a personal choice.

I noticed you prefixed the archer's bonus with a +, whereas you didn't when stating the creature's resistance. This made me think those two numbers mean different things and shouldn't interact directly (i.e. adding them up).

I can support this claim by considering the edge case of invincibility in your original problem.

Let's assume the target creature had a 100% bow damage resistance buff. (It could be a single-use item effect, for example.) In this case, I would expect the final damage to be zero.

The first equation you proposed yields such expected result:

$$\begin{eqnarray} DMG_{tot} &=& DMG_{bow}\cdot(1+BONUS_{bow})\cdot(1-RESIST_{bow})\\ &=& 50\cdot(1+0.3)\cdot(1-1)\\ &=& 0 \end{eqnarray}$$

The second one, however, does not:

$$\begin{eqnarray} DMG_{tot} &=& DMG_{bow}\cdot(1+BONUS_{bow}-RESIST_{bow})\\ &=& 50\cdot(1+0.3-1)\\ &=& 15 \end{eqnarray}$$

I would be disappointed if I read "100% resistance" on an armour my avatar is wearing, only to discover it didn't prevent me from taking damage.

Moreover, while the first equation describes how a defender absorbs part of the attacker's damage, the second equation implies that the defender actually affects the attack before the blow lands on them. I would consider the latter as a different game mechanic, such as debuff statuses on characters. Here's an example:

An archer attacks with 50 base bow damage. Their equipment provides a +30% bow damage bonus. The target creature has 15% bow damage resistance. The creature is also covered in mud, which hampers the arrows' piercing ability: +5% bow resistance. On the contrary, the archer is sleep-deprived from continuously fighting. This affects their ability to shoot arrows, causing a -10% bow damage malus.

In this scenario, we could merge the two original equations to compute the archer's total damage against the creature:

$$\begin{eqnarray} DMG_{tot} &=& DMG_{bow}\cdot(1+BONUS_{bow}-MALUS_{bow})\cdot(1-(RESIST_{bow}+BONUS_{resist}))\\ &=& 50\cdot(1+0.3-0.1)\cdot(1-0.15-0.05)\\ &=& 48 \end{eqnarray}$$