Choosing RUN in a trainer battle makes you win on DEBUG mode - pret/pokecrystal GitHub Wiki
This is an adaption of the same turorial for pokered by ZetaPhoenix.
In engine/battle/core.asm, go to TryToRunAwayFromBattle:
.cant_run_from_trainer
+IF DEF(_DEBUG)
+ call FaintEnemyPokemon
+ call WinTrainerBattle
+ call WaitSFX
+ call LoadTilemapToTempTilemap
+ scf
+ ret
+ENDC
ld hl, BattleText_TheresNoEscapeFromTrainerBattle
Adding the code above makes RUN in trainer battles do the following in debug mode:
- The enemy is fainted first with to avoid some graphical glitches.
- You immediately win the trainer battle.
- After the battle, you transition back to the overworld map as you do after a regular fight.