TeamLapen / Werewolves

addon mod for Vampirism which add Werewolves
https://wiki.werewolves.dev
GNU Lesser General Public License v3.0
36 stars 12 forks source link

[Feature]: Replacement based armor negation #158

Open Jackiecrazy opened 10 months ago

Jackiecrazy commented 10 months ago

What?

This is partially a bug report, but it appears to be a cross-mod conflict and I cannot determine the source. My armor values when transformed occasionally revert to their pre-transformation state. I'm guessing some mod is regularly refreshing all the attribute values, but I can't tell who. I do have a suggestion on how to mitigate this sort of unexpected occurrence, though. Create a dummy item that wraps around the armor item. On tick the dummy item checks if it is still equipped and if its wielder is still a werewolf, and if not, unwraps itself into the original armor piece. The dummy item drops a custom ItemEntity that also unwraps itself.

Mod experience

I think it's the only consistent way to completely remove the armor, if that's what you're going for. It handles all attributes, including ones potentially added by other mods, because it physically replaces the armor piece with something that also safely unwraps afterwards. There are several cases where this may lead to inconsistent behavior (such as not inheriting fire immunity from netherite gear when dropped), but these are not favorable to the player, and thus I don't think anyone will actually go out of their way to do something like it.

Contributions

I did something similar in Taoism once to suppress the offhand item while wielding a two-handed weapon. The code is old, but I haven't had any complaints from my users with this logic. Dungeons Gear also used the same system (which I also authored) for a while.