I am curious how different damage-reducing rules in Dungeons & Dragons 5th Edition play with one another. Mainly, it is an order-of-operations question.
There are the more common effects: Damage Vulnerability, Damage Immunity, and Damage Resistance, as well as damage-reducing effects when a creature succeeds on a saving throw caused by certain spells, like fireball. However, there are also Damage Thresholds, and sometimes a static reduction in damage as outlined by the Heavy Armor Master feat (PHB, page 167).
Theoretically, if a creature or object could get a set of four of these benefits at once (outlined below), in which order would they take effect?
- Damage resistance
- Halved damage from a spell effect or similar (like from fireball)
- Damage threshold (as per Object rules, DMG page 247)
- Damage reduction (as per Heavy Armor Master, PHB page 167)
Example
For example, imagine a theoretical golem that has the following properties:
- it has resistance to all damage.
- it has a Damage Threshold of 7.
- all damage it takes is reduced by 3.
Now imagine this golem has just succeeded on its save against fireball. It is receiving 40 fire damage before any modifiers. How much damage will this golem take? What are the calculations made to determine this?
Best Answer
First the saving throw, then damage reduction, then resistance, and finally the threshold
This answer will largely rely on two previous question and the rules on resistance/vulnerability:
These give us most of the rules we need to adjudicate the damage taken by your monster; in particular we know from the quoted rule above that resistance is applied last and, to quote the first question linked:
We also know from the second question I linked that (direct quote):
This lets us know that all of these can apply to a single instance of damage. Furthermore, notice that the saving throw will always be the first thing that happens; if we succeed on it, the damage will immediately be halved; if we fail it, the damage will not be reduced. Then we apply any damage reduction (such as the Heavy Armor Master feat), and finally we apply any resistances we may have.
The question left is when does the damage threshold come into play? Let's look at the rules on "Damage Thresholds":
Thus this is simply a final check we have to make after having totalled up the expected damage. If that total meets or exceeds the threshold then the creature takes that much damage, if the total is less than the threshold then the creature takes 0 damage.
And so we've arrived at the following ordering:
Here is an example using your numbers assuming the creature takes 40 damage:
Assuming the creature takes 33 damage:
If you're interested in a mathematical formula/interpretation you may use the following where X is the initial damage:
$$ \left \lfloor{ \frac{ \left \lfloor{ \frac{ x }{ 2 } }\right \rfloor - 3 }{ 2 } } \right \rfloor $$
Another way to explain this formula is the following:
If the initial damage is 33 or less, the creature takes 0 damage.
If the initial damage is 34-37 (including the ends), the creature takes 7 damage.
If the initial damage is 38-41 (including the ends), the creature takes 8 damage.
If the initial damage is 42-45, the creature takes 9 damage.
And so forth...
Looking at the above facts we can see that another way to calculate this is to take the total initial damage, subtract six, divide it by 4, and round down. Or in a formulaic form:
$$ \left \lfloor{ \frac{ x - 6 }{ 4 } }\right \rfloor $$
Another way to arrive at this formula is to use the following equality to our previous formula, this equality holds true for all positive integers h:
$$ \left \lfloor{ \frac{ \left \lfloor{ x }\right \rfloor + k }{ h } } \right \rfloor = \left \lfloor{ \frac{ x + k }{ h } } \right \rfloor \rightarrow \left \lfloor{ \frac{ \left \lfloor{ \frac{ x }{ 2 } }\right \rfloor - 3 }{ 2 } } \right \rfloor = \left \lfloor \frac{ \frac{ x }{ 2 } - 3 }{2} \right \rfloor = \left \lfloor{ \frac{ x - 6 }{ 4 } }\right \rfloor $$
The graph looks like this with the X-axis being the initial total damage and the Y-axis being the resulting final damage:
Notice that until you reach a damage of 34 the creature will take 0 damage and then at 34 it will take 7 damage. Also note that the end of each line is somewhat misleading. At a value such as 38 which is on two lines, the correct final damage is the higher number. So at 38 the creature would take 8 damage, not 7. Also, yes, the function provided is not exactly the graph shown, I had to make a piecewise so that it was always 0 when the initial damage was 33 or less, but the rest is identical to the formulas given.