Difference between revisions of "GetThreatRatio"

966 bytes added ,  19:08, 12 July 2022
→‎Description: simplified presentation of the math involved, based on reverse engineering
imported>Egocarib
(→‎Description: simplified presentation of the math involved, based on reverse engineering)
Line 2: Line 2:


[[GetThreatRatio]] returns the calculated threat ratio between two specified actors.
[[GetThreatRatio]] returns the calculated threat ratio between two specified actors.
A single actor's threat level is calculated using the formula below. The threat ratio between two actors is one actor's threat level divided by the other actor's threat level.
<math alt="Threat level = Estimated DPS times (Health / (1 - min(0.99, fArmorScalingFactor times Damage Resist divided by 100))">
Threat\ Level = Estimated\ DPS \times \dfrac{Current\ Health\ AV}{1 - \operatorname{min}\left(\dfrac{fArmorScalingFactor \times Damage\ Resist\ AV}{100} , 0.99\right)}
</math>
For the threat level calculation, the armor's estimated defense and estimated offense are multiplied together. The estimated defense is their current health, divided by the inverse of their armor protection (their Damage Resistance [[actor value]] scaled by the ''fArmorScalingFactor'' [[Game Settings|game setting]]). The estimated offense is the actor's estimated DPS (damage per second) given their currently equipped [[weapon]] (defaulting to the Unarmed weapon) and [[ammo]].


==Syntax==
==Syntax==
53

edits