See Also: Armor
Defense is a result of a mathematical calculation based on Armor, Accessories, and other modifiers levied against the player's Health total. In other words, it determines the difference between how much a source of damage will deal, versus how much damage the recipient will take.
All Defense calculations use the same basic formula. For clarity:
- x ´is the final resulting damage the player will take.
- base will be how much damage the source deals normally; in other words, the damage its attack deals in the wiki info page.
- def is the same number as the total "defense" score in the inventory screen, so the sum of armor plus accessories and modifiers on those items.
- gMode is the multiplier to def which is determined by game mode. This is either 0.5 (1/2) in Normal worlds or 0.75 (3/4) in Expert worlds. It is higher in Expert worlds to balance the increased damage from enemies.
- p is the sum total percentage of all items which, instead of adding to def', reduce damage done to the player by a percentage. Examples are Worm Scarf and Frozen Turtle Shell. Typically, these effects stack. It's represented as decimal instead of just a percentage because 1-p is easier to figure out by hand, but where you see 1-p, you can also think "p" as a percentage.
The formula is:
x = (base - (def * gmode)) * (1 - p)
For example, a hit for 200 points of damage in a Normal world (i.e. 0.5 multiplier) against a person with a Worm Scarf (17% reduction) and 62 total Defense would be:
x = (200 - (62 * 0.5)) * (1 -0.17) x = (200 - 31) * (0.83) x = 169 * 0.83 = 140.27 (140 for our purposes) x = 140.
It's important to note that when an effect reduces armor, such as Ichor, it tends to reduce the def value. Effects which ignore armor altogether reduce this value to 0, but do not affect the percentage bonuses.
The Armor Percent Bonus Exception
Beetle Armor and Solar Flare Armor both provide their defensive percentage bonuses multiplicatively instead of additively. This means, instead of adding their bonuses to p, their bonus is calculated against x. As these are the armors which supply such a bonus, it is safe to assume that "armor percentages" are an additional factor and may weigh in on future armors as well. If we call this new factor ap and treat it as a decimal like we do with p, the new equation is:
x =(1 - ap) * ((base - (def * gmode)) * (1 - p))
This means that damage taken by these melee armors can get unbelievably low. Let's consider Beetle Shell Armor (73 armor with 45% bonus), Frozen Turtle Shell (+25% resist at half health), Worm Scarf (17% resist), Worm Scarf and an Endurance Potion (+10% resist) with that same 200 damage incoming. For fun, we'll make all accessories have the Warding Modifier and assume that one of those is an Ankh Shield (+4 native def) and presume we are in Expert Mode (75% def modifier). This adds +28 def for a total of 111 def:
x = (1 - 0.45) * ((200 - (111 * 0.75)) * (1- 0.52)) x = (0.55) * ((200 - 83.25) * (0.48)) x = 0.55 * (116.75 * 0.48) x = 0.55 * (56.04) x = 30.822 (31 for our purposes, sure beats getting hit for 200).