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

Display exact HP when using Exact HP Mod #2280

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

HisuianZoroark
Copy link
Contributor

Exact HP mod sends current HP and Max HP to both the user and the opponent via server protocol messages, but displays percent regardless unless the user turns on hardcore mode, making it information almost only accessible via the console. This pull request displays the current hp in the hp bar and the current and Max HP in the pokemon's tooltips for easier accessibility.

Before:
https://github.com/user-attachments/assets/606f60bc-a4ee-4666-9144-c5432f517855

After:
https://github.com/user-attachments/assets/d103e177-005f-4132-a425-0d14e49a2008

@@ -3442,6 +3444,7 @@ export class Battle {
this.messageFadeTime = 40;
this.isBlitz = true;
}
if (ruleName === 'Exact HP Mod') this.reportExactHP = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you making a new property instead of checking this.rules['Exact HP Mod']

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was primarily was looking at something else was implemented and decided to mirror, if it should be checked that way then sure

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left blitz and species clause when I added the rules object just to minimize refactoring at the time, but I think any new code that needs rules should just use the rules object if the only thing that needs to be checked is if the rule is in play.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants