Damage Scaling

**Damage scaling** is a mechanic introduced in *The Binding of Isaac: Afterbirth* to make certain monsters and bosses more challenging. Some specific entities in the game mitigate high damage attacks, which effectively caps Isaac's damage per second to a maximum amount. The more damage dealt to such an enemy in a short period of time, the more Isaac's damage gets reduced.

The mechanic of damage scaling is conventionally referred to as "armor".

The amount of armor that an entity has corresponds to the "shieldStrength" field in the "entities2.xml" file.

## Overview

* The armor is based on 4 different criteria: how much **base HP** the entity has, how much **damage** it has taken in the last 4 seconds (120 game logic frames), the **value** of its armor (every applicable entity has a specific armor value), and their **starting armor protection** (increases from a value of 0 to 120).
* Every entity in the game is predisposed to make use of this mechanic: in fact, every entity sports a "starting armor protection" counter and an "armor value" field, but few entities actually use it.

## How it Works

* When an entity with an armor value spawns, it starts off with a separate instance of armor. This instance of armor starts off by reducing incoming damage by 99%, and will steadily decrease over the course of 4 seconds at which point it is no longer in effect. This value will increase its "armor deployment" each game logic frame going from 0 (fully armored) to 120 (no longer in effect), and use this value to compute a 'static degree' of damage reduction, separate from this starting armor protection.
	+ In practice, this is only a significant factor in the battle with Delirium, as while it's transformed, its starting armor protection is reapplied. In the cases of all other armored entities, the starting armor protection becomes irrelevant after 4 seconds.

* The entity keeps track of how much *unmodified* damage it has taken in the last 4 seconds, which combined with the 'static degree', the entity's HP, and armor effectiveness results in a multiplier to the actual damage dealt, capping out at a multiplier of 0.09x (in other words, Isaac's tears can never deal less than 9% of his Damage stat). This can stack with the starting armor protection to reduce damage even further.
* The entity's base HP is divided by its armor value to create a soft cap on damage per second (DPS). This soft cap serves as a way to equalize damage coming from Isaac; if his DPS is above this cap, it will be lowered, while DPS values below the soft cap are completely unaffected. The higher Isaac's DPS, the more his damage will be decreased.
* Due to the entity keeping track of how much unmodified damage it has taken in the past 4 seconds, Isaac's damage output will gradually decrease until it is equalized to the DPS soft cap, or the damage instance reaches the point that it is reduced to 9% of its original damage.
* Isaac's Damage stat is also taken into consideration, not just his DPS. If an individual damage instance is greater than 4 times the armored entity's DPS soft cap, that damage will be preemptively decreased, so as to prevent Isaac from obliterating entities in one shot, even if the entity has not been attacked in a period of 4 seconds.
* The overall result of this mechanic is that slow, high-powered attacks are less effective than rapid, lower damage ones; the damage reduction formula has difficulty keeping up with rapid, low damage attacks while slow, high-powered attacks will preemptively have their damage lowered, allowing for such attacks to have their damage equalized more easily.
* Ultimately this mechanic has its limits, as no matter what, each individual attack cannot have its damage reduced below 9% of its original damage, allowing the armor to be overwhelmed if the outgoing damage per second is large enough.

## Bypassing Damage Scaling

* Methods were added to bypass this mechanic, giving Isaac ways to deal full damage by certain means. These ways of dealing damage however do contribute to Isaac's damage per second, which can cause the damage dealt from his other attacks to be lowered as a result of running into the DPS soft cap. The amount of damage dealt through these methods tend to outweigh the downsides of lowering Isaac's damage in most cases.
	+ Bomb damage and most explosive damage in general bypasses damage scaling; most non-explosive bomb effects, however, do not (e.g. the tears fired by , etc).
		- : The initial explosion bypasses damage scaling, the subsequent explosions do not.
		- : The initial explosion bypasses damage scaling, the contact and explosion damage from the ghosts do not.
		- : Both the initial and subsequent explosions deal full damage.
	+ Effects which invoke  (e.g. Black Hearts, , etc), and the damage boosts from  and  bypass damage scaling.
	+ Knockback damage from  and  bypasses damage scaling.
	+ Dark Esau (see Tainted Jacob) bypasses damage scaling with his charge attack.
	+ bypasses damage scaling in all versions of the game.
* The following items that deal explosive damage are exceptions and do not bypass damage scaling:

## Entities with Armor Values

The game enables the armor for the following entities. (However, Delirium only has partial armor; see the note below.)

## Notes

* Delirium only has armor while assuming the form of random bosses. Its armor will start from 0 and increase as damage is taken while transformed; once taking the shape of its true form, it won't have any. Its armor only protects its alternate forms. Every time Delirium transforms, it's partial armor will be reapplied, resulting in considerably more damage reduction than the armor value alone.
* Armor is always actively updated, not only when an entity is taking damage.
* It is possible to apply the armor effect to any entity via editing its entry in `entities2.xml`.
* will lessen Ultra Greed's armor effectiveness by 25%.
* Ultra Greed, Ultra Greedier, and Delirium do not have corresponding "shieldStrength" values in the "entities2.xml" file. However, they nonetheless have damage scaling, so in these cases the mechanic is likely hard-coded.

## Trivia

* Despite the armor attempting to balance damage dealt and keep fights challenging, it's very possible to overwhelm the mechanic and destroy even strong armored enemies like Hush.
* Dark Esau (866.0), Mother's Shadow (867.0), and Dogma's phase 1 angel (950.0) have a "shieldStrength" value in the "entities2.xml" file. However, all of these entities are invulnerable, so it has no effect.