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

[Ability][Checkup][Bug] Defeatist checkup + getHpRatio() precision improved #450

Merged
merged 12 commits into from
Feb 12, 2025

Conversation

frutescens
Copy link
Contributor

What are the changes the user will see?

Getting damage for Flail will consider a HP ratio that has the same number of decimal places as listed in their conditions.
In random rewards, Potions and Hyper Potions will match the same number of decimal places as listed in their conditions too. Previously, the game cut all getHpRatio() requests to the hundredth place by default, causing issues for requests that were trying to match more precise values.

Why am I making these changes?

Ability Checkup.

What are the changes from a developer perspective?

pokemon.getHpRatio() has been replaced with getHpBarScaleX() in battle-info.ts, a helper function that suits the UI's need for a very precise decimal. pokemon.getHpRatio() now takes in an optional parameter precision that can increase the precision of the HP ratio calculated. It defaults to the hundredth place (precision value of 2) since most checks are limited to that, but now it is much more flexible and can be applied to other more precise checks.

Test for Defeatist created.

How to test the changes?

npm run test defeatist

Checklist

  • I'm using beta as my base branch
  • There is no overlap with another PR?
  • The PR is self-contained and cannot be split into smaller PRs?
  • Have I provided a clear explanation of the changes?
  • Have I tested the changes manually?
  • Are all unit tests still passing? (npm run test:silent)
    • Have I created new automated tests (npm run create-test) or updated existing tests related to the PR's changes?

@frutescens frutescens added P2 Bug Minor bug. Used for when a move/ability/interaction is incorrect but is not game breaking. Checkup Part of an effort to ensure that moves/abilities/game features are functioning correctly. labels Feb 8, 2025
@frutescens frutescens linked an issue Feb 8, 2025 that may be closed by this pull request
3 tasks
@frutescens frutescens mentioned this pull request Feb 8, 2025
3 tasks
torranx
torranx previously approved these changes Feb 9, 2025
Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>
@frutescens frutescens merged commit 4a73632 into beta Feb 12, 2025
8 checks passed
@frutescens frutescens deleted the defeatistCheckup branch February 12, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Checkup Part of an effort to ensure that moves/abilities/game features are functioning correctly. P2 Bug Minor bug. Used for when a move/ability/interaction is incorrect but is not game breaking.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Ability][Checkup] Defeatist
5 participants