Difference between revisions of "Weapon Damage Formula"

583 bytes added ,  15:34, 24 December 2008
Add information about critical hit damage
imported>SnakeChomp
m (Minor formatting)
imported>SnakeChomp
(Add information about critical hit damage)
Line 1: Line 1:
=== Variables ===
=== Variables ===
;Weapon damage listed on the [[Weapons|weapon form]] = D
;Weapon damage listed on the [[Weapons|weapon form]] = D
;Weapon crit damage listed on the [[Weapons|weapon form]] = CritD


;[[fDamageWeaponMult]] = DM
;[[fDamageWeaponMult]] = DM
Line 27: Line 29:


;Actor strength value = Str
;Actor strength value = Str
;IsCriticalHit
:This value is 1 if the attack was a critical hit, 0 otherwise


;All perks with a "Calculate weapon damage" entry point = PerkModifiers(x) => y
;All perks with a "Calculate weapon damage" entry point = PerkModifiers(x) => y
:Note that consumables which increase damage, such as the Yao Guai Meat, are implemented by adding a perk to the actor which has a "Calculate weapon damage" entry point for the duration of the effect.
:Note that consumables which increase damage, such as the Yao Guai Meat, are implemented by adding a perk to the actor which has a "Calculate weapon damage" entry point for the duration of the effect.
;All perks with a "Calculate my critical hit damage" entry point = PerkCritModifiers(x) => y


=== Gun Formula ===
=== Gun Formula ===
  Gun Damage = PerkModifiers(DM * (GunCB + (GunCM * C)) * (D * SB + S * SM))
  Gun Damage = IsCriticalHit * PerkCritModifiers(CritD) + PerkModifiers(DM * (GunCB + (GunCM * C)) * (D * SB + S * SM))


=== Melee Formula ===
=== Melee Formula ===
  Melee Damage = PerkModifiers((StrM * (Str + StrB)) + DM * (MeleeCB + (MeleeCM * C)) * (D * SB + S * SM))
  Melee Damage = IsCriticalHit * PerkCritModifiers(CritD) + PerkModifiers((StrM * (Str + StrB)) + DM * (MeleeCB + (MeleeCM * C)) * (D * SB + S * SM))


=== Unarmed Formula ===
=== Unarmed Formula ===
To be determined
To be determined
=== Notes ===
If the value returned by PerkModifiers is 0, the game engine considers the attack to have missed. No blood spatter is made, no hit sound effect is played, and the attack cannot critically hit, even if the critical hit chance is 100% or more.
Anonymous user