summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/battle.h24
-rw-r--r--src/battle_anim_special.c4
-rw-r--r--src/battle_controller_link_opponent.c30
-rw-r--r--src/battle_controller_link_partner.c12
-rw-r--r--src/battle_controller_oak_old_man.c8
-rw-r--r--src/battle_controller_opponent.c30
-rw-r--r--src/battle_controller_player.c20
-rw-r--r--src/battle_controller_pokedude.c16
-rw-r--r--src/battle_gfx_sfx_util.c9
-rw-r--r--src/union_room.c2
10 files changed, 77 insertions, 78 deletions
diff --git a/include/battle.h b/include/battle.h
index 54e33455d..0ae84b595 100644
--- a/include/battle.h
+++ b/include/battle.h
@@ -200,7 +200,7 @@ struct ProtectStruct
u32 field3 : 8;
/* field_4 */ u32 physicalDmg;
- /* field_8 */ u32 specialDmg;
+ /* soundTimer */ u32 specialDmg;
/* field_C */ u8 physicalBattlerId;
/* field_D */ u8 specialBattlerId;
/* field_E */ u16 fieldE;
@@ -556,28 +556,24 @@ struct BattleAnimationInfo
struct BattleHealthboxInfo
{
- u8 partyStatusSummaryShown : 1;
- u8 healthboxIsBouncing : 1;
- u8 battlerIsBouncing : 1;
+ u8 partyStatusSummaryShown : 1; // x1
+ u8 healthboxIsBouncing : 1; // x2
+ u8 battlerIsBouncing : 1; // x4
u8 ballAnimActive : 1; // 0x8
u8 statusAnimActive : 1; // x10
u8 animFromTableActive : 1; // x20
- u8 specialAnimActive : 1; //x40
- u8 triedShinyMonAnim : 1;
- u8 field_1_x1 : 1;
- u8 field_1_x1E : 5;
- u8 field_1_x40 : 1;
- u8 field_1_x80 : 1;
+ u8 specialAnimActive : 1; // x40
+ u8 triedShinyMonAnim : 1; // x80
+ u8 finishedShinyMonAnim : 1; // x1
+ u8 opponentDrawPartyStatusSummaryDelay : 5; // x2
u8 healthboxBounceSpriteId;
u8 battlerBounceSpriteId;
u8 animationState;
- u8 field_5;
+ u8 partyStatusDelayTimer;
u8 matrixNum;
u8 shadowSpriteId;
- u8 field_8;
+ u8 soundTimer;
u8 introEndDelay;
- u8 field_A;
- u8 field_B;
};
struct BattleBarInfo
diff --git a/src/battle_anim_special.c b/src/battle_anim_special.c
index e74605a21..a1cf5a491 100644
--- a/src/battle_anim_special.c
+++ b/src/battle_anim_special.c
@@ -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)
@@ -2165,7 +2165,7 @@ static void AnimTask_ShinySparkles_WaitSparkles(u8 taskId)
if (gTasks[taskId].data[1] == TRUE)
{
battler = gTasks[taskId].data[0];
- gBattleSpritesDataPtr->healthBoxesData[battler].field_1_x1 = 1;
+ gBattleSpritesDataPtr->healthBoxesData[battler].finishedShinyMonAnim = 1;
}
DestroyTask(taskId);
diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c
index 8795947b2..0e714ee13 100644
--- a/src/battle_controller_link_opponent.c
+++ b/src/battle_controller_link_opponent.c
@@ -214,13 +214,13 @@ static void sub_803A7E4(void)
{
if (GetBattlerPosition(gActiveBattler) == B_POSITION_OPPONENT_LEFT)
{
- if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1
- || !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1)
+ if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim
+ || !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim)
return;
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].field_1_x1 = 0;
+ gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
}
@@ -284,10 +284,10 @@ static void sub_803AC14(void)
{
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].field_1_x1 = 0;
+ gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
LinkOpponentBufferExecCompleted();
@@ -373,10 +373,10 @@ static void sub_803AEDC(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].field_1_x1 = 0;
+ gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0);
@@ -1585,29 +1585,29 @@ static void LinkOpponentHandleDrawPartyStatusSummary(void)
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;
}
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]);
- gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0;
+ gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0;
if (gBattleBufferA[gActiveBattler][2])
- gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0x5D;
+ gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0x5D;
gBattlerControllerFuncs[gActiveBattler] = sub_803D790;
}
}
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();
}
}
diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c
index b68bc2953..b15100f5a 100644
--- a/src/battle_controller_link_partner.c
+++ b/src/battle_controller_link_partner.c
@@ -328,10 +328,10 @@ static void sub_80D481C(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].field_1_x1 = 0;
+ gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
CreateTask(Task_PlayerController_RestoreBgmAfterCry, 10);
@@ -1509,10 +1509,10 @@ static void LinkPartnerHandleDrawPartyStatusSummary(void)
{
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1;
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])
- gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0x5D;
+ gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0x5D;
gBattlerControllerFuncs[gActiveBattler] = sub_80D70A0;
}
@@ -1520,9 +1520,9 @@ static void LinkPartnerHandleDrawPartyStatusSummary(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();
}
}
diff --git a/src/battle_controller_oak_old_man.c b/src/battle_controller_oak_old_man.c
index 51ee7c097..e51881523 100644
--- a/src/battle_controller_oak_old_man.c
+++ b/src/battle_controller_oak_old_man.c
@@ -439,13 +439,13 @@ static void Intro_WaitForShinyAnimAndHealthbox(void)
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy)
r4 = TRUE;
if (r4
- && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1
- && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1)
+ && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim
+ && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim)
{
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].field_1_x1 = 0;
+ gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
CreateTask(Task_PlayerController_RestoreBgmAfterCry, 10);
diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c
index 2d745a038..da268d4bf 100644
--- a/src/battle_controller_opponent.c
+++ b/src/battle_controller_opponent.c
@@ -222,12 +222,12 @@ static void sub_8035C30(void)
}
if (IsCryPlayingOrClearCrySongs())
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].field_1_x1 = 0;
+ gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 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);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
@@ -278,10 +278,10 @@ static void sub_8035FE8(void)
{
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].field_1_x1 = 0;
+ gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
OpponentBufferExecCompleted();
@@ -379,10 +379,10 @@ static void sub_80362E8(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].field_1_x1 = 0;
+ gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0);
@@ -1026,7 +1026,7 @@ static void OpponentHandleLoadMonSprite(void)
DecompressGhostFrontPic(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
y = GetGhostSpriteDefault_Y(gActiveBattler);
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 1;
- gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 1;
+ gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 1;
}
else
{
@@ -1684,32 +1684,32 @@ static void OpponentHandleDrawPartyStatusSummary(void)
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1;
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;
}
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]);
- gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0;
+ gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0;
if (gBattleBufferA[gActiveBattler][2])
- gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0x5D;
+ gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0x5D;
gBattlerControllerFuncs[gActiveBattler] = sub_8038FBC;
}
}
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();
}
}
diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c
index 3ff18ecb5..6dd98b1b0 100644
--- a/src/battle_controller_player.c
+++ b/src/battle_controller_player.c
@@ -886,13 +886,13 @@ static void Intro_WaitForShinyAnimAndHealthbox(void)
}
if (IsCryPlayingOrClearCrySongs())
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].field_1_x1 = 0;
+ gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 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);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
@@ -938,10 +938,10 @@ static void Intro_TryShinyAnimShowHealthbox(void)
static void sub_802FBF4(void)
{
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
- && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1)
+ && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
{
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0;
- gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0;
+ gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute)
@@ -2775,18 +2775,18 @@ static void PlayerHandleDrawPartyStatusSummary(void)
{
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1;
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)
- gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0x5D;
+ gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0x5D;
gBattlerControllerFuncs[gActiveBattler] = sub_8033830;
}
}
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();
}
}
diff --git a/src/battle_controller_pokedude.c b/src/battle_controller_pokedude.c
index 50d93d0cd..c3b62c871 100644
--- a/src/battle_controller_pokedude.c
+++ b/src/battle_controller_pokedude.c
@@ -600,10 +600,10 @@ static void sub_8156184(void)
{
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].field_1_x1 = 0;
+ gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
PokedudeBufferExecCompleted();
@@ -640,10 +640,10 @@ static void sub_8156294(void)
static void sub_81562F0(void)
{
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
- && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1)
+ && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
{
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = 0;
- gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0;
+ gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute)
@@ -783,13 +783,13 @@ static void sub_81567B0(void)
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy)
r4 = TRUE;
if (r4
- && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1
- && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1)
+ && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim
+ && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim)
{
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].field_1_x1 = 0;
+ gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = 0;
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
CreateTask(Task_PlayerController_RestoreBgmAfterCry, 10);
diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c
index db172b4a1..06c6aaaa9 100644
--- a/src/battle_gfx_sfx_util.c
+++ b/src/battle_gfx_sfx_util.c
@@ -296,15 +296,18 @@ bool8 IsBattleSEPlaying(u8 battlerId)
if (IsSEPlaying())
{
- ++gBattleSpritesDataPtr->healthBoxesData[battlerId].field_8;
- if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_8 < 30)
+ ++gBattleSpritesDataPtr->healthBoxesData[battlerId].soundTimer;
+ // 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;
m4aMPlayStop(&gMPlayInfo_SE1);
m4aMPlayStop(&gMPlayInfo_SE2);
}
if (zero == 0)
{
- gBattleSpritesDataPtr->healthBoxesData[battlerId].field_8 = 0;
+ gBattleSpritesDataPtr->healthBoxesData[battlerId].soundTimer = 0;
return FALSE;
}
else
diff --git a/src/union_room.c b/src/union_room.c
index df4d5af64..b4d9c8e5e 100644
--- a/src/union_room.c
+++ b/src/union_room.c
@@ -3563,7 +3563,7 @@ static u8 HandlePlayerListUpdate(void)
struct UnkStruct_URoom * structPtr = sUnionRoomMain.uRoom;
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++)
{
if (AreGnameUnameDifferent(&structPtr->field_C->arr[i].gname_uname, &sUnionGnameUnamePair_Dummy) == TRUE)