Fix Gravity's animation

This commit is contained in:
DizzyEggg 2021-06-08 12:13:40 +02:00
parent 339f297949
commit e2f14d43db
3 changed files with 13 additions and 0 deletions

View File

@ -863,6 +863,7 @@ Move_ROOST:
Move_GRAVITY:
fadetobg BG_COSMIC
waitbgfadein
createvisualtask AnimTask_SetAnimTargetToAttackerOpposite, 1
playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER
createvisualtask AnimTask_ShakeAndSinkMon, 5, ANIM_ATTACKER, 2, 0, 96, 30
createvisualtask AnimTask_ShakeAndSinkMon, 5, ANIM_DEF_PARTNER, 2, 0, 96, 30

View File

@ -321,6 +321,12 @@ static void AnimTask_ShakeMonInPlace_Step(u8 taskId)
void AnimTask_ShakeAndSinkMon(u8 taskId)
{
u8 spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
if (spriteId == SPRITE_NONE)
{
DestroyAnimVisualTask(taskId);
return;
}
gSprites[spriteId].pos2.x = gBattleAnimArgs[1];
gTasks[taskId].data[0] = spriteId;
gTasks[taskId].data[1] = gBattleAnimArgs[1];

View File

@ -1084,3 +1084,9 @@ void AnimTask_SetInvisible(u8 taskId)
gSprites[spriteId].invisible = gBattleSpritesDataPtr->battlerData[battlerId].invisible = gBattleAnimArgs[1];
DestroyAnimVisualTask(taskId);
}
void AnimTask_SetAnimTargetToAttackerOpposite(u8 taskId)
{
gBattleAnimTarget = BATTLE_OPPOSITE(gBattleAnimAttacker);
DestroyAnimVisualTask(taskId);
}