Minor battle_anim_throw cleanup

This commit is contained in:
GriffinR 2020-08-30 15:11:44 -04:00
parent 38298c3f1b
commit afb3472282
15 changed files with 264 additions and 245 deletions

View File

@ -416,7 +416,7 @@ gBattleAnims_Special::
.4byte Special_SwitchOutPlayerMon @ B_ANIM_SWITCH_OUT_PLAYER_MON .4byte Special_SwitchOutPlayerMon @ B_ANIM_SWITCH_OUT_PLAYER_MON
.4byte Special_SwitchOutOpponentMon @ B_ANIM_SWITCH_OUT_OPPONENT_MON .4byte Special_SwitchOutOpponentMon @ B_ANIM_SWITCH_OUT_OPPONENT_MON
.4byte Special_BallThrow @ B_ANIM_BALL_THROW .4byte Special_BallThrow @ B_ANIM_BALL_THROW
.4byte Special_SafariBallThrow @ B_ANIM_SAFARI_BALL_THROW .4byte Special_BallThrowWithTrainer @ B_ANIM_BALL_THROW_WITH_TRAINER
.4byte Special_SubstituteToMon @ B_ANIM_SUBSTITUTE_TO_MON .4byte Special_SubstituteToMon @ B_ANIM_SUBSTITUTE_TO_MON
.4byte Special_MonToSubstitute @ B_ANIM_MON_TO_SUBSTITUTE .4byte Special_MonToSubstitute @ B_ANIM_MON_TO_SUBSTITUTE
@ -10738,7 +10738,7 @@ BallThrowTrainerBlock:
blendoff blendoff
goto BallThrowEnd goto BallThrowEnd
Special_SafariBallThrow: Special_BallThrowWithTrainer:
createvisualtask AnimTask_LoadBallGfx, 2 createvisualtask AnimTask_LoadBallGfx, 2
delay 0 delay 0
createvisualtask AnimTask_ThrowBall_StandingTrainer, 2 createvisualtask AnimTask_ThrowBall_StandingTrainer, 2

View File

@ -544,8 +544,8 @@ struct BattleHealthboxInfo
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 flag_x80:1; u8 triedShinyMonAnim:1;
u8 field_1_x1:1; u8 finishedShinyMonAnim:1;
u8 field_1_x1E:4; u8 field_1_x1E:4;
u8 field_1_x20:1; u8 field_1_x20:1;
u8 field_1_x40:1; u8 field_1_x40:1;

View File

@ -67,7 +67,7 @@ void DoBounceEffect(u8 battlerId, u8 b, s8 c, s8 d);
void EndBounceEffect(u8 battlerId, bool8 b); void EndBounceEffect(u8 battlerId, bool8 b);
void SpriteCb_PlayerMonFromBall(struct Sprite *sprite); void SpriteCb_PlayerMonFromBall(struct Sprite *sprite);
void sub_8039E60(struct Sprite *sprite); void sub_8039E60(struct Sprite *sprite);
void sub_8039E84(struct Sprite *sprite); void SpriteCB_TrainerThrowObject(struct Sprite *sprite);
void sub_8039E9C(struct Sprite *sprite); void sub_8039E9C(struct Sprite *sprite);
void nullsub_20(void); void nullsub_20(void);
void BeginBattleIntro(void); void BeginBattleIntro(void);

View File

@ -376,7 +376,7 @@
#define B_ANIM_SWITCH_OUT_PLAYER_MON 0x1 #define B_ANIM_SWITCH_OUT_PLAYER_MON 0x1
#define B_ANIM_SWITCH_OUT_OPPONENT_MON 0x2 #define B_ANIM_SWITCH_OUT_OPPONENT_MON 0x2
#define B_ANIM_BALL_THROW 0x3 #define B_ANIM_BALL_THROW 0x3
#define B_ANIM_SAFARI_BALL_THROW 0x4 #define B_ANIM_BALL_THROW_WITH_TRAINER 0x4
#define B_ANIM_SUBSTITUTE_TO_MON 0x5 #define B_ANIM_SUBSTITUTE_TO_MON 0x5
#define B_ANIM_MON_TO_SUBSTITUTE 0x6 #define B_ANIM_MON_TO_SUBSTITUTE 0x6

View File

