Remove unused, unneeded fields from BattleHealthboxInfo

This commit is contained in:
PikalaxALT
2021-03-15 20:17:47 -04:00
parent 81da6acff5
commit 14aa5bf52f
10 changed files with 77 additions and 78 deletions
+10 -14
View File
@@ -200,7 +200,7 @@ struct ProtectStruct
u32 field3 : 8; u32 field3 : 8;
/* field_4 */ u32 physicalDmg; /* field_4 */ u32 physicalDmg;
/* field_8 */ u32 specialDmg; /* soundTimer */ u32 specialDmg;
/* field_C */ u8 physicalBattlerId; /* field_C */ u8 physicalBattlerId;
/* field_D */ u8 specialBattlerId; /* field_D */ u8 specialBattlerId;
/* field_E */ u16 fieldE; /* field_E */ u16 fieldE;
@@ -556,28 +556,24 @@ struct BattleAnimationInfo
struct BattleHealthboxInfo struct BattleHealthboxInfo
{ {
u8 partyStatusSummaryShown : 1; u8 partyStatusSummaryShown : 1; // x1
u8 healthboxIsBouncing : 1; u8 healthboxIsBouncing : 1; // x2
u8 battlerIsBouncing : 1; u8 battlerIsBouncing : 1; // x4
u8 ballAnimActive : 1; // 0x8 u8 ballAnimActive : 1; // 0x8
u8 statusAnimActive : 1; // x10 u8 statusAnimActive : 1; // x10
u8 animFromTableActive : 1; // x20 u8 animFromTableActive : 1; // x20
u8 specialAnimActive : 1; //x40 u8 specialAnimActive : 1; // x40
u8 triedShinyMonAnim : 1; u8 triedShinyMonAnim : 1; // x80
u8 field_1_x1 : 1; u8 finishedShinyMonAnim : 1; // x1
u8 field_1_x1E : 5; u8 opponentDrawPartyStatusSummaryDelay : 5; // x2
u8 field_1_x40 : 1;
u8 field_1_x80 : 1;
u8 healthboxBounceSpriteId; u8 healthboxBounceSpriteId;
u8 battlerBounceSpriteId; u8 battlerBounceSpriteId;
u8 animationState; u8 animationState;
u8 field_5; u8 partyStatusDelayTimer;
u8 matrixNum; u8 matrixNum;
u8 shadowSpriteId; u8 shadowSpriteId;
u8 field_8; u8 soundTimer;
u8 introEndDelay; u8 introEndDelay;
u8 field_A;
u8 field_B;
}; };
struct BattleBarInfo struct BattleBarInfo
+2 -2
View File
@@ -2082,7 +2082,7 @@ void TryShinyAnimation(u8 battler, struct Pokemon *mon)
} }
} }
gBattleSpritesDataPtr->healthBoxesData[battler].field_1_x1 = 1; gBattleSpritesDataPtr->healthBoxesData[battler].finishedShinyMonAnim = 1;
} }
static void AnimTask_ShinySparkles(u8 taskId) static void AnimTask_ShinySparkles(u8 taskId)
@@ -2165,7 +2165,7 @@ static void AnimTask_ShinySparkles_WaitSparkles(u8 taskId)
if (gTasks[taskId].data[1] == TRUE) if (gTasks[taskId].data[1] == TRUE)
{ {
battler = gTasks[taskId].data[0]; battler = gTasks[taskId].data[0];
gBattleSpritesDataPtr->healthBoxesData[battler].field_1_x1 = 1; gBattleSpritesDataPtr->healthBoxesData[battler].finishedShinyMonAnim = 1;
} }
DestroyTask(taskId); DestroyTask(taskId);
+15 -15
View File
@@ -214,13 +214,13 @@ static void sub_803A7E4(void)
{ {
if (GetBattlerPosition(gActiveBattler) == B_POSITION_OPPONENT_LEFT) if (GetBattlerPosition(gActiveBattler) == B_POSITION_OPPONENT_LEFT)
{ {
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim
|| !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1) || !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim)
return; return;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
} }
@@ -284,10 +284,10 @@ static void sub_803AC14(void)
{ {
TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
} }
else if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) else if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
LinkOpponentBufferExecCompleted(); LinkOpponentBufferExecCompleted();
@@ -373,10 +373,10 @@ static void sub_803AEDC(void)
static void sub_803AF28(void) static void sub_803AF28(void)
{ {
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0);
@@ -1585,29 +1585,29 @@ static void LinkOpponentHandleDrawPartyStatusSummary(void)
if (gBattleBufferA[gActiveBattler][2]) if (gBattleBufferA[gActiveBattler][2])
{ {
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; return;
} }
else else
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay = 0;
} }
} }
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]); gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0;
if (gBattleBufferA[gActiveBattler][2]) if (gBattleBufferA[gActiveBattler][2])
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0x5D; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0x5D;
gBattlerControllerFuncs[gActiveBattler] = sub_803D790; gBattlerControllerFuncs[gActiveBattler] = sub_803D790;
} }
} }
static void sub_803D790(void) static void sub_803D790(void)
{ {
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5++ > 0x5C) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer++ > 0x5C)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0;
LinkOpponentBufferExecCompleted(); LinkOpponentBufferExecCompleted();
} }
} }
+6 -6
View File
@@ -328,10 +328,10 @@ static void sub_80D481C(void)
static void sub_80D484C(void) static void sub_80D484C(void)
{ {
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
CreateTask(Task_PlayerController_RestoreBgmAfterCry, 10); CreateTask(Task_PlayerController_RestoreBgmAfterCry, 10);
@@ -1509,10 +1509,10 @@ static void LinkPartnerHandleDrawPartyStatusSummary(void)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1;
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]); gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0;
if (gBattleBufferA[gActiveBattler][2]) if (gBattleBufferA[gActiveBattler][2])
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0x5D; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0x5D;
gBattlerControllerFuncs[gActiveBattler] = sub_80D70A0; gBattlerControllerFuncs[gActiveBattler] = sub_80D70A0;
} }
@@ -1520,9 +1520,9 @@ static void LinkPartnerHandleDrawPartyStatusSummary(void)
static void sub_80D70A0(void) static void sub_80D70A0(void)
{ {
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5++ > 0x5C) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer++ > 0x5C)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0;
LinkPartnerBufferExecCompleted(); LinkPartnerBufferExecCompleted();
} }
} }
+4 -4
View File
@@ -439,13 +439,13 @@ static void Intro_WaitForShinyAnimAndHealthbox(void)
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy)
r4 = TRUE; r4 = TRUE;
if (r4 if (r4
&& gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim
&& gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1) && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
CreateTask(Task_PlayerController_RestoreBgmAfterCry, 10); CreateTask(Task_PlayerController_RestoreBgmAfterCry, 10);
+15 -15
View File
@@ -222,12 +222,12 @@ static void sub_8035C30(void)
} }
if (IsCryPlayingOrClearCrySongs()) if (IsCryPlayingOrClearCrySongs())
var = FALSE; var = FALSE;
if (var && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1) if (var && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
if (gBattleTypeFlags & BATTLE_TYPE_MULTI) if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
@@ -278,10 +278,10 @@ static void sub_8035FE8(void)
{ {
TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
} }
else if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) else if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
@@ -379,10 +379,10 @@ static void sub_80362E8(void)
static void sub_8036334(void) static void sub_8036334(void)
{ {
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0);
@@ -1026,7 +1026,7 @@ static void OpponentHandleLoadMonSprite(void)
DecompressGhostFrontPic(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); DecompressGhostFrontPic(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
y = GetGhostSpriteDefault_Y(gActiveBattler); y = GetGhostSpriteDefault_Y(gActiveBattler);
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 1; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 1;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 1; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 1;
} }
else else
{ {
@@ -1684,32 +1684,32 @@ static void OpponentHandleDrawPartyStatusSummary(void)
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1;
if (gBattleBufferA[gActiveBattler][2]) if (gBattleBufferA[gActiveBattler][2])
{ {
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E <= 1) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay < 2)
{ {
++gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E; ++gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay;
return; return;
} }
else else
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay = 0;
} }
} }
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler,
(struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4],
gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][1],
gBattleBufferA[gActiveBattler][2]); gBattleBufferA[gActiveBattler][2]);
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0;
if (gBattleBufferA[gActiveBattler][2]) if (gBattleBufferA[gActiveBattler][2])
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0x5D; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0x5D;
gBattlerControllerFuncs[gActiveBattler] = sub_8038FBC; gBattlerControllerFuncs[gActiveBattler] = sub_8038FBC;
} }
} }
static void sub_8038FBC(void) static void sub_8038FBC(void)
{ {
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5++ > 0x5C) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer++ > 0x5C)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0;
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
} }
} }
+10 -10
View File
@@ -886,13 +886,13 @@ static void Intro_WaitForShinyAnimAndHealthbox(void)
} }
if (IsCryPlayingOrClearCrySongs()) if (IsCryPlayingOrClearCrySongs())
var = FALSE; var = FALSE;
if (var && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 if (var && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim
&& gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1) && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
if (gBattleTypeFlags & BATTLE_TYPE_MULTI) if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
@@ -938,10 +938,10 @@ static void Intro_TryShinyAnimShowHealthbox(void)
static void sub_802FBF4(void) static void sub_802FBF4(void)
{ {
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
&& gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute) if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute)
@@ -2775,18 +2775,18 @@ static void PlayerHandleDrawPartyStatusSummary(void)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1;
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]); gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0;
if (gBattleBufferA[gActiveBattler][2] != 0) if (gBattleBufferA[gActiveBattler][2] != 0)
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0x5D; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0x5D;
gBattlerControllerFuncs[gActiveBattler] = sub_8033830; gBattlerControllerFuncs[gActiveBattler] = sub_8033830;
} }
} }
static void sub_8033830(void) static void sub_8033830(void)
{ {
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5++ > 0x5C) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer++ > 0x5C)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0;
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
} }
+8 -8
View File
@@ -600,10 +600,10 @@ static void sub_8156184(void)
{ {
TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
} }
else if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) else if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
PokedudeBufferExecCompleted(); PokedudeBufferExecCompleted();
@@ -640,10 +640,10 @@ static void sub_8156294(void)
static void sub_81562F0(void) static void sub_81562F0(void)
{ {
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
&& gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute) if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute)
@@ -783,13 +783,13 @@ static void sub_81567B0(void)
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy)
r4 = TRUE; r4 = TRUE;
if (r4 if (r4
&& gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim
&& gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1) && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = 0;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
CreateTask(Task_PlayerController_RestoreBgmAfterCry, 10); CreateTask(Task_PlayerController_RestoreBgmAfterCry, 10);
+6 -3
View File
@@ -296,15 +296,18 @@ bool8 IsBattleSEPlaying(u8 battlerId)
if (IsSEPlaying()) if (IsSEPlaying())
{ {
++gBattleSpritesDataPtr->healthBoxesData[battlerId].field_8; ++gBattleSpritesDataPtr->healthBoxesData[battlerId].soundTimer;
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_8 < 30) // UB: Uses gActiveBattler instead of battlerId.
// In practice, this is never a problem, as this routine
// is only ever passed gActiveBattler.
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].soundTimer < 30)
return TRUE; return TRUE;
m4aMPlayStop(&gMPlayInfo_SE1); m4aMPlayStop(&gMPlayInfo_SE1);
m4aMPlayStop(&gMPlayInfo_SE2); m4aMPlayStop(&gMPlayInfo_SE2);
} }
if (zero == 0) if (zero == 0)
{ {
gBattleSpritesDataPtr->healthBoxesData[battlerId].field_8 = 0; gBattleSpritesDataPtr->healthBoxesData[battlerId].soundTimer = 0;
return FALSE; return FALSE;
} }
else else
+1 -1
View File
@@ -3563,7 +3563,7 @@ static u8 HandlePlayerListUpdate(void)
struct UnkStruct_URoom * structPtr = sUnionRoomMain.uRoom; struct UnkStruct_URoom * structPtr = sUnionRoomMain.uRoom;
s32 r7 = 0; s32 r7 = 0;
// If someone new joined, register them in field_8 // If someone new joined, register them in soundTimer
for (i = 0; i < RFU_CHILD_MAX; i++) for (i = 0; i < RFU_CHILD_MAX; i++)
{ {
if (AreGnameUnameDifferent(&structPtr->field_C->arr[i].gname_uname, &sUnionGnameUnamePair_Dummy) == TRUE) if (AreGnameUnameDifferent(&structPtr->field_C->arr[i].gname_uname, &sUnionGnameUnamePair_Dummy) == TRUE)