New Damage Resistance System


This new system actually allows you to set all undefined Damage Resistances at the same time rather then needing to remember to set all Damage Factors manually. It does this by giving you access to a whole new set of Actor Properties. These are Resistance and [Damagetype]_Resistance. Lines 127-164

The new system also allows you to update resistance values at any time! The days of Damage Factors being set in stone upon creation are done!

While the new system is technically better it does have its downsides. One is that it is not blind to inheritance. This means that if you set a specific Resistance in the parent class the child class cannot override it with Resistance. My advice is to use specific resistance properties sparingly in parent classes. If you do want a specific resistance to use the base Resistance property you can set the specific resistance to -1.0.

In this example Omniaxe_Resistance will get set to 1.0 in the child

Another con of the new system is that new damage types are not created automatically like with Damage Factors. You can still use Damage Factors, but if you use both they will multiply together. New damage types have to be added manually into RFEnemyBase class which is easy but requires a lot of copy pasting.

In this Example damage from the Omniaxe will be 4 times normal!

The new Damage Resistance system uses the CalculateHealthDamage( ) function to do all of the magic. Its super basic and just checks if the specific damage type should be used or if the base resistance actor property should be used instead. Its Virtual so you can fully customize how it works if you need to in child classes. Lines 2052 - 2299


Armor and Shield

Resistance


The new resistance system extends to cover armor and shields! This means that you can dynamically control those resistances as well.

Much like the normal resistances you can set Armor and Shields resistances using a new collection of Actor Properties. Lines 169-205 and Lines 289-325

ArmorResistance
ShieldResistance
[Damagetype]_ArmorResistance
[Damagetype]_ShieldResistance

ArmorResistance , and ShieldResistance work in the same way as Resistance.

[Damagetype]_ArmorResistance , and [Damagetype]_ShieldResistance work in the same way as [Damagetype]_Resistance.

Armor and Shield Resistance both come with new virtual functions as well. They work in the same way as CalculateHealthDamage( ).

CalculateShieldDamage( )
CalculateArmorDamage( )