EnhancedVisuals

EnhancedVisuals

12M Downloads

[Suggestion] Heart Beat handler allows for percentages

Ariannae opened this issue ยท 10 comments

commented

As the title indicates, I'd like to suggest allowing the heart beat-handler to allow for percentages, specifically in the "I:heartLevel=" configuration. Either a configuration option to swap to an entirely percentage-based system or an option where if "I:heartLevel=" is between 0.0 and 1.0, it uses a percent-based format.

This would make it so that players with largely different amounts of health are able to be affected by this effect in a similar manner. If a player with 100 HP through the use of something like Scaling Health is at 20% health, the heart beat effect would play; likewise, if a player with 10 HP is at 20% health, the effect would also play. Both players would have a similar experience in that the heart beat effect would play at 20%, as opposed to the 100 HP player having it play immediately before their death, or the 10 HP player having it play when they get hit a single time.

commented

Sounds reasonable, I will try to implement it the next days.

commented

Ah, there was already a suggestion for percentage-based health listed here.

This would work out better if the player has a lot of health than a set value, let's just say the player's health is 200 and the value is set at 0.2 which is 20%. If your health is below or at 40/200, you get the red screen + heartbeat effect. If 0.1 which is 10% your health would need to be at 20/200 health to get the red screen & heartbeat effect.

Since the default value is 6 and vanilla max health is 20, that would be 0.3 aka 30% as the default value which means you need 6/20 health to get the red screen & heartbeat effect.

commented

I actually wanted to do it already, but then I thought about rewritting EnhancedVisuals or at least partially rewrite it. Unfortunately I can't do it at the moment. I hope to do it in two weeks.

commented

@SirPrimrose has done it! The new version is up on curseforge in a few moments. Thanks for you suggestion.

commented

How does one enable the percentage-based option? The changelog lists it as...

"Added percentage heart beat configuration (done by SirPrimrose)"

...but I don't see an option to change it to use a percentage-based option.

commented

It's just straight forward:
Set useHealthPercentage to true and healthLevelPercentage is the property to set the percentage.

commented

The config will update with the new options:
useHealthPercentage
healthLevel
healthLevelPercentage

They should have self explanatory comments with them but basically if you want to use a percent set with useHealthPercentage to true and set healthLevelPercentage to a number between 0.0 and 1.0. So for 20% do 0.2, etc.

commented

Hmm... I don't see those in the config. I'm using "EnhancedVisuals_v1.2.2_mc1.12.2.jar".

I did try deleting the config to have it regen and still can't seem to find those options in it.

There is 'heartLevel' but no 'useHealthPercentage', 'healthLevelPercentage' or 'healthLevel'.

commented

Oh sorry ... I messed up the compiled jar. I will upload the right version now, should be available in a few minutes.

commented

I see them now in the fixed version. Thanks.