diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index f7aac71e8..b4bb33993 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -416,7 +416,7 @@ gBattleAnims_Special:: .4byte Special_SwitchOutPlayerMon @ B_ANIM_SWITCH_OUT_PLAYER_MON .4byte Special_SwitchOutOpponentMon @ B_ANIM_SWITCH_OUT_OPPONENT_MON .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_MonToSubstitute @ B_ANIM_MON_TO_SUBSTITUTE @@ -10738,7 +10738,7 @@ BallThrowTrainerBlock: blendoff goto BallThrowEnd -Special_SafariBallThrow: +Special_BallThrowWithTrainer: createvisualtask AnimTask_LoadBallGfx, 2 delay 0 createvisualtask AnimTask_ThrowBall_StandingTrainer, 2 diff --git a/include/battle.h b/include/battle.h index 0ebc9fe01..5a04c1eec 100644 --- a/include/battle.h +++ b/include/battle.h @@ -544,8 +544,8 @@ struct BattleHealthboxInfo u8 statusAnimActive:1; // x10 u8 animFromTableActive:1; // x20 u8 specialAnimActive:1; // x40 - u8 flag_x80:1; - u8 field_1_x1:1; + u8 triedShinyMonAnim:1; + u8 finishedShinyMonAnim:1; u8 field_1_x1E:4; u8 field_1_x20:1; u8 field_1_x40:1; diff --git a/include/battle_main.h b/include/battle_main.h index 217b10b39..890e47f39 100644 --- a/include/battle_main.h +++ b/include/battle_main.h @@ -67,7 +67,7 @@ void DoBounceEffect(u8 battlerId, u8 b, s8 c, s8 d); void EndBounceEffect(u8 battlerId, bool8 b); void SpriteCb_PlayerMonFromBall(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 nullsub_20(void); void BeginBattleIntro(void); diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index dfdd9f912..ebc422b18 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -376,7 +376,7 @@ #define B_ANIM_SWITCH_OUT_PLAYER_MON 0x1 #define B_ANIM_SWITCH_OUT_OPPONENT_MON 0x2 #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_MON_TO_SUBSTITUTE 0x6 diff --git a/src/battle_anim_throw.c b/src/battle_anim_throw.c index 7049931d3..fef301326 100755 --- a/src/battle_anim_throw.c +++ b/src/battle_anim_throw.c @@ -49,7 +49,7 @@ enum { }; static void sub_8170660(u8); -static void sub_8170A38(u8); +static void AnimTask_FlashHealthboxOnLevelUp_Step(u8); static void AnimTask_ThrowBall_Step(u8); static void SpriteCB_Ball_Throw(struct Sprite *); static void AnimTask_ThrowBall_StandingTrainer_Step(u8); @@ -139,39 +139,39 @@ static const struct CaptureStar sCaptureStars[] = #define TAG_PARTICLES_LUXURYBALL 55030 #define TAG_PARTICLES_PREMIERBALL 55031 -const struct CompressedSpriteSheet gBallParticleSpritesheets[] = +static const struct CompressedSpriteSheet sBallParticleSpriteSheets[POKEBALL_COUNT] = { - {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_POKEBALL}, - {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_GREATBALL}, - {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_SAFARIBALL}, - {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_ULTRABALL}, - {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_MASTERBALL}, - {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_NETBALL}, - {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_DIVEBALL}, - {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_NESTBALL}, - {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_REPEATBALL}, - {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_TIMERBALL}, - {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_LUXURYBALL}, - {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_PREMIERBALL}, + [BALL_POKE] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_POKEBALL}, + [BALL_GREAT] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_GREATBALL}, + [BALL_SAFARI] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_SAFARIBALL}, + [BALL_ULTRA] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_ULTRABALL}, + [BALL_MASTER] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_MASTERBALL}, + [BALL_NET] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_NETBALL}, + [BALL_DIVE] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_DIVEBALL}, + [BALL_NEST] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_NESTBALL}, + [BALL_REPEAT] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_REPEATBALL}, + [BALL_TIMER] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_TIMERBALL}, + [BALL_LUXURY] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_LUXURYBALL}, + [BALL_PREMIER] = {gBattleAnimSpriteGfx_Particles, 0x100, TAG_PARTICLES_PREMIERBALL}, }; -const struct CompressedSpritePalette gBallParticlePalettes[] = +static const struct CompressedSpritePalette sBallParticlePalettes[POKEBALL_COUNT] = { - {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_POKEBALL}, - {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_GREATBALL}, - {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_SAFARIBALL}, - {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_ULTRABALL}, - {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_MASTERBALL}, - {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_NETBALL}, - {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_DIVEBALL}, - {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_NESTBALL}, - {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_REPEATBALL}, - {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_TIMERBALL}, - {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_LUXURYBALL}, - {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_PREMIERBALL}, + [BALL_POKE] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_POKEBALL}, + [BALL_GREAT] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_GREATBALL}, + [BALL_SAFARI] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_SAFARIBALL}, + [BALL_ULTRA] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_ULTRABALL}, + [BALL_MASTER] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_MASTERBALL}, + [BALL_NET] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_NETBALL}, + [BALL_DIVE] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_DIVEBALL}, + [BALL_NEST] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_NESTBALL}, + [BALL_REPEAT] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_REPEATBALL}, + [BALL_TIMER] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_TIMERBALL}, + [BALL_LUXURY] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_LUXURYBALL}, + [BALL_PREMIER] = {gBattleAnimSpritePal_CircleImpact, TAG_PARTICLES_PREMIERBALL}, }; -const union AnimCmd gAnim_RegularBall[] = +static const union AnimCmd sAnim_RegularBall[] = { ANIMCMD_FRAME(0, 1), ANIMCMD_FRAME(1, 1), @@ -182,185 +182,185 @@ const union AnimCmd gAnim_RegularBall[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gAnim_MasterBall[] = +static const union AnimCmd sAnim_MasterBall[] = { ANIMCMD_FRAME(3, 1), ANIMCMD_END, }; -const union AnimCmd gAnim_NetDiveBall[] = +static const union AnimCmd sAnim_NetDiveBall[] = { ANIMCMD_FRAME(4, 1), ANIMCMD_END, }; -const union AnimCmd gAnim_NestBall[] = +static const union AnimCmd sAnim_NestBall[] = { ANIMCMD_FRAME(5, 1), ANIMCMD_END, }; -const union AnimCmd gAnim_LuxuryPremierBall[] = +static const union AnimCmd sAnim_LuxuryPremierBall[] = { ANIMCMD_FRAME(6, 4), ANIMCMD_FRAME(7, 4), ANIMCMD_JUMP(0), }; -const union AnimCmd gAnim_UltraRepeatTimerBall[] = +static const union AnimCmd sAnim_UltraRepeatTimerBall[] = { ANIMCMD_FRAME(7, 4), ANIMCMD_END, }; -const union AnimCmd *const gAnims_BallParticles[] = +static const union AnimCmd *const sAnims_BallParticles[] = { - gAnim_RegularBall, - gAnim_MasterBall, - gAnim_NetDiveBall, - gAnim_NestBall, - gAnim_LuxuryPremierBall, - gAnim_UltraRepeatTimerBall, + sAnim_RegularBall, + sAnim_MasterBall, + sAnim_NetDiveBall, + sAnim_NestBall, + sAnim_LuxuryPremierBall, + sAnim_UltraRepeatTimerBall, }; -const u8 gBallParticleAnimNums[] = +static const u8 sBallParticleAnimNums[POKEBALL_COUNT] = { - [BALL_POKE] = 0, - [BALL_GREAT] = 0, - [BALL_SAFARI] = 0, - [BALL_ULTRA] = 5, - [BALL_MASTER] = 1, - [BALL_NET] = 2, - [BALL_DIVE] = 2, - [BALL_NEST] = 3, - [BALL_REPEAT] = 5, - [BALL_TIMER] = 5, - [BALL_LUXURY] = 4, + [BALL_POKE] = 0, + [BALL_GREAT] = 0, + [BALL_SAFARI] = 0, + [BALL_ULTRA] = 5, + [BALL_MASTER] = 1, + [BALL_NET] = 2, + [BALL_DIVE] = 2, + [BALL_NEST] = 3, + [BALL_REPEAT] = 5, + [BALL_TIMER] = 5, + [BALL_LUXURY] = 4, [BALL_PREMIER] = 4, }; -const TaskFunc gBallParticleAnimationFuncs[] = +static const TaskFunc sBallParticleAnimationFuncs[POKEBALL_COUNT] = { - PokeBallOpenParticleAnimation, - GreatBallOpenParticleAnimation, - SafariBallOpenParticleAnimation, - UltraBallOpenParticleAnimation, - MasterBallOpenParticleAnimation, - SafariBallOpenParticleAnimation, - DiveBallOpenParticleAnimation, - UltraBallOpenParticleAnimation, - RepeatBallOpenParticleAnimation, - TimerBallOpenParticleAnimation, - GreatBallOpenParticleAnimation, - PremierBallOpenParticleAnimation, + [BALL_POKE] = PokeBallOpenParticleAnimation, + [BALL_GREAT] = GreatBallOpenParticleAnimation, + [BALL_SAFARI] = SafariBallOpenParticleAnimation, + [BALL_ULTRA] = UltraBallOpenParticleAnimation, + [BALL_MASTER] = MasterBallOpenParticleAnimation, + [BALL_NET] = SafariBallOpenParticleAnimation, + [BALL_DIVE] = DiveBallOpenParticleAnimation, + [BALL_NEST] = UltraBallOpenParticleAnimation, + [BALL_REPEAT] = RepeatBallOpenParticleAnimation, + [BALL_TIMER] = TimerBallOpenParticleAnimation, + [BALL_LUXURY] = GreatBallOpenParticleAnimation, + [BALL_PREMIER] = PremierBallOpenParticleAnimation, }; -const struct SpriteTemplate gBallParticlesSpriteTemplates[] = +static const struct SpriteTemplate sBallParticleSpriteTemplates[POKEBALL_COUNT] = { - { + [BALL_POKE] = { .tileTag = TAG_PARTICLES_POKEBALL, .paletteTag = TAG_PARTICLES_POKEBALL, .oam = &gOamData_AffineOff_ObjNormal_8x8, - .anims = gAnims_BallParticles, + .anims = sAnims_BallParticles, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, }, - { + [BALL_GREAT] = { .tileTag = TAG_PARTICLES_GREATBALL, .paletteTag = TAG_PARTICLES_GREATBALL, .oam = &gOamData_AffineOff_ObjNormal_8x8, - .anims = gAnims_BallParticles, + .anims = sAnims_BallParticles, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, }, - { + [BALL_SAFARI] = { .tileTag = TAG_PARTICLES_SAFARIBALL, .paletteTag = TAG_PARTICLES_SAFARIBALL, .oam = &gOamData_AffineOff_ObjNormal_8x8, - .anims = gAnims_BallParticles, + .anims = sAnims_BallParticles, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, }, - { + [BALL_ULTRA] = { .tileTag = TAG_PARTICLES_ULTRABALL, .paletteTag = TAG_PARTICLES_ULTRABALL, .oam = &gOamData_AffineOff_ObjNormal_8x8, - .anims = gAnims_BallParticles, + .anims = sAnims_BallParticles, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, }, - { + [BALL_MASTER] = { .tileTag = TAG_PARTICLES_MASTERBALL, .paletteTag = TAG_PARTICLES_MASTERBALL, .oam = &gOamData_AffineOff_ObjNormal_8x8, - .anims = gAnims_BallParticles, + .anims = sAnims_BallParticles, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, }, - { + [BALL_NET] = { .tileTag = TAG_PARTICLES_NETBALL, .paletteTag = TAG_PARTICLES_NETBALL, .oam = &gOamData_AffineOff_ObjNormal_8x8, - .anims = gAnims_BallParticles, + .anims = sAnims_BallParticles, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, }, - { + [BALL_DIVE] = { .tileTag = TAG_PARTICLES_DIVEBALL, .paletteTag = TAG_PARTICLES_DIVEBALL, .oam = &gOamData_AffineOff_ObjNormal_8x8, - .anims = gAnims_BallParticles, + .anims = sAnims_BallParticles, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, }, - { + [BALL_NEST] = { .tileTag = TAG_PARTICLES_NESTBALL, .paletteTag = TAG_PARTICLES_NESTBALL, .oam = &gOamData_AffineOff_ObjNormal_8x8, - .anims = gAnims_BallParticles, + .anims = sAnims_BallParticles, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, }, - { + [BALL_REPEAT] = { .tileTag = TAG_PARTICLES_REPEATBALL, .paletteTag = TAG_PARTICLES_REPEATBALL, .oam = &gOamData_AffineOff_ObjNormal_8x8, - .anims = gAnims_BallParticles, + .anims = sAnims_BallParticles, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, }, - { + [BALL_TIMER] = { .tileTag = TAG_PARTICLES_TIMERBALL, .paletteTag = TAG_PARTICLES_TIMERBALL, .oam = &gOamData_AffineOff_ObjNormal_8x8, - .anims = gAnims_BallParticles, + .anims = sAnims_BallParticles, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, }, - { + [BALL_LUXURY] = { .tileTag = TAG_PARTICLES_LUXURYBALL, .paletteTag = TAG_PARTICLES_LUXURYBALL, .oam = &gOamData_AffineOff_ObjNormal_8x8, - .anims = gAnims_BallParticles, + .anims = sAnims_BallParticles, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, }, - { + [BALL_PREMIER] = { .tileTag = TAG_PARTICLES_PREMIERBALL, .paletteTag = TAG_PARTICLES_PREMIERBALL, .oam = &gOamData_AffineOff_ObjNormal_8x8, - .anims = gAnims_BallParticles, + .anims = sAnims_BallParticles, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, @@ -404,22 +404,23 @@ const struct SpriteTemplate gPokeblockSpriteTemplate = .callback = SpriteCB_PokeBlock_Throw, }; -const union AnimCmd gUnknown_085E5350[] = +static const union AnimCmd sAnim_SafariRock[] = { ANIMCMD_FRAME(64, 1), ANIMCMD_END, }; -const union AnimCmd *const gUnknown_085E5358[] = { - gUnknown_085E5350, +static const union AnimCmd *const sAnims_SafariRock[] = { + sAnim_SafariRock, }; -const struct SpriteTemplate gBattleAnimSpriteTemplate_085E535C = +// Unused, leftover from FRLG +static const struct SpriteTemplate sSafariRockSpriteTemplate = { .tileTag = ANIM_TAG_ROCKS, .paletteTag = ANIM_TAG_ROCKS, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = gUnknown_085E5358, + .anims = sAnims_SafariRock, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCB_PokeBlock_Throw, @@ -594,10 +595,10 @@ void AnimTask_FlashHealthboxOnLevelUp(u8 taskId) { gTasks[taskId].data[10] = gBattleAnimArgs[0]; 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; u32 paletteOffset, colorOffset; @@ -807,7 +808,7 @@ void AnimTask_ThrowBall_StandingTrainer(u8 taskId) gSprites[spriteId].sTargetX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); gSprites[spriteId].sTargetY = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) - 16; 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].func = AnimTask_ThrowBall_StandingTrainer_Step; } @@ -1415,7 +1416,7 @@ static void MakeCaptureStars(struct Sprite *sprite) LoadBallParticleGfx(BALL_MASTER); 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) { gSprites[spriteId].sDuration = 24; @@ -1424,7 +1425,7 @@ static void MakeCaptureStars(struct Sprite *sprite) gSprites[spriteId].sAmplitude = sCaptureStars[i].amplitude; InitAnimArcTranslation(&gSprites[spriteId]); 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; - if (GetSpriteTileStartByTag(gBallParticleSpritesheets[ballId].tag) == 0xFFFF) + if (GetSpriteTileStartByTag(sBallParticleSpriteSheets[ballId].tag) == 0xFFFF) { - LoadCompressedSpriteSheetUsingHeap(&gBallParticleSpritesheets[ballId]); - LoadCompressedSpritePaletteUsingHeap(&gBallParticlePalettes[ballId]); + LoadCompressedSpriteSheetUsingHeap(&sBallParticleSpriteSheets[ballId]); + LoadCompressedSpritePaletteUsingHeap(&sBallParticlePalettes[ballId]); } } @@ -1564,7 +1565,7 @@ u8 AnimateBallOpenParticles(u8 x, u8 y, u8 priority, u8 subpriority, u8 ballId) u8 taskId; LoadBallParticleGfx(ballId); - taskId = CreateTask(gBallParticleAnimationFuncs[ballId], 5); + taskId = CreateTask(sBallParticleAnimationFuncs[ballId], 5); gTasks[taskId].data[1] = x; gTasks[taskId].data[2] = y; gTasks[taskId].data[3] = priority; @@ -1597,11 +1598,11 @@ static void PokeBallOpenParticleAnimation(u8 taskId) priority = gTasks[taskId].data[3]; subpriority = gTasks[taskId].data[4]; - spriteId = CreateSprite(&gBallParticlesSpriteTemplates[ballId], x, y, subpriority); + spriteId = CreateSprite(&sBallParticleSpriteTemplates[ballId], x, y, subpriority); if (spriteId != MAX_SPRITES) { IncrBallParticleCount(); - StartSpriteAnim(&gSprites[spriteId], gBallParticleAnimNums[ballId]); + StartSpriteAnim(&gSprites[spriteId], sBallParticleAnimNums[ballId]); gSprites[spriteId].callback = PokeBallOpenParticleAnimation_Step1; gSprites[spriteId].oam.priority = priority; @@ -1656,11 +1657,11 @@ static void TimerBallOpenParticleAnimation(u8 taskId) for (i = 0; i < 8; i++) { - spriteId = CreateSprite(&gBallParticlesSpriteTemplates[ballId], x, y, subpriority); + spriteId = CreateSprite(&sBallParticleSpriteTemplates[ballId], x, y, subpriority); if (spriteId != MAX_SPRITES) { IncrBallParticleCount(); - StartSpriteAnim(&gSprites[spriteId], gBallParticleAnimNums[ballId]); + StartSpriteAnim(&gSprites[spriteId], sBallParticleAnimNums[ballId]); gSprites[spriteId].callback = FanOutBallOpenParticles_Step1; gSprites[spriteId].oam.priority = priority; gSprites[spriteId].data[0] = i * 32; @@ -1690,11 +1691,11 @@ static void DiveBallOpenParticleAnimation(u8 taskId) for (i = 0; i < 8; i++) { - spriteId = CreateSprite(&gBallParticlesSpriteTemplates[ballId], x, y, subpriority); + spriteId = CreateSprite(&sBallParticleSpriteTemplates[ballId], x, y, subpriority); if (spriteId != MAX_SPRITES) { IncrBallParticleCount(); - StartSpriteAnim(&gSprites[spriteId], gBallParticleAnimNums[ballId]); + StartSpriteAnim(&gSprites[spriteId], sBallParticleAnimNums[ballId]); gSprites[spriteId].callback = FanOutBallOpenParticles_Step1; gSprites[spriteId].oam.priority = priority; gSprites[spriteId].data[0] = i * 32; @@ -1725,11 +1726,11 @@ static void SafariBallOpenParticleAnimation(u8 taskId) for (i = 0; i < 8; i++) { - spriteId = CreateSprite(&gBallParticlesSpriteTemplates[ballId], x, y, subpriority); + spriteId = CreateSprite(&sBallParticleSpriteTemplates[ballId], x, y, subpriority); if (spriteId != MAX_SPRITES) { IncrBallParticleCount(); - StartSpriteAnim(&gSprites[spriteId], gBallParticleAnimNums[ballId]); + StartSpriteAnim(&gSprites[spriteId], sBallParticleAnimNums[ballId]); gSprites[spriteId].callback = FanOutBallOpenParticles_Step1; gSprites[spriteId].oam.priority = priority; gSprites[spriteId].data[0] = i * 32; @@ -1760,11 +1761,11 @@ static void UltraBallOpenParticleAnimation(u8 taskId) for (i = 0; i < 10; i++) { - spriteId = CreateSprite(&gBallParticlesSpriteTemplates[ballId], x, y, subpriority); + spriteId = CreateSprite(&sBallParticleSpriteTemplates[ballId], x, y, subpriority); if (spriteId != MAX_SPRITES) { IncrBallParticleCount(); - StartSpriteAnim(&gSprites[spriteId], gBallParticleAnimNums[ballId]); + StartSpriteAnim(&gSprites[spriteId], sBallParticleAnimNums[ballId]); gSprites[spriteId].callback = FanOutBallOpenParticles_Step1; gSprites[spriteId].oam.priority = priority; gSprites[spriteId].data[0] = i * 25; @@ -1801,11 +1802,11 @@ static void GreatBallOpenParticleAnimation(u8 taskId) for (i = 0; i < 8; i++) { - spriteId = CreateSprite(&gBallParticlesSpriteTemplates[ballId], x, y, subpriority); + spriteId = CreateSprite(&sBallParticleSpriteTemplates[ballId], x, y, subpriority); if (spriteId != MAX_SPRITES) { IncrBallParticleCount(); - StartSpriteAnim(&gSprites[spriteId], gBallParticleAnimNums[ballId]); + StartSpriteAnim(&gSprites[spriteId], sBallParticleAnimNums[ballId]); gSprites[spriteId].callback = FanOutBallOpenParticles_Step1; gSprites[spriteId].oam.priority = priority; gSprites[spriteId].data[0] = i * 32; @@ -1851,11 +1852,11 @@ static void RepeatBallOpenParticleAnimation(u8 taskId) 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) { IncrBallParticleCount(); - StartSpriteAnim(&gSprites[spriteId], gBallParticleAnimNums[ballId]); + StartSpriteAnim(&gSprites[spriteId], sBallParticleAnimNums[ballId]); gSprites[spriteId].callback = RepeatBallOpenParticleAnimation_Step1; gSprites[spriteId].oam.priority = priority; gSprites[spriteId].data[0] = i * 21; @@ -1895,11 +1896,11 @@ static void MasterBallOpenParticleAnimation(u8 taskId) { for (i = 0; i < 8; i++) { - spriteId = CreateSprite(&gBallParticlesSpriteTemplates[ballId], x, y, subpriority); + spriteId = CreateSprite(&sBallParticleSpriteTemplates[ballId], x, y, subpriority); if (spriteId != MAX_SPRITES) { IncrBallParticleCount(); - StartSpriteAnim(&gSprites[spriteId], gBallParticleAnimNums[ballId]); + StartSpriteAnim(&gSprites[spriteId], sBallParticleAnimNums[ballId]); gSprites[spriteId].callback = FanOutBallOpenParticles_Step1; gSprites[spriteId].oam.priority = priority; gSprites[spriteId].data[0] = i * 32; @@ -1939,11 +1940,11 @@ static void PremierBallOpenParticleAnimation(u8 taskId) for (i = 0; i < 8; i++) { - spriteId = CreateSprite(&gBallParticlesSpriteTemplates[ballId], x, y, subpriority); + spriteId = CreateSprite(&sBallParticleSpriteTemplates[ballId], x, y, subpriority); if (spriteId != MAX_SPRITES) { IncrBallParticleCount(); - StartSpriteAnim(&gSprites[spriteId], gBallParticleAnimNums[ballId]); + StartSpriteAnim(&gSprites[spriteId], sBallParticleAnimNums[ballId]); gSprites[spriteId].callback = PremierBallOpenParticleAnimation_Step1; gSprites[spriteId].oam.priority = priority; gSprites[spriteId].data[0] = i * 32; @@ -1985,7 +1986,7 @@ static void DestroyBallOpenAnimationParticle(struct Sprite *sprite) { for (i = 0; i < POKEBALL_COUNT; i++) { - if (FuncIsActiveTask(gBallParticleAnimationFuncs[i]) == TRUE) + if (FuncIsActiveTask(sBallParticleAnimationFuncs[i]) == TRUE) break; } @@ -1993,8 +1994,8 @@ static void DestroyBallOpenAnimationParticle(struct Sprite *sprite) { for (j = 0; j < POKEBALL_COUNT; j++) { - FreeSpriteTilesByTag(gBallParticleSpritesheets[j].tag); - FreeSpritePaletteByTag(gBallParticlePalettes[j].tag); + FreeSpriteTilesByTag(sBallParticleSpriteSheets[j].tag); + FreeSpritePaletteByTag(sBallParticlePalettes[j].tag); } } @@ -2218,7 +2219,7 @@ void TryShinyAnimation(u8 battler, struct Pokemon *mon) u8 taskCirc, taskDgnl; isShiny = FALSE; - gBattleSpritesDataPtr->healthBoxesData[battler].flag_x80 = 1; + gBattleSpritesDataPtr->healthBoxesData[battler].triedShinyMonAnim = TRUE; otId = GetMonData(mon, MON_DATA_OT_ID); 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) @@ -2331,7 +2332,7 @@ static void Task_ShinyStars_Wait(u8 taskId) if (gTasks[taskId].tStarMove == SHINY_STAR_DIAGONAL) { battler = gTasks[taskId].tBattler; - gBattleSpritesDataPtr->healthBoxesData[battler].field_1_x1 = 1; + gBattleSpritesDataPtr->healthBoxesData[battler].finishedShinyMonAnim = TRUE; } 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->sAmplitude = -32; InitAnimArcTranslation(sprite); - gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].callback = sub_8039E84; + gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].callback = SpriteCB_TrainerThrowObject; sprite->callback = SpriteCB_PokeBlock_LiftArm; } diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index 3461e9754..1041f6fda 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -239,27 +239,27 @@ static void sub_8064520(void) { if (r4 || !IsBattlerSpriteVisible(BATTLE_PARTNER(gActiveBattler))) { - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim) return; - if (!gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].field_1_x1) + if (!gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].finishedShinyMonAnim) return; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; - gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].flag_x80 = 0; - gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].finishedShinyMonAnim = FALSE; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); } else { - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim) return; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; if (GetBattlerPosition(gActiveBattler) == B_POSITION_OPPONENT_RIGHT) { @@ -278,15 +278,15 @@ static void sub_8064734(void) bool32 r10 = FALSE; if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive - && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 - && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) + && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim + && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim) { TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); } if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI) && !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive - && !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].flag_x80 - && !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].field_1_x1) + && !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim + && !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].finishedShinyMonAnim) { TryShinyAnimation(BATTLE_PARTNER(gActiveBattler), &gEnemyParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]]); } @@ -367,16 +367,16 @@ static void sub_8064B04(void) if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x == 0) { - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80) + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim) { TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); } else { - if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) + if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); LinkOpponentBufferExecCompleted(); @@ -473,11 +473,11 @@ static void sub_8064DD0(void) static void sub_8064E50(void) { - if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 + if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); @@ -495,7 +495,7 @@ static void sub_8064E50(void) static void sub_8064F40(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive - && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80) + && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim) { TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); } diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index 63aa6eaea..af81b06d5 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -359,10 +359,10 @@ static void sub_814B554(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].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); @@ -380,7 +380,7 @@ static void sub_814B5A8(void) static void sub_814B69C(void) { - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) { TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]); diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 858201b4b..f186bf3ff 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -249,23 +249,25 @@ static void sub_805F2F0(void) { 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].field_1_x1 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].flag_x80 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = FALSE; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); } else return; } - else if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) + else if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim) { 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); FreeSpritePaletteByTag(0x27F9); @@ -273,8 +275,8 @@ static void sub_805F2F0(void) else return; } - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; } else return; @@ -289,10 +291,19 @@ static void sub_805F560(void) bool32 sp = 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]]); - 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]]); + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80) @@ -368,13 +379,16 @@ static void sub_805F560(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]]); - 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].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); OpponentBufferExecCompleted(); @@ -463,10 +477,11 @@ static void sub_805FC80(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].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0); @@ -480,7 +495,8 @@ static void sub_805FD00(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]]); if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index c9a3bc2e0..d8005e808 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -951,13 +951,13 @@ static void sub_805896C(void) var = TRUE; } - 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].flag_x80 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].flag_x80 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = FALSE; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); @@ -976,9 +976,12 @@ static void sub_8058B40(void) bool32 r9 = 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]]); - 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]]); 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) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy - && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 + && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { CopyBattleSpriteInvisibility(gActiveBattler); - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); @@ -1079,11 +1082,9 @@ static void sub_8058FC0(void) static void sub_805902C(void) { - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) - { TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]); - } if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index 7796bef09..af6b739cc 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -544,10 +544,10 @@ static void sub_81BB9A0(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].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); @@ -565,7 +565,7 @@ static void sub_81BB9F4(void) static void sub_81BBAE8(void) { - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) { TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]); diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index 76e84da41..ca7cd4adc 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -239,15 +239,15 @@ static void sub_8186678(void) { if (GetBattlerPosition(gActiveBattler) == B_POSITION_OPPONENT_LEFT) { - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim) return; - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1) + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim) return; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].flag_x80 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = FALSE; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); } @@ -262,9 +262,12 @@ static void sub_818686C(void) bool32 r9 = 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]]); - 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]]); 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 && gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x == 0) { - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80) + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim) { TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); } else { - if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1) + if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); RecordedOpponentBufferExecCompleted(); @@ -455,11 +458,11 @@ static void sub_8186F14(void) static void sub_8186F94(void) { - if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 + if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); @@ -477,10 +480,8 @@ static void sub_8186F94(void) static void sub_8187084(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive - && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80) - { + && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim) TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); - } if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index 387586f88..72af27d5e 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -224,14 +224,14 @@ static void sub_8189AA0(void) } } - if (r6 && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 - && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1) + if (r6 && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim + && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].flag_x80 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = FALSE; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); @@ -277,16 +277,13 @@ static void sub_8189D40(void) if (GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_LEFT) { - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) - { 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) - { TryShinyAnimation(gActiveBattler ^ BIT_FLANK, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]]); - } } if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive @@ -439,10 +436,10 @@ static void sub_818A328(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].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); @@ -460,8 +457,8 @@ static void sub_818A37C(void) static void sub_818A470(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]]); } diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c index c39b904c9..70e41cf8d 100644 --- a/src/battle_controller_safari.c +++ b/src/battle_controller_safari.c @@ -389,7 +389,7 @@ static void SafariHandleSuccessBallThrowAnim(void) { gBattleSpritesDataPtr->animationData->ballThrowCaseId = BALL_3_SHAKES_SUCCESS; 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; } @@ -399,7 +399,7 @@ static void SafariHandleBallThrowAnim(void) gBattleSpritesDataPtr->animationData->ballThrowCaseId = ballThrowCaseId; 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; } diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index a26694a8e..aa50bc159 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -285,9 +285,12 @@ static void CompleteOnChosenItem(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]]); - 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]]); if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive @@ -320,14 +323,14 @@ static void sub_8168818(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) + if (r4 && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim + && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x80 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].flag_x80 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x1 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = FALSE; FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); @@ -1076,7 +1079,7 @@ static void WallyHandleSuccessBallThrowAnim(void) { gBattleSpritesDataPtr->animationData->ballThrowCaseId = BALL_3_SHAKES_SUCCESS; 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; } @@ -1086,7 +1089,7 @@ static void WallyHandleBallThrowAnim(void) gBattleSpritesDataPtr->animationData->ballThrowCaseId = ballThrowCaseId; 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; } diff --git a/src/battle_main.c b/src/battle_main.c index 935a53ffe..00ef33cf2 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -2978,7 +2978,7 @@ void sub_8039E60(struct Sprite *sprite) sprite->callback = SpriteCallbackDummy_3; } -void sub_8039E84(struct Sprite *sprite) +void SpriteCB_TrainerThrowObject(struct Sprite *sprite) { StartSpriteAnim(sprite, 1); sprite->callback = sub_8039E60;