Vampirism - Become a vampire!

Vampirism - Become a vampire!

16M Downloads

[Feature]: Option to turn off blood regeneration, or blood-hunger balancing replacing blood regeneration

Jackiecrazy opened this issue ยท 2 comments

commented

What?

blood is currently used in a way that mimics vanilla hunger mechanics to heal. Vanilla healing is disabled (at least in theory) by setting the hunger to 10. With certain mods that modify how hunger and regeneration work, that is no longer the case. This causes vampires to double dip healing and regenerate rapidly. The quick and dirty way of fixing this is to add an option to turn off blood regeneration independently from vanilla regeneration. A more involved proposal below.

As werewolves has demonstrated in this commit it is possible to make specific players derive no nutrition from certain items. Vampires could be allowed to eat at any time, yet gain no nutrition from any food (IForgeItemStack#getFoodProperties takes a Player parameter, which allows changing canAlwaysEat). However, if their hunger is less than their blood, blood exhaustion is added to refill the exhaustion and hunger bars until they are equal. If their hunger is higher than their blood, their hunger is set to their blood.
Pros: this fully integrates blood as a "buffer" to the now-hidden hunger bar. Anything that runs off hunger will correctly drain blood to do the same. Config for conversion rate allows tweaking how fast vampires exhaust (although I guess this is technically an option already, with the attribute). Prevents the aforementioned double dipping.
Cons: time consuming to implement. Takes one mixin and rewriting of the vampire heal code to instead balance hunger and blood. Likely other things down the line.

Mod experience

This allows more mods that interface with hunger to work with vampirism, so I think it's a positive.

Contributions

if you are really busy I suppose I could PR this in. I myself am really busy too, however.

commented

To understand this correctly: There are mods which change natural regeneration to also occur when the hunger bar is half empty?

commented

That is correct. Some mods do this with tick handlers (like harder natural healing), and I presume there's no good way to bridge that, but mods like combat next use a mixin to redefine the minimum hunger level required for healing.