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:

  1. The enemy is fainted first with to avoid some graphical glitches.
  2. You immediately win the trainer battle.
  3. After the battle, you transition back to the overworld map as you do after a regular fight.