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 Fire Protection #37

Open James103 opened 3 months ago

James103 commented 3 months ago

What does it do?

When Multiplicative Fire Protection is enabled, instead of Fire Protection reducing burn time when set on fire by (15 × level)% in a linear fashion, each level of the enchantment multiplies the burn time by 0.85.

In other words, the vanilla formula of the Fire Protection enchantment, $$y = 1 - 0.15 \times \text{level}$$ is replaced with the multiplicative formula $$y = 0.85^{\text{level}}$$ where $y$ is the multiplier to burn time from the Fire Protection enchantment and $\text{level}$ is the sum of the levels of the Fire Protection enchantments on the player's armor.

With Fire Protection IV on 1 piece, the pre-1.21 vanilla effect is maxed out with a burn time multiplier of $1 - 0.15 \times 4 = 0.40$, equivalent to a 60% reduction, while the proposed formula multiplies burn time by $0.85^4 \approx 0.52$, equivalent to a 48% reduction.

With Fire Protection IV on 2 pieces, the post-1.21 vanilla effect is maxed out with a burn time multiplier of $1 - 0.15 \times 8 = -0.20$, making the player unable to remain on fire without a corresponding heat source, while the proposed formula multiplies burn time by $0.85^8 \approx 0.27$, equivalent to a 73% reduction.

Why add it?

The multiplicative formula allows Fire Protection to be extended to higher levels beyond the vanilla limits while still keeping most of the vanilla effect at lower levels. If Fire Protection scaled linearly and was uncapped, the multiplier to burn time would drop below 0 with 7 levels of Fire Protection or more, making the entity unable to remain on fire without a heat source such as fire block, fireballs, or lava. With this change, equipping a full set of Fire Protection IV and running through a fiery tunnel can still result in a couple additional seconds of additional fire damage after exiting said tunnel.

Anything else?

See also https://github.com/adibarra/enchant-tweaker/issues/14.

Before submitting...