Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

Clopen

Combat Damage Modification

Recommended Posts

Clopen    12

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.

Share this post


Link to post
Share on other sites
Clopen    12

Oh, you're right.
I just automatically assumed it was local because it's a "class" function.

Thanks. =)

Share this post


Link to post
Share on other sites