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

DoBattlerEndTurnEffects and DoFieldEndTurnEffects need to be rewritten to better reflect later gens #5024

Open
Aeliko opened this issue Jul 23, 2024 · 3 comments
Labels
bug Bug category: battle-mechanic Pertains to battle mechanics status: confirmed This bug has been confirmed to exist in the codebase

Comments

@Aeliko
Copy link

Aeliko commented Jul 23, 2024

Description

As discussed, currently the end-turn resolution order is not cartridge accurate.

  • Should loop through each active battler for each "ENDTURN" case ("by-state-each-battler order")
  • Some of the effects are also out of order

A detailed table of end-turn resolution order, with sources, combining USUM and SwSh research can be found here: BluRosie/hg-engine#199

Version

master (default, unreleased bugfixes)

Upcoming/master Version

305c1ba

Discord contact info

___aero___

@Aeliko Aeliko added bug Bug category: battle-mechanic Pertains to battle mechanics status: unconfirmed This bug has not been reproduced yet labels Jul 23, 2024
@hedara90
Copy link
Collaborator

This is also relevant to the start of turn effects, an example is #5016 which affects for example if Ditto with Imposter will transform into Normal or Terastal form Terapagos.

@Aeliko
Copy link
Author

Aeliko commented Jul 23, 2024

I didn't make a table for that, here's a Bulbapedia article instead: User:FIQ/Turn sequence
A C implementation for reference: SwitchInAbilityCheck

@AlexOn1ine
Copy link
Collaborator

AlexOn1ine commented Jul 23, 2024

#5025 Should fix the first issue.

Also I looked at the second one and this will need a refactor and ideally combines DoFieldEndTurnEffects DoBattlerEndTurnEffects. I'm doing something else right now so for anyone who wants to work on it feel free to do it. Otherwise I'll do it sometime in the future.

@hedara90 hedara90 added status: confirmed This bug has been confirmed to exist in the codebase and removed status: unconfirmed This bug has not been reproduced yet labels Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug category: battle-mechanic Pertains to battle mechanics status: confirmed This bug has been confirmed to exist in the codebase
Projects
None yet
Development

No branches or pull requests

3 participants