[Mod Question] Changing the way armor works

flat damage decrease possible?

I am working on a balance overhaul and it would be great to re-work the way armor works but I can't find anywhere in the lua files that determines the amount of damage mitigation from armor.  If anyone could help me out telling me what file it is in that would be great.

1,519 views 4 replies
Reply #1 Top

Out of curiousity, how do you want it to work?

Reply #2 Top

lua/game.lua

Here is the main functions:

function CalculateArmorDamage(damage, armor)
    return damage - (damage * CalculateArmorMitigation(armor))
end

function CalculateArmorMitigation(armorVal)
    local rate = GameData.ArmorMitigationRate
    local armorRate = (armorVal or 0) * rate
    local armorMit = armorRate / (1 + armorRate)
    return armorMit
end

The mitigation rate is defined earlier in the gamedata table of the same file:
    ArmorMitigationRate = 0.0004,

Enjoy!

Reply #3 Top

Ahh thanks alot

 

And to Horse Strangler I want to rework it so it provides a more flat slope as you get armor so it doesnt start barely going up if you stack it.  Reworking the stat sytem though so it wouldn't make armor stacking invincible.

Reply #4 Top

Quoting Pyapiopi, reply 3
Ahh thanks alot

 

And to Horse Strangler I want to rework it so it provides a more flat slope as you get armor so it doesnt start barely going up if you stack it.  Reworking the stat sytem though so it wouldn't make armor stacking invincible.
End of Pyapiopi's quote

Uhh... question for you

At which point is increasing the amount of mitigation by 10% the most beneficial? When you have 10% (10 -> 20), or when you have 50% (50 -> 60)?

Is the 10% better? The 50% better? Or are they the same?

 

Answer: The 50% is better. If you're taking 50% of damage from everything and make it 40% you're reducing the nominal damage by 20%. If you were taking 10% and make it 20% you're reducing the nominal damage by 12.5%. On the current system, Armor increases your Effective HP linearally which is what we really care about.