rh-hideout / pokeemerald-expansion

Feature branche for the pokeemerald decompilation. See the wiki for more info.
360 stars 1.09k forks source link

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

Open Aeliko opened 3 months ago

Aeliko commented 3 months ago

Description

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

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

Version

master (default, unreleased bugfixes)

Upcoming/master Version

305c1ba55eea5a8d559128805528b4a2cc608e56

Discord contact info

___aero___

hedara90 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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.