Damage calculation - melindil/FTSE GitHub Wiki
Per-hit calculations
The following calculations are performed for any single attack, and each individual hit of a burst attack:
- Select a random number between minimum damage, and maximum damage - 1 (it appears to not be possible to ever do the max damage of a weapon)
- Multiply damage by multipliers for critical hit effect and 1 + ammo damage rating, and round damage down to an integer value
- Multiply target's damage threshold by (1 - ammo penetration), round down to an integer value, and subtract this from the damage roll
- Calculate effective damage resistance: 1 - (target's resistance * (1 - ammo penetration) / 100)
- Multiply damage roll by effective damage resistance and round down
- Multiply by damage factor from weapon mode and round down
Once damage from all hits (single or burst) are added, apply the following to the total:
- If damage type is electrical, multiply by 0.5 if target is living, and 1.5 if target is mechanical. Round down result.
- Add +5 if attacker has Living Anatomy perk, and target is living
- Apply attacker's Bonus Damage rating (as a multiplier: 1 + rating/100) and round down
- Multiply damage by 1.15 if attack type is Unarmed and the attacker has Bonus H2H Attacks perk (note that this is probably a bug - should be Bonus H2H Damage), and round down
- If attacker has Silent Death perk, is behind target and sneaking, and using Unarmed, double the damage
- Multiply damage for difficulty. If attacker is a player, multiply by 1.429, 0.769, or 0.5 for easy, hard, or insane difficulty. If target is a player, multiply by 0.7, 1.3, or 2.0 for easy, hard, or insane difficulty.