Damage Engine - Damage Reduction

Level 2
Joined
Jun 19, 2021
Messages
7
Hi,
Is there a way to make damage reduction in a way where I also can make units pierce the damage reduction?

For now I use:
Event DamageEventModifier

Action DamageEvent Amount = Damage Event Amount * 0,80 (20% dmg reduction)

But when I do this, I dont see a way how to make spells or items to "break" the armor, or break a certain amount of the armor ect.
 
Personally, I have armor penetration done by having a "stat" in my ExtendableBonusSystem that I then "bind" to items, buffs or just timed effects in The Defence of the Castle. Note: This is just a framework for "stats". Totally not needed to do what you ask!

Your problem can be solved without it, and instead just a UnitIndexer (such as GUI Unit Indexer 1.4.0.0) and doing something along these lines:

indexSource = Custom value of (DamageEventSource)
indexTarget = Custom value of (DamageEventTarget)
DamageEventAmount = DamageEventAmount * (1.0 - Max(0, DamageReductionPercent[indexTarget] - DamageReductionPenetrationPercent[indexTarget]))

If you "over penetrate" the reduction, I assume you don't want to amplify damage.
If you want other amplifications or "flat" damage reduction, you can add it to the same formula.
Personally I prefer doing math in "custom script", because doing "long" math is annoying in GUI with many clicks!

Also, whenever a unit is spawned (unit indexer event), you'll need to set the values of these to 0 to avoid garbage in these arrays (you can also have unit-type check at that time to have defaults for different unit types if that's something you want!).
 
Back
Top