diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index d7710631d..c44172bc6 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -6134,17 +6134,22 @@ Move_STRUGGLE_BUG: loadspritegfx ANIM_TAG_IMPACT monbg ANIM_TARGET setalpha 12, 8 - launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x2 0x0 0x9 0x0a1f + createvisualtask AnimTask_BlendBattleAnimPal, 10, ANIM_PAL_ATK, 2, 0, 9, 0x0a1f waitforvisualfinish - launchtask AnimTask_FlailMovement 0x2 0x1 0x0 - launchtemplate gMovementWavesSpriteTemplate 0x2 0x3 0x0 0x0 0x2 - launchtemplate gMovementWavesSpriteTemplate 0x2 0x3 0x0 0x1 0x2 + createvisualtask AnimTask_FlailMovement, 2, 0 + createsprite gMovementWavesSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 2 + createsprite gMovementWavesSpriteTemplate, ANIM_ATTACKER, 2, 0, 1, 2 loopsewithpan SE_M_HEADBUTT, SOUND_PAN_ATTACKER, 0x8, 0x2 waitforvisualfinish - launchtemplate gRandomPosHitSplatSpriteTemplate 0x83 0x2 0x1 0x3 - launchtask AnimTask_ShakeTargetBasedOnMovePowerOrDmg 0x2 0x5 0x0 0x1 0x1e 0x1 0x0 + createsprite gRandomPosHitSplatSpriteTemplate, ANIM_TARGET, 3, ANIM_TARGET, 1 + createvisualtask AnimTask_ShakeTargetBasedOnMovePowerOrDmg, 2, FALSE, 1, 0x1e, 1, 0 + createvisualtask AnimTask_ShakeTargetPartnerBasedOnMovePowerOrDmg, 2, FALSE, 1, 0x1e, 1, 0 playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET - launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x2 0x9 0x0 0x0a1f + createvisualtask AnimTask_BlendBattleAnimPal, 10, ANIM_PAL_ATK, 2, 9, 0, 0x0a1f + delay 5 + createsprite gRandomPosHitSplatSpriteTemplate, ANIM_TARGET, 3, ANIM_TARGET, 1 + delay 5 + createsprite gRandomPosHitSplatSpriteTemplate, ANIM_TARGET, 3, ANIM_TARGET, 1 waitforvisualfinish clearmonbg ANIM_TARGET blendoff diff --git a/include/battle_anim.h b/include/battle_anim.h index 9d9c61b6f..f9327292a 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -492,5 +492,6 @@ void AnimOverheatFlame(struct Sprite *sprite); // battle_anim_new.c void CoreEnforcerLoadBeamTarget(struct Sprite* sprite); +void SpriteCB_RandomCentredHits(struct Sprite* sprite); #endif // GUARD_BATTLE_ANIM_H diff --git a/src/battle_anim_mon_movement.c b/src/battle_anim_mon_movement.c index d15cf6342..c5c35ef6f 100644 --- a/src/battle_anim_mon_movement.c +++ b/src/battle_anim_mon_movement.c @@ -992,7 +992,7 @@ static void AnimTask_RotateMonSpriteToSide_Step(u8 taskId) } } -void AnimTask_ShakeTargetBasedOnMovePowerOrDmg(u8 taskId) +void SetupShakeBattlerBasedOnMovePowerOrDmg(u8 taskId, u8 animBattlerId) { if (!gBattleAnimArgs[0]) { @@ -1023,12 +1023,23 @@ void AnimTask_ShakeTargetBasedOnMovePowerOrDmg(u8 taskId) gTasks[taskId].data[12] = 0; gTasks[taskId].data[10] = gBattleAnimArgs[3]; gTasks[taskId].data[11] = gBattleAnimArgs[4]; - gTasks[taskId].data[7] = GetAnimBattlerSpriteId(ANIM_TARGET); + gTasks[taskId].data[7] = GetAnimBattlerSpriteId(animBattlerId); gTasks[taskId].data[8] = gSprites[gTasks[taskId].data[7]].x2; gTasks[taskId].data[9] = gSprites[gTasks[taskId].data[7]].y2; gTasks[taskId].data[0] = 0; gTasks[taskId].data[1] = gBattleAnimArgs[1]; gTasks[taskId].data[2] = gBattleAnimArgs[2]; +} + +void AnimTask_ShakeTargetPartnerBasedOnMovePowerOrDmg(u8 taskId) +{ + SetupShakeBattlerBasedOnMovePowerOrDmg(taskId, ANIM_DEF_PARTNER); + gTasks[taskId].func = AnimTask_ShakeTargetBasedOnMovePowerOrDmg_Step; +} + +void AnimTask_ShakeTargetBasedOnMovePowerOrDmg(u8 taskId) +{ + SetupShakeBattlerBasedOnMovePowerOrDmg(taskId, ANIM_TARGET); gTasks[taskId].func = AnimTask_ShakeTargetBasedOnMovePowerOrDmg_Step; } diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index 450ab3524..1392fc626 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -33,7 +33,6 @@ static void SpriteCB_MoongeistCharge(struct Sprite *sprite); static void SpriteCB_MindBlownBall(struct Sprite *sprite); static void AnimMindBlownBallStep(struct Sprite *sprite); static void SpriteCB_MindBlownExplosion(struct Sprite* sprite); -static void SpriteCB_RandomCentredHits(struct Sprite* sprite); static void SpriteCB_LockingJaw(struct Sprite *sprite); static void SpriteCB_LockingJawStep(struct Sprite *sprite); static void SpriteCB_LockingJawFinish(struct Sprite *sprite); @@ -4585,7 +4584,7 @@ static void SpriteCB_MindBlownExplosion(struct Sprite* sprite) } } -static void SpriteCB_RandomCentredHits(struct Sprite* sprite) +void SpriteCB_RandomCentredHits(struct Sprite* sprite) { if (gBattleAnimArgs[1] == -1) gBattleAnimArgs[1] = Random() & 3; diff --git a/src/battle_anim_normal.c b/src/battle_anim_normal.c index 8bbfc5845..524abccb1 100644 --- a/src/battle_anim_normal.c +++ b/src/battle_anim_normal.c @@ -258,7 +258,7 @@ const struct SpriteTemplate gRandomPosHitSplatSpriteTemplate = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gAffineAnims_HitSplat, - .callback = AnimHitSplatRandom, + .callback = SpriteCB_RandomCentredHits, }; const struct SpriteTemplate gMonEdgeHitSplatSpriteTemplate =