Jump to content

Combat Damage Modification

Recommended Posts

I'm trying to modify damage taken before armor checks and in a non-multiplicative manner.

Specifically, I'm making a "heavy armor" component which grants a fixed damage reduction that should go before everything else.
For example, if the damage reduction is 10 then when a character wearing this armor is attacked, the damage should be reduced by 10 and then the entire combat mechanism should do its job.

After the damage reduction takes place I want the normal armor damage reduction, so I can't make the armor component do this work.
I also don't want any of the absorbed damage to affect the equipped armors and wear them down.

Ideally I would wrap the function Inventory:ApplyDamage with my mechanism and alter the damage before the inventory does its work, but I can't do that since it's a local function.

I looked at combat.lua to see if I could interject in the process somehow.
I found Combat:GetAttacked and Combat:CalcDamage, but I didn't see any way for me to do what I want.
The effects should occur after the damage calculation is performed but before the inventory applies the damage to the equipped armor.

Any ideas on how I can do this?
Of course, I could always replace inventory.lua or combat.lua, but that seems extremely intrusive and I imagine it would require constant updating with the game.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...