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

[Refactor] Add player faint count to ArenaData, track total player/enemy faints #5427

Open
wants to merge 1 commit into
base: beta
Choose a base branch
from

Conversation

Fontbane
Copy link
Contributor

What are the changes the user will see?

  • None (yet)

Why am I making these changes?

  • In [Ability][Move] Last Respects Refactor and Full Implementation #5200, playerFaints was tracked oddly. It's stored by the Arena class but not by ArenaData. This meant it wouldn't save. So instead, playerFaints was added straight to sessionSaveData, and the Arena constructor as well as BattleScene.newArena() required an extra parameter just to pass sessionSaveData.playerFaints.
  • Might be nice to see run-wide faint count in run history later

What are the changes from a developer perspective?

  • Puts player faint count in ArenaData class so it's saved and loaded from there instead of at the root of session data.
  • Removes unnecessary parameter from Arena constructor and BattleScene.newArena()
  • Adds totalPlayerFaints and totalEnemyFaints to BattleScene and increments appropriately
  • Repurposes sessionSaveData.playerFaints to track totalPlayerFaints and adds the enemyFaints field to track totalEnemyFaints
  • These fields aren't used for anything yet but could be neat in the future

Screenshots/Videos

How to test the changes?

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)
    • Have I created new automated tests (npm run create-test) or updated existing tests related to the PR's changes?
  • Have I provided screenshots/videos of the changes (if applicable)?
    • Have I made sure that any UI change works for both UI themes (default and legacy)?

Are there any localization additions or changes? If so:

  • Has a locales PR been created on the locales repo?
    • If so, please leave a link to it here:
  • Has the translation team been contacted for proofreading/translation?

@Fontbane Fontbane requested a review from a team as a code owner February 27, 2025 02:15
@Madmadness65 Madmadness65 added the Refactor Rewriting existing code related label Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Rewriting existing code related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants