damage formula

Nirran

Vault Senior Citizen
Modder
I want to fine tune my combatdamag script,who can tell me the formula of vanilla and what each separate value does ,for instance what does armor value do?i over looked this when writing my script
 
Weapon:
base_dmg - weapon base damage (Random (min, max) damage)

Ammo modificators:
DT_mod1 - Damage Treshold modificator 1
DT_mod2 - Damage Treshold modificator 1
DR_mod- Damage Resistance modificator

Armor modificators:
DT - Damage Treshold
DR - Damage Resistance

SIMPLE formula is:

dmg_result = [base_dmg * (DT_mod1/DT_mod2) - DT] - [base_dmg * (DT_mod1/DT_mod2) - DT] * [DR + DR_mod]


where:
if
[base_dmg * (DT_mod1/DT_mod2) - DT] < 0
then
[base_dmg * (DT_mod1/DT_mod2) - DT] = 0

if
[DR + DR_mod] <0
then
[DR + DR_mod] = 0

if
[DR + DR_mod] >1
then
[DR + DR_mod] =1


Example:
weapon Pistol 10mm with base damage 5-12, so for example random damage is
base_dmg = 11

Ammo JHP 2/1 +25%:
DT_mod1 = 2
DT_mod2 = 1
DR_mod = 25% = 0.25

Armor is Metal Armor 4/30%
DT = 4
DR = 30% = 0.30

calculations:
[base_dmg * (DT_mod1/DT_mod2) - DT] = 11 * (2/1) - 4 = 18
[DR + DR_mod] = 0.30 + 0.25 = 0.55

dmg_result = 18 - 18 * 0.55 = 18 - 9 = 9; (value 18 * 0.55 is truncated, not rounded)
 
Back
Top