From 59f89bde9e8ced4c8240bdaded3b938ee1454def Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Thu, 18 Aug 2022 14:23:45 -0400 Subject: [PATCH] Misc cleanup --- gflib/sprite.c | 2 +- include/battle.h | 2 +- src/battle_controller_link_opponent.c | 21 +++++++++------------ src/battle_controller_opponent.c | 6 +++--- src/battle_controller_recorded_opponent.c | 6 +++--- 5 files changed, 17 insertions(+), 20 deletions(-) diff --git a/gflib/sprite.c b/gflib/sprite.c index 9fc597cc3..cbcd6fb7c 100644 --- a/gflib/sprite.c +++ b/gflib/sprite.c @@ -103,7 +103,7 @@ typedef void (*AffineAnimCmdFunc)(u8 matrixNum, struct Sprite *); #define DUMMY_OAM_DATA \ { \ .y = DISPLAY_HEIGHT, \ - .affineMode = 0, \ + .affineMode = ST_OAM_AFFINE_OFF, \ .objMode = 0, \ .mosaic = FALSE, \ .bpp = 0, \ diff --git a/include/battle.h b/include/battle.h index 0b349e4b6..38c4cd779 100644 --- a/include/battle.h +++ b/include/battle.h @@ -551,7 +551,7 @@ struct BattleHealthboxInfo u8 specialAnimActive:1; // x40 u8 triedShinyMonAnim:1; u8 finishedShinyMonAnim:1; - u8 field_1_x1E:4; + u8 opponentDrawPartyStatusSummaryDelay:4; u8 bgmRestored:1; u8 waitForCry:1; u8 healthboxSlideInStarted:1; diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index a0756b8cb..a9629f662 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -368,16 +368,13 @@ static void TryShinyAnimAfterMonAnim(void) { TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); } - else + else if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim) { - if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim) - { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; - FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); - FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); - LinkOpponentBufferExecCompleted(); - } + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; + FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); + FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); + LinkOpponentBufferExecCompleted(); } } } @@ -1758,14 +1755,14 @@ static void LinkOpponentHandleDrawPartyStatusSummary(void) if (gBattleBufferA[gActiveBattler][2] != 0) { - if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E < 2) + if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay < 2) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E++; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay++; return; } else { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay = 0; } } diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index cf155dc76..641cbd0ac 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1929,14 +1929,14 @@ static void OpponentHandleDrawPartyStatusSummary(void) if (gBattleBufferA[gActiveBattler][2] != 0) { - if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E < 2) + if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay < 2) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E++; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay++; return; } else { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay = 0; } } diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index ebfdbc909..49538b834 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -1698,14 +1698,14 @@ static void RecordedOpponentHandleDrawPartyStatusSummary(void) if (gBattleBufferA[gActiveBattler][2] != 0) { - if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E < 2) + if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay < 2) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E++; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay++; return; } else { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay = 0; } }