@ -49,7 +49,7 @@ enum {
}; };
static void sub_8170660(u8); static void sub_8170660(u8);
static void sub_8170A38(u8); static void AnimTask_FlashHealthboxOnLevelUp_Step(u8);
static void AnimTask_ThrowBall_Step(u8); static void AnimTask_ThrowBall_Step(u8);
static void SpriteCB_Ball_Throw(struct Sprite *); static void SpriteCB_Ball_Throw(struct Sprite *);
static void AnimTask_ThrowBall_StandingTrainer_Step(u8); static void AnimTask_ThrowBall_StandingTrainer_Step(u8);
@ -139,39 +139,39 @@ static const struct CaptureStar sCaptureStars[] =
#define TAG_PARTICLES_LUXURYBALL 55030 #define TAG_PARTICLES_LUXURYBALL 55030
#define TAG_PARTICLES_PREMIERBALL 55031 #define TAG_PARTICLES_PREMIERBALL 55031
const struct CompressedSpriteSheet gBallParticleSpritesheets[] = static const struct CompressedSpriteSheet sBallParticleSpriteSheets[POKEBALL_COUNT] =
{ {
{gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_POKEBALL}, [BALL_POKE] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_POKEBALL},
{gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_GREATBALL}, [BALL_GREAT] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_GREATBALL},
{gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_SAFARIBALL}, [BALL_SAFARI] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_SAFARIBALL},
{gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_ULTRABALL}, [BALL_ULTRA] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_ULTRABALL},
{gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_MASTERBALL}, [BALL_MASTER] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_MASTERBALL},
{gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_NETBALL}, [BALL_NET] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_NETBALL},
{gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_DIVEBALL}, [BALL_DIVE] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_DIVEBALL},
{gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_NESTBALL}, [BALL_NEST] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_NESTBALL},
{gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_REPEATBALL}, [BALL_REPEAT] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_REPEATBALL},
{gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_TIMERBALL}, [BALL_TIMER] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_TIMERBALL},
{gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_LUXURYBALL}, [BALL_LUXURY] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_LUXURYBALL},
{gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_PREMIERBALL}, [BALL_PREMIER] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_PREMIERBALL},
}; };
const struct CompressedSpritePalette gBallParticlePalettes[] = static const struct CompressedSpritePalette sBallParticlePalettes[POKEBALL_COUNT] =
{ {
{gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_POKEBALL}, [BALL_POKE] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_POKEBALL},
{gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_GREATBALL}, [BALL_GREAT] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_GREATBALL},
{gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_SAFARIBALL}, [BALL_SAFARI] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_SAFARIBALL},
{gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_ULTRABALL}, [BALL_ULTRA] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_ULTRABALL},
{gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_MASTERBALL}, [BALL_MASTER] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_MASTERBALL},
{gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_NETBALL}, [BALL_NET] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_NETBALL},
{gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_DIVEBALL}, [BALL_DIVE] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_DIVEBALL},
{gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_NESTBALL}, [BALL_NEST] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_NESTBALL},
{gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_REPEATBALL}, [BALL_REPEAT] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_REPEATBALL},
{gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_TIMERBALL}, [BALL_TIMER] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_TIMERBALL},
{gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_LUXURYBALL}, [BALL_LUXURY] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_LUXURYBALL},
{gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_PREMIERBALL}, [BALL_PREMIER] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_PREMIERBALL},
}; };
const union AnimCmd gAnim_RegularBall[] = static const union AnimCmd sAnim_RegularBall[] =
{ {
ANIMCMD_FRAME(0, 1), ANIMCMD_FRAME(0, 1),
ANIMCMD_FRAME(1, 1), ANIMCMD_FRAME(1, 1),
@ -182,185 +182,185 @@ const union AnimCmd gAnim_RegularBall[] =
ANIMCMD_JUMP(0), ANIMCMD_JUMP(0),
}; };
const union AnimCmd gAnim_MasterBall[] = static const union AnimCmd sAnim_MasterBall[] =
{ {
ANIMCMD_FRAME(3, 1), ANIMCMD_FRAME(3, 1),
ANIMCMD_END, ANIMCMD_END,
}; };
const union AnimCmd gAnim_NetDiveBall[] = static const union AnimCmd sAnim_NetDiveBall[] =
{ {
ANIMCMD_FRAME(4, 1), ANIMCMD_FRAME(4, 1),
ANIMCMD_END, ANIMCMD_END,
}; };
const union AnimCmd gAnim_NestBall[] = static const union AnimCmd sAnim_NestBall[] =
{ {
ANIMCMD_FRAME(5, 1), ANIMCMD_FRAME(5, 1),
ANIMCMD_END, ANIMCMD_END,
}; };
const union AnimCmd gAnim_LuxuryPremierBall[] = static const union AnimCmd sAnim_LuxuryPremierBall[] =
{ {
ANIMCMD_FRAME(6, 4), ANIMCMD_FRAME(6, 4),
ANIMCMD_FRAME(7, 4), ANIMCMD_FRAME(7, 4),
ANIMCMD_JUMP(0), ANIMCMD_JUMP(0),
}; };
const union AnimCmd gAnim_UltraRepeatTimerBall[] = static const union AnimCmd sAnim_UltraRepeatTimerBall[] =
{ {
ANIMCMD_FRAME(7, 4), ANIMCMD_FRAME(7, 4),
ANIMCMD_END, ANIMCMD_END,
}; };
const union AnimCmd *const gAnims_BallParticles[] = static const union AnimCmd *const sAnims_BallParticles[] =
{ {
gAnim_RegularBall, sAnim_RegularBall,
gAnim_MasterBall, sAnim_MasterBall,
gAnim_NetDiveBall, sAnim_NetDiveBall,
gAnim_NestBall, sAnim_NestBall,
gAnim_LuxuryPremierBall, sAnim_LuxuryPremierBall,
gAnim_UltraRepeatTimerBall, sAnim_UltraRepeatTimerBall,
}; };
const u8 gBallParticleAnimNums[] = static const u8 sBallParticleAnimNums[POKEBALL_COUNT] =
{ {
[BALL_POKE] = 0, [BALL_POKE] = 0,
[BALL_GREAT] = 0, [BALL_GREAT] = 0,
[BALL_SAFARI] = 0, [BALL_SAFARI] = 0,
[BALL_ULTRA] = 5, [BALL_ULTRA] = 5,
[BALL_MASTER] = 1, [BALL_MASTER] = 1,
[BALL_NET] = 2, [BALL_NET] = 2,
[BALL_DIVE] = 2, [BALL_DIVE] = 2,
[BALL_NEST] = 3, [BALL_NEST] = 3,
[BALL_REPEAT] = 5, [BALL_REPEAT] = 5,
[BALL_TIMER] = 5, [BALL_TIMER] = 5,
[BALL_LUXURY] = 4, [BALL_LUXURY] = 4,
[BALL_PREMIER] = 4, [BALL_PREMIER] = 4,
}; };
const TaskFunc gBallParticleAnimationFuncs[] = static const TaskFunc sBallParticleAnimationFuncs[POKEBALL_COUNT] =
{ {
PokeBallOpenParticleAnimation, [BALL_POKE] = PokeBallOpenParticleAnimation,
GreatBallOpenParticleAnimation, [BALL_GREAT] = GreatBallOpenParticleAnimation,
SafariBallOpenParticleAnimation, [BALL_SAFARI] = SafariBallOpenParticleAnimation,
UltraBallOpenParticleAnimation, [BALL_ULTRA] = UltraBallOpenParticleAnimation,
MasterBallOpenParticleAnimation, [BALL_MASTER] = MasterBallOpenParticleAnimation,
SafariBallOpenParticleAnimation, [BALL_NET] = SafariBallOpenParticleAnimation,
DiveBallOpenParticleAnimation, [BALL_DIVE] = DiveBallOpenParticleAnimation,
UltraBallOpenParticleAnimation, [BALL_NEST] = UltraBallOpenParticleAnimation,
RepeatBallOpenParticleAnimation, [BALL_REPEAT] = RepeatBallOpenParticleAnimation,
TimerBallOpenParticleAnimation, [BALL_TIMER] = TimerBallOpenParticleAnimation,
GreatBallOpenParticleAnimation, [BALL_LUXURY] = GreatBallOpenParticleAnimation,
PremierBallOpenParticleAnimation, [BALL_PREMIER] = PremierBallOpenParticleAnimation,
}; };
const struct SpriteTemplate gBallParticlesSpriteTemplates[] = static const struct SpriteTemplate sBallParticleSpriteTemplates[POKEBALL_COUNT] =
{ {
{ [BALL_POKE] = {
.tileTag = TAG_PARTICLES_POKEBALL, .tileTag = TAG_PARTICLES_POKEBALL,
.paletteTag = TAG_PARTICLES_POKEBALL, .paletteTag = TAG_PARTICLES_POKEBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8, .oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles, .anims = sAnims_BallParticles,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy, .callback = SpriteCallbackDummy,
}, },
{ [BALL_GREAT] = {
.tileTag = TAG_PARTICLES_GREATBALL, .tileTag = TAG_PARTICLES_GREATBALL,
.paletteTag = TAG_PARTICLES_GREATBALL, .paletteTag = TAG_PARTICLES_GREATBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8, .oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles, .anims = sAnims_BallParticles,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy, .callback = SpriteCallbackDummy,
}, },
{ [BALL_SAFARI] = {
.tileTag = TAG_PARTICLES_SAFARIBALL, .tileTag = TAG_PARTICLES_SAFARIBALL,
.paletteTag = TAG_PARTICLES_SAFARIBALL, .paletteTag = TAG_PARTICLES_SAFARIBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8, .oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles, .anims = sAnims_BallParticles,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy, .callback = SpriteCallbackDummy,
}, },
{ [BALL_ULTRA] = {
.tileTag = TAG_PARTICLES_ULTRABALL, .tileTag = TAG_PARTICLES_ULTRABALL,
.paletteTag = TAG_PARTICLES_ULTRABALL, .paletteTag = TAG_PARTICLES_ULTRABALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8, .oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles, .anims = sAnims_BallParticles,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy, .callback = SpriteCallbackDummy,
}, },
{ [BALL_MASTER] = {
.tileTag = TAG_PARTICLES_MASTERBALL, .tileTag = TAG_PARTICLES_MASTERBALL,
.paletteTag = TAG_PARTICLES_MASTERBALL, .paletteTag = TAG_PARTICLES_MASTERBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8, .oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles, .anims = sAnims_BallParticles,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy, .callback = SpriteCallbackDummy,
}, },
{ [BALL_NET] = {
.tileTag = TAG_PARTICLES_NETBALL, .tileTag = TAG_PARTICLES_NETBALL,
.paletteTag = TAG_PARTICLES_NETBALL, .paletteTag = TAG_PARTICLES_NETBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8, .oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles, .anims = sAnims_BallParticles,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy, .callback = SpriteCallbackDummy,
}, },
{ [BALL_DIVE] = {
.tileTag = TAG_PARTICLES_DIVEBALL, .tileTag = TAG_PARTICLES_DIVEBALL,
.paletteTag = TAG_PARTICLES_DIVEBALL, .paletteTag = TAG_PARTICLES_DIVEBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8, .oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles, .anims = sAnims_BallParticles,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy, .callback = SpriteCallbackDummy,
}, },
{ [BALL_NEST] = {
.tileTag = TAG_PARTICLES_NESTBALL, .tileTag = TAG_PARTICLES_NESTBALL,
.paletteTag = TAG_PARTICLES_NESTBALL, .paletteTag = TAG_PARTICLES_NESTBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8, .oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles, .anims = sAnims_BallParticles,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy, .callback = SpriteCallbackDummy,
}, },
{ [BALL_REPEAT] = {
.tileTag = TAG_PARTICLES_REPEATBALL, .tileTag = TAG_PARTICLES_REPEATBALL,
.paletteTag = TAG_PARTICLES_REPEATBALL, .paletteTag = TAG_PARTICLES_REPEATBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8, .oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles, .anims = sAnims_BallParticles,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy, .callback = SpriteCallbackDummy,
}, },
{ [BALL_TIMER] = {
.tileTag = TAG_PARTICLES_TIMERBALL, .tileTag = TAG_PARTICLES_TIMERBALL,
.paletteTag = TAG_PARTICLES_TIMERBALL, .paletteTag = TAG_PARTICLES_TIMERBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8, .oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles, .anims = sAnims_BallParticles,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy, .callback = SpriteCallbackDummy,
}, },
{ [BALL_LUXURY] = {
.tileTag = TAG_PARTICLES_LUXURYBALL, .tileTag = TAG_PARTICLES_LUXURYBALL,
.paletteTag = TAG_PARTICLES_LUXURYBALL, .paletteTag = TAG_PARTICLES_LUXURYBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8, .oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles, .anims = sAnims_BallParticles,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy, .callback = SpriteCallbackDummy,
}, },
{ [BALL_PREMIER] = {
.tileTag = TAG_PARTICLES_PREMIERBALL, .tileTag = TAG_PARTICLES_PREMIERBALL,
.paletteTag = TAG_PARTICLES_PREMIERBALL, .paletteTag = TAG_PARTICLES_PREMIERBALL,
.oam = &gOamData_AffineOff_ObjNormal_8x8, .oam = &gOamData_AffineOff_ObjNormal_8x8,
.anims = gAnims_BallParticles, .anims = sAnims_BallParticles,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy, .callback = SpriteCallbackDummy,
@ -404,22 +404,23 @@ const struct SpriteTemplate gPokeblockSpriteTemplate =
.callback = SpriteCB_PokeBlock_Throw, .callback = SpriteCB_PokeBlock_Throw,
}; };
const union AnimCmd gUnknown_085E5350[] = static const union AnimCmd sAnim_SafariRock[] =
{ {
ANIMCMD_FRAME(64, 1), ANIMCMD_FRAME(64, 1),
ANIMCMD_END, ANIMCMD_END,
}; };
const union AnimCmd *const gUnknown_085E5358[] = { static const union AnimCmd *const sAnims_SafariRock[] = {
gUnknown_085E5350, sAnim_SafariRock,
}; };
const struct SpriteTemplate gBattleAnimSpriteTemplate_085E535C = // Unused, leftover from FRLG
static const struct SpriteTemplate sSafariRockSpriteTemplate =
{ {
.tileTag = ANIM_TAG_ROCKS, .tileTag = ANIM_TAG_ROCKS,
.paletteTag = ANIM_TAG_ROCKS, .paletteTag = ANIM_TAG_ROCKS,
.oam = &gOamData_AffineOff_ObjNormal_32x32, .oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = gUnknown_085E5358, .anims = sAnims_SafariRock,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCB_PokeBlock_Throw, .callback = SpriteCB_PokeBlock_Throw,
@ -594,10 +595,10 @@ void AnimTask_FlashHealthboxOnLevelUp(u8 taskId)
{ {
gTasks[taskId].data[10] = gBattleAnimArgs[0]; gTasks[taskId].data[10] = gBattleAnimArgs[0];
gTasks[taskId].data[11] = gBattleAnimArgs[1]; gTasks[taskId].data[11] = gBattleAnimArgs[1];
gTasks[taskId].func = sub_8170A38; gTasks[taskId].func = AnimTask_FlashHealthboxOnLevelUp_Step;
} }
static void sub_8170A38(u8 taskId) static void AnimTask_FlashHealthboxOnLevelUp_Step(u8 taskId)
{ {
u8 paletteNum; u8 paletteNum;
u32 paletteOffset, colorOffset; u32 paletteOffset, colorOffset;
@ -807,7 +808,7 @@ void AnimTask_ThrowBall_StandingTrainer(u8 taskId)
gSprites[spriteId].sTargetX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); gSprites[spriteId].sTargetX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X);
gSprites[spriteId].sTargetY = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) - 16; gSprites[spriteId].sTargetY = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) - 16;
gSprites[spriteId].callback = SpriteCallbackDummy; gSprites[spriteId].callback = SpriteCallbackDummy;
gSprites[gBattlerSpriteIds[GetBattlerAtPosition(B_POSITION_PLAYER_LEFT)]].callback = sub_8039E84; gSprites[gBattlerSpriteIds[GetBattlerAtPosition(B_POSITION_PLAYER_LEFT)]].callback = SpriteCB_TrainerThrowObject;
gTasks[taskId].tSpriteId = spriteId; gTasks[taskId].tSpriteId = spriteId;
gTasks[taskId].func = AnimTask_ThrowBall_StandingTrainer_Step; gTasks[taskId].func = AnimTask_ThrowBall_StandingTrainer_Step;
} }
@ -1415,7 +1416,7 @@ static void MakeCaptureStars(struct Sprite *sprite)
LoadBallParticleGfx(BALL_MASTER); LoadBallParticleGfx(BALL_MASTER);
for (i = 0; i < ARRAY_COUNT(sCaptureStars); i++) for (i = 0; i < ARRAY_COUNT(sCaptureStars); i++)
{ {
u8 spriteId = CreateSprite(&gBallParticlesSpriteTemplates[4], sprite->pos1.x, sprite->pos1.y, subpriority); u8 spriteId = CreateSprite(&sBallParticleSpriteTemplates[4], sprite->pos1.x, sprite->pos1.y, subpriority);
if (spriteId != MAX_SPRITES) if (spriteId != MAX_SPRITES)
{ {
gSprites[spriteId].sDuration = 24; gSprites[spriteId].sDuration = 24;
@ -1424,7 +1425,7 @@ static void MakeCaptureStars(struct Sprite *sprite)
gSprites[spriteId].sAmplitude = sCaptureStars[i].amplitude; gSprites[spriteId].sAmplitude = sCaptureStars[i].amplitude;
InitAnimArcTranslation(&gSprites[spriteId]); InitAnimArcTranslation(&gSprites[spriteId]);
gSprites[spriteId].callback = SpriteCB_CaptureStar_Flicker; gSprites[spriteId].callback = SpriteCB_CaptureStar_Flicker;
StartSpriteAnim(&gSprites[spriteId], gBallParticleAnimNums[BALL_MASTER]); StartSpriteAnim(&gSprites[spriteId], sBallParticleAnimNums[BALL_MASTER]);
} }
} }
} }
@ -1552,10 +1553,10 @@ static void LoadBallParticleGfx(u8 ballId)
{ {
u8 taskId; u8 taskId;
if (GetSpriteTileStartByTag(gBallParticleSpritesheets[ballId].tag) == 0xFFFF) if (GetSpriteTileStartByTag(sBallParticleSpriteSheets[ballId].tag) == 0xFFFF)
{ {
LoadCompressedSpriteSheetUsingHeap(&gBallParticleSpritesheets[ballId]); LoadCompressedSpriteSheetUsingHeap(&sBallParticleSpriteSheets[ballId]);
LoadCompressedSpritePaletteUsingHeap(&gBallParticlePalettes[ballId]); LoadCompressedSpritePaletteUsingHeap(&sBallParticlePalettes[ballId]);
} }
} }
@ -1564,7 +1565,7 @@ u8 AnimateBallOpenParticles(u8 x, u8 y, u8 priority, u8 subpriority, u8 ballId)
u8 taskId; u8 taskId;
LoadBallParticleGfx(ballId); LoadBallParticleGfx(ballId);
taskId = CreateTask(gBallParticleAnimationFuncs[ballId], 5); taskId = CreateTask(sBallParticleAnimationFuncs[ballId], 5);
gTasks[taskId].data[1] = x; gTasks[taskId].data[1] = x;
gTasks[taskId].data[2] = y; gTasks[taskId].data[2] = y;
gTasks[taskId].data[3] = priority; gTasks[taskId].data[3] = priority;
@ -1597,11 +1598,11 @@ static void PokeBallOpenParticleAnimation(u8 taskId)
priority = gTasks[taskId].data[3]; priority = gTasks[taskId].data[3];
subpriority = gTasks[taskId].data[4]; subpriority = gTasks[taskId].data[4];
spriteId = CreateSprite(&gBallParticlesSpriteTemplates[ballId], x, y, subpriority); spriteId = CreateSprite(&sBallParticleSpriteTemplates[ballId], x, y, subpriority);
if (spriteId != MAX_SPRITES) if (spriteId != MAX_SPRITES)
{ {
IncrBallParticleCount(); IncrBallParticleCount();
StartSpriteAnim(&gSprites[spriteId], gBallParticleAnimNums[ballId]); StartSpriteAnim(&gSprites[spriteId], sBallParticleAnimNums[ballId]);
gSprites[spriteId].callback = PokeBallOpenParticleAnimation_Step1; gSprites[spriteId].callback = PokeBallOpenParticleAnimation_Step1;
gSprites[spriteId].oam.priority = priority; gSprites[spriteId].oam.priority = priority;
@ -1656,11 +1657,11 @@ static void TimerBallOpenParticleAnimation(u8 taskId)
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
{ {
spriteId = CreateSprite(&gBallParticlesSpriteTemplates[ballId], x, y, subpriority); spriteId = CreateSprite(&sBallParticleSpriteTemplates[ballId], x, y, subpriority);
if (spriteId != MAX_SPRITES) if (spriteId != MAX_SPRITES)
{ {
IncrBallParticleCount(); IncrBallParticleCount();
StartSpriteAnim(&gSprites[spriteId], gBallParticleAnimNums[ballId]); StartSpriteAnim(&gSprites[spriteId], sBallParticleAnimNums[ballId]);
gSprites[spriteId].callback = FanOutBallOpenParticles_Step1; gSprites[spriteId].callback = FanOutBallOpenParticles_Step1;
gSprites[spriteId].oam.priority = priority; gSprites[spriteId].oam.priority = priority;
gSprites[spriteId].data[0] = i * 32; gSprites[spriteId].data[0] = i * 32;
@ -1690,11 +1691,11 @@ static void DiveBallOpenParticleAnimation(u8 taskId)
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
{ {
spriteId = CreateSprite(&gBallParticlesSpriteTemplates[ballId], x, y, subpriority); spriteId = CreateSprite(&sBallParticleSpriteTemplates[ballId], x, y, subpriority);
if (spriteId != MAX_SPRITES) if (spriteId != MAX_SPRITES)
{ {
IncrBallParticleCount(); IncrBallParticleCount();
StartSpriteAnim(&gSprites[spriteId], gBallParticleAnimNums[ballId]); StartSpriteAnim(&gSprites[spriteId], sBallParticleAnimNums[ballId]);
gSprites[spriteId].callback = FanOutBallOpenParticles_Step1; gSprites[spriteId].callback = FanOutBallOpenParticles_Step1;
gSprites[spriteId].oam.priority = priority; gSprites[spriteId].oam.priority = priority;
gSprites[spriteId].data[0] = i * 32; gSprites[spriteId].data[0] = i * 32;
@ -1725,11 +1726,11 @@ static void SafariBallOpenParticleAnimation(u8 taskId)
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
{ {
spriteId = CreateSprite(&gBallParticlesSpriteTemplates[ballId], x, y, subpriority); spriteId = CreateSprite(&sBallParticleSpriteTemplates[ballId], x, y, subpriority);
if (spriteId != MAX_SPRITES) if (spriteId != MAX_SPRITES)
{ {
IncrBallParticleCount(); IncrBallParticleCount();
StartSpriteAnim(&gSprites[spriteId], gBallParticleAnimNums[ballId]); StartSpriteAnim(&gSprites[spriteId], sBallParticleAnimNums[ballId]);
gSprites[spriteId].callback = FanOutBallOpenParticles_Step1; gSprites[spriteId].callback = FanOutBallOpenParticles_Step1;
gSprites[spriteId].oam.priority = priority; gSprites[spriteId].oam.priority = priority;
gSprites[spriteId].data[0] = i * 32; gSprites[spriteId].data[0] = i * 32;
@ -1760,11 +1761,11 @@ static void UltraBallOpenParticleAnimation(u8 taskId)
for (i = 0; i < 10; i++) for (i = 0; i < 10; i++)
{ {
spriteId = CreateSprite(&gBallParticlesSpriteTemplates[ballId], x, y, subpriority); spriteId = CreateSprite(&sBallParticleSpriteTemplates[ballId], x, y, subpriority);
if (spriteId != MAX_SPRITES) if (spriteId != MAX_SPRITES)
{ {
IncrBallParticleCount(); IncrBallParticleCount();
StartSpriteAnim(&gSprites[spriteId], gBallParticleAnimNums[ballId]); StartSpriteAnim(&gSprites[spriteId], sBallParticleAnimNums[ballId]);
gSprites[spriteId].callback = FanOutBallOpenParticles_Step1; gSprites[spriteId].callback = FanOutBallOpenParticles_Step1;
gSprites[spriteId].oam.priority = priority; gSprites[spriteId].oam.priority = priority;
gSprites[spriteId].data[0] = i * 25; gSprites[spriteId].data[0] = i * 25;
@ -1801,11 +1802,11 @@ static void GreatBallOpenParticleAnimation(u8 taskId)
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
{ {
spriteId = CreateSprite(&gBallParticlesSpriteTemplates[ballId], x, y, subpriority); spriteId = CreateSprite(&sBallParticleSpriteTemplates[ballId], x, y, subpriority);
if (spriteId != MAX_SPRITES) if (spriteId != MAX_SPRITES)
{ {
IncrBallParticleCount(); IncrBallParticleCount();
StartSpriteAnim(&gSprites[spriteId], gBallParticleAnimNums[ballId]); StartSpriteAnim(&gSprites[spriteId], sBallParticleAnimNums[ballId]);
gSprites[spriteId].callback = FanOutBallOpenParticles_Step1; gSprites[spriteId].callback = FanOutBallOpenParticles_Step1;
gSprites[spriteId].oam.priority = priority; gSprites[spriteId].oam.priority = priority;
gSprites[spriteId].data[0] = i * 32; gSprites[spriteId].data[0] = i * 32;
@ -1851,11 +1852,11 @@ static void RepeatBallOpenParticleAnimation(u8 taskId)
for (i = 0; i < POKEBALL_COUNT; i++) for (i = 0; i < POKEBALL_COUNT; i++)
{ {
spriteId = CreateSprite(&gBallParticlesSpriteTemplates[ballId], x, y, subpriority); spriteId = CreateSprite(&sBallParticleSpriteTemplates[ballId], x, y, subpriority);
if (spriteId != MAX_SPRITES) if (spriteId != MAX_SPRITES)
{ {
IncrBallParticleCount(); IncrBallParticleCount();
StartSpriteAnim(&gSprites[spriteId], gBallParticleAnimNums[ballId]); StartSpriteAnim(&gSprites[spriteId], sBallParticleAnimNums[ballId]);
gSprites[spriteId].callback = RepeatBallOpenParticleAnimation_Step1; gSprites[spriteId].callback = RepeatBallOpenParticleAnimation_Step1;
gSprites[spriteId].oam.priority = priority; gSprites[spriteId].oam.priority = priority;
gSprites[spriteId].data[0] = i * 21; gSprites[spriteId].data[0] = i * 21;
@ -1895,11 +1896,11 @@ static void MasterBallOpenParticleAnimation(u8 taskId)
{ {
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
{ {
spriteId = CreateSprite(&gBallParticlesSpriteTemplates[ballId], x, y, subpriority); spriteId = CreateSprite(&sBallParticleSpriteTemplates[ballId], x, y, subpriority);
if (spriteId != MAX_SPRITES) if (spriteId != MAX_SPRITES)
{ {
IncrBallParticleCount(); IncrBallParticleCount();
StartSpriteAnim(&gSprites[spriteId], gBallParticleAnimNums[ballId]); StartSpriteAnim(&gSprites[spriteId], sBallParticleAnimNums[ballId]);
gSprites[spriteId].callback = FanOutBallOpenParticles_Step1; gSprites[spriteId].callback = FanOutBallOpenParticles_Step1;
gSprites[spriteId].oam.priority = priority; gSprites[spriteId].oam.priority = priority;
gSprites[spriteId].data[0] = i * 32; gSprites[spriteId].data[0] = i * 32;
@ -1939,11 +1940,11 @@ static void PremierBallOpenParticleAnimation(u8 taskId)
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
{ {
spriteId = CreateSprite(&gBallParticlesSpriteTemplates[ballId], x, y, subpriority); spriteId = CreateSprite(&sBallParticleSpriteTemplates[ballId], x, y, subpriority);
if (spriteId != MAX_SPRITES) if (spriteId != MAX_SPRITES)
{ {
IncrBallParticleCount(); IncrBallParticleCount();
StartSpriteAnim(&gSprites[spriteId], gBallParticleAnimNums[ballId]); StartSpriteAnim(&gSprites[spriteId], sBallParticleAnimNums[ballId]);
gSprites[spriteId].callback = PremierBallOpenParticleAnimation_Step1; gSprites[spriteId].callback = PremierBallOpenParticleAnimation_Step1;
gSprites[spriteId].oam.priority = priority; gSprites[spriteId].oam.priority = priority;
gSprites[spriteId].data[0] = i * 32; gSprites[spriteId].data[0] = i * 32;
@ -1985,7 +1986,7 @@ static void DestroyBallOpenAnimationParticle(struct Sprite *sprite)
{ {
for (i = 0; i < POKEBALL_COUNT; i++) for (i = 0; i < POKEBALL_COUNT; i++)
{ {
if (FuncIsActiveTask(gBallParticleAnimationFuncs[i]) == TRUE) if (FuncIsActiveTask(sBallParticleAnimationFuncs[i]) == TRUE)
break; break;
} }
@ -1993,8 +1994,8 @@ static void DestroyBallOpenAnimationParticle(struct Sprite *sprite)
{ {
for (j = 0; j < POKEBALL_COUNT; j++) for (j = 0; j < POKEBALL_COUNT; j++)
{ {
FreeSpriteTilesByTag(gBallParticleSpritesheets[j].tag); FreeSpriteTilesByTag(sBallParticleSpriteSheets[j].tag);
FreeSpritePaletteByTag(gBallParticlePalettes[j].tag); FreeSpritePaletteByTag(sBallParticlePalettes[j].tag);
} }
} }
@ -2218,7 +2219,7 @@ void TryShinyAnimation(u8 battler, struct Pokemon *mon)
u8 taskCirc, taskDgnl; u8 taskCirc, taskDgnl;
isShiny = FALSE; isShiny = FALSE;
gBattleSpritesDataPtr->healthBoxesData[battler].flag_x80 = 1; gBattleSpritesDataPtr->healthBoxesData[battler].triedShinyMonAnim = TRUE;
otId = GetMonData(mon, MON_DATA_OT_ID); otId = GetMonData(mon, MON_DATA_OT_ID);
personality = GetMonData(mon, MON_DATA_PERSONALITY); personality = GetMonData(mon, MON_DATA_PERSONALITY);
@ -2246,7 +2247,7 @@ void TryShinyAnimation(u8 battler, struct Pokemon *mon)
} }
} }
gBattleSpritesDataPtr->healthBoxesData[battler].field_1_x1 = 1; gBattleSpritesDataPtr->healthBoxesData[battler].finishedShinyMonAnim = TRUE;
} }
static void Task_ShinyStars(u8 taskId) static void Task_ShinyStars(u8 taskId)
@ -2331,7 +2332,7 @@ static void Task_ShinyStars_Wait(u8 taskId)
if (gTasks[taskId].tStarMove == SHINY_STAR_DIAGONAL) if (gTasks[taskId].tStarMove == SHINY_STAR_DIAGONAL)
{ {
battler = gTasks[taskId].tBattler; battler = gTasks[taskId].tBattler;
gBattleSpritesDataPtr->healthBoxesData[battler].field_1_x1 = 1; gBattleSpritesDataPtr->healthBoxesData[battler].finishedShinyMonAnim = TRUE;
} }
DestroyTask(taskId); DestroyTask(taskId);
@ -2411,7 +2412,7 @@ static void SpriteCB_PokeBlock_Throw(struct Sprite *sprite)
sprite->sTargetY = GetBattlerSpriteCoord(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), BATTLER_COORD_Y) + gBattleAnimArgs[3]; sprite->sTargetY = GetBattlerSpriteCoord(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), BATTLER_COORD_Y) + gBattleAnimArgs[3];
sprite->sAmplitude = -32; sprite->sAmplitude = -32;
InitAnimArcTranslation(sprite); InitAnimArcTranslation(sprite);
gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].callback = sub_8039E84; gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].callback = SpriteCB_TrainerThrowObject;
sprite->callback = SpriteCB_PokeBlock_LiftArm; sprite->callback = SpriteCB_PokeBlock_LiftArm;
} }

View File

@ -239,27 +239,27 @@ static void sub_8064520(void)
{ {
if (r4 || !IsBattlerSpriteVisible(BATTLE_PARTNER(gActiveBattler))) if (r4 || !IsBattlerSpriteVisible(BATTLE_PARTNER(gActiveBattler)))
{ {
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
return; return;
if (!gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].field_1_x1) if (!gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].finishedShinyMonAnim)
return; return;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].finishedShinyMonAnim = FALSE;
FreeSpriteTilesByTag(0x27F9); FreeSpriteTilesByTag(0x27F9);
FreeSpritePaletteByTag(0x27F9); FreeSpritePaletteByTag(0x27F9);
} }
else else
{ {
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
return; return;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
if (GetBattlerPosition(gActiveBattler) == B_POSITION_OPPONENT_RIGHT) if (GetBattlerPosition(gActiveBattler) == B_POSITION_OPPONENT_RIGHT)
{ {
@ -278,15 +278,15 @@ static void sub_8064734(void)
bool32 r10 = FALSE; bool32 r10 = FALSE;
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
{ {
TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
} }
if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI) if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI)
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].field_1_x1) && !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].finishedShinyMonAnim)
{ {
TryShinyAnimation(BATTLE_PARTNER(gActiveBattler), &gEnemyParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]]); TryShinyAnimation(BATTLE_PARTNER(gActiveBattler), &gEnemyParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]]);
} }
@ -367,16 +367,16 @@ static void sub_8064B04(void)
if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
&& gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x == 0) && gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x == 0)
{ {
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim)
{ {
TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
} }
else else
{ {
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
FreeSpriteTilesByTag(0x27F9); FreeSpriteTilesByTag(0x27F9);
FreeSpritePaletteByTag(0x27F9); FreeSpritePaletteByTag(0x27F9);
LinkOpponentBufferExecCompleted(); LinkOpponentBufferExecCompleted();
@ -473,11 +473,11 @@ static void sub_8064DD0(void)
static void sub_8064E50(void) static void sub_8064E50(void)
{ {
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim
&& gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
FreeSpriteTilesByTag(0x27F9); FreeSpriteTilesByTag(0x27F9);
FreeSpritePaletteByTag(0x27F9); FreeSpritePaletteByTag(0x27F9);
@ -495,7 +495,7 @@ static void sub_8064E50(void)
static void sub_8064F40(void) static void sub_8064F40(void)
{ {
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80) && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim)
{ {
TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
} }

View File

@ -359,10 +359,10 @@ static void sub_814B554(void)
static void sub_814B5A8(void) static void sub_814B5A8(void)
{ {
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
FreeSpriteTilesByTag(0x27F9); FreeSpriteTilesByTag(0x27F9);
FreeSpritePaletteByTag(0x27F9); FreeSpritePaletteByTag(0x27F9);
@ -380,7 +380,7 @@ static void sub_814B5A8(void)
static void sub_814B69C(void) static void sub_814B69C(void)
{ {
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive)
{ {
TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]); TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]);

View File

@ -249,23 +249,25 @@ static void sub_805F2F0(void)
{ {
if (var2 == TRUE) if (var2 == TRUE)
{ {
if (var2 && 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)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = FALSE;
FreeSpriteTilesByTag(0x27F9); FreeSpriteTilesByTag(0x27F9);
FreeSpritePaletteByTag(0x27F9); FreeSpritePaletteByTag(0x27F9);
} }
else else
return; return;
} }
else if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) else if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
{ {
if (GetBattlerPosition(gActiveBattler) == 3) if (GetBattlerPosition(gActiveBattler) == 3)
{ {
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].flag_x80 == 0 && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1 == 0) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim)
{ {
FreeSpriteTilesByTag(0x27F9); FreeSpriteTilesByTag(0x27F9);
FreeSpritePaletteByTag(0x27F9); FreeSpritePaletteByTag(0x27F9);
@ -273,8 +275,8 @@ static void sub_805F2F0(void)
else else
return; return;
} }
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
} }
else else
return; return;
@ -289,10 +291,19 @@ static void sub_805F560(void)
bool32 sp = FALSE; bool32 sp = FALSE;
bool32 r10 = FALSE; bool32 r10 = FALSE;
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
if (!(gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) && !(gBattleTypeFlags & BATTLE_TYPE_MULTI) && IsDoubleBattle() && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1)
if (!(gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS)
&& !(gBattleTypeFlags & BATTLE_TYPE_MULTI)
&& IsDoubleBattle()
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim)
TryShinyAnimation(gActiveBattler ^ BIT_FLANK, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]]); TryShinyAnimation(gActiveBattler ^ BIT_FLANK, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]]);
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive)
{ {
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80)
@ -368,13 +379,16 @@ static void sub_805F560(void)
static void sub_805F994(void) static void sub_805F994(void)
{ {
if (gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x == 0 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) if (gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x == 0
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
&& gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
FreeSpriteTilesByTag(0x27F9); FreeSpriteTilesByTag(0x27F9);
FreeSpritePaletteByTag(0x27F9); FreeSpritePaletteByTag(0x27F9);
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
@ -463,10 +477,11 @@ static void sub_805FC80(void)
static void sub_805FD00(void) static void sub_805FD00(void)
{ {
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim
&& gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
FreeSpriteTilesByTag(0x27F9); FreeSpriteTilesByTag(0x27F9);
FreeSpritePaletteByTag(0x27F9); FreeSpritePaletteByTag(0x27F9);
StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0);
@ -480,7 +495,8 @@ static void sub_805FD00(void)
static void sub_805FDF0(void) static void sub_805FDF0(void)
{ {
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive)
TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy

View File

@ -951,13 +951,13 @@ static void sub_805896C(void)
var = TRUE; var = TRUE;
} }
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].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = FALSE;
FreeSpriteTilesByTag(0x27F9); FreeSpriteTilesByTag(0x27F9);
FreeSpritePaletteByTag(0x27F9); FreeSpritePaletteByTag(0x27F9);
@ -976,9 +976,12 @@ static void sub_8058B40(void)
bool32 r9 = FALSE; bool32 r9 = FALSE;
bool32 r8 = FALSE; bool32 r8 = FALSE;
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive)
TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]); TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]);
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive)
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive)
TryShinyAnimation(gActiveBattler ^ BIT_FLANK, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]]); TryShinyAnimation(gActiveBattler ^ BIT_FLANK, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]]);
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive)
@ -1050,12 +1053,12 @@ static void sub_8058B40(void)
static void sub_8058EDC(void) static void sub_8058EDC(void)
{ {
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
&& gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim
&& gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy)
{ {
CopyBattleSpriteInvisibility(gActiveBattler); CopyBattleSpriteInvisibility(gActiveBattler);
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
FreeSpriteTilesByTag(0x27F9); FreeSpriteTilesByTag(0x27F9);
FreeSpritePaletteByTag(0x27F9); FreeSpritePaletteByTag(0x27F9);
@ -1079,11 +1082,9 @@ static void sub_8058FC0(void)
static void sub_805902C(void) static void sub_805902C(void)
{ {
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive)
{
TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]); TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]);
}
if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive)

View File

@ -544,10 +544,10 @@ static void sub_81BB9A0(void)
static void sub_81BB9F4(void) static void sub_81BB9F4(void)
{ {
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
FreeSpriteTilesByTag(0x27F9); FreeSpriteTilesByTag(0x27F9);
FreeSpritePaletteByTag(0x27F9); FreeSpritePaletteByTag(0x27F9);
@ -565,7 +565,7 @@ static void sub_81BB9F4(void)
static void sub_81BBAE8(void) static void sub_81BBAE8(void)
{ {
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive)
{ {
TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]); TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]);

View File

@ -239,15 +239,15 @@ static void sub_8186678(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)
return; return;
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim)
return; return;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = FALSE;
FreeSpriteTilesByTag(0x27F9); FreeSpriteTilesByTag(0x27F9);
FreeSpritePaletteByTag(0x27F9); FreeSpritePaletteByTag(0x27F9);
} }
@ -262,9 +262,12 @@ static void sub_818686C(void)
bool32 r9 = FALSE; bool32 r9 = FALSE;
bool32 r8 = FALSE; bool32 r8 = FALSE;
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive)
TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive)
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive)
TryShinyAnimation(gActiveBattler ^ BIT_FLANK, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]]); TryShinyAnimation(gActiveBattler ^ BIT_FLANK, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]]);
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive)
@ -348,16 +351,16 @@ static void sub_8186C48(void)
if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
&& gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x == 0) && gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x == 0)
{ {
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim)
{ {
TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
} }
else else
{ {
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
FreeSpriteTilesByTag(0x27F9); FreeSpriteTilesByTag(0x27F9);
FreeSpritePaletteByTag(0x27F9); FreeSpritePaletteByTag(0x27F9);
RecordedOpponentBufferExecCompleted(); RecordedOpponentBufferExecCompleted();
@ -455,11 +458,11 @@ static void sub_8186F14(void)
static void sub_8186F94(void) static void sub_8186F94(void)
{ {
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim
&& gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
FreeSpriteTilesByTag(0x27F9); FreeSpriteTilesByTag(0x27F9);
FreeSpritePaletteByTag(0x27F9); FreeSpritePaletteByTag(0x27F9);
@ -477,10 +480,8 @@ static void sub_8186F94(void)
static void sub_8187084(void) static void sub_8187084(void)
{ {
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80) && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim)
{
TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
}
if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive)

View File

@ -224,14 +224,14 @@ static void sub_8189AA0(void)
} }
} }
if (r6 && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 if (r6 && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim
&& gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1) && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = FALSE;
FreeSpriteTilesByTag(0x27F9); FreeSpriteTilesByTag(0x27F9);
FreeSpritePaletteByTag(0x27F9); FreeSpritePaletteByTag(0x27F9);
@ -277,16 +277,13 @@ static void sub_8189D40(void)
if (GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_LEFT) if (GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_LEFT)
{ {
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive)
{
TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]); TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]);
}
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].flag_x80 if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive) && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive)
{
TryShinyAnimation(gActiveBattler ^ BIT_FLANK, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]]); TryShinyAnimation(gActiveBattler ^ BIT_FLANK, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]]);
}
} }
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive
@ -439,10 +436,10 @@ static void sub_818A328(void)
static void sub_818A37C(void) static void sub_818A37C(void)
{ {
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
FreeSpriteTilesByTag(0x27F9); FreeSpriteTilesByTag(0x27F9);
FreeSpritePaletteByTag(0x27F9); FreeSpritePaletteByTag(0x27F9);
@ -460,8 +457,8 @@ static void sub_818A37C(void)
static void sub_818A470(void) static void sub_818A470(void)
{ {
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive)
{ {
TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]); TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]);
} }

