adibarra / enchant-tweaker

Tweak many enchantment related mechanics while keeping the vanilla minecraft feel.
https://modrinth.com/mod/enchant-tweaker
MIT License
4 stars 0 forks source link

feat: Multiplicative Protection #14

Open James103 opened 1 year ago

James103 commented 1 year ago

What does it do?

When the tweak is enabled, instead of the Protection enchantment reducing damage taken by (4 × level)% in a linear fashion, each level of the enchantment multiplies the damage taken by 0.96.

In other words, the vanilla formula of the Protection enchantment, $$y = 1 - \min(0.04 \times \text{level}, 0.8)$$ is replaced with the multiplicative formula $$y = 0.96^{\text{level}}$$ where $y$ is the multiplier to damage taken from the Protection enchantment and $\text{level}$ is the sum of the levels of the Protection enchantments on the player's armor.

With Protection IV on all pieces, the vanilla formula multiplies damage taken by $1 - 0.04 \times 16 = 0.36$, equivalent to a 64% reduction, while the proposed formula multiplies damage taken by $0.96^{16} \approx 0.52$, equivalent to a 48% reduction.

With the proposed formula, a full set of armor with a mix of Protection VI and VII is required to get the same damage reduction as a full set of Protection IV in vanilla. Similarly, maxing out the damage reduction at 80% will require Protection X on all pieces instead of Protection V.

Why add it?

The multiplicative formula easily allows Protection to be extended to higher levels beyond the vanilla limits while still keeping combat balanced, which is good for some modpack developers. If Protection scaled linearly and was uncapped, the damage reduction would exceed 100% with a full set of Protection VII or higher, making the entity immune to almost all damage and making for an unbalanced fighting experience.

The net result of the tweak is that for small amounts of Protection, such as Protection I or II on a single piece, the reduction in effect is negligible; however, the player is incentivized to use Protection levels greater than the vanilla maximum to maintain a similar level of damage reduction.

Anything else?

The tweak may be incompatible with other mods that modify how the Protection effect works; in these cases, one of the other mod's tweak or this tweak will need to be disabled.

Before submitting...

adibarra commented 1 year ago

Hello! Thanks for the detailed suggestion. I think your idea meshes well with the mod's vision. I'll start looking into which changes I need to make.

James103 commented 1 year ago

Would this also affect specialized Protection enchantments such as Fire Protection, Blast Protection, Projectile Protection, and Feather Falling?

adibarra commented 1 year ago

I'll add an option to the config to select the types of protection enchantments affected. That way each player can individually decide for themselves.