TheDeathlyCow / scorchful

A heat mod for Minecraft Fabric and Quilt. Sister mod to Frostiful.
GNU Lesser General Public License v3.0
5 stars 1 forks source link

Make Fire Protection Enchantments affect Heat Resistance #62

Open Kogitsune opened 3 months ago

Kogitsune commented 3 months ago

Is your feature request related to a problem? Please describe. It seems silly to have armor and potions that can protect you from open flames or pools of lava, but it can't help keep you cool.

Describe the solution you'd like Each rank of fire protection on an armor piece should give a fraction of the "good protection" value - Fire Protection V would give +1 heat resistance, while Fire Protection I would only give +.2, as an example.

Potions of fire resistance should provide heat immunity for the duration instead. I'm not sure how to balance out infinite fire resistance effects - maybe instead wrap them to a high heat resistance value instead?

Describe alternatives you've considered The obvious answer is to just wear turtle armor, but that can be a bit difficult depending on your world. I've been in the same world for over a real week now and have not encountered a single turtle despite actively searching.

I may just not be smart enough to figure out the predicates, but I suspect that by combining the existing item_attribute_modifiers with the Autotag mod would give a way to maybe do this to items tagged c:armor but that isn't platform agnostic since Autotag doesn't exist for Forge currently.

I suspect this could also simply be brute-forced on the server by iterating over the player's inventory, sniff the c:armor tag, and then examine the enchantments to dynamically alter the attribute but I'm not sure how performant that would be, and then we're still back in Fabric-only land.

Additional context N/A

TheDeathlyCow commented 3 months ago

This is pretty similar to #60, and I gave my reasons there for why fire resistance should not grant immunity to heat. There has been similar discussion in the past for some form of Freezing Immunity in Frostiful as well, though I cannot find where that was. The TL;DR is that being able to grant yourself complete immunity is kind of boring and means you may as well uninstall the mod. The preferred alternative would be to grant the opposite, where heat becomes beneficial rather than harmful, so you still interact with the system in some way (this is what the Cloak of Frostology does for cold).

Giving some additional benefit with Fire Protection would be a nice addition though. I think the solution you propose of having it increase heat resistance is pretty solid, as it comes with the trade-off of not being able to use standard Protection armour. I'm not sure how that would work out on the tooltip, as it could be weird if Iron Armor, for example, was shown to both decrease and increase heat resistance. Unfortunately, implementation of this might be best saved for 1.21, as the new data-driven enchantments provide a really solid way to make enchantments affect attributes that is not present in the current enchantment system (which is frankly, very old and very bad).

The item attribute modifier system in Thermoo is there to modify the base attributes of a default stack, not one that has been enchanted. It could be extended with this functionality, but I'm holding off a bit on that system until Thermoo is on 1.20.6 and a default item component API is implemented in Fabric.

the Autotag mod would give a way to maybe do this to items tagged c:armor but that isn't platform agnostic since Autotag doesn't exist for Forge currently.

Not a problem, neither does Scorchful. Also, the conventional tags for Fabric and NeoForge have been undergoing a unification process, so c:armors works across Fabric/Quilt and NeoForge anyway. Also, thanks for highlighting that my armours may be missing from this tag, lol.

TheDeathlyCow commented 1 month ago

Coming back to this issue. Currently, no API exists in Fabric to modify the effects of an enchantment. I have attempted to find a way to do this myself, but so far I cannot find a good way to do it (that doesn't rely on modifying record fields, which is undefined behaviour). Fire Protection already provides some indirect benefits against Heat. It can reduce overheating damage (as that is classed as fire damage), and the reduction of fire time will also indirectly decrease the heat from being on fire. I think I will either make Heat Resistance a part of another enchantment or add more ways of obtaining Turtle Scutes from loot (like in treasure chests or Sunken ships).