From 88424b0ea3488b6d8c3d1f3a1cc825bd0cd33c86 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Mon, 1 Apr 2019 21:56:25 +0200 Subject: [PATCH] Support for custom multi battle choose mons --- .../scripts.inc | 20 +++++++++++++++---- src/battle_tower.c | 3 +++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc b/data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc index 0fe68cb1ed..6992438415 100644 --- a/data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc +++ b/data/maps/EverGrandeCity_PokemonLeague_1F/scripts.inc @@ -47,18 +47,30 @@ EverGrandeCity_PokemonLeague_1F_Pokemart_229624: @ 8229624 EverGrandeCity_PokemonLeague_1F_EventScript_229636:: @ 8229636 special SavePlayerParty - - trainerbattle 10, TRAINER_WALLACE, 0, NULL, EverGrandeCity_PokemonLeague_1F_Text_2296E8 + + fadescreen 1 + special ChooseHalfPartyForBattle + waitstate + @ Check here to see if the player didn't choose Cancel. + + special ReducePlayerPartyToSelectedMons + setvar VAR_0x8004, 2 + setvar VAR_0x8005, 4 + special CallFrontierUtilFunc + + trainerbattle 10, 1, 0, NULL, EverGrandeCity_PokemonLeague_1F_Text_2296E8 trainerbattle 11, TRAINER_ALEXA, 0, NULL, EverGrandeCity_PokemonLeague_1F_Text_2297EF setvar VAR_0x8004, SPECIAL_BATTLE_MULTI - setvar VAR_0x8005, 0 + setvar VAR_0x8005, 2 | 0x80 setvar VAR_0x8006, TRAINER_EDWARDO setvar VAR_0x8007, TRAINER_BACK_PIC_LEAF special DoSpecialTrainerBattle - waitstate + setvar VAR_0x8004, 6 + special CallFrontierUtilFunc + special LoadPlayerParty lockall diff --git a/src/battle_tower.c b/src/battle_tower.c index 760bd3315b..26b361fe0c 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -2397,6 +2397,9 @@ void DoSpecialTrainerBattle(void) BattleTransition_StartOnField(GetWildBattleTransition()); else BattleTransition_StartOnField(GetTrainerBattleTransition()); + + if (gSpecialVar_0x8005 & 0x80) // Skip mons restoring(done in the script) + gBattleScripting.specialTrainerBattleType = 0xFF; break; } }