HbmMods / Hbm-s-Nuclear-Tech-GIT

A flaming wreck of a minecraft mod about nuclear technology that is somehow still in development.
GNU General Public License v3.0
402 stars 280 forks source link

On the problem of armor bonus #1659

Closed 2Canned closed 2 months ago

2Canned commented 2 months ago

Hello, I have some questions about armor. First:how the damage limit works. Second: what is the working order of the armor's damage protection bonus. I hope you can provide a more clear illustration,Thank you very much

TheChosenIndividual commented 2 months ago

im pretty sure the damage limit means...well...that, that there is only so much damage a single hit can do to you, and anything over that is simply nullified, as for the damage protection bonus, it says that ingame, so it shouldnt be hard to make a spreadsheet or something with that

HbmMods commented 2 months ago

Each set of armor has a protection value, i.e. the maximum amount of damage where the protection applies, by default this value is 100, although higher tier armors may have a larger value (lunar has 500, RPA has 1500, FAU has 1000 and HEV has 500).

The first step at calculating the damage value is removing any damage above this protection value and storing it for later use, for example if the incoming damage is 120 and the protection value is 100, we remove 20 which we save and do the calculation with the remaining 100.

Then we calculate the damage threshold which is a flat subtractor, a damage threshold of 20 on 100 damage would result in 80.

Then, all resistances are applied which are multiplicative and can stack should multiple apply. Assuming a general damage multiplier of 0.5 and a projectile protection multiplier of 0.75, and that the incoming damage is a projectile, the damage would be 80 * 0.5 * 0.75 = 30.

Afterwards the damage cap is applied, if the damage is above the damage cap then it will simply be reduced. Assuming a damage cap of 10, the 30 will simply be reduced to 10.

The final step is adding back the amount above the protection value from the first step since that amount wasn't affected by the armor calculation at all, which was 20, with the final damage being 10 + 20 = 30.