AdAstra-LD / DS-Pokemon-Rom-Editor

New DS Pokemon ROM Editor, based on Nømura's 2020 edition. Expanded with loads of new features, bugfixes and better usability.
165 stars 45 forks source link

Trainer editor additions and small general improvements #32

Closed OtakuGracie closed 1 year ago

OtakuGracie commented 1 year ago

Fixed #20, after much research and testing I determined that the byte following difficulty is actually a bitfield that allows for overriding the default gender and ability of pokemon in a trainer's party. 0x1 forces the pokemon to be male, 0x2 forces it to be female, 0x20 sets the pokemon to use it's ability in slot 2. This is only used in pokemon HGSS (the gender override is seemingly never used in the actual game files but it does work on testing) and seems to simply be a filler byte in the other games from what I can tell. This is easy to test in the existing trainer editor by simply setting the first rival fight [495-497] to have a pokemon that normally has intimidate such as growlithe then setting the "DV" to 8704, this should lead to a female growlithe with the ability flash fire instead of intimidate. The value 8192 that was showing up for "DV" in some HGSS pokemon was actually the override that set a pokemon to use it's second ability.

You can also see evidence of this in the pret dissasembly (TrMon_OverridePidGender) https://github.com/pret/pokeheartgold/blob/master/src/trainer_data.c

This is also includes the ability to set the gender and ability of pokemon in the trainer editor for HGSS only. Also adds the ability to set form for pokemon that have them such as burmy, this is disabled in DP as they do not have this feature. The main window had to be expanded slightly to fit additional controls in the trainer editor. DSPRE-R_trainer_editor_improvements

Some other small changes:

AdAstra-LD commented 1 year ago

Should be all good. The only big 'yikes' was the MainWindow resize without adjusting the other editor tabs.

Gotta do some testing but I can handle the rest myself, thanks!