Skip to content

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

Closed
Fontbane wants to merge 1 commit intopagefaultgames:betafrom
Fontbane:faintdata
Closed

[Refactor] Add player faint count to ArenaData, track total player/enemy faints #5427
Fontbane wants to merge 1 commit intopagefaultgames:betafrom
Fontbane:faintdata

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
@SirzBenjie SirzBenjie force-pushed the beta branch 3 times, most recently from 2c2003f to 701eecf Compare August 26, 2025 17:22
@damocleas damocleas closed this Jan 31, 2026
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.

3 participants