View File

@ -389,7 +389,7 @@ static void SafariHandleSuccessBallThrowAnim(void)
{ {
gBattleSpritesDataPtr->animationData->ballThrowCaseId = BALL_3_SHAKES_SUCCESS; gBattleSpritesDataPtr->animationData->ballThrowCaseId = BALL_3_SHAKES_SUCCESS;
gDoingBattleAnim = TRUE; gDoingBattleAnim = TRUE;
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), B_ANIM_SAFARI_BALL_THROW); InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), B_ANIM_BALL_THROW_WITH_TRAINER);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnSpecialAnimDone; gBattlerControllerFuncs[gActiveBattler] = CompleteOnSpecialAnimDone;
} }
@ -399,7 +399,7 @@ static void SafariHandleBallThrowAnim(void)
gBattleSpritesDataPtr->animationData->ballThrowCaseId = ballThrowCaseId; gBattleSpritesDataPtr->animationData->ballThrowCaseId = ballThrowCaseId;
gDoingBattleAnim = TRUE; gDoingBattleAnim = TRUE;
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), B_ANIM_SAFARI_BALL_THROW); InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), B_ANIM_BALL_THROW_WITH_TRAINER);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnSpecialAnimDone; gBattlerControllerFuncs[gActiveBattler] = CompleteOnSpecialAnimDone;
} }

