fix struggle bug anim

This commit is contained in:
ghoulslash 2022-02-25 08:54:35 -05:00
parent eebe664bfc
commit 7c2bbf1df3
5 changed files with 28 additions and 12 deletions

View File

@ -6134,17 +6134,22 @@ Move_STRUGGLE_BUG:
loadspritegfx ANIM_TAG_IMPACT loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_TARGET monbg ANIM_TARGET
setalpha 12, 8 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 waitforvisualfinish
launchtask AnimTask_FlailMovement 0x2 0x1 0x0 createvisualtask AnimTask_FlailMovement, 2, 0
launchtemplate gMovementWavesSpriteTemplate 0x2 0x3 0x0 0x0 0x2 createsprite gMovementWavesSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 2
launchtemplate gMovementWavesSpriteTemplate 0x2 0x3 0x0 0x1 0x2 createsprite gMovementWavesSpriteTemplate, ANIM_ATTACKER, 2, 0, 1, 2
loopsewithpan SE_M_HEADBUTT, SOUND_PAN_ATTACKER, 0x8, 0x2 loopsewithpan SE_M_HEADBUTT, SOUND_PAN_ATTACKER, 0x8, 0x2
waitforvisualfinish waitforvisualfinish
launchtemplate gRandomPosHitSplatSpriteTemplate 0x83 0x2 0x1 0x3 createsprite gRandomPosHitSplatSpriteTemplate, ANIM_TARGET, 3, ANIM_TARGET, 1
launchtask AnimTask_ShakeTargetBasedOnMovePowerOrDmg 0x2 0x5 0x0 0x1 0x1e 0x1 0x0 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 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 waitforvisualfinish
clearmonbg ANIM_TARGET clearmonbg ANIM_TARGET
blendoff blendoff

View File

@ -492,5 +492,6 @@ void AnimOverheatFlame(struct Sprite *sprite);
// battle_anim_new.c // battle_anim_new.c
void CoreEnforcerLoadBeamTarget(struct Sprite* sprite); void CoreEnforcerLoadBeamTarget(struct Sprite* sprite);
void SpriteCB_RandomCentredHits(struct Sprite* sprite);
#endif // GUARD_BATTLE_ANIM_H #endif // GUARD_BATTLE_ANIM_H

View File

@ -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]) if (!gBattleAnimArgs[0])
{ {
@ -1023,12 +1023,23 @@ void AnimTask_ShakeTargetBasedOnMovePowerOrDmg(u8 taskId)
gTasks[taskId].data[12] = 0; gTasks[taskId].data[12] = 0;
gTasks[taskId].data[10] = gBattleAnimArgs[3]; gTasks[taskId].data[10] = gBattleAnimArgs[3];
gTasks[taskId].data[11] = gBattleAnimArgs[4]; 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[8] = gSprites[gTasks[taskId].data[7]].x2;
gTasks[taskId].data[9] = gSprites[gTasks[taskId].data[7]].y2; gTasks[taskId].data[9] = gSprites[gTasks[taskId].data[7]].y2;
gTasks[taskId].data[0] = 0; gTasks[taskId].data[0] = 0;
gTasks[taskId].data[1] = gBattleAnimArgs[1]; gTasks[taskId].data[1] = gBattleAnimArgs[1];
gTasks[taskId].data[2] = gBattleAnimArgs[2]; 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; gTasks[taskId].func = AnimTask_ShakeTargetBasedOnMovePowerOrDmg_Step;
} }

View File

@ -33,7 +33,6 @@ static void SpriteCB_MoongeistCharge(struct Sprite *sprite);
static void SpriteCB_MindBlownBall(struct Sprite *sprite); static void SpriteCB_MindBlownBall(struct Sprite *sprite);
static void AnimMindBlownBallStep(struct Sprite *sprite); static void AnimMindBlownBallStep(struct Sprite *sprite);
static void SpriteCB_MindBlownExplosion(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_LockingJaw(struct Sprite *sprite);
static void SpriteCB_LockingJawStep(struct Sprite *sprite); static void SpriteCB_LockingJawStep(struct Sprite *sprite);
static void SpriteCB_LockingJawFinish(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) if (gBattleAnimArgs[1] == -1)
gBattleAnimArgs[1] = Random() & 3; gBattleAnimArgs[1] = Random() & 3;

View File

@ -258,7 +258,7 @@ const struct SpriteTemplate gRandomPosHitSplatSpriteTemplate =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gAffineAnims_HitSplat, .affineAnims = gAffineAnims_HitSplat,
.callback = AnimHitSplatRandom, .callback = SpriteCB_RandomCentredHits,
}; };
const struct SpriteTemplate gMonEdgeHitSplatSpriteTemplate = const struct SpriteTemplate gMonEdgeHitSplatSpriteTemplate =