Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gen 5+ HP fraction calculation #5776

Open
Kasenn opened this issue Dec 5, 2024 · 3 comments
Open

Gen 5+ HP fraction calculation #5776

Kasenn opened this issue Dec 5, 2024 · 3 comments
Labels
feature-request Requests a new feature

Comments

@Kasenn
Copy link

Kasenn commented Dec 5, 2024

Description

The way the HP fractions are currently calculated for things like health bar color or critical health bleep can lead to unexpected results. For example, when a mon's health is between 20% and 21%, it gets rounded down to 20% and is incorrectly displayed as being on low health. This was fixed in Gen 5+.
image
image
image
Here's an example of a mon being at 20.5% health in Gen 3, 4, and 5.

Discord contact info

No response

@Kasenn Kasenn added the feature-request Requests a new feature label Dec 5, 2024
@kittenchilly
Copy link

So does gen 5+ round to nearest here instead of rounding down?

@Kasenn
Copy link
Author

Kasenn commented Dec 6, 2024

I have no idea how it's actually handled in the code, but i assume it's simply using a more accurate method of calculation. The calculations in Gen 3 include a / 100, which may cause incorrect behavior when the mon's health falls between 20-21% or 50-51%.

@ShadowzLmao2
Copy link

ShadowzLmao2 commented Dec 9, 2024

Wouldn't it be ideal for it to be red under 25% and yellow under 50%? It would help a lot for guestimating ranges for berries and such. And at the very least, could that be added as an optional config for it to be set that way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Requests a new feature
Projects
None yet
Development

No branches or pull requests

3 participants