View File

@ -285,9 +285,12 @@ static void CompleteOnChosenItem(void)
static void sub_816864C(void) static void sub_816864C(void)
{ {
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive)
TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]); TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]);
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive)
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive)
TryShinyAnimation(gActiveBattler ^ BIT_FLANK, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]]); TryShinyAnimation(gActiveBattler ^ BIT_FLANK, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]]);
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive
@ -320,14 +323,14 @@ static void sub_8168818(void)
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy)
r4 = TRUE; r4 = TRUE;
if (r4 && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 if (r4 && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim
&& gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1) && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim)
{ {
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = FALSE;
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = FALSE;
FreeSpriteTilesByTag(0x27F9); FreeSpriteTilesByTag(0x27F9);
FreeSpritePaletteByTag(0x27F9); FreeSpritePaletteByTag(0x27F9);
@ -1076,7 +1079,7 @@ static void WallyHandleSuccessBallThrowAnim(void)
{ {
gBattleSpritesDataPtr->animationData->ballThrowCaseId = BALL_3_SHAKES_SUCCESS; gBattleSpritesDataPtr->animationData->ballThrowCaseId = BALL_3_SHAKES_SUCCESS;
gDoingBattleAnim = TRUE; gDoingBattleAnim = TRUE;
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), B_ANIM_SAFARI_BALL_THROW); InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), B_ANIM_BALL_THROW_WITH_TRAINER);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnFinishedAnimation; gBattlerControllerFuncs[gActiveBattler] = CompleteOnFinishedAnimation;
} }
@ -1086,7 +1089,7 @@ static void WallyHandleBallThrowAnim(void)
gBattleSpritesDataPtr->animationData->ballThrowCaseId = ballThrowCaseId; gBattleSpritesDataPtr->animationData->ballThrowCaseId = ballThrowCaseId;
gDoingBattleAnim = TRUE; gDoingBattleAnim = TRUE;
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), B_ANIM_SAFARI_BALL_THROW); InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), B_ANIM_BALL_THROW_WITH_TRAINER);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnFinishedAnimation; gBattlerControllerFuncs[gActiveBattler] = CompleteOnFinishedAnimation;
} }

View File

@ -2978,7 +2978,7 @@ void sub_8039E60(struct Sprite *sprite)
sprite->callback = SpriteCallbackDummy_3; sprite->callback = SpriteCallbackDummy_3;
} }
void sub_8039E84(struct Sprite *sprite) void SpriteCB_TrainerThrowObject(struct Sprite *sprite)
{ {
StartSpriteAnim(sprite, 1); StartSpriteAnim(sprite, 1);
sprite->callback = sub_8039E60; sprite->callback = sub_8039E60;