diff --git a/asm/macros/battle_frontier/battle_tower.inc b/asm/macros/battle_frontier/battle_tower.inc index 49e72e7446..b3c86955dd 100644 --- a/asm/macros/battle_frontier/battle_tower.inc +++ b/asm/macros/battle_frontier/battle_tower.inc @@ -98,7 +98,7 @@ waitstate .endm - .macro multi_do type:req, partnerId:req, partnerPicId:req + .macro multi_do type:req, partnerId:req special ReducePlayerPartyToSelectedMons setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA setvar VAR_0x8005, FRONTIER_DATA_SELECTED_MON_ORDER @@ -106,7 +106,6 @@ setvar VAR_0x8004, SPECIAL_BATTLE_MULTI setvar VAR_0x8005, \type | MULTI_BATTLE_CHOOSE_MONS setvar VAR_0x8006, \partnerId - setvar VAR_0x8007, \partnerPicId special DoSpecialTrainerBattle waitstate setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SAVE_PARTY @@ -114,30 +113,29 @@ special LoadPlayerParty .endm - .macro multi_2_vs_2 trainer1Id:req, trainer1LoseText:req, trainer2Id:req, trainer2LoseText:req, partnerId:req, partnerPicId:req + .macro multi_2_vs_2 trainer1Id:req, trainer1LoseText:req, trainer2Id:req, trainer2LoseText:req, partnerId:req special SavePlayerParty trainerbattle TRAINER_BATTLE_SET_TRAINER_A, \trainer1Id, 0, NULL, \trainer1LoseText @ set first trainer mons trainerbattle TRAINER_BATTLE_SET_TRAINER_B, \trainer2Id, 0, NULL, \trainer2LoseText @ set second trainer mons - multi_do MULTI_BATTLE_2_VS_2, \partnerId, \partnerPicId + multi_do MULTI_BATTLE_2_VS_2, \partnerId .endm - .macro multi_2_vs_1 trainer1Id:req, trainer1LoseText:req, partnerId:req, partnerPicId:req + .macro multi_2_vs_1 trainer1Id:req, trainer1LoseText:req, partnerId:req special SavePlayerParty trainerbattle TRAINER_BATTLE_SET_TRAINER_A, \trainer1Id, 0, NULL, \trainer1LoseText @ set first trainer mons - multi_do MULTI_BATTLE_2_VS_1, \partnerId, \partnerPicId + multi_do MULTI_BATTLE_2_VS_1, \partnerId .endm @ Wild mons need to be assigned to gEnemyParty 0 and 3 slots, other slots need to be cleared out. - .macro multi_wild partnerId:req, partnerPicId:req + .macro multi_wild partnerId:req special SavePlayerParty - multi_do MULTI_BATTLE_2_VS_WILD, \partnerId, \partnerPicId + multi_do MULTI_BATTLE_2_VS_WILD, \partnerId .endm - .macro multi_do_fixed type:req, partnerId:req, partnerPicId:req + .macro multi_do_fixed type:req, partnerId:req setvar VAR_0x8004, SPECIAL_BATTLE_MULTI setvar VAR_0x8005, \type setvar VAR_0x8006, \partnerId - setvar VAR_0x8007, \partnerPicId special DoSpecialTrainerBattle waitstate setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SAVE_PARTY @@ -145,21 +143,21 @@ special LoadPlayerParty .endm - .macro multi_fixed_2_vs_2 trainer1Id:req, trainer1LoseText:req, trainer2Id:req, trainer2LoseText:req, partnerId:req, partnerPicId:req + .macro multi_fixed_2_vs_2 trainer1Id:req, trainer1LoseText:req, trainer2Id:req, trainer2LoseText:req, partnerId:req special SavePlayerParty trainerbattle TRAINER_BATTLE_SET_TRAINER_A, \trainer1Id, 0, NULL, \trainer1LoseText @ set first trainer mons trainerbattle TRAINER_BATTLE_SET_TRAINER_B, \trainer2Id, 0, NULL, \trainer2LoseText @ set second trainer mons - multi_do_fixed MULTI_BATTLE_2_VS_2, \partnerId, \partnerPicId + multi_do_fixed MULTI_BATTLE_2_VS_2, \partnerId .endm - .macro multi_fixed_2_vs_1 trainer1Id:req, trainer1LoseText:req, partnerId:req, partnerPicId:req + .macro multi_fixed_2_vs_1 trainer1Id:req, trainer1LoseText:req, partnerId:req special SavePlayerParty trainerbattle TRAINER_BATTLE_SET_TRAINER_A, \trainer1Id, 0, NULL, \trainer1LoseText @ set first trainer mons - multi_do_fixed MULTI_BATTLE_2_VS_1, \partnerId, \partnerPicId + multi_do_fixed MULTI_BATTLE_2_VS_1, \partnerId .endm @ Wild mons need to be assigned to gEnemyParty 0 and 3 slots, other slots need to be cleared out. - .macro multi_fixed_wild partnerId:req, partnerPicId:req + .macro multi_fixed_wild partnerId:req special SavePlayerParty - multi_do_fixed MULTI_BATTLE_2_VS_WILD, \partnerId, \partnerPicId + multi_do_fixed MULTI_BATTLE_2_VS_WILD, \partnerId .endm diff --git a/data/maps/MossdeepCity_SpaceCenter_2F/scripts.inc b/data/maps/MossdeepCity_SpaceCenter_2F/scripts.inc index a4fcc0237c..4ec82003b5 100644 --- a/data/maps/MossdeepCity_SpaceCenter_2F/scripts.inc +++ b/data/maps/MossdeepCity_SpaceCenter_2F/scripts.inc @@ -257,7 +257,7 @@ MossdeepCity_SpaceCenter_2F_EventScript_ChoosePartyForMultiBattle:: goto MossdeepCity_SpaceCenter_2F_EventScript_ReadyForBattlePrompt MossdeepCity_SpaceCenter_2F_EventScript_DoStevenMultiBattle:: - multi_2_vs_2 TRAINER_MAXIE_MOSSDEEP, MossdeepCity_SpaceCenter_2F_Text_JustWantToExpandLand, TRAINER_TABITHA_MOSSDEEP, MossdeepCity_SpaceCenter_Text_TabithaDefeat, PARTNER_STEVEN, TRAINER_BACK_PIC_STEVEN + multi_2_vs_2 TRAINER_MAXIE_MOSSDEEP, MossdeepCity_SpaceCenter_2F_Text_JustWantToExpandLand, TRAINER_TABITHA_MOSSDEEP, MossdeepCity_SpaceCenter_Text_TabithaDefeat, PARTNER_STEVEN switch VAR_RESULT case 1, MossdeepCity_SpaceCenter_2F_EventScript_DefeatedMaxieTabitha fadescreen FADE_TO_BLACK diff --git a/include/battle.h b/include/battle.h index dc771a5d77..51d1a03bc3 100644 --- a/include/battle.h +++ b/include/battle.h @@ -1090,7 +1090,6 @@ extern u16 gMoveToLearn; extern u32 gFieldStatuses; extern struct FieldTimer gFieldTimers; extern u8 gBattlerAbility; -extern u16 gPartnerSpriteId; extern struct QueuedStatBoost gQueuedStatBoosts[MAX_BATTLERS_COUNT]; extern const struct BattleMoveEffect gBattleMoveEffects[]; diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index 5c3fd41762..b817adf097 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -435,7 +435,7 @@ static void PlayerPartnerHandleIntroTrainerBallThrow(u32 battler) const u32 *trainerPal; if (gPartnerTrainerId > TRAINER_PARTNER(PARTNER_NONE)) - trainerPal = gTrainerBacksprites[gPartnerSpriteId].palette.data; + trainerPal = gTrainerBacksprites[gBattlePartners[gPartnerTrainerId - TRAINER_PARTNER(PARTNER_NONE)].trainerPic].palette.data; else if (IsAiVsAiBattle()) trainerPal = gTrainerSprites[GetTrainerPicFromId(gPartnerTrainerId)].palette.data; else diff --git a/src/battle_main.c b/src/battle_main.c index 0ab3a67fa8..4d64ed46b2 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -220,7 +220,6 @@ EWRAM_DATA u16 gMoveToLearn = 0; EWRAM_DATA u32 gFieldStatuses = 0; EWRAM_DATA struct FieldTimer gFieldTimers = {0}; EWRAM_DATA u8 gBattlerAbility = 0; -EWRAM_DATA u16 gPartnerSpriteId = 0; EWRAM_DATA struct QueuedStatBoost gQueuedStatBoosts[MAX_BATTLERS_COUNT] = {0}; EWRAM_DATA bool8 gHasFetchedBall = FALSE; EWRAM_DATA u8 gLastUsedBall = 0; diff --git a/src/battle_tower.c b/src/battle_tower.c index cd94e7919b..266d7258b3 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -2148,7 +2148,6 @@ void DoSpecialTrainerBattle(void) gBattleTypeFlags = BATTLE_TYPE_TRAINER | BATTLE_TYPE_DOUBLE | BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_MULTI | BATTLE_TYPE_INGAME_PARTNER; } - gPartnerSpriteId = VarGet(gSpecialVar_0x8007); gPartnerTrainerId = VarGet(gSpecialVar_0x8006) + TRAINER_PARTNER(PARTNER_NONE); FillPartnerParty(gPartnerTrainerId); CreateTask(Task_StartBattleAfterTransition, 1);