rh-hideout / pokeemerald-expansion

Feature branche for the pokeemerald decompilation. See the wiki for more info.
336 stars 993 forks source link

In Tests, stats defined in tests are overwritten by pokemon default stats on form changes #4550

Open hedara90 opened 4 months ago

hedara90 commented 4 months ago

Description

Some form changing effects that change stats when activated behave strangely in tests. HP is recalculated when the form changes and the new MaxHP is calculated using the species Base HP with 0 IVs and EVs. Then damage taken is applied in different ways depending on how the new Max/current HP compares to the Test defined ones. I haven't analyzed the relationship properly, just noticed that differences exist. Transform is not affected by this presumably because it's specifically coded to not change the HP stat. Most of the effects could be coded to ignore the HP stat too, since most forms with different stats never have different HP, the only outlier is Zygarde-Complete which changes its HP stat.

https://github.com/rh-hideout/pokeemerald-expansion/assets/149414898/270b691f-8d5e-4360-9072-762387cbcdac

https://github.com/rh-hideout/pokeemerald-expansion/assets/149414898/a18864cf-e1b5-4688-a113-e73bd625c976

Version

1.8.3 (Latest release)

Upcoming/master Version

No response

Discord contact info

hedara

hedara90 commented 1 month ago

The original issue is only a part of a larger category of interactions of stats in tests. If a stat is defined in the test setup, it will be overwritten on form change and switch out. This especially interacts with the inferred speeds in tests where the test system sets speeds to a value around 12, but if a pokemon changes form it will regain it's original speed as determined by stats, which in almost all circumstances will be greater than 12.