diff options
Diffstat (limited to 'src/battle_controller_opponent.c')
-rw-r--r-- | src/battle_controller_opponent.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 64cf16b86..2af17d32e 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -16,6 +16,7 @@ #include "constants/songs.h" #include "sound.h" #include "constants/moves.h" +#include "constants/trainers.h" #include "window.h" #include "m4a.h" #include "palette.h" @@ -39,7 +40,7 @@ extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; extern void sub_8172EF0(u8 battlerId, struct Pokemon *mon); extern void sub_806A068(u16, u8); extern void sub_81A57E4(u8 battlerId, u16 stringId); -extern u8 sub_81A4CB0(void); +extern u8 GetFrontierBrainTrainerPicIndex(void); extern u8 sub_81D5588(u16 trainerId); extern u8 GetFrontierTrainerFrontSpriteId(u16 trainerId); extern u8 GetEreaderTrainerFrontSpriteId(void); @@ -94,8 +95,8 @@ static void OpponentHandleFaintingCry(void); static void OpponentHandleIntroSlide(void); static void OpponentHandleIntroTrainerBallThrow(void); static void OpponentHandleDrawPartyStatusSummary(void); -static void OpponentHandleCmd49(void); -static void OpponentHandleCmd50(void); +static void OpponentHandleHidePartyStatusSummary(void); +static void OpponentHandleEndBounceEffect(void); static void OpponentHandleSpriteInvisibility(void); static void OpponentHandleBattleAnimation(void); static void OpponentHandleLinkStandbyMsg(void); @@ -166,8 +167,8 @@ static void (*const sOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) = OpponentHandleIntroSlide, OpponentHandleIntroTrainerBallThrow, OpponentHandleDrawPartyStatusSummary, - OpponentHandleCmd49, - OpponentHandleCmd50, + OpponentHandleHidePartyStatusSummary, + OpponentHandleEndBounceEffect, OpponentHandleSpriteInvisibility, OpponentHandleBattleAnimation, OpponentHandleLinkStandbyMsg, @@ -391,7 +392,7 @@ static void sub_805F994(void) static void CompleteOnHealthbarDone(void) { - s16 hpValue = sub_8074AA0(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], HEALTH_BAR, 0); + s16 hpValue = MoveBattleBar(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], HEALTH_BAR, 0); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); if (hpValue != -1) { @@ -1232,9 +1233,9 @@ static void OpponentHandleDrawTrainerPic(void) { trainerPicId = GetSecretBaseTrainerPicIndex(); } - else if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_3FE) + else if (gTrainerBattleOpponent_A == TRAINER_FRONTIER_BRAIN) { - trainerPicId = sub_81A4CB0(); + trainerPicId = GetFrontierBrainTrainerPicIndex(); } else if (gBattleTypeFlags & BATTLE_TYPE_x4000000) { @@ -1316,9 +1317,9 @@ static void OpponentHandleTrainerSlide(void) { trainerPicId = GetSecretBaseTrainerPicIndex(); } - else if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_3FE) + else if (gTrainerBattleOpponent_A == TRAINER_FRONTIER_BRAIN) { - trainerPicId = sub_81A4CB0(); + trainerPicId = GetFrontierBrainTrainerPicIndex(); } else if (gBattleTypeFlags & BATTLE_TYPE_x4000000) { @@ -1403,7 +1404,7 @@ static void OpponentHandleFaintAnimation(void) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; PlaySE12WithPanning(SE_POKE_DEAD, PAN_SIDE_OPPONENT); - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_8039934; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_FaintOpponentMon; gBattlerControllerFuncs[gActiveBattler] = sub_805FAC4; } } @@ -1511,7 +1512,7 @@ static void OpponentHandlePrintString(void) gBattle_BG0_Y = 0; stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]); BufferStringBattle(*stringId); - BattleHandleAddTextPrinter(gDisplayedStringBattle, 0); + BattlePutTextOnWindow(gDisplayedStringBattle, 0); gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter; sub_81A57E4(gActiveBattler, *stringId); } @@ -1865,8 +1866,8 @@ static void OpponentHandleIntroTrainerBallThrow(void) taskId = CreateTask(sub_8062828, 5); gTasks[taskId].data[0] = gActiveBattler; - if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1) - gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30; + if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown) + gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary; gBattleSpritesDataPtr->animationData->field_9_x1 = 1; gBattlerControllerFuncs[gActiveBattler] = nullsub_26; @@ -1916,7 +1917,7 @@ static void OpponentHandleDrawPartyStatusSummary(void) } else { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1 = 1; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1; if (gBattleBufferA[gActiveBattler][2] != 0) { @@ -1950,14 +1951,14 @@ static void sub_8062A2C(void) } } -static void OpponentHandleCmd49(void) +static void OpponentHandleHidePartyStatusSummary(void) { - if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1) - gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30; + if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown) + gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary; OpponentBufferExecCompleted(); } -static void OpponentHandleCmd50(void) +static void OpponentHandleEndBounceEffect(void) { OpponentBufferExecCompleted(); } |