summaryrefslogtreecommitdiff
path: root/src/script_pokemon_util_80F87D8.c
diff options
context:
space:
mode:
authorPhlosioneer <mattmdrr2@gmail.com>2019-02-10 20:42:50 -0500
committerPhlosioneer <mattmdrr2@gmail.com>2019-02-10 20:42:50 -0500
commite75f45dbcfcd65901035fbc7e3793332670eb306 (patch)
tree68b8a0144067b5da0d057094e14b9ae7827357df /src/script_pokemon_util_80F87D8.c
parentf2f1b1978ba3423a519df66d4f382dd68ac8b185 (diff)
Reverse engineered many of the multiplayer events
Some corrections to the way events are handled and identified.
Diffstat (limited to 'src/script_pokemon_util_80F87D8.c')
-rwxr-xr-xsrc/script_pokemon_util_80F87D8.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/script_pokemon_util_80F87D8.c b/src/script_pokemon_util_80F87D8.c
index cade00b50..f971d8487 100755
--- a/src/script_pokemon_util_80F87D8.c
+++ b/src/script_pokemon_util_80F87D8.c
@@ -29,6 +29,7 @@
#include "constants/items.h"
#include "constants/species.h"
#include "constants/vars.h"
+#include "constants/battle_frontier.h"
extern const u16 gEventObjectPalette8[];
extern const u16 gEventObjectPalette17[];
@@ -40,7 +41,7 @@ static const u8 gUnknown_0858D8EC[] = { 3, 4, 5, 14 };
static void sub_80F8EE8(u8 taskId);
static void sub_80F9088(u8 taskId);
-static void sub_80F9460(void);
+static void CB2_ReturnFromChooseHalfParty(void);
static void sub_80F94B8(void);
void SetContestTrainerGfxIds(void)
@@ -640,22 +641,24 @@ void ScriptSetMonMoveSlot(u8 monIndex, u16 move, u8 slot)
SetMonMoveSlot(&gPlayerParty[monIndex], move, slot);
}
-void sub_80F9438(void)
+// Note: When control returns to the event script, gSpecialVar_Result be
+// TRUE if the party selection was successful.
+void EventScript_ChooseHalfPartyForBattle(void)
{
- gMain.savedCallback = sub_80F9460;
- VarSet(VAR_FRONTIER_FACILITY, 9); // this isn't a valid frontier facility id (??)
- sub_81B8518(0);
+ gMain.savedCallback = CB2_ReturnFromChooseHalfParty;
+ VarSet(VAR_FRONTIER_FACILITY, FRONTIER_FACILITY_DOUBLE_COLOSSEUM);
+ InitChooseHalfPartyForBattle(0);
}
-static void sub_80F9460(void)
+static void CB2_ReturnFromChooseHalfParty(void)
{
switch (gSelectedOrderFromParty[0])
{
case 0:
- gSpecialVar_Result = 0;
+ gSpecialVar_Result = FALSE;
break;
default:
- gSpecialVar_Result = 1;
+ gSpecialVar_Result = TRUE;
break;
}
@@ -665,7 +668,7 @@ static void sub_80F9460(void)
void sub_80F9490(void)
{
gMain.savedCallback = sub_80F94B8;
- sub_81B8518(gSpecialVar_0x8004 + 1);
+ InitChooseHalfPartyForBattle(gSpecialVar_0x8004 + 1);
}
static void sub_80F94B8(void)