diff options
author | DizzyEggg <jajkodizzy@wp.pl> | 2018-07-22 13:14:58 +0200 |
---|---|---|
committer | DizzyEggg <jajkodizzy@wp.pl> | 2018-07-22 13:14:58 +0200 |
commit | 1e9143e0b22bc72cb77866e10817bc509064842a (patch) | |
tree | 87b77fdd2c19d34cb7ac10870fdc4c30188e2d70 /src/battle_controller_wally.c | |
parent | c9d486a5d3ea6bf7d256c2d7ca7f10339e498427 (diff) | |
parent | 06b3ce408f774c7192202308e783cc22bb8e7643 (diff) |
merge union room with master
Diffstat (limited to 'src/battle_controller_wally.c')
-rw-r--r-- | src/battle_controller_wally.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index ca7b2fd44..960181fbc 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" @@ -38,7 +39,6 @@ extern struct UnusedControllerStruct gUnknown_02022D0C; extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[]; extern void sub_8172EF0(u8 battlerId, struct Pokemon *mon); -extern void sub_806A068(u16, u8); // this file's functions static void WallyHandleGetMonData(void); @@ -90,8 +90,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 +159,8 @@ static void (*const sWallyBufferCommands[CONTROLLER_CMDS_COUNT])(void) = WallyHandleIntroSlide, WallyHandleIntroTrainerBallThrow, WallyHandleDrawPartyStatusSummary, - WallyHandleCmd49, - WallyHandleCmd50, + WallyHandleHidePartyStatusSummary, + WallyHandleEndBounceEffect, WallyHandleSpriteInvisibility, WallyHandleBattleAnimation, WallyHandleLinkStandbyMsg, @@ -253,7 +253,7 @@ static void WallyHandleActions(void) } } -static void CompleteOnBankSpriteCallbackDummy(void) +static void CompleteOnBattlerSpriteCallbackDummy(void) { if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) WallyBufferExecCompleted(); @@ -349,7 +349,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,26 +1037,26 @@ static void WallyHandleReturnMonToBall(void) static void WallyHandleDrawTrainerPic(void) { - DecompressTrainerBackPic(BACK_PIC_WALLY, gActiveBattler); - sub_806A12C(BACK_PIC_WALLY, GetBattlerPosition(gActiveBattler)); - gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gUnknown_0202499C, + DecompressTrainerBackPic(TRAINER_BACK_PIC_WALLY, gActiveBattler); + SetMultiuseSpriteTemplateToTrainerBack(TRAINER_BACK_PIC_WALLY, GetBattlerPosition(gActiveBattler)); + gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, 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; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2; gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC; - gBattlerControllerFuncs[gActiveBattler] = CompleteOnBankSpriteCallbackDummy; + gBattlerControllerFuncs[gActiveBattler] = CompleteOnBattlerSpriteCallbackDummy; } static void WallyHandleTrainerSlide(void) { - DecompressTrainerBackPic(BACK_PIC_WALLY, gActiveBattler); - sub_806A12C(BACK_PIC_WALLY, GetBattlerPosition(gActiveBattler)); - gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gUnknown_0202499C, + DecompressTrainerBackPic(TRAINER_BACK_PIC_WALLY, gActiveBattler); + SetMultiuseSpriteTemplateToTrainerBack(TRAINER_BACK_PIC_WALLY, GetBattlerPosition(gActiveBattler)); + gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, 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 +1179,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 +1206,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) @@ -1251,7 +1251,7 @@ static void WallyHandleChooseMove(void) static void WallyHandleChooseItem(void) { - BeginNormalPaletteFade(-1, 0, 0, 0x10, 0); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, 0); gBattlerControllerFuncs[gActiveBattler] = OpenBagAfterPaletteFade; gBattlerInMenuId = gActiveBattler; } @@ -1444,14 +1444,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; @@ -1465,8 +1465,8 @@ static void sub_816AA80(u8 battlerId) gBattlerPartyIndexes[battlerId] = gBattleBufferA[battlerId][1]; species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES); gUnknown_03005D7C[battlerId] = CreateInvisibleSpriteWithCallback(sub_805D714); - sub_806A068(species, GetBattlerPosition(battlerId)); - gBattlerSpriteIds[battlerId] = CreateSprite(&gUnknown_0202499C, + SetMultiuseSpriteTemplateToPokemon(species, GetBattlerPosition(battlerId)); + gBattlerSpriteIds[battlerId] = CreateSprite(&gMultiuseSpriteTemplate, GetBattlerSpriteCoord(battlerId, 2), GetBattlerSpriteDefault_Y(battlerId), sub_80A82E4(battlerId)); @@ -1511,18 +1511,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(); } |