diff options
Diffstat (limited to 'src/battle_controller_wally.c')
-rw-r--r-- | src/battle_controller_wally.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index ca7b2fd44..f66a1d773 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -15,6 +15,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" @@ -90,8 +91,8 @@ static void WallyHandleFaintingCry(void); static void WallyHandleIntroSlide(void); static void WallyHandleIntroTrainerBallThrow(void); static void WallyHandleDrawPartyStatusSummary(void); -static void WallyHandleCmd49(void); -static void WallyHandleCmd50(void); +static void WallyHandleHidePartyStatusSummary(void); +static void WallyHandleEndBounceEffect(void); static void WallyHandleSpriteInvisibility(void); static void WallyHandleBattleAnimation(void); static void WallyHandleLinkStandbyMsg(void); @@ -159,8 +160,8 @@ static void (*const sWallyBufferCommands[CONTROLLER_CMDS_COUNT])(void) = WallyHandleIntroSlide, WallyHandleIntroTrainerBallThrow, WallyHandleDrawPartyStatusSummary, - WallyHandleCmd49, - WallyHandleCmd50, + WallyHandleHidePartyStatusSummary, + WallyHandleEndBounceEffect, WallyHandleSpriteInvisibility, WallyHandleBattleAnimation, WallyHandleLinkStandbyMsg, @@ -349,7 +350,7 @@ static void sub_8168818(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]); @@ -1037,11 +1038,11 @@ static void WallyHandleReturnMonToBall(void) static void WallyHandleDrawTrainerPic(void) { - DecompressTrainerBackPic(BACK_PIC_WALLY, gActiveBattler); - sub_806A12C(BACK_PIC_WALLY, GetBattlerPosition(gActiveBattler)); + DecompressTrainerBackPic(TRAINER_BACK_PIC_WALLY, gActiveBattler); + sub_806A12C(TRAINER_BACK_PIC_WALLY, GetBattlerPosition(gActiveBattler)); gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gUnknown_0202499C, 80, - 80 + 4 * (8 - gTrainerBackPicCoords[BACK_PIC_WALLY].coords), + 80 + 4 * (8 - gTrainerBackPicCoords[TRAINER_BACK_PIC_WALLY].coords), 30); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; @@ -1052,11 +1053,11 @@ static void WallyHandleDrawTrainerPic(void) static void WallyHandleTrainerSlide(void) { - DecompressTrainerBackPic(BACK_PIC_WALLY, gActiveBattler); - sub_806A12C(BACK_PIC_WALLY, GetBattlerPosition(gActiveBattler)); + DecompressTrainerBackPic(TRAINER_BACK_PIC_WALLY, gActiveBattler); + sub_806A12C(TRAINER_BACK_PIC_WALLY, GetBattlerPosition(gActiveBattler)); gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gUnknown_0202499C, 80, - 80 + 4 * (8 - gTrainerBackPicCoords[BACK_PIC_WALLY].coords), + 80 + 4 * (8 - gTrainerBackPicCoords[TRAINER_BACK_PIC_WALLY].coords), 30); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -96; @@ -1179,7 +1180,7 @@ static void WallyHandlePrintString(void) gBattle_BG0_Y = 0; stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]); BufferStringBattle(*stringId); - BattleHandleAddTextPrinter(gDisplayedStringBattle, 0); + BattlePutTextOnWindow(gDisplayedStringBattle, 0); gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter; } @@ -1206,14 +1207,14 @@ static void WallyHandleChooseAction(void) s32 i; gBattlerControllerFuncs[gActiveBattler] = HandleChooseActionAfterDma3; - BattleHandleAddTextPrinter(gText_BattleMenu, 2); + BattlePutTextOnWindow(gText_BattleMenu, 2); for (i = 0; i < 4; i++) ActionSelectionDestroyCursorAt(i); ActionSelectionCreateCursorAt(gActionSelectionCursor[gActiveBattler], 0); BattleStringExpandPlaceholdersToDisplayedString(gText_WhatWillWallyDo); - BattleHandleAddTextPrinter(gDisplayedStringBattle, 1); + BattlePutTextOnWindow(gDisplayedStringBattle, 1); } static void WallyHandleUnknownYesNoBox(void) @@ -1444,14 +1445,14 @@ static void WallyHandleIntroTrainerBallThrow(void) StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 1); paletteNum = AllocSpritePalette(0xD6F8); - LoadCompressedPalette(gTrainerBackPicPaletteTable[BACK_PIC_WALLY].data, 0x100 + paletteNum * 16, 32); + LoadCompressedPalette(gTrainerBackPicPaletteTable[TRAINER_BACK_PIC_WALLY].data, 0x100 + paletteNum * 16, 32); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = paletteNum; taskId = CreateTask(sub_816AC04, 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_21; @@ -1511,18 +1512,18 @@ static void WallyHandleDrawPartyStatusSummary(void) } else { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1 = 1; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1; gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]); WallyBufferExecCompleted(); } } -static void WallyHandleCmd49(void) +static void WallyHandleHidePartyStatusSummary(void) { WallyBufferExecCompleted(); } -static void WallyHandleCmd50(void) +static void WallyHandleEndBounceEffect(void) { WallyBufferExecCompleted(); } |