You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

27 lines
1.1 KiB

```cpp
CurrentDamageValue = Source.WeaponDamage * Ability.WeaponDamageScaling
if : Rand(0,1) < Source.CriticalHitChance
CurrentDamageValue = CurrentDamageValue * Source.CriticalHitDamage * Target.CritResist
if : Rand(0,1) < Source.UberCriticalHitChance
CurrentDamageValue = CurrentDamageValue * Source.UberCriticalHitDamage
CurrentDamageValue = CurrentDamageValue * Source.GetElementalDamageValue(Ability.DamageType)
```
-----
```cpp
if : Target.Armor - Source.ArmorPenetration >= 0 && Target.Armor >= 0
CurrentDamageValue = CurrentDamageValue * ((ARMOR_EFFICENCY) / (ARMOR_EFFICENCY + (Target.Armor - Source.ArmorPenetration))
else :
CurrentDamageValue = CurrentDamageValue * (2 - (ARMOR_EFFICENCY) / (ARMOR_EFFICENCY + (Target.Armor - Source.ArmorPenetration))
CurrentDamageValue = CurrentDamageValue * Target.DamageReduction * Target.GetElementalResistValue(Ability.DamageType) - Target.FlatDamageReduction
if : Rand(0,1) < Target.BlockChance
CurrentDamageValue = 0
if : Rand(0,1) > Source.HitChance
CurrentDamageValue = 0
```
-----
```cpp
return CurrentDamageValue
```