diff --git a/include/battle_controllers.h b/include/battle_controllers.h index fddfaf584f..2188cd7894 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -257,6 +257,7 @@ void BtlController_Empty(void); // Empty command, does nothing, only completes t void BtlController_TerminatorNop(void); // Dummy function at the end of the table. void StartSendOutAnim(u32 battler, bool32 dontClearSubstituteBit); void Controller_WaitForString(void); +void Controller_WaitForHealthBar(void); // handlers void BtlController_HandleGetMonData(void); @@ -274,6 +275,7 @@ void BtlController_HandleSuccessBallThrowAnim(u32 battler, u32 target, u32 animI void BtlController_HandleBallThrowAnim(u32 battler, u32 target, u32 animId, bool32 allowCriticalCapture); void BtlController_HandleMoveAnimation(u32 battler, bool32 updateTvData); void BtlController_HandlePrintString(u32 battler, bool32 updateTvData, bool32 arenaPtsDeduct); +void BtlController_HandleHealthBarUpdate(u32 battler, bool32 updateHpText); void DoStatusIconUpdate(u32 battler); void BtlController_HandleStatusIconUpdate(void); void BtlController_HandleStatusAnimation(void); diff --git a/include/battle_dome.h b/include/battle_dome.h index 900508c4bf..b7572451ca 100644 --- a/include/battle_dome.h +++ b/include/battle_dome.h @@ -1,8 +1,6 @@ #ifndef GUARD_BATTLE_DOME_H #define GUARD_BATTLE_DOME_H -extern u32 gPlayerPartyLostHP; - int GetDomeTrainerSelectedMons(u16 tournamentTrainerId); int TrainerIdToDomeTournamentId(u16 trainerId); diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index 1ece5126e4..98f2e6451a 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -301,18 +301,6 @@ static void TryShinyAnimAfterMonAnim(void) } } -static void CompleteOnHealthbarDone(void) -{ - s16 hpValue = MoveBattleBar(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], HEALTH_BAR, 0); - - SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); - - if (hpValue != -1) - UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], HP_CURRENT, hpValue, gBattleMons[gActiveBattler].maxHP); - else - LinkOpponentBufferExecCompleted(); -} - static void SwitchIn_ShowSubstitute(void) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) @@ -508,26 +496,7 @@ static void LinkOpponentHandlePrintString(void) static void LinkOpponentHandleHealthBarUpdate(void) { - s16 hpVal; - - LoadBattleBarGfx(0); - hpVal = gBattleResources->bufferA[gActiveBattler][2] | (gBattleResources->bufferA[gActiveBattler][3] << 8); - - if (hpVal != INSTANT_HP_BAR_DROP) - { - u32 maxHP = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MAX_HP); - u32 curHP = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_HP); - - SetBattleBarStruct(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, curHP, hpVal); - } - else - { - u32 maxHP = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MAX_HP); - - SetBattleBarStruct(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, 0, hpVal); - } - - gBattlerControllerFuncs[gActiveBattler] = CompleteOnHealthbarDone; + BtlController_HandleHealthBarUpdate(gActiveBattler, FALSE); } static void LinkOpponentHandleIntroTrainerBallThrow(void) diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index ddf75265bb..41337a6c7b 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -131,23 +131,6 @@ static void WaitForMonAnimAfterLoad(void) LinkPartnerBufferExecCompleted(); } -static void CompleteOnHealthbarDone(void) -{ - s16 hpValue = MoveBattleBar(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], HEALTH_BAR, 0); - - SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); - - if (hpValue != -1) - { - UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], HP_CURRENT, hpValue, gBattleMons[gActiveBattler].maxHP); - } - else - { - HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); - LinkPartnerBufferExecCompleted(); - } -} - static void SwitchIn_ShowSubstitute(void) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) @@ -272,26 +255,7 @@ static void LinkPartnerHandlePrintString(void) static void LinkPartnerHandleHealthBarUpdate(void) { - s16 hpVal; - - LoadBattleBarGfx(0); - hpVal = gBattleResources->bufferA[gActiveBattler][2] | (gBattleResources->bufferA[gActiveBattler][3] << 8); - - if (hpVal != INSTANT_HP_BAR_DROP) - { - u32 maxHP = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MAX_HP); - u32 curHP = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_HP); - - SetBattleBarStruct(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, curHP, hpVal); - } - else - { - u32 maxHP = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MAX_HP); - - SetBattleBarStruct(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, 0, hpVal); - } - - gBattlerControllerFuncs[gActiveBattler] = CompleteOnHealthbarDone; + BtlController_HandleHealthBarUpdate(gActiveBattler, FALSE); } static void LinkPartnerHandleIntroTrainerBallThrow(void) diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index e406f710d1..5da0ce2048 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -324,16 +324,6 @@ static void TryShinyAnimAfterMonAnim(void) } } -static void CompleteOnHealthbarDone(void) -{ - s16 hpValue = MoveBattleBar(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], HEALTH_BAR, 0); - SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); - if (hpValue != -1) - UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], HP_CURRENT, hpValue, gBattleMons[gActiveBattler].maxHP); - else - OpponentBufferExecCompleted(); -} - static void SwitchIn_ShowSubstitute(void) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) @@ -724,26 +714,7 @@ static u8 CountAIAliveNonEggMonsExcept(u8 slotToIgnore) static void OpponentHandleHealthBarUpdate(void) { - s16 hpVal; - - LoadBattleBarGfx(0); - hpVal = (gBattleResources->bufferA[gActiveBattler][3] << 8) | gBattleResources->bufferA[gActiveBattler][2]; - - if (hpVal != INSTANT_HP_BAR_DROP) - { - u32 maxHP = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MAX_HP); - u32 curHP = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_HP); - - SetBattleBarStruct(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, curHP, hpVal); - } - else - { - u32 maxHP = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MAX_HP); - - SetBattleBarStruct(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, 0, hpVal); - } - - gBattlerControllerFuncs[gActiveBattler] = CompleteOnHealthbarDone; + BtlController_HandleHealthBarUpdate(gActiveBattler, FALSE); } static void OpponentHandleIntroTrainerBallThrow(void) diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 681d0d0743..e944721e6f 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -317,13 +317,6 @@ static void HandleInputChooseAction(void) #endif } -static void UnusedEndBounceEffect(void) -{ - EndBounceEffect(gActiveBattler, BOUNCE_HEALTHBOX); - EndBounceEffect(gActiveBattler, BOUNCE_MON); - gBattlerControllerFuncs[gActiveBattler] = HandleInputChooseTarget; -} - static void HandleInputChooseTarget(void) { s32 i; @@ -1282,23 +1275,6 @@ void Task_PlayerController_RestoreBgmAfterCry(u8 taskId) } } -static void CompleteOnHealthbarDone(void) -{ - s16 hpValue = MoveBattleBar(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], HEALTH_BAR, 0); - - SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); - - if (hpValue != -1) - { - UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], HP_CURRENT, hpValue, gBattleMons[gActiveBattler].maxHP); - } - else - { - HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); - PlayerBufferExecCompleted(); - } -} - #define tExpTask_monId data[0] #define tExpTask_battler data[2] #define tExpTask_gainedExp_1 data[3] @@ -1955,31 +1931,7 @@ static void PlayerHandleCmd23(void) static void PlayerHandleHealthBarUpdate(void) { - s16 hpVal; - - LoadBattleBarGfx(0); - hpVal = gBattleResources->bufferA[gActiveBattler][2] | (gBattleResources->bufferA[gActiveBattler][3] << 8); - - // gPlayerPartyLostHP used by Battle Dome, but never read - if (hpVal > 0) - gPlayerPartyLostHP += hpVal; - - if (hpVal != INSTANT_HP_BAR_DROP) - { - u32 maxHP = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MAX_HP); - u32 curHP = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_HP); - - SetBattleBarStruct(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, curHP, hpVal); - } - else - { - u32 maxHP = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MAX_HP); - - SetBattleBarStruct(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, 0, hpVal); - UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], HP_CURRENT, 0, maxHP); - } - - gBattlerControllerFuncs[gActiveBattler] = CompleteOnHealthbarDone; + BtlController_HandleHealthBarUpdate(gActiveBattler, TRUE); } void PlayerHandleExpUpdate(void) diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index 6ab65b11c3..da7508cc4c 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -207,23 +207,6 @@ static void WaitForMonAnimAfterLoad(void) PlayerPartnerBufferExecCompleted(); } -static void CompleteOnHealthbarDone(void) -{ - s16 hpValue = MoveBattleBar(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], HEALTH_BAR, 0); - - SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); - - if (hpValue != -1) - { - UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], HP_CURRENT, hpValue, gBattleMons[gActiveBattler].maxHP); - } - else - { - HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); - PlayerPartnerBufferExecCompleted(); - } -} - static void SwitchIn_ShowSubstitute(void) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) @@ -430,26 +413,7 @@ static void PlayerPartnerHandleChoosePokemon(void) static void PlayerPartnerHandleHealthBarUpdate(void) { - s16 hpVal; - - LoadBattleBarGfx(0); - hpVal = gBattleResources->bufferA[gActiveBattler][2] | (gBattleResources->bufferA[gActiveBattler][3] << 8); - - if (hpVal != INSTANT_HP_BAR_DROP) - { - u32 maxHP = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MAX_HP); - u32 curHP = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_HP); - - SetBattleBarStruct(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, curHP, hpVal); - } - else - { - u32 maxHP = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MAX_HP); - - SetBattleBarStruct(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, 0, hpVal); - } - - gBattlerControllerFuncs[gActiveBattler] = CompleteOnHealthbarDone; + BtlController_HandleHealthBarUpdate(gActiveBattler, FALSE); } static void PlayerPartnerHandleIntroTrainerBallThrow(void) diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index a15272c610..6dac18df0b 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -302,18 +302,6 @@ static void TryShinyAnimAfterMonAnim(void) } } -static void CompleteOnHealthbarDone(void) -{ - s16 hpValue = MoveBattleBar(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], HEALTH_BAR, 0); - - SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); - - if (hpValue != -1) - UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], HP_CURRENT, hpValue, gBattleMons[gActiveBattler].maxHP); - else - RecordedOpponentBufferExecCompleted(); -} - static void SwitchIn_ShowSubstitute(void) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) @@ -539,7 +527,7 @@ static void RecordedOpponentHandleHealthBarUpdate(void) TestRunner_Battle_RecordHP(gActiveBattler, curHP, 0); } - gBattlerControllerFuncs[gActiveBattler] = CompleteOnHealthbarDone; + gBattlerControllerFuncs[gActiveBattler] = Controller_WaitForHealthBar; } static void RecordedOpponentHandleStatusIconUpdate(void) diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index c45054378c..a3fb6891e3 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -281,23 +281,6 @@ static void WaitForMonAnimAfterLoad(void) RecordedPlayerBufferExecCompleted(); } -static void CompleteOnHealthbarDone(void) -{ - s16 hpValue = MoveBattleBar(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], HEALTH_BAR, 0); - - SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); - - if (hpValue != -1) - { - UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], HP_CURRENT, hpValue, gBattleMons[gActiveBattler].maxHP); - } - else - { - HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); - RecordedPlayerBufferExecCompleted(); - } -} - static void SwitchIn_ShowSubstitute(void) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) @@ -545,7 +528,7 @@ static void RecordedPlayerHandleHealthBarUpdate(void) TestRunner_Battle_RecordHP(gActiveBattler, curHP, 0); } - gBattlerControllerFuncs[gActiveBattler] = CompleteOnHealthbarDone; + gBattlerControllerFuncs[gActiveBattler] = Controller_WaitForHealthBar; } static void RecordedPlayerHandleStatusIconUpdate(void) diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c index fcb26e80d9..569ba81fb4 100644 --- a/src/battle_controller_safari.c +++ b/src/battle_controller_safari.c @@ -237,14 +237,6 @@ static void SafariBufferExecCompleted(void) } } -static void CompleteOnFinishedStatusAnimation(void) -{ - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].statusAnimActive) - SafariBufferExecCompleted(); -} - -#define sSpeedX data[0] - static void SafariHandleDrawTrainerPic(void) { u32 trainerPicId = gSaveBlock2Ptr->playerGender + TRAINER_BACK_PIC_BRENDAN; @@ -254,8 +246,6 @@ static void SafariHandleDrawTrainerPic(void) 30); } -#undef sSpeedX - static void SafariHandleSuccessBallThrowAnim(void) { BtlController_HandleSuccessBallThrowAnim(gActiveBattler, GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), B_ANIM_BALL_THROW_WITH_TRAINER, FALSE); diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index f853e5d923..103b8b18a6 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -282,23 +282,6 @@ static void Intro_WaitForShinyAnimAndHealthbox(void) } } -static void CompleteOnHealthbarDone(void) -{ - s16 hpValue = MoveBattleBar(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], HEALTH_BAR, 0); - - SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); - - if (hpValue != -1) - { - UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], HP_CURRENT, hpValue, gBattleMons[gActiveBattler].maxHP); - } - else - { - HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); - WallyBufferExecCompleted(); - } -} - static void WallyBufferExecCompleted(void) { gBattlerControllerFuncs[gActiveBattler] = WallyBufferRunCommand; @@ -421,27 +404,7 @@ static void WallyHandleChooseItem(void) static void WallyHandleHealthBarUpdate(void) { - s16 hpVal; - - LoadBattleBarGfx(0); - hpVal = gBattleResources->bufferA[gActiveBattler][2] | (gBattleResources->bufferA[gActiveBattler][3] << 8); - - if (hpVal != INSTANT_HP_BAR_DROP) - { - u32 maxHP = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MAX_HP); - u32 curHP = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_HP); - - SetBattleBarStruct(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, curHP, hpVal); - } - else - { - u32 maxHP = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MAX_HP); - - SetBattleBarStruct(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, 0, hpVal); - UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], HP_CURRENT, 0, maxHP); - } - - gBattlerControllerFuncs[gActiveBattler] = CompleteOnHealthbarDone; + BtlController_HandleHealthBarUpdate(gActiveBattler, TRUE); } // For some reason Wally's SE don't take side into account and pan is always the same. Possibly a bug diff --git a/src/battle_controllers.c b/src/battle_controllers.c index 3ef4d302ab..4c1eb5e0ee 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -2247,6 +2247,23 @@ static void Controller_HandleTrainerSlideBack(void) } } +void Controller_WaitForHealthBar(void) +{ + s16 hpValue = MoveBattleBar(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], HEALTH_BAR, 0); + + SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); + if (hpValue != -1) + { + UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], HP_CURRENT, hpValue, gBattleMons[gActiveBattler].maxHP); + } + else + { + if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) + HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); + BattleControllerComplete(gActiveBattler); + } +} + static void Controller_WaitForBallThrow(void) { if (!gDoingBattleAnim || !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) @@ -2658,6 +2675,33 @@ void BtlController_HandlePrintString(u32 battler, bool32 updateTvData, bool32 ar BattleArena_DeductSkillPoints(battler, *stringId); } +void BtlController_HandleHealthBarUpdate(u32 battler, bool32 updateHpText) +{ + s16 hpVal; + struct Pokemon *party = GetBattlerParty(battler); + + LoadBattleBarGfx(0); + hpVal = gBattleResources->bufferA[battler][2] | (gBattleResources->bufferA[battler][3] << 8); + + if (hpVal != INSTANT_HP_BAR_DROP) + { + u32 maxHP = GetMonData(&party[gBattlerPartyIndexes[battler]], MON_DATA_MAX_HP); + u32 curHP = GetMonData(&party[gBattlerPartyIndexes[battler]], MON_DATA_HP); + + SetBattleBarStruct(battler, gHealthboxSpriteIds[battler], maxHP, curHP, hpVal); + } + else + { + u32 maxHP = GetMonData(&party[gBattlerPartyIndexes[battler]], MON_DATA_MAX_HP); + + SetBattleBarStruct(battler, gHealthboxSpriteIds[battler], maxHP, 0, hpVal); + if (updateHpText) + UpdateHpTextInHealthbox(gHealthboxSpriteIds[battler], HP_CURRENT, 0, maxHP); + } + + gBattlerControllerFuncs[battler] = Controller_WaitForHealthBar; +} + void DoStatusIconUpdate(u32 battler) { struct Pokemon *party = GetBattlerParty(battler); diff --git a/src/battle_dome.c b/src/battle_dome.c index e94261f727..7f5b7abecd 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -157,8 +157,6 @@ static void BufferLastDomeWinnerName(void); static void InitRandomTourneyTreeResults(void); static void InitDomeTrainers(void); -EWRAM_DATA u32 gPlayerPartyLostHP = 0; // never read -static EWRAM_DATA u32 sPlayerPartyMaxHP = 0; // never read static EWRAM_DATA struct TourneyTreeInfoCard *sInfoCard = {0}; static EWRAM_DATA u8 *sTilemapBuffer = NULL; @@ -2544,9 +2542,6 @@ static void BufferDomeOpponentName(void) static void InitDomeOpponentParty(void) { - gPlayerPartyLostHP = 0; - sPlayerPartyMaxHP = GetMonData(&gPlayerParty[0], MON_DATA_MAX_HP, NULL); - sPlayerPartyMaxHP += GetMonData(&gPlayerParty[1], MON_DATA_MAX_HP, NULL); CalculatePlayerPartyCount(); CreateDomeOpponentMons(TrainerIdToTournamentId(gTrainerBattleOpponent_A)); }