Clean up battle anim C for doc

This commit is contained in:
GriffinR 2020-02-20 16:22:33 -05:00 committed by huderlem
parent afa1ae2209
commit efd53d080c
23 changed files with 1393 additions and 1384 deletions

View File

@ -799,14 +799,14 @@ Move_DOUBLE_EDGE:
createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 4, -10, 0, ANIM_TARGET, 0 createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 4, -10, 0, ANIM_TARGET, 0
createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 1, -32, 0, 0, 3 createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 1, -32, 0, 0, 3
waitforvisualfinish waitforvisualfinish
createvisualtask AminTask_DipMonSpriteToSide, 2, 8, -256, 0, 0 createvisualtask AnimTask_RotateMonSpriteToSide, 2, 8, -256, 0, 0
createvisualtask AminTask_DipMonSpriteToSide, 2, 8, -256, 1, 0 createvisualtask AnimTask_RotateMonSpriteToSide, 2, 8, -256, 1, 0
createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_ATTACKER, 4, 0, 12, 1 createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_ATTACKER, 4, 0, 12, 1
createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 4, 0, 12, 1 createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 4, 0, 12, 1
createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 16, 0, RGB_WHITE createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 16, 0, RGB_WHITE
waitforvisualfinish waitforvisualfinish
createvisualtask AminTask_DipMonSpriteToSide, 2, 8, -256, 0, 1 createvisualtask AnimTask_RotateMonSpriteToSide, 2, 8, -256, 0, 1
createvisualtask AminTask_DipMonSpriteToSide, 2, 8, -256, 1, 1 createvisualtask AnimTask_RotateMonSpriteToSide, 2, 8, -256, 1, 1
waitforvisualfinish waitforvisualfinish
createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 5 createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 5
delay 3 delay 3
@ -2442,7 +2442,7 @@ Move_HORN_ATTACK:
Move_FURY_ATTACK: Move_FURY_ATTACK:
loadspritegfx ANIM_TAG_IMPACT loadspritegfx ANIM_TAG_IMPACT
loadspritegfx ANIM_TAG_HORN_HIT loadspritegfx ANIM_TAG_HORN_HIT
createvisualtask AminTask_DipMonSpriteToSide, 2, 4, 256, 0, 2 createvisualtask AnimTask_RotateMonSpriteToSide, 2, 4, 256, 0, 2
choosetwoturnanim FuryAttackRight, FuryAttackLeft choosetwoturnanim FuryAttackRight, FuryAttackLeft
FuryAttackContinue: FuryAttackContinue:
createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 6, 1 createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 6, 1
@ -2591,7 +2591,7 @@ Move_LOW_KICK:
createsprite gSlidingKickSpriteTemplate, ANIM_TARGET, 2, -24, 28, 40, 8, 160, 0 createsprite gSlidingKickSpriteTemplate, ANIM_TARGET, 2, -24, 28, 40, 8, 160, 0
delay 4 delay 4
createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 2, -8, 8, ANIM_TARGET, 2 createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 2, -8, 8, ANIM_TARGET, 2
createvisualtask AminTask_DipMonSpriteToSide, 2, 6, 384, 1, 2 createvisualtask AnimTask_RotateMonSpriteToSide, 2, 6, 384, 1, 2
playsewithpan SE_W233B, SOUND_PAN_TARGET playsewithpan SE_W233B, SOUND_PAN_TARGET
waitforvisualfinish waitforvisualfinish
createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, 0, 1, 4 createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, 0, 1, 4
@ -2836,7 +2836,7 @@ SkullBashSetUpHeadDown:
createsprite gSlideMonToOffsetAndBackSpriteTemplate, ANIM_ATTACKER, 2, ANIM_ATTACKER, -24, 0, 0, 10, 0 createsprite gSlideMonToOffsetAndBackSpriteTemplate, ANIM_ATTACKER, 2, ANIM_ATTACKER, -24, 0, 0, 10, 0
playsewithpan SE_W036, SOUND_PAN_ATTACKER playsewithpan SE_W036, SOUND_PAN_ATTACKER
waitforvisualfinish waitforvisualfinish
createvisualtask AminTask_DipMonSpriteToSide, 2, 16, 96, 0, 2 createvisualtask AnimTask_RotateMonSpriteToSide, 2, 16, 96, 0, 2
waitforvisualfinish waitforvisualfinish
createsprite gSlideMonToOffsetAndBackSpriteTemplate, ANIM_ATTACKER, 2, ANIM_ATTACKER, 24, 0, 0, 10, 1 createsprite gSlideMonToOffsetAndBackSpriteTemplate, ANIM_ATTACKER, 2, ANIM_ATTACKER, 24, 0, 0, 10, 1
waitforvisualfinish waitforvisualfinish
@ -3405,13 +3405,13 @@ ExtremeSpeedContinue:
createvisualtask AnimTask_ExtremeSpeedImpact, 2 createvisualtask AnimTask_ExtremeSpeedImpact, 2
delay 2 delay 2
playsewithpan SE_W004, SOUND_PAN_TARGET playsewithpan SE_W004, SOUND_PAN_TARGET
createsprite gExtremeSpeedHitSplatSpriteTemplate, ANIM_TARGET, 2, 1, 0, -12, 3 createsprite gExtremeSpeedHitSplatSpriteTemplate, ANIM_TARGET, 2, ANIM_TARGET, 0, -12, 3
delay 10 delay 10
playsewithpan SE_W004, SOUND_PAN_TARGET playsewithpan SE_W004, SOUND_PAN_TARGET
createsprite gExtremeSpeedHitSplatSpriteTemplate, ANIM_TARGET, 2, 1, 0, 12, 3 createsprite gExtremeSpeedHitSplatSpriteTemplate, ANIM_TARGET, 2, ANIM_TARGET, 0, 12, 3
delay 10 delay 10
playsewithpan SE_W233B, SOUND_PAN_TARGET playsewithpan SE_W233B, SOUND_PAN_TARGET
createsprite gExtremeSpeedHitSplatSpriteTemplate, ANIM_TARGET, 2, 1, 0, 0, 3 createsprite gExtremeSpeedHitSplatSpriteTemplate, ANIM_TARGET, 2, ANIM_TARGET, 0, 0, 3
waitforvisualfinish waitforvisualfinish
createvisualtask AnimTask_SpeedDust, 2 createvisualtask AnimTask_SpeedDust, 2
delay 10 delay 10
@ -8570,14 +8570,14 @@ Move_ARM_THRUST:
loadspritegfx ANIM_TAG_IMPACT loadspritegfx ANIM_TAG_IMPACT
monbgprio_28 ANIM_TARGET monbgprio_28 ANIM_TARGET
setalpha 12, 8 setalpha 12, 8
createvisualtask AminTask_DipMonSpriteToSide, 5, 8, 5, 0, 0 createvisualtask AnimTask_RotateMonSpriteToSide, 5, 8, 5, 0, 0
delay 6 delay 6
createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 4, 3 createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 4, 3
delay 4 delay 4
playsewithpan SE_W207, SOUND_PAN_TARGET playsewithpan SE_W207, SOUND_PAN_TARGET
createsprite gArmThrustHandSpriteTemplate, ANIM_TARGET, 2, 10, -8, 14, 3 createsprite gArmThrustHandSpriteTemplate, ANIM_TARGET, 2, 10, -8, 14, 3
waitforvisualfinish waitforvisualfinish
createvisualtask AminTask_DipMonSpriteToSide, 5, 8, 5, 0, 1 createvisualtask AnimTask_RotateMonSpriteToSide, 5, 8, 5, 0, 1
playsewithpan SE_W003, SOUND_PAN_TARGET playsewithpan SE_W003, SOUND_PAN_TARGET
choosetwoturnanim ArmThrustRight, ArmThrustLeft choosetwoturnanim ArmThrustRight, ArmThrustLeft
ArmThrustContinue: ArmThrustContinue:

View File

@ -222,6 +222,7 @@ void sub_8117854(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5,
// battle_anim_effects_1.c // battle_anim_effects_1.c
void SetSpriteNextToMonHead(u8 battler, struct Sprite* sprite); void SetSpriteNextToMonHead(u8 battler, struct Sprite* sprite);
void AnimMoveTwisterParticle(struct Sprite* sprite); void AnimMoveTwisterParticle(struct Sprite* sprite);
void AnimParticleBurst(struct Sprite *);
// water.c // water.c
void AnimWaterPulseRing(struct Sprite *sprite); void AnimWaterPulseRing(struct Sprite *sprite);

File diff suppressed because it is too large Load Diff

View File

@ -16,70 +16,43 @@
#include "constants/rgb.h" #include "constants/rgb.h"
#include "constants/songs.h" #include "constants/songs.h"
void sub_8103448(struct Sprite *); static void sub_8103448(struct Sprite *);
void sub_8103498(struct Sprite *); static void sub_8103498(struct Sprite *);
void sub_810358C(struct Sprite *);
void sub_8103620(struct Sprite *);
void Anim_KinesisZapEnergy(struct Sprite *);
void Anim_SwordsDanceBlade(struct Sprite *);
void AnimSonicBoomProjectile(struct Sprite *);
void AnimAirWaveProjectile(struct Sprite *);
void sub_8103FE8(struct Sprite *);
void AnimCoinThrow(struct Sprite *);
void AnimFallingCoin(struct Sprite *);
void AnimBulletSeed(struct Sprite *);
void AnimRazorWindTornado(struct Sprite *);
void AnimViceGripPincer(struct Sprite *);
void AnimGuillotinePincer(struct Sprite *);
void AnimBreathPuff(struct Sprite *);
void AnimAngerMark(struct Sprite *);
void AnimPencil(struct Sprite *);
void AnimBlendThinRing(struct Sprite *);
void AnimHyperVoiceRing(struct Sprite *);
void AnimUproarRing(struct Sprite *);
void AnimSoftBoiledEgg(struct Sprite *);
void AnimSpeedDust(struct Sprite *);
void AnimHealBellMusicNote(struct Sprite *);
void AnimMagentaHeart(struct Sprite *);
void AnimRedHeartProjectile(struct Sprite *);
void AnimParticuleBurst(struct Sprite *);
void AnimRedHeartRising(struct Sprite *);
void AnimOrbitFast(struct Sprite *);
void AnimOrbitScatter(struct Sprite *);
void AnimSpitUpOrb(struct Sprite *);
void AnimEyeSparkle(struct Sprite *);
void AnimAngel(struct Sprite *);
void AnimPinkHeart(struct Sprite *);
void AnimDevil(struct Sprite *);
void AnimFurySwipes(struct Sprite *);
void AnimMovmentWaves(struct Sprite *);
void AnimJaggedMusicNote(struct Sprite *);
void AnimPerishSongMusicNote2(struct Sprite *);
void AnimPerishSongMusicNote(struct Sprite *);
void AnimGuardRing(struct Sprite *);
static void sub_81034D8(struct Sprite *); static void sub_81034D8(struct Sprite *);
static void sub_810358C(struct Sprite *);
static void sub_8103620(struct Sprite *);
static void sub_8103658(struct Sprite *); static void sub_8103658(struct Sprite *);
static void sub_8103680(struct Sprite *); static void sub_8103680(struct Sprite *);
static void AnimTask_WithdrawStep(u8); static void AnimKinesisZapEnergy(struct Sprite *);
static void AnimSwordsDanceBladeStep(struct Sprite *); static void AnimSwordsDanceBlade(struct Sprite *);
static void AnimSwordsDanceBlade_Step(struct Sprite *);
static void AnimSonicBoomProjectile(struct Sprite *);
static void AnimAirWaveProjectile(struct Sprite *);
static void AnimAirWaveProjectile_Step1(struct Sprite *sprite);
static void AnimAirWaveProjectile_Step2(struct Sprite *sprite);
static void sub_8103FE8(struct Sprite *);
static void sub_8104018(struct Sprite *); static void sub_8104018(struct Sprite *);
static void AnimCoinThrow(struct Sprite *);
static void AnimFallingCoin(struct Sprite *);
static void AnimFallingCoin_Step(struct Sprite *); static void AnimFallingCoin_Step(struct Sprite *);
static void AnimBulletSeed(struct Sprite *);
static void AnimBulletSeed_Step1(struct Sprite *); static void AnimBulletSeed_Step1(struct Sprite *);
static void AnimBulletSeed_Step2(struct Sprite *); static void AnimBulletSeed_Step2(struct Sprite *);
static void AnimViceGripPincerStep(struct Sprite *); static void AnimRazorWindTornado(struct Sprite *);
static void AnimGuillotinePincerStep1(struct Sprite *); static void AnimViceGripPincer(struct Sprite *);
static void AnimGuillotinePincerStep2(struct Sprite *); static void AnimViceGripPincer_Step(struct Sprite *);
static void AnimGuillotinePincerStep3(struct Sprite *); static void AnimGuillotinePincer(struct Sprite *);
static void AnimTask_GrowAndGreyscaleStep(u8); static void AnimGuillotinePincer_Step1(struct Sprite *);
static void AnimTask_MinimizeStep1(u8); static void AnimGuillotinePincer_Step2(struct Sprite *);
static void CreateMinimizeSprite(struct Task *, u8); static void AnimGuillotinePincer_Step3(struct Sprite *);
static void ClonedMinizeSprite_Step(struct Sprite *); static void AnimBreathPuff(struct Sprite *);
static void AnimTask_SplashStep(u8); static void AnimAngerMark(struct Sprite *);
static void AnimTask_GrowAndShrinkStep(u8); static void AnimPencil(struct Sprite *);
static void ThrashMoveMonStep(u8);
static void ThrashMoveMon(u8);
static void AnimTask_SketchDrawMonStep(u8);
static void AnimPencil_Step(struct Sprite *); static void AnimPencil_Step(struct Sprite *);
static void AnimBlendThinRing(struct Sprite *);
static void AnimHyperVoiceRing(struct Sprite *);
static void AnimUproarRing(struct Sprite *);
static void AnimSoftBoiledEgg(struct Sprite *);
static void AnimSoftBoiledEgg_Step1(struct Sprite *); static void AnimSoftBoiledEgg_Step1(struct Sprite *);
static void AnimSoftBoiledEgg_Step2(struct Sprite *); static void AnimSoftBoiledEgg_Step2(struct Sprite *);
static void AnimSoftBoiledEgg_Step3(struct Sprite *); static void AnimSoftBoiledEgg_Step3(struct Sprite *);
@ -87,23 +60,53 @@ static void AnimSoftBoiledEgg_Step3_Callback1(struct Sprite *);
static void AnimSoftBoiledEgg_Step3_Callback2(struct Sprite *); static void AnimSoftBoiledEgg_Step3_Callback2(struct Sprite *);
static void AnimSoftBoiledEgg_Step4(struct Sprite *); static void AnimSoftBoiledEgg_Step4(struct Sprite *);
static void AnimSoftBoiledEgg_Step4_Callback(struct Sprite *); static void AnimSoftBoiledEgg_Step4_Callback(struct Sprite *);
static void AttackerStretchAndDisappear_Step(u8); static void AnimSpeedDust(struct Sprite *);
static void ExtremeSpeedImpact_Step(u8); static void AnimHealBellMusicNote(struct Sprite *);
static void ExtremeSpeedMonReappear_Step(u8); static void AnimMagentaHeart(struct Sprite *);
static void SpeedDust_Step1(u8); static void AnimRedHeartProjectile(struct Sprite *);
static void FakeOutStep1(u8);
static void FakeOutStep2(u8);
static void AnimRedHeartProjectile_Step(struct Sprite *); static void AnimRedHeartProjectile_Step(struct Sprite *);
static void AnimRedHeartRising(struct Sprite *);
static void AnimRedHeartRising_Step(struct Sprite *); static void AnimRedHeartRising_Step(struct Sprite *);
static void HeartsBackground_Step(u8); static void AnimOrbitFast(struct Sprite *);
static void ScaryFace_Step(u8); static void AnimOrbitFast_Step(struct Sprite *);
static void AnimOrbitFastStep(struct Sprite *); static void AnimOrbitScatter(struct Sprite *);
static void AnimOrbitScatterStep(struct Sprite *); static void AnimOrbitScatter_Step(struct Sprite *);
static void AnimSpitUpOrb(struct Sprite *);
static void AnimSpitUpOrb_Step(struct Sprite *sprite);
static void AnimEyeSparkle(struct Sprite *);
static void AnimEyeSparkle_Step(struct Sprite *sprite);
static void AnimAngel(struct Sprite *);
static void AnimPinkHeart(struct Sprite *);
static void AnimDevil(struct Sprite *);
static void AnimFurySwipes(struct Sprite *);
static void AnimMovmentWaves(struct Sprite *);
static void AnimMovmentWaves_Step(struct Sprite *); static void AnimMovmentWaves_Step(struct Sprite *);
static void UproarDistortion_Step(u8); static void AnimJaggedMusicNote(struct Sprite *);
static void AnimJaggedMusicNote_Step(struct Sprite *); static void AnimJaggedMusicNote_Step(struct Sprite *);
static void AnimPerishSongMusicNote2(struct Sprite *);
static void AnimPerishSongMusicNote(struct Sprite *);
static void AnimPerishSongMusicNote_Step1(struct Sprite *); static void AnimPerishSongMusicNote_Step1(struct Sprite *);
static void AnimPerishSongMusicNote_Step2(struct Sprite *); static void AnimPerishSongMusicNote_Step2(struct Sprite *);
static void AnimGuardRing(struct Sprite *);
static void AnimTask_Withdraw_Step(u8);
static void AnimTask_GrowAndGreyscale_Step(u8);
static void AnimTask_Minimize_Step(u8);
static void CreateMinimizeSprite(struct Task *, u8);
static void ClonedMinizeSprite_Step(struct Sprite *);
static void AnimTask_Splash_Step(u8);
static void AnimTask_GrowAndShrink_Step(u8);
static void AnimTask_ThrashMoveMonHorizontal_Step(u8);
static void AnimTask_ThrashMoveMonVertical_Step(u8);
static void AnimTask_SketchDrawMon_Step(u8);
static void AnimTask_AttackerStretchAndDisappear_Step(u8);
static void AnimTask_ExtremeSpeedImpact_Step(u8);
static void AnimTask_ExtremeSpeedMonReappear_Step(u8);
static void AnimTask_SpeedDust_Step(u8);
static void AnimTask_FakeOut_Step1(u8);
static void AnimTask_FakeOut_Step2(u8);
static void AnimTask_HeartsBackground_Step(u8);
static void AnimTask_ScaryFace_Step(u8);
static void AnimTask_UproarDistortion_Step(u8);
// Unused // Unused
const struct SpriteTemplate gUnknown_08593264 = const struct SpriteTemplate gUnknown_08593264 =
@ -229,7 +232,7 @@ const struct SpriteTemplate gKinesisZapEnergySpriteTemplate =
.anims = gKinesisZapEnergyAnimTable, .anims = gKinesisZapEnergyAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = Anim_KinesisZapEnergy, .callback = AnimKinesisZapEnergy,
}; };
const union AffineAnimCmd gSwordsDanceBladeAffineAnimCmds[] = const union AffineAnimCmd gSwordsDanceBladeAffineAnimCmds[] =
@ -253,7 +256,7 @@ const struct SpriteTemplate gSwordsDanceBladeSpriteTemplate =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gSwordsDanceBladeAffineAnimTable, .affineAnims = gSwordsDanceBladeAffineAnimTable,
.callback = Anim_SwordsDanceBlade, .callback = AnimSwordsDanceBlade,
}; };
const struct SpriteTemplate gSonicBoomSpriteTemplate = const struct SpriteTemplate gSonicBoomSpriteTemplate =
@ -934,7 +937,7 @@ const struct SpriteTemplate gRedHeartBurstSpriteTemplate =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimParticuleBurst, .callback = AnimParticleBurst,
}; };
const struct SpriteTemplate gRedHeartRisingSpriteTemplate = const struct SpriteTemplate gRedHeartRisingSpriteTemplate =
@ -1259,7 +1262,7 @@ const struct SpriteTemplate gGuardRingSpriteTemplate =
.callback = AnimGuardRing, .callback = AnimGuardRing,
}; };
void sub_8103448(struct Sprite *sprite) static void sub_8103448(struct Sprite *sprite)
{ {
SetSpriteCoordsToAnimAttackerCoords(sprite); SetSpriteCoordsToAnimAttackerCoords(sprite);
SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]);
@ -1273,7 +1276,7 @@ void sub_8103448(struct Sprite *sprite)
sprite->callback(sprite); sprite->callback(sprite);
} }
void sub_8103498(struct Sprite *sprite) static void sub_8103498(struct Sprite *sprite)
{ {
u8 battler; u8 battler;
if (gBattleAnimArgs[0] == 0) if (gBattleAnimArgs[0] == 0)
@ -1323,7 +1326,7 @@ static void sub_810353C(struct Sprite *sprite)
sprite->data[0]--; sprite->data[0]--;
} }
void sub_810358C(struct Sprite *sprite) static void sub_810358C(struct Sprite *sprite)
{ {
u8 spriteId; u8 spriteId;
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
@ -1339,10 +1342,10 @@ void sub_810358C(struct Sprite *sprite)
sprite->data[1] = gBattleAnimArgs[3]; sprite->data[1] = gBattleAnimArgs[3];
sprite->data[2] = spriteId; sprite->data[2] = spriteId;
sprite->callback = sub_810353C; sprite->callback = sub_810353C;
sprite->invisible = 1; sprite->invisible = TRUE;
} }
void sub_8103620(struct Sprite *sprite) static void sub_8103620(struct Sprite *sprite)
{ {
InitSpritePosToAnimAttacker(sprite, TRUE); InitSpritePosToAnimAttacker(sprite, TRUE);
sprite->data[0] = gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[2];
@ -1374,10 +1377,10 @@ static void sub_8103680(struct Sprite *sprite)
void AnimTask_Withdraw(u8 taskId) void AnimTask_Withdraw(u8 taskId)
{ {
PrepareBattlerSpriteForRotScale(gBattlerSpriteIds[gBattleAnimAttacker], ST_OAM_OBJ_NORMAL); PrepareBattlerSpriteForRotScale(gBattlerSpriteIds[gBattleAnimAttacker], ST_OAM_OBJ_NORMAL);
gTasks[taskId].func = AnimTask_WithdrawStep; gTasks[taskId].func = AnimTask_Withdraw_Step;
} }
static void AnimTask_WithdrawStep(u8 taskId) static void AnimTask_Withdraw_Step(u8 taskId)
{ {
u8 spriteId = gBattlerSpriteIds[gBattleAnimAttacker]; u8 spriteId = gBattlerSpriteIds[gBattleAnimAttacker];
s16 rotation; s16 rotation;
@ -1426,7 +1429,7 @@ static void AnimTask_WithdrawStep(u8 taskId)
// arg 0: x pixel offset // arg 0: x pixel offset
// arg 1: y pixel offset // arg 1: y pixel offset
// arg 2: vertical flip // arg 2: vertical flip
void Anim_KinesisZapEnergy(struct Sprite *sprite) static void AnimKinesisZapEnergy(struct Sprite *sprite)
{ {
SetSpriteCoordsToAnimAttackerCoords(sprite); SetSpriteCoordsToAnimAttackerCoords(sprite);
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
@ -1454,14 +1457,14 @@ void Anim_KinesisZapEnergy(struct Sprite *sprite)
// Animates a sword that rises into the air after a brief pause. // Animates a sword that rises into the air after a brief pause.
// arg 0: x pixel offset // arg 0: x pixel offset
// arg 1: y pixel offset // arg 1: y pixel offset
void Anim_SwordsDanceBlade(struct Sprite *sprite) static void AnimSwordsDanceBlade(struct Sprite *sprite)
{ {
InitSpritePosToAnimAttacker(sprite, FALSE); InitSpritePosToAnimAttacker(sprite, FALSE);
sprite->callback = RunStoredCallbackWhenAffineAnimEnds; sprite->callback = RunStoredCallbackWhenAffineAnimEnds;
StoreSpriteCallbackInData6(sprite, AnimSwordsDanceBladeStep); StoreSpriteCallbackInData6(sprite, AnimSwordsDanceBlade_Step);
} }
static void AnimSwordsDanceBladeStep(struct Sprite *sprite) static void AnimSwordsDanceBlade_Step(struct Sprite *sprite)
{ {
sprite->data[0] = 6; sprite->data[0] = 6;
sprite->data[2] = sprite->pos1.x; sprite->data[2] = sprite->pos1.x;
@ -1477,7 +1480,7 @@ static void AnimSwordsDanceBladeStep(struct Sprite *sprite)
// arg 2: target x pixel offset // arg 2: target x pixel offset
// arg 3: target y pixel offset // arg 3: target y pixel offset
// arg 4: duration // arg 4: duration
void AnimSonicBoomProjectile(struct Sprite *sprite) static void AnimSonicBoomProjectile(struct Sprite *sprite)
{ {
s16 targetXPos; s16 targetXPos;
s16 targetYPos; s16 targetYPos;
@ -1552,7 +1555,7 @@ static void AnimAirWaveProjectile_Step1(struct Sprite *sprite)
} }
} }
void AnimAirWaveProjectile(struct Sprite *sprite) static void AnimAirWaveProjectile(struct Sprite *sprite)
{ {
s16 a; s16 a;
s16 b; s16 b;
@ -1735,7 +1738,7 @@ void AnimTask_AirCutterProjectile(u8 taskId)
gTasks[taskId].func = AirCutterProjectileStep1; gTasks[taskId].func = AirCutterProjectileStep1;
} }
void sub_8103FE8(struct Sprite *sprite) static void sub_8103FE8(struct Sprite *sprite)
{ {
InitSpritePosToAnimAttacker(sprite, FALSE); InitSpritePosToAnimAttacker(sprite, FALSE);
sprite->data[0] = 0x100 + (IndexOfSpritePaletteTag(gUnknown_085934A0.paletteTag) << 4); sprite->data[0] = 0x100 + (IndexOfSpritePaletteTag(gUnknown_085934A0.paletteTag) << 4);
@ -1762,7 +1765,7 @@ static void sub_8104018(struct Sprite *sprite)
} }
} }
void AnimCoinThrow(struct Sprite *sprite) static void AnimCoinThrow(struct Sprite *sprite)
{ {
s16 r6; s16 r6;
s16 r7; s16 r7;
@ -1785,7 +1788,7 @@ void AnimCoinThrow(struct Sprite *sprite)
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
} }
void AnimFallingCoin(struct Sprite *sprite) static void AnimFallingCoin(struct Sprite *sprite)
{ {
sprite->data[2] = -16; sprite->data[2] = -16;
sprite->pos1.y += 8; sprite->pos1.y += 8;
@ -1810,7 +1813,7 @@ static void AnimFallingCoin_Step(struct Sprite *sprite)
} }
} }
void AnimBulletSeed(struct Sprite *sprite) static void AnimBulletSeed(struct Sprite *sprite)
{ {
InitSpritePosToAnimAttacker(sprite, TRUE); InitSpritePosToAnimAttacker(sprite, TRUE);
sprite->data[0] = 20; sprite->data[0] = 20;
@ -1869,7 +1872,7 @@ static void AnimBulletSeed_Step2(struct Sprite *sprite)
// arg 4: initial wave offset // arg 4: initial wave offset
// arg 5: wave period (higher means faster wave) // arg 5: wave period (higher means faster wave)
// arg 6: duration // arg 6: duration
void AnimRazorWindTornado(struct Sprite *sprite) static void AnimRazorWindTornado(struct Sprite *sprite)
{ {
InitSpritePosToAnimAttacker(sprite, FALSE); InitSpritePosToAnimAttacker(sprite, FALSE);
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
@ -1887,7 +1890,7 @@ void AnimRazorWindTornado(struct Sprite *sprite)
// Animates a single pincer line that extends towards the center of the target mon. // Animates a single pincer line that extends towards the center of the target mon.
// arg 0: invert // arg 0: invert
void AnimViceGripPincer(struct Sprite *sprite) static void AnimViceGripPincer(struct Sprite *sprite)
{ {
s16 startXOffset = 32; s16 startXOffset = 32;
s16 startYOffset = -32; s16 startYOffset = -32;
@ -1908,10 +1911,10 @@ void AnimViceGripPincer(struct Sprite *sprite)
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + endXOffset; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + endXOffset;
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + endYOffset; sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + endYOffset;
sprite->callback = StartAnimLinearTranslation; sprite->callback = StartAnimLinearTranslation;
StoreSpriteCallbackInData6(sprite, AnimViceGripPincerStep); StoreSpriteCallbackInData6(sprite, AnimViceGripPincer_Step);
} }
static void AnimViceGripPincerStep(struct Sprite *sprite) static void AnimViceGripPincer_Step(struct Sprite *sprite)
{ {
if (sprite->animEnded) if (sprite->animEnded)
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
@ -1919,7 +1922,7 @@ static void AnimViceGripPincerStep(struct Sprite *sprite)
// Animates a single pincer line that extends towards the center of the target mon, and then back out. // Animates a single pincer line that extends towards the center of the target mon, and then back out.
// arg 0: animation id // arg 0: animation id
void AnimGuillotinePincer(struct Sprite *sprite) static void AnimGuillotinePincer(struct Sprite *sprite)
{ {
s16 startXOffset = 32; s16 startXOffset = 32;
s16 startYOffset = -32; s16 startYOffset = -32;
@ -1944,10 +1947,10 @@ void AnimGuillotinePincer(struct Sprite *sprite)
InitAnimLinearTranslation(sprite); InitAnimLinearTranslation(sprite);
sprite->data[5] = gBattleAnimArgs[0]; sprite->data[5] = gBattleAnimArgs[0];
sprite->data[6] = sprite->data[0]; sprite->data[6] = sprite->data[0];
sprite->callback = AnimGuillotinePincerStep1; sprite->callback = AnimGuillotinePincer_Step1;
} }
static void AnimGuillotinePincerStep1(struct Sprite *sprite) static void AnimGuillotinePincer_Step1(struct Sprite *sprite)
{ {
if (AnimTranslateLinear(sprite) && sprite->animEnded) if (AnimTranslateLinear(sprite) && sprite->animEnded)
{ {
@ -1962,11 +1965,11 @@ static void AnimGuillotinePincerStep1(struct Sprite *sprite)
sprite->data[2] ^= 1; sprite->data[2] ^= 1;
sprite->data[4] = 0; sprite->data[4] = 0;
sprite->data[3] = 0; sprite->data[3] = 0;
sprite->callback = AnimGuillotinePincerStep2; sprite->callback = AnimGuillotinePincer_Step2;
} }
} }
static void AnimGuillotinePincerStep2(struct Sprite *sprite) static void AnimGuillotinePincer_Step2(struct Sprite *sprite)
{ {
if (sprite->data[3]) if (sprite->data[3])
{ {
@ -1983,11 +1986,11 @@ static void AnimGuillotinePincerStep2(struct Sprite *sprite)
sprite->data[3] = 0; sprite->data[3] = 0;
sprite->animPaused = 0; sprite->animPaused = 0;
StartSpriteAnim(sprite, sprite->data[5] ^ 1); StartSpriteAnim(sprite, sprite->data[5] ^ 1);
sprite->callback = AnimGuillotinePincerStep3; sprite->callback = AnimGuillotinePincer_Step3;
} }
} }
static void AnimGuillotinePincerStep3(struct Sprite *sprite) static void AnimGuillotinePincer_Step3(struct Sprite *sprite)
{ {
if (AnimTranslateLinear(sprite)) if (AnimTranslateLinear(sprite))
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
@ -2003,10 +2006,10 @@ void AnimTask_GrowAndGreyscale(u8 taskId)
SetSpriteRotScale(spriteId, 0xD0, 0xD0, 0); SetSpriteRotScale(spriteId, 0xD0, 0xD0, 0);
SetGreyscaleOrOriginalPalette(gSprites[spriteId].oam.paletteNum + 16, FALSE); SetGreyscaleOrOriginalPalette(gSprites[spriteId].oam.paletteNum + 16, FALSE);
gTasks[taskId].data[0] = 80; gTasks[taskId].data[0] = 80;
gTasks[taskId].func = AnimTask_GrowAndGreyscaleStep; gTasks[taskId].func = AnimTask_GrowAndGreyscale_Step;
} }
static void AnimTask_GrowAndGreyscaleStep(u8 taskId) static void AnimTask_GrowAndGreyscale_Step(u8 taskId)
{ {
if (--gTasks[taskId].data[0] == -1) if (--gTasks[taskId].data[0] == -1)
{ {
@ -2033,10 +2036,10 @@ void AnimTask_Minimize(u8 taskId)
task->data[5] = 0; task->data[5] = 0;
task->data[6] = 0; task->data[6] = 0;
task->data[7] = GetBattlerSpriteSubpriority(gBattleAnimAttacker); task->data[7] = GetBattlerSpriteSubpriority(gBattleAnimAttacker);
task->func = AnimTask_MinimizeStep1; task->func = AnimTask_Minimize_Step;
} }
static void AnimTask_MinimizeStep1(u8 taskId) static void AnimTask_Minimize_Step(u8 taskId)
{ {
struct Task* task = &gTasks[taskId]; struct Task* task = &gTasks[taskId];
switch (task->data[1]) switch (task->data[1])
@ -2161,11 +2164,11 @@ void AnimTask_Splash(u8 taskId)
task->data[3] = 0; task->data[3] = 0;
task->data[4] = 0; task->data[4] = 0;
PrepareAffineAnimInTaskData(task, spriteId, gSplashEffectAffineAnimCmds); PrepareAffineAnimInTaskData(task, spriteId, gSplashEffectAffineAnimCmds);
task->func = AnimTask_SplashStep; task->func = AnimTask_Splash_Step;
} }
} }
static void AnimTask_SplashStep(u8 taskId) static void AnimTask_Splash_Step(u8 taskId)
{ {
struct Task* task = &gTasks[taskId]; struct Task* task = &gTasks[taskId];
switch (task->data[1]) switch (task->data[1])
@ -2224,10 +2227,10 @@ void AnimTask_GrowAndShrink(u8 taskId)
struct Task* task = &gTasks[taskId]; struct Task* task = &gTasks[taskId];
u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
PrepareAffineAnimInTaskData(task, spriteId, gGrowAndShrinkAffineAnimCmds); PrepareAffineAnimInTaskData(task, spriteId, gGrowAndShrinkAffineAnimCmds);
task->func = AnimTask_GrowAndShrinkStep; task->func = AnimTask_GrowAndShrink_Step;
} }
static void AnimTask_GrowAndShrinkStep(u8 taskId) static void AnimTask_GrowAndShrink_Step(u8 taskId)
{ {
struct Task* task = &gTasks[taskId]; struct Task* task = &gTasks[taskId];
if (!RunAffineAnimFromTaskData(task)) if (!RunAffineAnimFromTaskData(task))
@ -2237,7 +2240,7 @@ static void AnimTask_GrowAndShrinkStep(u8 taskId)
// Animates a little puff of the mon's breath. // Animates a little puff of the mon's breath.
// Used by MOVE_SWAGGER and MOVE_BULK_UP // Used by MOVE_SWAGGER and MOVE_BULK_UP
// No args. // No args.
void AnimBreathPuff(struct Sprite *sprite) static void AnimBreathPuff(struct Sprite *sprite)
{ {
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
{ {
@ -2265,7 +2268,7 @@ void AnimBreathPuff(struct Sprite *sprite)
// arg 0: target mon (0 = attacker, 1 = target) // arg 0: target mon (0 = attacker, 1 = target)
// arg 1: x pixel offset // arg 1: x pixel offset
// arg 2: y pixel offset // arg 2: y pixel offset
void AnimAngerMark(struct Sprite *sprite) static void AnimAngerMark(struct Sprite *sprite)
{ {
u8 battler; u8 battler;
if (!gBattleAnimArgs[0]) if (!gBattleAnimArgs[0])
@ -2293,10 +2296,10 @@ void AnimTask_ThrashMoveMonHorizontal(u8 taskId)
task->data[0] = spriteId; task->data[0] = spriteId;
task->data[1] = 0; task->data[1] = 0;
PrepareAffineAnimInTaskData(task, spriteId, gThrashMoveMonAffineAnimCmds); PrepareAffineAnimInTaskData(task, spriteId, gThrashMoveMonAffineAnimCmds);
task->func = ThrashMoveMonStep; task->func = AnimTask_ThrashMoveMonHorizontal_Step;
} }
static void ThrashMoveMonStep(u8 taskId) static void AnimTask_ThrashMoveMonHorizontal_Step(u8 taskId)
{ {
struct Task* task = &gTasks[taskId]; struct Task* task = &gTasks[taskId];
if (!RunAffineAnimFromTaskData(task)) if (!RunAffineAnimFromTaskData(task))
@ -2320,10 +2323,10 @@ void AnimTask_ThrashMoveMonVertical(u8 taskId)
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT)
task->data[2] *= -1; task->data[2] *= -1;
task->func = ThrashMoveMon; task->func = AnimTask_ThrashMoveMonVertical_Step;
} }
static void ThrashMoveMon(u8 taskId) static void AnimTask_ThrashMoveMonVertical_Step(u8 taskId)
{ {
struct Task* task = &gTasks[taskId]; struct Task* task = &gTasks[taskId];
if (++task->data[7] > 2) if (++task->data[7] > 2)
@ -2412,10 +2415,10 @@ void AnimTask_SketchDrawMon(u8 taskId)
params.initState = 1; params.initState = 1;
params.unused9 = 0; params.unused9 = 0;
ScanlineEffect_SetParams(params); ScanlineEffect_SetParams(params);
task->func = AnimTask_SketchDrawMonStep; task->func = AnimTask_SketchDrawMon_Step;
} }
static void AnimTask_SketchDrawMonStep(u8 taskId) static void AnimTask_SketchDrawMon_Step(u8 taskId)
{ {
struct Task* task = &gTasks[taskId]; struct Task* task = &gTasks[taskId];
@ -2462,7 +2465,7 @@ static void AnimTask_SketchDrawMonStep(u8 taskId)
} }
} }
void AnimPencil(struct Sprite *sprite) static void AnimPencil(struct Sprite *sprite)
{ {
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 0) - 16; sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 0) - 16;
sprite->pos1.y = GetBattlerYCoordWithElevation(gBattleAnimTarget) + 16; sprite->pos1.y = GetBattlerYCoordWithElevation(gBattleAnimTarget) + 16;
@ -2488,7 +2491,7 @@ static void AnimPencil_Step(struct Sprite *sprite)
} }
if (++sprite->data[1] > 16) if (++sprite->data[1] > 16)
{ {
sprite->invisible = 0; sprite->invisible = FALSE;
sprite->data[0]++; sprite->data[0]++;
} }
break; break;
@ -2528,14 +2531,14 @@ static void AnimPencil_Step(struct Sprite *sprite)
} }
if (++sprite->data[1] > 16) if (++sprite->data[1] > 16)
{ {
sprite->invisible = 0; sprite->invisible = FALSE;
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
break; break;
} }
} }
void AnimBlendThinRing(struct Sprite *sprite) static void AnimBlendThinRing(struct Sprite *sprite)
{ {
u8 battler = 0; u8 battler = 0;
u16 sp0 = 0; u16 sp0 = 0;
@ -2575,7 +2578,7 @@ void sub_8105284(struct Sprite *sprite)
} }
} }
void AnimHyperVoiceRing(struct Sprite *sprite) static void AnimHyperVoiceRing(struct Sprite *sprite)
{ {
u16 r9 = 0; u16 r9 = 0;
u16 r6 = 0; u16 r6 = 0;
@ -2660,7 +2663,7 @@ void AnimHyperVoiceRing(struct Sprite *sprite)
sprite->callback(sprite); sprite->callback(sprite);
} }
void AnimUproarRing(struct Sprite *sprite) static void AnimUproarRing(struct Sprite *sprite)
{ {
u8 index = IndexOfSpritePaletteTag(ANIM_TAG_THIN_RING); u8 index = IndexOfSpritePaletteTag(ANIM_TAG_THIN_RING);
if (index != 0xFF) if (index != 0xFF)
@ -2673,7 +2676,7 @@ void AnimUproarRing(struct Sprite *sprite)
sprite->callback(sprite); sprite->callback(sprite);
} }
void AnimSoftBoiledEgg(struct Sprite *sprite) static void AnimSoftBoiledEgg(struct Sprite *sprite)
{ {
s16 r1; s16 r1;
InitSpritePosToAnimAttacker(sprite, FALSE); InitSpritePosToAnimAttacker(sprite, FALSE);
@ -2760,7 +2763,7 @@ static void AnimSoftBoiledEgg_Step4(struct Sprite *sprite)
{ {
if ((u16)gBattleAnimArgs[ARG_RET_ID] == 0xFFFF) if ((u16)gBattleAnimArgs[ARG_RET_ID] == 0xFFFF)
{ {
sprite->invisible = 1; sprite->invisible = TRUE;
if (sprite->data[7] == 0) if (sprite->data[7] == 0)
sprite->callback = AnimSoftBoiledEgg_Step4_Callback; sprite->callback = AnimSoftBoiledEgg_Step4_Callback;
else else
@ -2782,10 +2785,10 @@ void AnimTask_AttackerStretchAndDisappear(u8 taskId)
u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
task->data[0] = spriteId; task->data[0] = spriteId;
PrepareAffineAnimInTaskData(task, spriteId, gStretchAttackerAffineAnimCmds); PrepareAffineAnimInTaskData(task, spriteId, gStretchAttackerAffineAnimCmds);
task->func = AttackerStretchAndDisappear_Step; task->func = AnimTask_AttackerStretchAndDisappear_Step;
} }
static void AttackerStretchAndDisappear_Step(u8 taskId) static void AnimTask_AttackerStretchAndDisappear_Step(u8 taskId)
{ {
struct Task* task = &gTasks[taskId]; struct Task* task = &gTasks[taskId];
if (!RunAffineAnimFromTaskData(task)) if (!RunAffineAnimFromTaskData(task))
@ -2816,10 +2819,10 @@ void AnimTask_ExtremeSpeedImpact(u8 taskId)
} }
task->data[15] = GetAnimBattlerSpriteId(ANIM_TARGET); task->data[15] = GetAnimBattlerSpriteId(ANIM_TARGET);
task->func = ExtremeSpeedImpact_Step; task->func = AnimTask_ExtremeSpeedImpact_Step;
} }
static void ExtremeSpeedImpact_Step(u8 taskId) static void AnimTask_ExtremeSpeedImpact_Step(u8 taskId)
{ {
struct Task* task = &gTasks[taskId]; struct Task* task = &gTasks[taskId];
@ -2876,19 +2879,19 @@ void AnimTask_ExtremeSpeedMonReappear(u8 taskId)
task->data[13] = 14; task->data[13] = 14;
task->data[14] = 2; task->data[14] = 2;
task->data[15] = GetAnimBattlerSpriteId(ANIM_ATTACKER); task->data[15] = GetAnimBattlerSpriteId(ANIM_ATTACKER);
task->func = ExtremeSpeedMonReappear_Step; task->func = AnimTask_ExtremeSpeedMonReappear_Step;
} }
static void ExtremeSpeedMonReappear_Step(u8 taskId) static void AnimTask_ExtremeSpeedMonReappear_Step(u8 taskId)
{ {
struct Task* task = &gTasks[taskId]; struct Task* task = &gTasks[taskId];
if (task->data[0] == 0 && ++task->data[1] > task->data[4]) if (task->data[0] == 0 && ++task->data[1] > task->data[4])
{ {
task->data[1] = 0; task->data[1] = 0;
if (++task->data[2] & 1) if (++task->data[2] & 1)
gSprites[task->data[15]].invisible = 0; gSprites[task->data[15]].invisible = FALSE;
else else
gSprites[task->data[15]].invisible = 1; gSprites[task->data[15]].invisible = TRUE;
if (++task->data[3] >= task->data[13]) if (++task->data[3] >= task->data[13])
{ {
@ -2900,7 +2903,7 @@ static void ExtremeSpeedMonReappear_Step(u8 taskId)
} }
else else
{ {
gSprites[task->data[15]].invisible = 0; gSprites[task->data[15]].invisible = FALSE;
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }
} }
@ -2922,10 +2925,10 @@ void AnimTask_SpeedDust(u8 taskId)
task->data[13] = 0; task->data[13] = 0;
task->data[14] = GetBattlerSpriteCoord(gBattleAnimAttacker, ANIM_ATTACKER); task->data[14] = GetBattlerSpriteCoord(gBattleAnimAttacker, ANIM_ATTACKER);
task->data[15] = GetBattlerSpriteCoord(gBattleAnimAttacker, ANIM_TARGET); task->data[15] = GetBattlerSpriteCoord(gBattleAnimAttacker, ANIM_TARGET);
task->func = SpeedDust_Step1; task->func = AnimTask_SpeedDust_Step;
} }
static void SpeedDust_Step1(u8 taskId) static void AnimTask_SpeedDust_Step(u8 taskId)
{ {
struct Task* task = &gTasks[taskId]; struct Task* task = &gTasks[taskId];
switch (task->data[8]) switch (task->data[8])
@ -2991,7 +2994,7 @@ static void SpeedDust_Step1(u8 taskId)
} }
} }
void AnimSpeedDust(struct Sprite *sprite) static void AnimSpeedDust(struct Sprite *sprite)
{ {
sprite->invisible = gTasks[sprite->data[0]].data[5]; sprite->invisible = gTasks[sprite->data[0]].data[5];
if (sprite->animEnded) if (sprite->animEnded)
@ -3037,7 +3040,7 @@ static void SetMusicNotePalette(struct Sprite *sprite, u8 a, u8 b)
sprite->oam.paletteNum = IndexOfSpritePaletteTag(sMusicNotePaletteTagsTable[b >> 1]); sprite->oam.paletteNum = IndexOfSpritePaletteTag(sMusicNotePaletteTagsTable[b >> 1]);
} }
void AnimHealBellMusicNote(struct Sprite *sprite) static void AnimHealBellMusicNote(struct Sprite *sprite)
{ {
InitSpritePosToAnimAttacker(sprite, FALSE); InitSpritePosToAnimAttacker(sprite, FALSE);
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
@ -3051,7 +3054,7 @@ void AnimHealBellMusicNote(struct Sprite *sprite)
SetMusicNotePalette(sprite, gBattleAnimArgs[5], gBattleAnimArgs[6]); SetMusicNotePalette(sprite, gBattleAnimArgs[5], gBattleAnimArgs[6]);
} }
void AnimMagentaHeart(struct Sprite *sprite) static void AnimMagentaHeart(struct Sprite *sprite)
{ {
if (++sprite->data[0] == 1) if (++sprite->data[0] == 1)
InitSpritePosToAnimAttacker(sprite, FALSE); InitSpritePosToAnimAttacker(sprite, FALSE);
@ -3079,17 +3082,17 @@ void AnimTask_FakeOut(u8 taskId)
SetGpuReg(REG_OFFSET_BLDY, 0x10); SetGpuReg(REG_OFFSET_BLDY, 0x10);
gTasks[taskId].data[0] = win0v; gTasks[taskId].data[0] = win0v;
gTasks[taskId].data[1] = win0h; gTasks[taskId].data[1] = win0h;
gTasks[taskId].func = FakeOutStep1; gTasks[taskId].func = AnimTask_FakeOut_Step1;
} }
static void FakeOutStep1(u8 taskId) static void AnimTask_FakeOut_Step1(u8 taskId)
{ {
gTasks[taskId].data[0] += 13; gTasks[taskId].data[0] += 13;
gTasks[taskId].data[1] -= 13; gTasks[taskId].data[1] -= 13;
if (gTasks[taskId].data[0] >= gTasks[taskId].data[1]) if (gTasks[taskId].data[0] >= gTasks[taskId].data[1])
{ {
gBattle_WIN0H = 0; gBattle_WIN0H = 0;
gTasks[taskId].func = FakeOutStep2; gTasks[taskId].func = AnimTask_FakeOut_Step2;
} }
else else
{ {
@ -3097,7 +3100,7 @@ static void FakeOutStep1(u8 taskId)
} }
} }
static void FakeOutStep2(u8 taskId) static void AnimTask_FakeOut_Step2(u8 taskId)
{ {
if (++gTasks[taskId].data[10] == 5) if (++gTasks[taskId].data[10] == 5)
{ {
@ -3157,7 +3160,7 @@ void AnimTask_StretchAttackerUp(u8 taskId)
} }
} }
void AnimRedHeartProjectile(struct Sprite *sprite) static void AnimRedHeartProjectile(struct Sprite *sprite)
{ {
InitSpritePosToAnimAttacker(sprite, TRUE); InitSpritePosToAnimAttacker(sprite, TRUE);
sprite->data[0] = 95; sprite->data[0] = 95;
@ -3182,7 +3185,7 @@ static void AnimRedHeartProjectile_Step(struct Sprite *sprite)
} }
} }
void AnimParticuleBurst(struct Sprite *sprite) void AnimParticleBurst(struct Sprite *sprite)
{ {
if (sprite->data[0] == 0) if (sprite->data[0] == 0)
{ {
@ -3204,7 +3207,7 @@ void AnimParticuleBurst(struct Sprite *sprite)
} }
} }
void AnimRedHeartRising(struct Sprite *sprite) static void AnimRedHeartRising(struct Sprite *sprite)
{ {
sprite->pos1.x = gBattleAnimArgs[0]; sprite->pos1.x = gBattleAnimArgs[0];
sprite->pos1.y = 160; sprite->pos1.y = 160;
@ -3249,10 +3252,10 @@ void AnimTask_HeartsBackground(u8 taskId)
AnimLoadCompressedBgGfx(animBg.bgId, &gUnknown_08C232E0, animBg.tilesOffset); AnimLoadCompressedBgGfx(animBg.bgId, &gUnknown_08C232E0, animBg.tilesOffset);
sub_80A6D60(&animBg, &gUnknown_08C23D78, 0); sub_80A6D60(&animBg, &gUnknown_08C23D78, 0);
LoadCompressedPalette(&gUnknown_08C23D50, animBg.paletteId * 16, 32); LoadCompressedPalette(&gUnknown_08C23D50, animBg.paletteId * 16, 32);
gTasks[taskId].func = HeartsBackground_Step; gTasks[taskId].func = AnimTask_HeartsBackground_Step;
} }
static void HeartsBackground_Step(u8 taskId) static void AnimTask_HeartsBackground_Step(u8 taskId)
{ {
struct BattleAnimBgData animBg; struct BattleAnimBgData animBg;
@ -3333,10 +3336,10 @@ void AnimTask_ScaryFace(u8 taskId)
AnimLoadCompressedBgGfx(animBg.bgId, gUnknown_08C249F8, animBg.tilesOffset); AnimLoadCompressedBgGfx(animBg.bgId, gUnknown_08C249F8, animBg.tilesOffset);
LoadCompressedPalette(gUnknown_08C249D0, animBg.paletteId * 16, 32); LoadCompressedPalette(gUnknown_08C249D0, animBg.paletteId * 16, 32);
gTasks[taskId].func = ScaryFace_Step; gTasks[taskId].func = AnimTask_ScaryFace_Step;
} }
static void ScaryFace_Step(u8 taskId) static void AnimTask_ScaryFace_Step(u8 taskId)
{ {
struct BattleAnimBgData animBg; struct BattleAnimBgData animBg;
@ -3397,7 +3400,7 @@ static void ScaryFace_Step(u8 taskId)
// Used by MOVE_HIDDEN_POWER // Used by MOVE_HIDDEN_POWER
// arg 0: duration // arg 0: duration
// arg 1: initial wave offset // arg 1: initial wave offset
void AnimOrbitFast(struct Sprite *sprite) static void AnimOrbitFast(struct Sprite *sprite)
{ {
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
@ -3405,11 +3408,11 @@ void AnimOrbitFast(struct Sprite *sprite)
sprite->data[0] = gBattleAnimArgs[0]; sprite->data[0] = gBattleAnimArgs[0];
sprite->data[1] = gBattleAnimArgs[1]; sprite->data[1] = gBattleAnimArgs[1];
sprite->data[7] = GetBattlerSpriteSubpriority(gBattleAnimAttacker); sprite->data[7] = GetBattlerSpriteSubpriority(gBattleAnimAttacker);
sprite->callback = AnimOrbitFastStep; sprite->callback = AnimOrbitFast_Step;
sprite->callback(sprite); sprite->callback(sprite);
} }
static void AnimOrbitFastStep(struct Sprite *sprite) static void AnimOrbitFast_Step(struct Sprite *sprite)
{ {
if (sprite->data[1] >= 64 && sprite->data[1] <= 191) if (sprite->data[1] >= 64 && sprite->data[1] <= 191)
sprite->subpriority = sprite->data[7] + 1; sprite->subpriority = sprite->data[7] + 1;
@ -3448,16 +3451,16 @@ static void AnimOrbitFastStep(struct Sprite *sprite)
// Moves orbs away from the mon, based on where they are in their orbit. // Moves orbs away from the mon, based on where they are in their orbit.
// Used in MOVE_HIDDEN_POWER. // Used in MOVE_HIDDEN_POWER.
// arg 0: initial wave offset // arg 0: initial wave offset
void AnimOrbitScatter(struct Sprite *sprite) static void AnimOrbitScatter(struct Sprite *sprite)
{ {
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
sprite->data[0] = Sin(gBattleAnimArgs[0], 10); sprite->data[0] = Sin(gBattleAnimArgs[0], 10);
sprite->data[1] = Cos(gBattleAnimArgs[0], 7); sprite->data[1] = Cos(gBattleAnimArgs[0], 7);
sprite->callback = AnimOrbitScatterStep; sprite->callback = AnimOrbitScatter_Step;
} }
static void AnimOrbitScatterStep(struct Sprite *sprite) static void AnimOrbitScatter_Step(struct Sprite *sprite)
{ {
sprite->pos2.x += sprite->data[0]; sprite->pos2.x += sprite->data[0];
sprite->pos2.y += sprite->data[1]; sprite->pos2.y += sprite->data[1];
@ -3473,7 +3476,7 @@ static void AnimSpitUpOrb_Step(struct Sprite *sprite)
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
void AnimSpitUpOrb(struct Sprite *sprite) static void AnimSpitUpOrb(struct Sprite *sprite)
{ {
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
@ -3483,19 +3486,19 @@ void AnimSpitUpOrb(struct Sprite *sprite)
sprite->callback = AnimSpitUpOrb_Step; sprite->callback = AnimSpitUpOrb_Step;
} }
static void sub_810699C(struct Sprite *sprite) static void AnimEyeSparkle_Step(struct Sprite *sprite)
{ {
if (sprite->animEnded) if (sprite->animEnded)
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
void AnimEyeSparkle(struct Sprite *sprite) static void AnimEyeSparkle(struct Sprite *sprite)
{ {
InitSpritePosToAnimAttacker(sprite, TRUE); InitSpritePosToAnimAttacker(sprite, TRUE);
sprite->callback = sub_810699C; sprite->callback = AnimEyeSparkle_Step;
} }
void AnimAngel(struct Sprite *sprite) static void AnimAngel(struct Sprite *sprite)
{ {
s16 var0; s16 var0;
if (!sprite->data[0]) if (!sprite->data[0])
@ -3533,7 +3536,7 @@ static void sub_8106A64(struct Sprite *sprite)
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
void AnimPinkHeart(struct Sprite *sprite) static void AnimPinkHeart(struct Sprite *sprite)
{ {
if (sprite->data[0] == 0) if (sprite->data[0] == 0)
{ {
@ -3559,7 +3562,7 @@ void AnimPinkHeart(struct Sprite *sprite)
} }
} }
void AnimDevil(struct Sprite *sprite) static void AnimDevil(struct Sprite *sprite)
{ {
if (sprite->data[3] == 0) if (sprite->data[3] == 0)
{ {
@ -3588,7 +3591,7 @@ void AnimDevil(struct Sprite *sprite)
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
void AnimFurySwipes(struct Sprite *sprite) static void AnimFurySwipes(struct Sprite *sprite)
{ {
if (sprite->data[0] == 0) if (sprite->data[0] == 0)
{ {
@ -3603,7 +3606,7 @@ void AnimFurySwipes(struct Sprite *sprite)
} }
} }
void AnimMovmentWaves(struct Sprite *sprite) static void AnimMovmentWaves(struct Sprite *sprite)
{ {
if (!gBattleAnimArgs[2]) if (!gBattleAnimArgs[2])
{ {
@ -3650,16 +3653,16 @@ void AnimTask_UproarDistortion(u8 taskId)
u8 spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); u8 spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
PrepareAffineAnimInTaskData(&gTasks[taskId], spriteId, gUnknown_08593B98); PrepareAffineAnimInTaskData(&gTasks[taskId], spriteId, gUnknown_08593B98);
gTasks[taskId].func = UproarDistortion_Step; gTasks[taskId].func = AnimTask_UproarDistortion_Step;
} }
static void UproarDistortion_Step(u8 taskId) static void AnimTask_UproarDistortion_Step(u8 taskId)
{ {
if (!RunAffineAnimFromTaskData(&gTasks[taskId])) if (!RunAffineAnimFromTaskData(&gTasks[taskId]))
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }
void AnimJaggedMusicNote(struct Sprite *sprite) static void AnimJaggedMusicNote(struct Sprite *sprite)
{ {
int var1; int var1;
u8 battler = !gBattleAnimArgs[0] ? gBattleAnimAttacker : gBattleAnimTarget; u8 battler = !gBattleAnimArgs[0] ? gBattleAnimAttacker : gBattleAnimTarget;
@ -3697,12 +3700,12 @@ static void AnimJaggedMusicNote_Step(struct Sprite *sprite)
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
void AnimPerishSongMusicNote2(struct Sprite *sprite) static void AnimPerishSongMusicNote2(struct Sprite *sprite)
{ {
if (!sprite->data[0]) if (!sprite->data[0])
{ {
sprite->data[1] = 120 - gBattleAnimArgs[0]; sprite->data[1] = 120 - gBattleAnimArgs[0];
sprite->invisible = 1; sprite->invisible = TRUE;
} }
if (++sprite->data[0] == sprite->data[1]) if (++sprite->data[0] == sprite->data[1])
@ -3712,7 +3715,7 @@ void AnimPerishSongMusicNote2(struct Sprite *sprite)
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
void AnimPerishSongMusicNote(struct Sprite *sprite) static void AnimPerishSongMusicNote(struct Sprite *sprite)
{ {
int index; int index;
int var2; int var2;
@ -3789,7 +3792,7 @@ static void AnimPerishSongMusicNote_Step2(struct Sprite *sprite)
} }
} }
void AnimGuardRing(struct Sprite *sprite) static void AnimGuardRing(struct Sprite *sprite)
{ {
if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimAttacker))) if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimAttacker)))
{ {

File diff suppressed because it is too large Load Diff

View File

@ -6,27 +6,27 @@
#include "trig.h" #include "trig.h"
// This file's functions. // This file's functions.
void AnimTask_ShakeMonStep(u8 taskId); static void AnimTask_ShakeMon_Step(u8 taskId);
void AnimTask_ShakeMon2Step(u8 taskId); static void AnimTask_ShakeMon2_Step(u8 taskId);
void AnimTask_ShakeMonInPlaceStep(u8 taskId); static void AnimTask_ShakeMonInPlace_Step(u8 taskId);
void AnimTask_ShakeAndSinkMonStep(u8 taskId); static void AnimTask_ShakeAndSinkMon_Step(u8 taskId);
void sub_80D57B8(u8 taskId); static void AnimTask_TranslateMonElliptical_Step(u8 taskId);
static void DoHorizontalLunge(struct Sprite *sprite); static void DoHorizontalLunge(struct Sprite *sprite);
static void ReverseHorizontalLungeDirection(struct Sprite *sprite); static void ReverseHorizontalLungeDirection(struct Sprite *sprite);
static void DoVerticalDip(struct Sprite *sprite); static void DoVerticalDip(struct Sprite *sprite);
static void ReverseVerticalDipDirection(struct Sprite* sprite); static void ReverseVerticalDipDirection(struct Sprite* sprite);
static void SlideMonToOriginalPos(struct Sprite *sprite); static void SlideMonToOriginalPos(struct Sprite *sprite);
static void SlideMonToOriginalPosStep(struct Sprite *sprite); static void SlideMonToOriginalPos_Step(struct Sprite *sprite);
static void SlideMonToOffset(struct Sprite *sprite); static void SlideMonToOffset(struct Sprite *sprite);
static void SlideMonToOffsetAndBack(struct Sprite *sprite); static void SlideMonToOffsetAndBack(struct Sprite *sprite);
static void sub_80D5C20(struct Sprite *sprite); static void SlideMonToOffsetAndBack_End(struct Sprite *sprite);
void AnimTask_WindUpLungePart1(u8 taskId); static void AnimTask_WindUpLunge_Step1(u8 taskId);
void AnimTask_WindUpLungePart2(u8 taskId); static void AnimTask_WindUpLunge_Step2(u8 taskId);
void AnimTask_SwayMonStep(u8 taskId); static void AnimTask_SwayMonStep(u8 taskId);
void AnimTask_ScaleMonAndRestoreStep(u8 taskId); static void AnimTask_ScaleMonAndRestore_Step(u8 taskId);
void sub_80D6308(u8 taskId); static void AnimTask_RotateMonSpriteToSide_Step(u8 taskId);
void sub_80D646C(u8 taskId); static void AnimTask_ShakeTargetBasedOnMovePowerOrDmg_Step(u8 taskId);
void sub_80A8B3C(u8 taskId); static void AnimTask_SlideOffScreen_Step(u8 taskId);
const struct SpriteTemplate gHorizontalLungeSpriteTemplate = const struct SpriteTemplate gHorizontalLungeSpriteTemplate =
{ {
@ -107,11 +107,11 @@ void AnimTask_ShakeMon(u8 taskId)
gTasks[taskId].data[3] = gBattleAnimArgs[4]; gTasks[taskId].data[3] = gBattleAnimArgs[4];
gTasks[taskId].data[4] = gBattleAnimArgs[1]; gTasks[taskId].data[4] = gBattleAnimArgs[1];
gTasks[taskId].data[5] = gBattleAnimArgs[2]; gTasks[taskId].data[5] = gBattleAnimArgs[2];
gTasks[taskId].func = AnimTask_ShakeMonStep; gTasks[taskId].func = AnimTask_ShakeMon_Step;
AnimTask_ShakeMonStep(taskId); AnimTask_ShakeMon_Step(taskId);
} }
void AnimTask_ShakeMonStep(u8 taskId) static void AnimTask_ShakeMon_Step(u8 taskId)
{ {
if (gTasks[taskId].data[3] == 0) if (gTasks[taskId].data[3] == 0)
{ {
@ -211,11 +211,11 @@ void AnimTask_ShakeMon2(u8 taskId)
gTasks[taskId].data[3] = gBattleAnimArgs[4]; gTasks[taskId].data[3] = gBattleAnimArgs[4];
gTasks[taskId].data[4] = gBattleAnimArgs[1]; gTasks[taskId].data[4] = gBattleAnimArgs[1];
gTasks[taskId].data[5] = gBattleAnimArgs[2]; gTasks[taskId].data[5] = gBattleAnimArgs[2];
gTasks[taskId].func = AnimTask_ShakeMon2Step; gTasks[taskId].func = AnimTask_ShakeMon2_Step;
gTasks[taskId].func(taskId); gTasks[taskId].func(taskId);
} }
void AnimTask_ShakeMon2Step(u8 taskId) static void AnimTask_ShakeMon2_Step(u8 taskId)
{ {
if (gTasks[taskId].data[3] == 0) if (gTasks[taskId].data[3] == 0)
{ {
@ -270,11 +270,11 @@ void AnimTask_ShakeMonInPlace(u8 taskId)
gTasks[taskId].data[4] = gBattleAnimArgs[4]; gTasks[taskId].data[4] = gBattleAnimArgs[4];
gTasks[taskId].data[5] = gBattleAnimArgs[1] * 2; gTasks[taskId].data[5] = gBattleAnimArgs[1] * 2;
gTasks[taskId].data[6] = gBattleAnimArgs[2] * 2; gTasks[taskId].data[6] = gBattleAnimArgs[2] * 2;
gTasks[taskId].func = AnimTask_ShakeMonInPlaceStep; gTasks[taskId].func = AnimTask_ShakeMonInPlace_Step;
gTasks[taskId].func(taskId); gTasks[taskId].func(taskId);
} }
void AnimTask_ShakeMonInPlaceStep(u8 taskId) static void AnimTask_ShakeMonInPlace_Step(u8 taskId)
{ {
if (gTasks[taskId].data[3] == 0) if (gTasks[taskId].data[3] == 0)
{ {
@ -326,11 +326,11 @@ void AnimTask_ShakeAndSinkMon(u8 taskId)
gTasks[taskId].data[2] = gBattleAnimArgs[2]; gTasks[taskId].data[2] = gBattleAnimArgs[2];
gTasks[taskId].data[3] = gBattleAnimArgs[3]; gTasks[taskId].data[3] = gBattleAnimArgs[3];
gTasks[taskId].data[4] = gBattleAnimArgs[4]; gTasks[taskId].data[4] = gBattleAnimArgs[4];
gTasks[taskId].func = AnimTask_ShakeAndSinkMonStep; gTasks[taskId].func = AnimTask_ShakeAndSinkMon_Step;
gTasks[taskId].func(taskId); gTasks[taskId].func(taskId);
} }
void AnimTask_ShakeAndSinkMonStep(u8 taskId) static void AnimTask_ShakeAndSinkMon_Step(u8 taskId)
{ {
s16 x; s16 x;
u8 spriteId; u8 spriteId;
@ -383,11 +383,11 @@ void AnimTask_TranslateMonElliptical(u8 taskId)
gTasks[taskId].data[2] = gBattleAnimArgs[2]; gTasks[taskId].data[2] = gBattleAnimArgs[2];
gTasks[taskId].data[3] = gBattleAnimArgs[3]; gTasks[taskId].data[3] = gBattleAnimArgs[3];
gTasks[taskId].data[4] = wavePeriod; gTasks[taskId].data[4] = wavePeriod;
gTasks[taskId].func = sub_80D57B8; gTasks[taskId].func = AnimTask_TranslateMonElliptical_Step;
gTasks[taskId].func(taskId); gTasks[taskId].func(taskId);
} }
void sub_80D57B8(u8 taskId) static void AnimTask_TranslateMonElliptical_Step(u8 taskId)
{ {
u8 spriteId = gTasks[taskId].data[0]; u8 spriteId = gTasks[taskId].data[0];
gSprites[spriteId].pos2.x = Sin(gTasks[taskId].data[5], gTasks[taskId].data[1]); gSprites[spriteId].pos2.x = Sin(gTasks[taskId].data[5], gTasks[taskId].data[1]);
@ -511,10 +511,10 @@ static void SlideMonToOriginalPos(struct Sprite *sprite)
sprite->data[7] = gBattleAnimArgs[1]; sprite->data[7] = gBattleAnimArgs[1];
sprite->data[7] |= monSpriteId << 8; sprite->data[7] |= monSpriteId << 8;
sprite->callback = SlideMonToOriginalPosStep; sprite->callback = SlideMonToOriginalPos_Step;
} }
static void SlideMonToOriginalPosStep(struct Sprite *sprite) static void SlideMonToOriginalPos_Step(struct Sprite *sprite)
{ {
s8 monSpriteId; s8 monSpriteId;
u8 lo; u8 lo;
@ -620,13 +620,13 @@ static void SlideMonToOffsetAndBack(struct Sprite *sprite)
} }
else else
{ {
StoreSpriteCallbackInData6(sprite, sub_80D5C20); StoreSpriteCallbackInData6(sprite, SlideMonToOffsetAndBack_End);
} }
sprite->callback = TranslateMonSpriteLinearFixedPoint; sprite->callback = TranslateMonSpriteLinearFixedPoint;
} }
static void sub_80D5C20(struct Sprite *sprite) static void SlideMonToOffsetAndBack_End(struct Sprite *sprite)
{ {
gSprites[sprite->data[5]].pos2.x = 0; gSprites[sprite->data[5]].pos2.x = 0;
gSprites[sprite->data[5]].pos2.y = 0; gSprites[sprite->data[5]].pos2.y = 0;
@ -659,10 +659,10 @@ void AnimTask_WindUpLunge(u8 taskId)
gTasks[taskId].data[5] = (gBattleAnimArgs[5] << 8) / gBattleAnimArgs[6]; gTasks[taskId].data[5] = (gBattleAnimArgs[5] << 8) / gBattleAnimArgs[6];
gTasks[taskId].data[6] = gBattleAnimArgs[6]; gTasks[taskId].data[6] = gBattleAnimArgs[6];
gTasks[taskId].data[7] = wavePeriod; gTasks[taskId].data[7] = wavePeriod;
gTasks[taskId].func = AnimTask_WindUpLungePart1; gTasks[taskId].func = AnimTask_WindUpLunge_Step1;
} }
void AnimTask_WindUpLungePart1(u8 taskId) static void AnimTask_WindUpLunge_Step1(u8 taskId)
{ {
u8 spriteId; u8 spriteId;
spriteId = gTasks[taskId].data[0]; spriteId = gTasks[taskId].data[0];
@ -672,11 +672,11 @@ void AnimTask_WindUpLungePart1(u8 taskId)
gTasks[taskId].data[10] += gTasks[taskId].data[7]; gTasks[taskId].data[10] += gTasks[taskId].data[7];
if (--gTasks[taskId].data[3] == 0) if (--gTasks[taskId].data[3] == 0)
{ {
gTasks[taskId].func = AnimTask_WindUpLungePart2; gTasks[taskId].func = AnimTask_WindUpLunge_Step2;
} }
} }
void AnimTask_WindUpLungePart2(u8 taskId) static void AnimTask_WindUpLunge_Step2(u8 taskId)
{ {
u8 spriteId; u8 spriteId;
if (gTasks[taskId].data[4] > 0) if (gTasks[taskId].data[4] > 0)
@ -735,10 +735,10 @@ void AnimTask_SlideOffScreen(u8 taskId)
{ {
gTasks[taskId].data[1] = -gBattleAnimArgs[1]; gTasks[taskId].data[1] = -gBattleAnimArgs[1];
} }
gTasks[taskId].func = sub_80A8B3C; gTasks[taskId].func = AnimTask_SlideOffScreen_Step;
} }
void sub_80A8B3C(u8 taskId) static void AnimTask_SlideOffScreen_Step(u8 taskId)
{ {
u8 spriteId = gTasks[taskId].data[0]; u8 spriteId = gTasks[taskId].data[0];
gSprites[spriteId].pos2.x += gTasks[taskId].data[1]; gSprites[spriteId].pos2.x += gTasks[taskId].data[1];
@ -779,7 +779,7 @@ void AnimTask_SwayMon(u8 taskId)
gTasks[taskId].func = AnimTask_SwayMonStep; gTasks[taskId].func = AnimTask_SwayMonStep;
} }
void AnimTask_SwayMonStep(u8 taskId) static void AnimTask_SwayMonStep(u8 taskId)
{ {
s16 sineValue; s16 sineValue;
u8 spriteId; u8 spriteId;
@ -841,10 +841,10 @@ void AnimTask_ScaleMonAndRestore(u8 taskId)
gTasks[taskId].data[4] = spriteId; gTasks[taskId].data[4] = spriteId;
gTasks[taskId].data[10] = 0x100; gTasks[taskId].data[10] = 0x100;
gTasks[taskId].data[11] = 0x100; gTasks[taskId].data[11] = 0x100;
gTasks[taskId].func = AnimTask_ScaleMonAndRestoreStep; gTasks[taskId].func = AnimTask_ScaleMonAndRestore_Step;
} }
void AnimTask_ScaleMonAndRestoreStep(u8 taskId) static void AnimTask_ScaleMonAndRestore_Step(u8 taskId)
{ {
u8 spriteId; u8 spriteId;
gTasks[taskId].data[10] += gTasks[taskId].data[0]; gTasks[taskId].data[10] += gTasks[taskId].data[0];
@ -869,7 +869,7 @@ void AnimTask_ScaleMonAndRestoreStep(u8 taskId)
} }
} }
void AminTask_DipMonSpriteToSide(u8 taskId) void AnimTask_RotateMonSpriteToSide(u8 taskId)
{ {
u8 spriteId; u8 spriteId;
spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[2]); spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[2]);
@ -910,7 +910,7 @@ void AminTask_DipMonSpriteToSide(u8 taskId)
gTasks[taskId].data[4] *= -1; gTasks[taskId].data[4] *= -1;
} }
} }
gTasks[taskId].func = sub_80D6308; gTasks[taskId].func = AnimTask_RotateMonSpriteToSide_Step;
} }
// Rotates mon to side and back to original position. For Peck and when a held item activates // Rotates mon to side and back to original position. For Peck and when a held item activates
@ -949,10 +949,10 @@ void AnimTask_RotateMonToSideAndRestore(u8 taskId)
gTasks[taskId].data[7] = 1; gTasks[taskId].data[7] = 1;
gTasks[taskId].data[3] *= -1; gTasks[taskId].data[3] *= -1;
gTasks[taskId].data[4] *= -1; gTasks[taskId].data[4] *= -1;
gTasks[taskId].func = sub_80D6308; gTasks[taskId].func = AnimTask_RotateMonSpriteToSide_Step;
} }
void sub_80D6308(u8 taskId) static void AnimTask_RotateMonSpriteToSide_Step(u8 taskId)
{ {
gTasks[taskId].data[3] += gTasks[taskId].data[4]; gTasks[taskId].data[3] += gTasks[taskId].data[4];
SetSpriteRotScale(gTasks[taskId].data[5], 0x100, 0x100, gTasks[taskId].data[3]); SetSpriteRotScale(gTasks[taskId].data[5], 0x100, 0x100, gTasks[taskId].data[3]);
@ -1016,10 +1016,10 @@ void AnimTask_ShakeTargetBasedOnMovePowerOrDmg(u8 taskId)
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];
gTasks[taskId].func = sub_80D646C; gTasks[taskId].func = AnimTask_ShakeTargetBasedOnMovePowerOrDmg_Step;
} }
void sub_80D646C(u8 taskId) static void AnimTask_ShakeTargetBasedOnMovePowerOrDmg_Step(u8 taskId)
{ {
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
if (++task->data[0] > task->data[1]) if (++task->data[0] > task->data[1])

View File

@ -633,7 +633,7 @@ void AnimTask_SwitchOutShrinkMon(u8 taskId)
break; break;
case 2: case 2:
ResetSpriteRotScale(spriteId); ResetSpriteRotScale(spriteId);
gSprites[spriteId].invisible = 1; gSprites[spriteId].invisible = TRUE;
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
break; break;
} }
@ -896,7 +896,7 @@ static void sub_8171240(struct Sprite *sprite)
break; break;
case 2: case 2:
ResetSpriteRotScale(spriteId); ResetSpriteRotScale(spriteId);
gSprites[spriteId].invisible = 1; gSprites[spriteId].invisible = TRUE;
gTasks[taskId].data[0]++; gTasks[taskId].data[0]++;
break; break;
default: default:
@ -1229,7 +1229,7 @@ static void sub_81718D8(struct Sprite *sprite)
} }
break; break;
case 2: case 2:
sprite->invisible = 1; sprite->invisible = TRUE;
sprite->data[0]++; sprite->data[0]++;
break; break;
default: default:
@ -1313,7 +1313,7 @@ static void sub_8171AE4(struct Sprite *sprite)
break; break;
} }
gSprites[gBattlerSpriteIds[gBattleAnimTarget]].invisible = 0; gSprites[gBattlerSpriteIds[gBattleAnimTarget]].invisible = FALSE;
StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimTarget]], 1); StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimTarget]], 1);
AnimateSprite(&gSprites[gBattlerSpriteIds[gBattleAnimTarget]]); AnimateSprite(&gSprites[gBattlerSpriteIds[gBattleAnimTarget]]);
gSprites[gBattlerSpriteIds[gBattleAnimTarget]].data[1] = 0x1000; gSprites[gBattlerSpriteIds[gBattleAnimTarget]].data[1] = 0x1000;
@ -1324,7 +1324,7 @@ static void sub_8171BAC(struct Sprite *sprite)
int next = FALSE; int next = FALSE;
if (sprite->animEnded) if (sprite->animEnded)
sprite->invisible = 1; sprite->invisible = TRUE;
if (gSprites[gBattlerSpriteIds[gBattleAnimTarget]].affineAnimEnded) if (gSprites[gBattlerSpriteIds[gBattleAnimTarget]].affineAnimEnded)
{ {
@ -2105,7 +2105,7 @@ static void sub_8172FEC(u8 taskId)
gSprites[spriteId].callback = sub_8173250; gSprites[spriteId].callback = sub_8173250;
gSprites[spriteId].pos2.x = -32; gSprites[spriteId].pos2.x = -32;
gSprites[spriteId].pos2.y = 32; gSprites[spriteId].pos2.y = 32;
gSprites[spriteId].invisible = 1; gSprites[spriteId].invisible = TRUE;
if (gTasks[taskId].data[11] == 0) if (gTasks[taskId].data[11] == 0)
{ {
if (GetBattlerSide(battler) == B_SIDE_PLAYER) if (GetBattlerSide(battler) == B_SIDE_PLAYER)
@ -2163,7 +2163,7 @@ static void sub_8173250(struct Sprite *sprite)
} }
else else
{ {
sprite->invisible = 0; sprite->invisible = FALSE;
sprite->pos2.x += 5; sprite->pos2.x += 5;
sprite->pos2.y -= 5; sprite->pos2.y -= 5;
if (sprite->pos2.x > 32) if (sprite->pos2.x > 32)
@ -2215,7 +2215,7 @@ static void sub_81733D4(struct Sprite *sprite)
if (TranslateAnimHorizontalArc(sprite)) if (TranslateAnimHorizontalArc(sprite))
{ {
sprite->data[0] = 0; sprite->data[0] = 0;
sprite->invisible = 1; sprite->invisible = TRUE;
sprite->callback = sub_8173400; sprite->callback = sub_8173400;
} }
} }

View File

@ -328,7 +328,7 @@ void AnimTask_DrawFallingWhiteLinesOnAttacker(u8 taskId)
species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimAttacker]], MON_DATA_SPECIES); species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimAttacker]], MON_DATA_SPECIES);
} }
spriteId = GetAnimBattlerSpriteId(0); spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
newSpriteId = sub_80A89C8(gBattleAnimAttacker, spriteId, species); newSpriteId = sub_80A89C8(gBattleAnimAttacker, spriteId, species);
sub_80A6B30(&unknownStruct); sub_80A6B30(&unknownStruct);
sub_80A6D60(&unknownStruct, gUnknown_08C20684, 0); sub_80A6D60(&unknownStruct, gUnknown_08C20684, 0);

View File

@ -7,16 +7,16 @@
static void AnimMegahornHorn(struct Sprite *); static void AnimMegahornHorn(struct Sprite *);
static void AnimLeechLifeNeedle(struct Sprite *); static void AnimLeechLifeNeedle(struct Sprite *);
static void AnimTranslateWebThread(struct Sprite *); static void AnimTranslateWebThread(struct Sprite *);
static void AnimTranslateWebThread_Step(struct Sprite *);
static void AnimStringWrap(struct Sprite *); static void AnimStringWrap(struct Sprite *);
void sub_811067C(struct Sprite *); static void AnimStringWrap_Step(struct Sprite *);
void AnimTranslateStinger(struct Sprite *); static void AnimSpiderWeb(struct Sprite *);
void AnimMissileArc(struct Sprite *); static void AnimSpiderWeb_Step(struct Sprite *);
static void AnimSpiderWeb_End(struct Sprite *);
static void AnimTranslateStinger(struct Sprite *);
static void AnimMissileArc(struct Sprite *);
static void AnimMissileArc_Step(struct Sprite *);
static void AnimTailGlowOrb(struct Sprite *); static void AnimTailGlowOrb(struct Sprite *);
static void sub_811057C(struct Sprite *);
static void sub_8110630(struct Sprite *);
static void sub_81106A4(struct Sprite *);
static void sub_8110700(struct Sprite *);
static void AnimMissileArcStep(struct Sprite *);
const union AffineAnimCmd gUnknown_08596938[] = const union AffineAnimCmd gUnknown_08596938[] =
{ {
@ -132,7 +132,7 @@ const struct SpriteTemplate gSpiderWebSpriteTemplate =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gUnknown_08596A28, .affineAnims = gUnknown_08596A28,
.callback = sub_811067C, .callback = AnimSpiderWeb,
}; };
const struct SpriteTemplate gLinearStingerSpriteTemplate = const struct SpriteTemplate gLinearStingerSpriteTemplate =
@ -276,10 +276,10 @@ static void AnimTranslateWebThread(struct Sprite *sprite)
sub_80A6FD4(sprite); sub_80A6FD4(sprite);
sprite->data[5] = gBattleAnimArgs[3]; sprite->data[5] = gBattleAnimArgs[3];
sprite->callback = sub_811057C; sprite->callback = AnimTranslateWebThread_Step;
} }
static void sub_811057C(struct Sprite *sprite) static void AnimTranslateWebThread_Step(struct Sprite *sprite)
{ {
if (AnimTranslateLinear(sprite)) if (AnimTranslateLinear(sprite))
{ {
@ -304,10 +304,10 @@ static void AnimStringWrap(struct Sprite *sprite)
if (!GetBattlerSide(gBattleAnimTarget)) if (!GetBattlerSide(gBattleAnimTarget))
sprite->pos1.y += 8; sprite->pos1.y += 8;
sprite->callback = sub_8110630; sprite->callback = AnimStringWrap_Step;
} }
static void sub_8110630(struct Sprite *sprite) static void AnimStringWrap_Step(struct Sprite *sprite)
{ {
if (++sprite->data[0] == 3) if (++sprite->data[0] == 3)
{ {
@ -321,16 +321,16 @@ static void sub_8110630(struct Sprite *sprite)
} }
} }
void sub_811067C(struct Sprite *sprite) static void AnimSpiderWeb(struct Sprite *sprite)
{ {
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND);
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(16, 0)); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(16, 0));
sprite->data[0] = 16; sprite->data[0] = 16;
sprite->callback = sub_81106A4; sprite->callback = AnimSpiderWeb_Step;
} }
static void sub_81106A4(struct Sprite *sprite) static void AnimSpiderWeb_Step(struct Sprite *sprite)
{ {
if (sprite->data[2] < 20) if (sprite->data[2] < 20)
{ {
@ -344,12 +344,12 @@ static void sub_81106A4(struct Sprite *sprite)
if (sprite->data[0] == 0) if (sprite->data[0] == 0)
{ {
sprite->invisible = TRUE; sprite->invisible = TRUE;
sprite->callback = sub_8110700; sprite->callback = AnimSpiderWeb_End;
} }
} }
} }
static void sub_8110700(struct Sprite *sprite) static void AnimSpiderWeb_End(struct Sprite *sprite)
{ {
SetGpuReg(REG_OFFSET_BLDCNT, 0); SetGpuReg(REG_OFFSET_BLDCNT, 0);
SetGpuReg(REG_OFFSET_BLDALPHA, 0); SetGpuReg(REG_OFFSET_BLDALPHA, 0);
@ -363,7 +363,7 @@ static void sub_8110700(struct Sprite *sprite)
// arg 2: target x pixel offset // arg 2: target x pixel offset
// arg 3: target y pixel offset // arg 3: target y pixel offset
// arg 4: duration // arg 4: duration
void AnimTranslateStinger(struct Sprite *sprite) static void AnimTranslateStinger(struct Sprite *sprite)
{ {
s16 lVarX, lVarY; s16 lVarX, lVarY;
u16 rot; u16 rot;
@ -420,7 +420,7 @@ void AnimTranslateStinger(struct Sprite *sprite)
// arg 3: target y pixel offset // arg 3: target y pixel offset
// arg 4: duration // arg 4: duration
// arg 5: wave amplitude // arg 5: wave amplitude
void AnimMissileArc(struct Sprite *sprite) static void AnimMissileArc(struct Sprite *sprite)
{ {
InitSpritePosToAnimAttacker(sprite, 1); InitSpritePosToAnimAttacker(sprite, 1);
@ -433,11 +433,11 @@ void AnimMissileArc(struct Sprite *sprite)
sprite->data[5] = gBattleAnimArgs[5]; sprite->data[5] = gBattleAnimArgs[5];
InitAnimArcTranslation(sprite); InitAnimArcTranslation(sprite);
sprite->callback = AnimMissileArcStep; sprite->callback = AnimMissileArc_Step;
sprite->invisible = TRUE; sprite->invisible = TRUE;
} }
static void AnimMissileArcStep(struct Sprite *sprite) static void AnimMissileArc_Step(struct Sprite *sprite)
{ {
sprite->invisible = FALSE; sprite->invisible = FALSE;

View File

@ -9,21 +9,21 @@
#include "util.h" #include "util.h"
#include "constants/rgb.h" #include "constants/rgb.h"
void sub_81138D4(struct Sprite *); static void sub_81138D4(struct Sprite *);
static void AnimBite(struct Sprite *); static void AnimBite(struct Sprite *);
static void AnimTearDrop(struct Sprite *); static void AnimTearDrop(struct Sprite *);
static void AnimClawSlash(struct Sprite *); static void AnimClawSlash(struct Sprite *);
static void sub_811375C(u8); static void AnimTask_AttackerFadeToInvisible_Step(u8);
static void sub_811381C(u8); static void AnimTask_AttackerFadeFromInvisible_Step(u8);
static void sub_8113950(struct Sprite *); static void sub_8113950(struct Sprite *);
static void sub_8113A18(struct Sprite *); static void AnimBite_Step1(struct Sprite *);
static void sub_8113A58(struct Sprite *); static void AnimBite_Step2(struct Sprite *);
static void sub_8113B90(struct Sprite *); static void AnimTearDrop_Step(struct Sprite *);
static void sub_8113D60(u8); static void AnimTask_MoveAttackerMementoShadow_Step(u8);
static void sub_81140C8(u8); static void AnimTask_MoveTargetMementoShadow_Step(u8);
static void sub_8114244(struct Task *); static void sub_8114244(struct Task *);
static void sub_8114374(u8); static void sub_8114374(u8);
static void sub_8114748(u8); static void AnimTask_MetallicShine_Step(u8);
const struct SpriteTemplate gUnknown_08596FC8 = const struct SpriteTemplate gUnknown_08596FC8 =
{ {
@ -198,10 +198,10 @@ void AnimTask_AttackerFadeToInvisible(u8 taskId)
else else
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG2); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG2);
gTasks[taskId].func = sub_811375C; gTasks[taskId].func = AnimTask_AttackerFadeToInvisible_Step;
} }
static void sub_811375C(u8 taskId) static void AnimTask_AttackerFadeToInvisible_Step(u8 taskId)
{ {
u8 blendA = gTasks[taskId].data[1] >> 8; u8 blendA = gTasks[taskId].data[1] >> 8;
u8 blendB = gTasks[taskId].data[1]; u8 blendB = gTasks[taskId].data[1];
@ -228,11 +228,11 @@ void AnimTask_AttackerFadeFromInvisible(u8 taskId)
{ {
gTasks[taskId].data[0] = gBattleAnimArgs[0]; gTasks[taskId].data[0] = gBattleAnimArgs[0];
gTasks[taskId].data[1] = BLDALPHA_BLEND(0, 16); gTasks[taskId].data[1] = BLDALPHA_BLEND(0, 16);
gTasks[taskId].func = sub_811381C; gTasks[taskId].func = AnimTask_AttackerFadeFromInvisible_Step;
SetGpuReg(REG_OFFSET_BLDALPHA, gTasks[taskId].data[1]); SetGpuReg(REG_OFFSET_BLDALPHA, gTasks[taskId].data[1]);
} }
static void sub_811381C(u8 taskId) static void AnimTask_AttackerFadeFromInvisible_Step(u8 taskId)
{ {
u8 blendA = gTasks[taskId].data[1] >> 8; u8 blendA = gTasks[taskId].data[1] >> 8;
u8 blendB = gTasks[taskId].data[1]; u8 blendB = gTasks[taskId].data[1];
@ -267,7 +267,7 @@ void AnimTask_InitAttackerFadeFromInvisible(u8 taskId)
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }
void sub_81138D4(struct Sprite *sprite) static void sub_81138D4(struct Sprite *sprite)
{ {
sprite->data[1] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->data[1] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2);
@ -319,20 +319,20 @@ static void AnimBite(struct Sprite *sprite)
sprite->data[0] = gBattleAnimArgs[3]; sprite->data[0] = gBattleAnimArgs[3];
sprite->data[1] = gBattleAnimArgs[4]; sprite->data[1] = gBattleAnimArgs[4];
sprite->data[2] = gBattleAnimArgs[5]; sprite->data[2] = gBattleAnimArgs[5];
sprite->callback = sub_8113A18; sprite->callback = AnimBite_Step1;
} }
static void sub_8113A18(struct Sprite *sprite) static void AnimBite_Step1(struct Sprite *sprite)
{ {
sprite->data[4] += sprite->data[0]; sprite->data[4] += sprite->data[0];
sprite->data[5] += sprite->data[1]; sprite->data[5] += sprite->data[1];
sprite->pos2.x = sprite->data[4] >> 8; sprite->pos2.x = sprite->data[4] >> 8;
sprite->pos2.y = sprite->data[5] >> 8; sprite->pos2.y = sprite->data[5] >> 8;
if (++sprite->data[3] == sprite->data[2]) if (++sprite->data[3] == sprite->data[2])
sprite->callback = sub_8113A58; sprite->callback = AnimBite_Step2;
} }
static void sub_8113A58(struct Sprite *sprite) static void AnimBite_Step2(struct Sprite *sprite)
{ {
sprite->data[4] -= sprite->data[0]; sprite->data[4] -= sprite->data[0];
sprite->data[5] -= sprite->data[1]; sprite->data[5] -= sprite->data[1];
@ -386,10 +386,10 @@ static void AnimTearDrop(struct Sprite *sprite)
sprite->data[5] = -12; sprite->data[5] = -12;
InitAnimArcTranslation(sprite); InitAnimArcTranslation(sprite);
sprite->callback = sub_8113B90; sprite->callback = AnimTearDrop_Step;
} }
static void sub_8113B90(struct Sprite *sprite) static void AnimTearDrop_Step(struct Sprite *sprite)
{ {
if (TranslateAnimHorizontalArc(sprite)) if (TranslateAnimHorizontalArc(sprite))
DestroySpriteAndMatrix(sprite); DestroySpriteAndMatrix(sprite);
@ -463,10 +463,10 @@ void AnimTask_MoveAttackerMementoShadow(u8 taskId)
gBattle_WIN0H = (task->data[14] << 8) | task->data[15]; gBattle_WIN0H = (task->data[14] << 8) | task->data[15];
gBattle_WIN0V = 160; gBattle_WIN0V = 160;
task->func = sub_8113D60; task->func = AnimTask_MoveAttackerMementoShadow_Step;
} }
static void sub_8113D60(u8 taskId) static void AnimTask_MoveAttackerMementoShadow_Step(u8 taskId)
{ {
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
@ -627,12 +627,12 @@ void AnimTask_MoveTargetMementoShadow(u8 taskId)
task->data[1] = 0; task->data[1] = 0;
task->data[2] = 0; task->data[2] = 0;
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(12, 8)); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(12, 8));
task->func = sub_81140C8; task->func = AnimTask_MoveTargetMementoShadow_Step;
break; break;
} }
} }
static void sub_81140C8(u8 taskId) static void AnimTask_MoveTargetMementoShadow_Step(u8 taskId)
{ {
u8 pos; u8 pos;
u16 i; u16 i;
@ -880,10 +880,10 @@ void AnimTask_MetallicShine(u8 taskId)
gTasks[taskId].data[2] = gBattleAnimArgs[1]; gTasks[taskId].data[2] = gBattleAnimArgs[1];
gTasks[taskId].data[3] = gBattleAnimArgs[2]; gTasks[taskId].data[3] = gBattleAnimArgs[2];
gTasks[taskId].data[6] = priorityChanged; gTasks[taskId].data[6] = priorityChanged;
gTasks[taskId].func = sub_8114748; gTasks[taskId].func = AnimTask_MetallicShine_Step;
} }
static void sub_8114748(u8 taskId) static void AnimTask_MetallicShine_Step(u8 taskId)
{ {
struct BattleAnimBgData animBg; struct BattleAnimBgData animBg;
u16 paletteNum; u16 paletteNum;

View File

@ -9,11 +9,11 @@ static void AnimOutrageFlame(struct Sprite *);
static void AnimDragonRageFirePlume(struct Sprite *); static void AnimDragonRageFirePlume(struct Sprite *);
static void AnimDragonFireToTarget(struct Sprite *); static void AnimDragonFireToTarget(struct Sprite *);
static void AnimDragonDanceOrb(struct Sprite *); static void AnimDragonDanceOrb(struct Sprite *);
static void AnimDragonDanceOrb_Step(struct Sprite *);
static void AnimOverheatFlame(struct Sprite *); static void AnimOverheatFlame(struct Sprite *);
static void sub_81132E0(struct Sprite *); static void AnimOverheatFlame_Step(struct Sprite *);
static void sub_81134B8(u8); static void AnimTask_DragonDanceWaver_Step(u8);
static void sub_8113574(struct Task *); static void sub_8113574(struct Task *);
static void sub_811369C(struct Sprite *);
EWRAM_DATA static u16 gUnknown_0203A100[7] = {0}; EWRAM_DATA static u16 gUnknown_0203A100[7] = {0};
@ -283,10 +283,10 @@ static void AnimDragonDanceOrb(struct Sprite *sprite)
sprite->data[7] = r0 / 2; sprite->data[7] = r0 / 2;
sprite->pos2.x = Cos(sprite->data[6], sprite->data[7]); sprite->pos2.x = Cos(sprite->data[6], sprite->data[7]);
sprite->pos2.y = Sin(sprite->data[6], sprite->data[7]); sprite->pos2.y = Sin(sprite->data[6], sprite->data[7]);
sprite->callback = sub_81132E0; sprite->callback = AnimDragonDanceOrb_Step;
} }
static void sub_81132E0(struct Sprite *sprite) static void AnimDragonDanceOrb_Step(struct Sprite *sprite)
{ {
switch (sprite->data[0]) switch (sprite->data[0])
{ {
@ -359,10 +359,10 @@ void AnimTask_DragonDanceWaver(u8 taskId)
} }
ScanlineEffect_SetParams(sp); ScanlineEffect_SetParams(sp);
task->func = sub_81134B8; task->func = AnimTask_DragonDanceWaver_Step;
} }
static void sub_81134B8(u8 taskId) static void AnimTask_DragonDanceWaver_Step(u8 taskId)
{ {
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
switch (task->data[0]) switch (task->data[0])
@ -424,12 +424,12 @@ static void AnimOverheatFlame(struct Sprite *sprite)
sprite->pos1.x += sprite->data[1] * gBattleAnimArgs[0]; sprite->pos1.x += sprite->data[1] * gBattleAnimArgs[0];
sprite->pos1.y += sprite->data[2] * gBattleAnimArgs[0]; sprite->pos1.y += sprite->data[2] * gBattleAnimArgs[0];
sprite->data[3] = gBattleAnimArgs[3]; sprite->data[3] = gBattleAnimArgs[3];
sprite->callback = sub_811369C; sprite->callback = AnimOverheatFlame_Step;
for (i = 0; i < 7; i++) for (i = 0; i < 7; i++)
gUnknown_0203A100[i] = sprite->data[i]; gUnknown_0203A100[i] = sprite->data[i];
} }
static void sub_811369C(struct Sprite *sprite) static void AnimOverheatFlame_Step(struct Sprite *sprite)
{ {
sprite->data[4] += sprite->data[1]; sprite->data[4] += sprite->data[1];
sprite->data[5] += sprite->data[2]; sprite->data[5] += sprite->data[2];

View File

@ -6,34 +6,34 @@
#include "sound.h" #include "sound.h"
static void AnimLightning(struct Sprite *); static void AnimLightning(struct Sprite *);
static void sub_810A1F8(struct Sprite *); static void AnimLightning_Step(struct Sprite *);
static void sub_810A214(struct Sprite *); static void sub_810A214(struct Sprite *);
static void sub_810A258(struct Sprite *); static void sub_810A258(struct Sprite *);
static void sub_810A274(struct Sprite *); static void sub_810A274(struct Sprite *);
static void AnimSparkElectricity(struct Sprite *); static void AnimSparkElectricity(struct Sprite *);
static void AnimZapCannonSpark(struct Sprite *); static void AnimZapCannonSpark(struct Sprite *);
static void sub_810A4F4(struct Sprite *); static void AnimZapCannonSpark_Step(struct Sprite *);
static void sub_810A56C(struct Sprite *); static void AnimThunderboltOrb(struct Sprite *);
static void AnimThunderboltOrbSpriteTemplate(struct Sprite *); static void AnimThunderboltOrb_Step(struct Sprite *);
static void AnimSparkElectricityFlashing(struct Sprite *); static void AnimSparkElectricityFlashing(struct Sprite *);
static void sub_810A6EC(struct Sprite *); static void AnimSparkElectricityFlashing_Step(struct Sprite *);
static void sub_810A75C(struct Sprite *); static void AnimElectricity(struct Sprite *);
static void sub_810A834(u8 taskId); static void AnimTask_ElectricBolt_Step(u8 taskId);
static void sub_810A9DC(struct Sprite *); static void AnimElectricBoltSegment(struct Sprite *);
static void AnimThunderWave(struct Sprite *); static void AnimThunderWave(struct Sprite *);
static void sub_810AAB0(struct Sprite *); static void AnimThunderWave_Step(struct Sprite *);
static void sub_810AB78(u8 taskId); static void sub_810AB78(u8 taskId);
static void sub_810AC8C(struct Sprite *); static void sub_810AC8C(struct Sprite *);
static void sub_810ACC0(struct Sprite *); static void sub_810ACC0(struct Sprite *);
static void AnimGrowingChargeOrb(struct Sprite *); static void AnimGrowingChargeOrb(struct Sprite *);
static void AnimElectricPuff(struct Sprite *); static void AnimElectricPuff(struct Sprite *);
static void AnimVoltTackleOrbSlide(struct Sprite *); static void AnimVoltTackleOrbSlide(struct Sprite *);
static void sub_810ADF8(struct Sprite *); static void AnimVoltTackleOrbSlide_Step(struct Sprite *);
static bool8 sub_810B154(struct Task *task, u8 taskId); static bool8 sub_810B154(struct Task *task, u8 taskId);
static void sub_810B1F0(struct Sprite *); static void sub_810B1F0(struct Sprite *);
static void AnimGrowingShockWaveOrb(struct Sprite *); static void AnimGrowingShockWaveOrb(struct Sprite *);
static bool8 sub_810B430(struct Task *task, u8 taskId); static bool8 sub_810B430(struct Task *task, u8 taskId);
static void sub_810B51C(struct Sprite *); static void AnimShockWaveProgressingBolt(struct Sprite *);
static bool8 sub_810B614(struct Task *task, u8 taskId); static bool8 sub_810B614(struct Task *task, u8 taskId);
static void sub_810B684(struct Sprite *sprite); static void sub_810B684(struct Sprite *sprite);
@ -192,7 +192,7 @@ const struct SpriteTemplate gThunderboltOrbSpriteTemplate =
.anims = gUnknown_085957B8, .anims = gUnknown_085957B8,
.images = NULL, .images = NULL,
.affineAnims = gUnknown_085957DC, .affineAnims = gUnknown_085957DC,
.callback = AnimThunderboltOrbSpriteTemplate, .callback = AnimThunderboltOrb,
}; };
const struct SpriteTemplate gSparkElectricityFlashingSpriteTemplate = const struct SpriteTemplate gSparkElectricityFlashingSpriteTemplate =
@ -214,10 +214,10 @@ const struct SpriteTemplate gElectricitySpriteTemplate =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_810A75C, .callback = AnimElectricity,
}; };
const struct SpriteTemplate gUnknown_08595828 = const struct SpriteTemplate gElectricBoltSegmentSpriteTemplate =
{ {
.tileTag = ANIM_TAG_SPARK, .tileTag = ANIM_TAG_SPARK,
.paletteTag = ANIM_TAG_SPARK, .paletteTag = ANIM_TAG_SPARK,
@ -225,7 +225,7 @@ const struct SpriteTemplate gUnknown_08595828 =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_810A9DC, .callback = AnimElectricBoltSegment,
}; };
const struct SpriteTemplate gThunderWaveSpriteTemplate = const struct SpriteTemplate gThunderWaveSpriteTemplate =
@ -451,7 +451,7 @@ const struct SpriteTemplate gShockWaveProgressingBoltSpriteTemplate =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_810B51C, .callback = AnimShockWaveProgressingBolt,
}; };
static void AnimLightning(struct Sprite *sprite) static void AnimLightning(struct Sprite *sprite)
@ -462,10 +462,10 @@ static void AnimLightning(struct Sprite *sprite)
sprite->pos1.x += gBattleAnimArgs[0]; sprite->pos1.x += gBattleAnimArgs[0];
sprite->pos1.y += gBattleAnimArgs[1]; sprite->pos1.y += gBattleAnimArgs[1];
sprite->callback = sub_810A1F8; sprite->callback = AnimLightning_Step;
} }
static void sub_810A1F8(struct Sprite *sprite) static void AnimLightning_Step(struct Sprite *sprite)
{ {
if (sprite->animEnded) if (sprite->animEnded)
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
@ -580,11 +580,11 @@ static void AnimZapCannonSpark(struct Sprite *sprite)
sprite->data[6] = gBattleAnimArgs[5]; sprite->data[6] = gBattleAnimArgs[5];
sprite->data[7] = gBattleAnimArgs[4]; sprite->data[7] = gBattleAnimArgs[4];
sprite->oam.tileNum += gBattleAnimArgs[6] * 4; sprite->oam.tileNum += gBattleAnimArgs[6] * 4;
sprite->callback = sub_810A4F4; sprite->callback = AnimZapCannonSpark_Step;
sub_810A4F4(sprite); AnimZapCannonSpark_Step(sprite);
} }
static void sub_810A4F4(struct Sprite *sprite) static void AnimZapCannonSpark_Step(struct Sprite *sprite)
{ {
if (!AnimTranslateLinear(sprite)) if (!AnimTranslateLinear(sprite))
{ {
@ -598,7 +598,7 @@ static void sub_810A4F4(struct Sprite *sprite)
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
static void sub_810A56C(struct Sprite *sprite) static void AnimThunderboltOrb_Step(struct Sprite *sprite)
{ {
if (--sprite->data[5] == -1) if (--sprite->data[5] == -1)
{ {
@ -609,7 +609,7 @@ static void sub_810A56C(struct Sprite *sprite)
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
static void AnimThunderboltOrbSpriteTemplate(struct Sprite *sprite) static void AnimThunderboltOrb(struct Sprite *sprite)
{ {
if (IsContest() || GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) if (IsContest() || GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
gBattleAnimArgs[1] = -gBattleAnimArgs[1]; gBattleAnimArgs[1] = -gBattleAnimArgs[1];
@ -619,7 +619,7 @@ static void AnimThunderboltOrbSpriteTemplate(struct Sprite *sprite)
sprite->data[3] = gBattleAnimArgs[0]; sprite->data[3] = gBattleAnimArgs[0];
sprite->data[4] = gBattleAnimArgs[3]; sprite->data[4] = gBattleAnimArgs[3];
sprite->data[5] = gBattleAnimArgs[3]; sprite->data[5] = gBattleAnimArgs[3];
sprite->callback = sub_810A56C; sprite->callback = AnimThunderboltOrb_Step;
} }
static void AnimSparkElectricityFlashing(struct Sprite *sprite) static void AnimSparkElectricityFlashing(struct Sprite *sprite)
@ -644,11 +644,11 @@ static void AnimSparkElectricityFlashing(struct Sprite *sprite)
sprite->data[7] = gBattleAnimArgs[4]; sprite->data[7] = gBattleAnimArgs[4];
sprite->oam.tileNum += gBattleAnimArgs[6] * 4; sprite->oam.tileNum += gBattleAnimArgs[6] * 4;
sprite->callback = sub_810A6EC; sprite->callback = AnimSparkElectricityFlashing_Step;
sprite->callback(sprite); sprite->callback(sprite);
} }
static void sub_810A6EC(struct Sprite *sprite) static void AnimSparkElectricityFlashing_Step(struct Sprite *sprite)
{ {
sprite->pos2.x = Sin(sprite->data[7], sprite->data[5]); sprite->pos2.x = Sin(sprite->data[7], sprite->data[5]);
sprite->pos2.y = Cos(sprite->data[7], sprite->data[5]); sprite->pos2.y = Cos(sprite->data[7], sprite->data[5]);
@ -661,7 +661,8 @@ static void sub_810A6EC(struct Sprite *sprite)
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
static void sub_810A75C(struct Sprite *sprite) // Electricity arcs around the target. Used for Paralysis and various electric move hits
static void AnimElectricity(struct Sprite *sprite)
{ {
InitSpritePosToAnimTarget(sprite, FALSE); InitSpritePosToAnimTarget(sprite, FALSE);
sprite->oam.tileNum += gBattleAnimArgs[3] * 4; sprite->oam.tileNum += gBattleAnimArgs[3] * 4;
@ -682,10 +683,10 @@ void AnimTask_ElectricBolt(u8 taskId)
gTasks[taskId].data[0] = GetBattlerSpriteCoord(gBattleAnimTarget, 0) + gBattleAnimArgs[0]; gTasks[taskId].data[0] = GetBattlerSpriteCoord(gBattleAnimTarget, 0) + gBattleAnimArgs[0];
gTasks[taskId].data[1] = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + gBattleAnimArgs[1]; gTasks[taskId].data[1] = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + gBattleAnimArgs[1];
gTasks[taskId].data[2] = gBattleAnimArgs[2]; gTasks[taskId].data[2] = gBattleAnimArgs[2];
gTasks[taskId].func = sub_810A834; gTasks[taskId].func = AnimTask_ElectricBolt_Step;
} }
static void sub_810A834(u8 taskId) static void AnimTask_ElectricBolt_Step(u8 taskId)
{ {
u16 r8; u16 r8;
u16 r2; u16 r2;
@ -713,30 +714,30 @@ static void sub_810A834(u8 taskId)
{ {
case 0: case 0:
r12 *= 1; r12 *= 1;
spriteId = CreateSprite(&gUnknown_08595828, x, y + r12, 2); spriteId = CreateSprite(&gElectricBoltSegmentSpriteTemplate, x, y + r12, 2);
r7++; r7++;
break; break;
case 2: case 2:
r12 *= 2; r12 *= 2;
r8 += r2; r8 += r2;
spriteId = CreateSprite(&gUnknown_08595828, x, y + r12, 2); spriteId = CreateSprite(&gElectricBoltSegmentSpriteTemplate, x, y + r12, 2);
r7++; r7++;
break; break;
case 4: case 4:
r12 *= 3; r12 *= 3;
r8 += r2 * 2; r8 += r2 * 2;
spriteId = CreateSprite(&gUnknown_08595828, x, y + r12, 2); spriteId = CreateSprite(&gElectricBoltSegmentSpriteTemplate, x, y + r12, 2);
r7++; r7++;
break; break;
case 6: case 6:
r12 *= 4; r12 *= 4;
r8 += r2 * 3; r8 += r2 * 3;
spriteId = CreateSprite(&gUnknown_08595828, x, y + r12, 2); spriteId = CreateSprite(&gElectricBoltSegmentSpriteTemplate, x, y + r12, 2);
r7++; r7++;
break; break;
case 8: case 8:
r12 *= 5; r12 *= 5;
spriteId = CreateSprite(&gUnknown_08595828, x, y + r12, 2); spriteId = CreateSprite(&gElectricBoltSegmentSpriteTemplate, x, y + r12, 2);
r7++; r7++;
break; break;
case 10: case 10:
@ -754,7 +755,7 @@ static void sub_810A834(u8 taskId)
gTasks[taskId].data[10]++; gTasks[taskId].data[10]++;
} }
static void sub_810A9DC(struct Sprite *sprite) static void AnimElectricBoltSegment(struct Sprite *sprite)
{ {
if (!sprite->data[0]) if (!sprite->data[0])
{ {
@ -780,11 +781,11 @@ static void AnimThunderWave(struct Sprite *sprite)
spriteId = CreateSprite(&gThunderWaveSpriteTemplate, sprite->pos1.x + 32, sprite->pos1.y, sprite->subpriority); spriteId = CreateSprite(&gThunderWaveSpriteTemplate, sprite->pos1.x + 32, sprite->pos1.y, sprite->subpriority);
gSprites[spriteId].oam.tileNum += 8; gSprites[spriteId].oam.tileNum += 8;
gAnimVisualTaskCount++; gAnimVisualTaskCount++;
gSprites[spriteId].callback = sub_810AAB0; gSprites[spriteId].callback = AnimThunderWave_Step;
sprite->callback = sub_810AAB0; sprite->callback = AnimThunderWave_Step;
} }
static void sub_810AAB0(struct Sprite *sprite) static void AnimThunderWave_Step(struct Sprite *sprite)
{ {
if (++sprite->data[0] == 3) if (++sprite->data[0] == 3)
{ {
@ -823,7 +824,7 @@ void AnimTask_ElectricChargingParticles(u8 taskId)
task->func = sub_810AB78; task->func = sub_810AB78;
} }
void sub_810AB78(u8 taskId) static void sub_810AB78(u8 taskId)
{ {
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
@ -934,10 +935,10 @@ static void AnimVoltTackleOrbSlide(struct Sprite *sprite)
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT)
sprite->data[7] *= -1; sprite->data[7] *= -1;
sprite->callback = sub_810ADF8; sprite->callback = AnimVoltTackleOrbSlide_Step;
} }
static void sub_810ADF8(struct Sprite *sprite) static void AnimVoltTackleOrbSlide_Step(struct Sprite *sprite)
{ {
switch (sprite->data[0]) switch (sprite->data[0])
{ {
@ -1003,7 +1004,7 @@ void AnimTask_VoltTackleAttackerReappear(u8 taskId)
} }
break; break;
case 3: case 3:
gSprites[task->data[15]].invisible = 0; gSprites[task->data[15]].invisible = FALSE;
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }
} }
@ -1256,7 +1257,8 @@ static bool8 sub_810B430(struct Task *task, u8 taskId)
} }
} }
static void sub_810B51C(struct Sprite *sprite) // Just runs timer for sprite. See AnimTask_ShockWaveProgressingBolt
static void AnimShockWaveProgressingBolt(struct Sprite *sprite)
{ {
if (++sprite->data[0] > 12) if (++sprite->data[0] > 12)
{ {

View File

@ -6,35 +6,36 @@
#include "trig.h" #include "trig.h"
#include "constants/rgb.h" #include "constants/rgb.h"
void unc_080B08A0(struct Sprite *); static void unc_080B08A0(struct Sprite *);
void sub_810CE68(struct Sprite *); static void AnimSlideHandOrFootToTarget(struct Sprite *);
static void AnimJumpKick(struct Sprite *); static void AnimJumpKick(struct Sprite *);
static void AnimBasicFistOrFoot(struct Sprite *); static void AnimBasicFistOrFoot(struct Sprite *);
static void AnimFistOrFootRandomPos(struct Sprite *); static void AnimFistOrFootRandomPos(struct Sprite *);
static void AnimFistOrFootRandomPos_Step(struct Sprite *);
static void AnimCrossChopHand(struct Sprite *); static void AnimCrossChopHand(struct Sprite *);
void sub_810D1B4(struct Sprite *); static void AnimCrossChopHand_Step(struct Sprite *);
static void AnimSlidingKick(struct Sprite *);
static void AnimSlidingKick_Step(struct Sprite *);
static void AnimSpinningKickOrPunch(struct Sprite *); static void AnimSpinningKickOrPunch(struct Sprite *);
static void AnimStompFoot(struct Sprite *); static void AnimStompFoot(struct Sprite *);
static void AnimStompFoot_Step(struct Sprite *);
static void AnimStompFoot_End(struct Sprite *);
static void AnimDizzyPunchDuck(struct Sprite *); static void AnimDizzyPunchDuck(struct Sprite *);
static void AnimBrickBreakWall(struct Sprite *); static void AnimBrickBreakWall(struct Sprite *);
static void AnimBrickBreakWall_Step(struct Sprite *);
static void AnimBrickBreakWallShard(struct Sprite *); static void AnimBrickBreakWallShard(struct Sprite *);
static void AnimBrickBreakWallShard_Step(struct Sprite *);
static void AnimSuperpowerOrb(struct Sprite *); static void AnimSuperpowerOrb(struct Sprite *);
static void AnimSuperpowerOrb_Step(struct Sprite *);
static void AnimSuperpowerRock(struct Sprite *); static void AnimSuperpowerRock(struct Sprite *);
static void AnimSuperpowerRock_Step1(struct Sprite *);
static void AnimSuperpowerRock_Step2(struct Sprite *);
static void AnimSuperpowerFireball(struct Sprite *); static void AnimSuperpowerFireball(struct Sprite *);
static void AnimArmThrustHit(struct Sprite *); static void AnimArmThrustHit(struct Sprite *);
void sub_810DA10(struct Sprite *); static void AnimArmThrustHit_Step(struct Sprite *sprite);
static void AnimRevengeScratch(struct Sprite *);
static void AnimFocusPunchFist(struct Sprite *); static void AnimFocusPunchFist(struct Sprite *);
static void sub_810D0B8(struct Sprite *);
static void sub_810D164(struct Sprite *);
static void sub_810D240(struct Sprite *);
static void AnimSpinningKickOrPunchFinish(struct Sprite *); static void AnimSpinningKickOrPunchFinish(struct Sprite *);
static void AnimStompFootStep(struct Sprite *);
static void AnimStompFootEnd(struct Sprite *);
static void sub_810D47C(struct Sprite *);
static void sub_810D5DC(struct Sprite *);
static void sub_810D6A8(struct Sprite *);
static void sub_810D770(struct Sprite *);
static void sub_810D830(struct Sprite *);
extern struct SpriteTemplate gBasicHitSplatSpriteTemplate; extern struct SpriteTemplate gBasicHitSplatSpriteTemplate;
@ -104,7 +105,7 @@ const struct SpriteTemplate gKarateChopSpriteTemplate =
.anims = gUnknown_08595E54, .anims = gUnknown_08595E54,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_810CE68, .callback = AnimSlideHandOrFootToTarget,
}; };
const struct SpriteTemplate gJumpKickSpriteTemplate = const struct SpriteTemplate gJumpKickSpriteTemplate =
@ -159,7 +160,7 @@ const struct SpriteTemplate gSlidingKickSpriteTemplate =
.anims = gUnknown_08595E58, .anims = gUnknown_08595E58,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_810D1B4, .callback = AnimSlidingKick,
}; };
const union AffineAnimCmd gUnknown_08595EF8[] = const union AffineAnimCmd gUnknown_08595EF8[] =
@ -350,7 +351,7 @@ const struct SpriteTemplate gRevengeSmallScratchSpriteTemplate =
.anims = gUnknown_0859607C, .anims = gUnknown_0859607C,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_810DA10, .callback = AnimRevengeScratch,
}; };
const union AnimCmd gUnknown_085960A0[] = const union AnimCmd gUnknown_085960A0[] =
@ -389,7 +390,7 @@ const struct SpriteTemplate gRevengeBigScratchSpriteTemplate =
.anims = gUnknown_085960C4, .anims = gUnknown_085960C4,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_810DA10, .callback = AnimRevengeScratch,
}; };
const union AffineAnimCmd gUnknown_085960E8[] = const union AffineAnimCmd gUnknown_085960E8[] =
@ -415,7 +416,7 @@ const struct SpriteTemplate gFocusPunchFistSpriteTemplate =
.callback = AnimFocusPunchFist, .callback = AnimFocusPunchFist,
}; };
void unc_080B08A0(struct Sprite *sprite) static void unc_080B08A0(struct Sprite *sprite)
{ {
SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]);
sprite->pos1.y += gBattleAnimArgs[1]; sprite->pos1.y += gBattleAnimArgs[1];
@ -424,7 +425,7 @@ void unc_080B08A0(struct Sprite *sprite)
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
} }
void sub_810CE68(struct Sprite *sprite) static void AnimSlideHandOrFootToTarget(struct Sprite *sprite)
{ {
if (gBattleAnimArgs[ARG_RET_ID] == 1 && GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) if (gBattleAnimArgs[ARG_RET_ID] == 1 && GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
{ {
@ -445,7 +446,7 @@ static void AnimJumpKick(struct Sprite *sprite)
gBattleAnimArgs[3] = -gBattleAnimArgs[3]; gBattleAnimArgs[3] = -gBattleAnimArgs[3];
} }
sub_810CE68(sprite); AnimSlideHandOrFootToTarget(sprite);
} }
// Displays a basic fist or foot sprite for a given duration. // Displays a basic fist or foot sprite for a given duration.
@ -512,10 +513,10 @@ static void AnimFistOrFootRandomPos(struct Sprite *sprite)
gSprites[sprite->data[7]].callback = SpriteCallbackDummy; gSprites[sprite->data[7]].callback = SpriteCallbackDummy;
} }
sprite->callback = sub_810D0B8; sprite->callback = AnimFistOrFootRandomPos_Step;
} }
static void sub_810D0B8(struct Sprite *sprite) static void AnimFistOrFootRandomPos_Step(struct Sprite *sprite)
{ {
if (sprite->data[0] == 0) if (sprite->data[0] == 0)
{ {
@ -550,10 +551,10 @@ static void AnimCrossChopHand(struct Sprite *sprite)
sprite->data[4] = sprite->pos1.y - 20; sprite->data[4] = sprite->pos1.y - 20;
sprite->callback = StartAnimLinearTranslation; sprite->callback = StartAnimLinearTranslation;
StoreSpriteCallbackInData6(sprite, sub_810D164); StoreSpriteCallbackInData6(sprite, AnimCrossChopHand_Step);
} }
static void sub_810D164(struct Sprite *sprite) static void AnimCrossChopHand_Step(struct Sprite *sprite)
{ {
if (++sprite->data[5] == 11) if (++sprite->data[5] == 11)
{ {
@ -570,7 +571,8 @@ static void sub_810D164(struct Sprite *sprite)
} }
} }
void sub_810D1B4(struct Sprite *sprite) // Rolling Kick / Low Kick
static void AnimSlidingKick(struct Sprite *sprite)
{ {
if (BATTLE_PARTNER(gBattleAnimAttacker) == gBattleAnimTarget && GetBattlerPosition(gBattleAnimTarget) < B_POSITION_PLAYER_RIGHT) if (BATTLE_PARTNER(gBattleAnimAttacker) == gBattleAnimTarget && GetBattlerPosition(gBattleAnimTarget) < B_POSITION_PLAYER_RIGHT)
gBattleAnimArgs[0] *= -1; gBattleAnimArgs[0] *= -1;
@ -592,10 +594,10 @@ void sub_810D1B4(struct Sprite *sprite)
sprite->data[6] = gBattleAnimArgs[4]; sprite->data[6] = gBattleAnimArgs[4];
sprite->data[7] = 0; sprite->data[7] = 0;
sprite->callback = sub_810D240; sprite->callback = AnimSlidingKick_Step;
} }
static void sub_810D240(struct Sprite *sprite) static void AnimSlidingKick_Step(struct Sprite *sprite)
{ {
if (!AnimTranslateLinear(sprite)) if (!AnimTranslateLinear(sprite))
{ {
@ -643,10 +645,10 @@ static void AnimStompFoot(struct Sprite *sprite)
InitSpritePosToAnimTarget(sprite, TRUE); InitSpritePosToAnimTarget(sprite, TRUE);
sprite->data[0] = gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[2];
sprite->callback = AnimStompFootStep; sprite->callback = AnimStompFoot_Step;
} }
static void AnimStompFootStep(struct Sprite *sprite) static void AnimStompFoot_Step(struct Sprite *sprite)
{ {
if (--sprite->data[0] == -1) if (--sprite->data[0] == -1)
{ {
@ -655,11 +657,11 @@ static void AnimStompFootStep(struct Sprite *sprite)
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3);
sprite->callback = StartAnimLinearTranslation; sprite->callback = StartAnimLinearTranslation;
StoreSpriteCallbackInData6(sprite, AnimStompFootEnd); StoreSpriteCallbackInData6(sprite, AnimStompFoot_End);
} }
} }
static void AnimStompFootEnd(struct Sprite *sprite) static void AnimStompFoot_End(struct Sprite *sprite)
{ {
sprite->data[0] = 15; sprite->data[0] = 15;
@ -712,10 +714,10 @@ static void AnimBrickBreakWall(struct Sprite *sprite)
sprite->data[1] = gBattleAnimArgs[3]; sprite->data[1] = gBattleAnimArgs[3];
sprite->data[2] = gBattleAnimArgs[4]; sprite->data[2] = gBattleAnimArgs[4];
sprite->data[3] = 0; sprite->data[3] = 0;
sprite->callback = sub_810D47C; sprite->callback = AnimBrickBreakWall_Step;
} }
static void sub_810D47C(struct Sprite *sprite) static void AnimBrickBreakWall_Step(struct Sprite *sprite)
{ {
switch (sprite->data[0]) switch (sprite->data[0])
{ {
@ -785,10 +787,10 @@ static void AnimBrickBreakWallShard(struct Sprite *sprite)
return; return;
} }
sprite->callback = sub_810D5DC; sprite->callback = AnimBrickBreakWallShard_Step;
} }
static void sub_810D5DC(struct Sprite *sprite) static void AnimBrickBreakWallShard_Step(struct Sprite *sprite)
{ {
sprite->pos1.x += sprite->data[6]; sprite->pos1.x += sprite->data[6];
sprite->pos1.y += sprite->data[7]; sprite->pos1.y += sprite->data[7];
@ -815,10 +817,10 @@ static void AnimSuperpowerOrb(struct Sprite *sprite)
sprite->data[0] = 0; sprite->data[0] = 0;
sprite->data[1] = 12; sprite->data[1] = 12;
sprite->data[2] = 8; sprite->data[2] = 8;
sprite->callback = sub_810D6A8; sprite->callback = AnimSuperpowerOrb_Step;
} }
static void sub_810D6A8(struct Sprite *sprite) static void AnimSuperpowerOrb_Step(struct Sprite *sprite)
{ {
if (++sprite->data[0] == 180) if (++sprite->data[0] == 180)
{ {
@ -848,10 +850,10 @@ static void AnimSuperpowerRock(struct Sprite *sprite)
sprite->data[6] = gBattleAnimArgs[1]; sprite->data[6] = gBattleAnimArgs[1];
sprite->oam.tileNum += gBattleAnimArgs[2] * 4; sprite->oam.tileNum += gBattleAnimArgs[2] * 4;
sprite->callback = sub_810D770; sprite->callback = AnimSuperpowerRock_Step1;
} }
static void sub_810D770(struct Sprite *sprite) static void AnimSuperpowerRock_Step1(struct Sprite *sprite)
{ {
void *var0; void *var0;
@ -880,11 +882,11 @@ static void sub_810D770(struct Sprite *sprite)
sprite->data[2] = sprite->pos1.x << 4; sprite->data[2] = sprite->pos1.x << 4;
sprite->data[3] = sprite->pos1.y << 4; sprite->data[3] = sprite->pos1.y << 4;
sprite->callback = sub_810D830; sprite->callback = AnimSuperpowerRock_Step2;
} }
} }
static void sub_810D830(struct Sprite *sprite) static void AnimSuperpowerRock_Step2(struct Sprite *sprite)
{ {
u16 edgeX; u16 edgeX;
@ -931,7 +933,7 @@ static void AnimSuperpowerFireball(struct Sprite *sprite)
sprite->callback = sub_80A6F98; sprite->callback = sub_80A6F98;
} }
static void sub_810D960(struct Sprite *sprite) static void AnimArmThrustHit_Step(struct Sprite *sprite)
{ {
if (sprite->data[0] == sprite->data[4]) if (sprite->data[0] == sprite->data[4])
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
@ -963,12 +965,12 @@ static void AnimArmThrustHit(struct Sprite *sprite)
StartSpriteAnim(sprite, sprite->data[1]); StartSpriteAnim(sprite, sprite->data[1]);
sprite->pos2.x = sprite->data[2]; sprite->pos2.x = sprite->data[2];
sprite->pos2.y = sprite->data[3]; sprite->pos2.y = sprite->data[3];
sprite->callback = sub_810D960; sprite->callback = AnimArmThrustHit_Step;
} }
void sub_810DA10(struct Sprite *sprite) static void AnimRevengeScratch(struct Sprite *sprite)
{ {
if (gBattleAnimArgs[2] == 0) if (gBattleAnimArgs[2] == ANIM_ATTACKER)
InitSpritePosToAnimAttacker(sprite, 0); InitSpritePosToAnimAttacker(sprite, 0);
else else
InitSpritePosToAnimTarget(sprite, FALSE); InitSpritePosToAnimTarget(sprite, FALSE);

View File

@ -9,8 +9,8 @@
static void AnimFireSpiralInward(struct Sprite *); static void AnimFireSpiralInward(struct Sprite *);
static void AnimFireSpread(struct Sprite *); static void AnimFireSpread(struct Sprite *);
static void sub_8108F4C(struct Sprite *); static void AnimFirePlume(struct Sprite *);
static void sub_8108FBC(struct Sprite *); static void AnimLargeFlame(struct Sprite *);
static void sub_8109028(struct Sprite *); static void sub_8109028(struct Sprite *);
static void sub_8109064(struct Sprite *); static void sub_8109064(struct Sprite *);
static void sub_81090D8(struct Sprite *); static void sub_81090D8(struct Sprite *);
@ -18,26 +18,26 @@ static void AnimSunlight(struct Sprite *);
static void AnimEmberFlare(struct Sprite *); static void AnimEmberFlare(struct Sprite *);
static void AnimBurnFlame(struct Sprite *); static void AnimBurnFlame(struct Sprite *);
static void AnimFireRing(struct Sprite *); static void AnimFireRing(struct Sprite *);
static void AnimFireRingStep1(struct Sprite *); static void AnimFireRing_Step1(struct Sprite *);
static void AnimFireRingStep2(struct Sprite *); static void AnimFireRing_Step2(struct Sprite *);
static void AnimFireRingStep3(struct Sprite *); static void AnimFireRing_Step3(struct Sprite *);
static void UpdateFireRingCircleOffset(struct Sprite *); static void UpdateFireRingCircleOffset(struct Sprite *);
static void AnimFireCross(struct Sprite *); static void AnimFireCross(struct Sprite *);
static void AnimFireSpiralOutward(struct Sprite *); static void AnimFireSpiralOutward(struct Sprite *);
static void sub_81093E4(struct Sprite *); static void AnimFireSpiralOutward_Step1(struct Sprite *);
static void sub_810940C(struct Sprite *); static void AnimFireSpiralOutward_Step2(struct Sprite *);
static void sub_81094D0(u8 taskId); static void AnimTask_EruptionLaunchRocks_Step(u8 taskId);
static void sub_81097B4(u8 spriteId, u8 taskId, u8 a3); static void sub_81097B4(u8 spriteId, u8 taskId, u8 a3);
static void sub_81098EC(struct Sprite *); static void sub_81098EC(struct Sprite *);
static u16 sub_8109930(u8 spriteId); static u16 sub_8109930(u8 spriteId);
static void sub_8109984(struct Sprite *sprite, s16 x, s16 y); static void sub_8109984(struct Sprite *sprite, s16 x, s16 y);
static void sub_81099A0(struct Sprite *); static void sub_81099A0(struct Sprite *);
static void AnimEruptionFallingRock(struct Sprite *); static void AnimEruptionFallingRock(struct Sprite *);
static void sub_8109A64(struct Sprite *); static void AnimEruptionFallingRock_Step(struct Sprite *);
static void AnimWillOWispOrb(struct Sprite *); static void AnimWillOWispOrb(struct Sprite *);
static void sub_8109C4C(struct Sprite *); static void AnimWillOWispOrb_Step(struct Sprite *);
static void AnimWillOWispFire(struct Sprite *); static void AnimWillOWispFire(struct Sprite *);
static void sub_8109E2C(u8 taskId); static void AnimTask_MoveHeatWaveTargets_Step(u8 taskId);
const union AnimCmd gUnknown_08595340[] = const union AnimCmd gUnknown_08595340[] =
{ {
@ -136,7 +136,7 @@ const struct SpriteTemplate gLargeFlameSpriteTemplate =
.anims = gUnknown_085953BC, .anims = gUnknown_085953BC,
.images = NULL, .images = NULL,
.affineAnims = gUnknown_085953F4, .affineAnims = gUnknown_085953F4,
.callback = sub_8108FBC, .callback = AnimLargeFlame,
}; };
const struct SpriteTemplate gLargeFlameScatterSpriteTemplate = const struct SpriteTemplate gLargeFlameScatterSpriteTemplate =
@ -147,7 +147,7 @@ const struct SpriteTemplate gLargeFlameScatterSpriteTemplate =
.anims = gUnknown_085953BC, .anims = gUnknown_085953BC,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_8108FBC, .callback = AnimLargeFlame,
}; };
const struct SpriteTemplate gFirePlumeSpriteTemplate = const struct SpriteTemplate gFirePlumeSpriteTemplate =
@ -158,7 +158,7 @@ const struct SpriteTemplate gFirePlumeSpriteTemplate =
.anims = gUnknown_085953D8, .anims = gUnknown_085953D8,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_8108F4C, .callback = AnimFirePlume,
}; };
const struct SpriteTemplate gUnknown_08595440 = const struct SpriteTemplate gUnknown_08595440 =
@ -169,7 +169,7 @@ const struct SpriteTemplate gUnknown_08595440 =
.anims = gUnknown_085953D8, .anims = gUnknown_085953D8,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_8108F4C, .callback = AnimFirePlume,
}; };
const union AnimCmd gUnknown_08595458[] = const union AnimCmd gUnknown_08595458[] =
@ -488,7 +488,7 @@ static void AnimFireSpread(struct Sprite *sprite)
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
} }
static void sub_8108F4C(struct Sprite *sprite) static void AnimFirePlume(struct Sprite *sprite)
{ {
SetSpriteCoordsToAnimAttackerCoords(sprite); SetSpriteCoordsToAnimAttackerCoords(sprite);
@ -512,7 +512,7 @@ static void sub_8108F4C(struct Sprite *sprite)
sprite->callback = sub_8109028; sprite->callback = sub_8109028;
} }
static void sub_8108FBC(struct Sprite *sprite) static void AnimLargeFlame(struct Sprite *sprite)
{ {
if (GetBattlerSide(gBattleAnimAttacker)) if (GetBattlerSide(gBattleAnimAttacker))
{ {
@ -654,10 +654,10 @@ void AnimFireRing(struct Sprite *sprite)
sprite->data[7] = gBattleAnimArgs[2]; sprite->data[7] = gBattleAnimArgs[2];
sprite->data[0] = 0; sprite->data[0] = 0;
sprite->callback = AnimFireRingStep1; sprite->callback = AnimFireRing_Step1;
} }
static void AnimFireRingStep1(struct Sprite *sprite) static void AnimFireRing_Step1(struct Sprite *sprite)
{ {
UpdateFireRingCircleOffset(sprite); UpdateFireRingCircleOffset(sprite);
@ -671,11 +671,11 @@ static void AnimFireRingStep1(struct Sprite *sprite)
InitAnimLinearTranslation(sprite); InitAnimLinearTranslation(sprite);
sprite->callback = AnimFireRingStep2; sprite->callback = AnimFireRing_Step2;
} }
} }
static void AnimFireRingStep2(struct Sprite *sprite) static void AnimFireRing_Step2(struct Sprite *sprite)
{ {
if (AnimTranslateLinear(sprite)) if (AnimTranslateLinear(sprite))
{ {
@ -686,7 +686,7 @@ static void AnimFireRingStep2(struct Sprite *sprite)
sprite->pos2.y = 0; sprite->pos2.y = 0;
sprite->pos2.x = 0; sprite->pos2.x = 0;
sprite->callback = AnimFireRingStep3; sprite->callback = AnimFireRing_Step3;
sprite->callback(sprite); sprite->callback(sprite);
} }
else else
@ -698,7 +698,7 @@ static void AnimFireRingStep2(struct Sprite *sprite)
} }
} }
static void AnimFireRingStep3(struct Sprite *sprite) static void AnimFireRing_Step3(struct Sprite *sprite)
{ {
UpdateFireRingCircleOffset(sprite); UpdateFireRingCircleOffset(sprite);
@ -744,21 +744,21 @@ static void AnimFireSpiralOutward(struct Sprite *sprite)
sprite->invisible = TRUE; sprite->invisible = TRUE;
sprite->callback = WaitAnimForDuration; sprite->callback = WaitAnimForDuration;
StoreSpriteCallbackInData6(sprite, sub_81093E4); StoreSpriteCallbackInData6(sprite, AnimFireSpiralOutward_Step1);
} }
static void sub_81093E4(struct Sprite *sprite) static void AnimFireSpiralOutward_Step1(struct Sprite *sprite)
{ {
sprite->invisible = FALSE; sprite->invisible = FALSE;
sprite->data[0] = sprite->data[1]; sprite->data[0] = sprite->data[1];
sprite->data[1] = 0; sprite->data[1] = 0;
sprite->callback = sub_810940C; sprite->callback = AnimFireSpiralOutward_Step2;
sprite->callback(sprite); sprite->callback(sprite);
} }
static void sub_810940C(struct Sprite *sprite) static void AnimFireSpiralOutward_Step2(struct Sprite *sprite)
{ {
sprite->pos2.x = Sin(sprite->data[1], sprite->data[2] >> 8); sprite->pos2.x = Sin(sprite->data[1], sprite->data[2] >> 8);
sprite->pos2.y = Cos(sprite->data[1], sprite->data[2] >> 8); sprite->pos2.y = Cos(sprite->data[1], sprite->data[2] >> 8);
@ -787,10 +787,10 @@ void AnimTask_EruptionLaunchRocks(u8 taskId)
PrepareBattlerSpriteForRotScale(task->data[15], ST_OAM_OBJ_NORMAL); PrepareBattlerSpriteForRotScale(task->data[15], ST_OAM_OBJ_NORMAL);
task->func = sub_81094D0; task->func = AnimTask_EruptionLaunchRocks_Step;
} }
static void sub_81094D0(u8 taskId) // animate Move_ERUPTION? static void AnimTask_EruptionLaunchRocks_Step(u8 taskId) // animate Move_ERUPTION?
{ {
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
@ -1009,10 +1009,10 @@ static void AnimEruptionFallingRock(struct Sprite *sprite)
sprite->data[7] = gBattleAnimArgs[3]; sprite->data[7] = gBattleAnimArgs[3];
sprite->oam.tileNum += gBattleAnimArgs[4] * 16; sprite->oam.tileNum += gBattleAnimArgs[4] * 16;
sprite->callback = sub_8109A64; sprite->callback = AnimEruptionFallingRock_Step;
} }
static void sub_8109A64(struct Sprite *sprite) static void AnimEruptionFallingRock_Step(struct Sprite *sprite)
{ {
switch (sprite->data[0]) switch (sprite->data[0])
{ {
@ -1114,13 +1114,13 @@ static void AnimWillOWispOrb(struct Sprite *sprite)
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3);
sub_80A6FD4(sprite); sub_80A6FD4(sprite);
sprite->callback = sub_8109C4C; sprite->callback = AnimWillOWispOrb_Step;
} }
break; break;
} }
} }
static void sub_8109C4C(struct Sprite *sprite) static void AnimWillOWispOrb_Step(struct Sprite *sprite)
{ {
s16 initialData5; s16 initialData5;
s16 newData5; s16 newData5;
@ -1190,10 +1190,10 @@ void AnimTask_MoveHeatWaveTargets(u8 taskId)
task->data[14] = GetAnimBattlerSpriteId(ANIM_TARGET); task->data[14] = GetAnimBattlerSpriteId(ANIM_TARGET);
task->data[15] = GetAnimBattlerSpriteId(ANIM_DEF_PARTNER); task->data[15] = GetAnimBattlerSpriteId(ANIM_DEF_PARTNER);
task->func = sub_8109E2C; task->func = AnimTask_MoveHeatWaveTargets_Step;
} }
static void sub_8109E2C(u8 taskId) static void AnimTask_MoveHeatWaveTargets_Step(u8 taskId)
{ {
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];

View File

@ -9,32 +9,32 @@
extern const struct SpriteTemplate gFlashingHitSplatSpriteTemplate; extern const struct SpriteTemplate gFlashingHitSplatSpriteTemplate;
static void AnimEllipticalGust(struct Sprite *); static void AnimEllipticalGust(struct Sprite *);
static void AnimEllipticalGust_Step(struct Sprite *);
static void AnimGustToTarget(struct Sprite *); static void AnimGustToTarget(struct Sprite *);
void sub_810E044(struct Sprite *); static void AnimGustToTarget_Step(struct Sprite *);
static void AnimAirWaveCrescent(struct Sprite *);
static void AnimFlyBallUp(struct Sprite *); static void AnimFlyBallUp(struct Sprite *);
static void AnimFlyBallUp_Step(struct Sprite *);
static void AnimFlyBallAttack(struct Sprite *); static void AnimFlyBallAttack(struct Sprite *);
static void AnimFlyBallAttack_Step(struct Sprite *);
static void AnimFallingFeather(struct Sprite *); static void AnimFallingFeather(struct Sprite *);
void sub_810E520(struct Sprite *); static void sub_810E520(struct Sprite *);
void sub_810EB40(struct Sprite *); static void sub_810EB40(struct Sprite *);
void sub_810EA4C(struct Sprite *); static void sub_810EA4C(struct Sprite *);
static void AnimWhirlwindLine(struct Sprite *); static void AnimWhirlwindLine(struct Sprite *);
void sub_810EC34(struct Sprite *); static void AnimBounceBallShrink(struct Sprite *);
void sub_810EC94(struct Sprite *); static void AnimBounceBallLand(struct Sprite *);
static void AnimDiveBall(struct Sprite *); static void AnimDiveBall(struct Sprite *);
void sub_810ED70(struct Sprite *); static void AnimDiveBall_Step1(struct Sprite *);
void sub_810EDD0(struct Sprite *); static void AnimDiveBall_Step2(struct Sprite *);
static void AnimDiveWaterSplash(struct Sprite *); static void AnimDiveWaterSplash(struct Sprite *);
static void AnimSprayWaterDroplet(struct Sprite *); static void AnimSprayWaterDroplet(struct Sprite *);
void sub_810EFA8(struct Sprite *); static void AnimSprayWaterDroplet_Step(struct Sprite *);
void sub_810F004(struct Sprite *); static void sub_810F004(struct Sprite *);
void sub_810F018(struct Sprite *); static void sub_810F018(struct Sprite *);
static void AnimSkyAttackBird(struct Sprite *); static void AnimSkyAttackBird(struct Sprite *);
void sub_810F140(struct Sprite *); static void AnimSkyAttackBird_Step(struct Sprite *);
static void sub_810DE98(struct Sprite *); static void AnimTask_AnimateGustTornadoPalette_Step(u8);
static void sub_810DF18(u8);
static void sub_810E028(struct Sprite *);
static void sub_810E184(struct Sprite *);
static void sub_810E24C(struct Sprite *);
const struct SpriteTemplate gEllipticalGustSpriteTemplate = const struct SpriteTemplate gEllipticalGustSpriteTemplate =
@ -93,7 +93,7 @@ const struct SpriteTemplate gAirWaveCrescentSpriteTemplate =
.anims = gUnknown_085962D0, .anims = gUnknown_085962D0,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_810E044, .callback = AnimAirWaveCrescent,
}; };
const union AffineAnimCmd gUnknown_085962EC[] = const union AffineAnimCmd gUnknown_085962EC[] =
@ -239,7 +239,7 @@ const struct SpriteTemplate gBounceBallShrinkSpriteTemplate =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gUnknown_0859641C, .affineAnims = gUnknown_0859641C,
.callback = sub_810EC34, .callback = AnimBounceBallShrink,
}; };
const union AffineAnimCmd gUnknown_08596438[] = const union AffineAnimCmd gUnknown_08596438[] =
@ -261,7 +261,7 @@ const struct SpriteTemplate gBounceBallLandSpriteTemplate =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gUnknown_08596448, .affineAnims = gUnknown_08596448,
.callback = sub_810EC94, .callback = AnimBounceBallLand,
}; };
const union AffineAnimCmd gUnknown_08596464[] = const union AffineAnimCmd gUnknown_08596464[] =
@ -352,11 +352,11 @@ static void AnimEllipticalGust(struct Sprite *sprite)
InitSpritePosToAnimTarget(sprite, FALSE); InitSpritePosToAnimTarget(sprite, FALSE);
sprite->pos1.y += 20; sprite->pos1.y += 20;
sprite->data[1] = 191; sprite->data[1] = 191;
sprite->callback = sub_810DE98; sprite->callback = AnimEllipticalGust_Step;
sprite->callback(sprite); sprite->callback(sprite);
} }
static void sub_810DE98(struct Sprite *sprite) static void AnimEllipticalGust_Step(struct Sprite *sprite)
{ {
sprite->pos2.x = Sin(sprite->data[1], 32); sprite->pos2.x = Sin(sprite->data[1], 32);
sprite->pos2.y = Cos(sprite->data[1], 8); sprite->pos2.y = Cos(sprite->data[1], 8);
@ -372,10 +372,10 @@ void AnimTask_AnimateGustTornadoPalette(u8 taskId)
gTasks[taskId].data[0] = gBattleAnimArgs[1]; gTasks[taskId].data[0] = gBattleAnimArgs[1];
gTasks[taskId].data[1] = gBattleAnimArgs[0]; gTasks[taskId].data[1] = gBattleAnimArgs[0];
gTasks[taskId].data[2] = IndexOfSpritePaletteTag(ANIM_TAG_GUST); gTasks[taskId].data[2] = IndexOfSpritePaletteTag(ANIM_TAG_GUST);
gTasks[taskId].func = sub_810DF18; gTasks[taskId].func = AnimTask_AnimateGustTornadoPalette_Step;
} }
static void sub_810DF18(u8 taskId) static void AnimTask_AnimateGustTornadoPalette_Step(u8 taskId)
{ {
u8 data2; u8 data2;
u16 temp; u16 temp;
@ -415,16 +415,16 @@ static void AnimGustToTarget(struct Sprite *sprite)
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[3]; sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[3];
InitAnimLinearTranslation(sprite); InitAnimLinearTranslation(sprite);
sprite->callback = RunStoredCallbackWhenAffineAnimEnds; sprite->callback = RunStoredCallbackWhenAffineAnimEnds;
StoreSpriteCallbackInData6(sprite, sub_810E028); StoreSpriteCallbackInData6(sprite, AnimGustToTarget_Step);
} }
static void sub_810E028(struct Sprite *sprite) static void AnimGustToTarget_Step(struct Sprite *sprite)
{ {
if (AnimTranslateLinear(sprite)) if (AnimTranslateLinear(sprite))
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
void sub_810E044(struct Sprite *sprite) static void AnimAirWaveCrescent(struct Sprite *sprite)
{ {
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
{ {
@ -469,11 +469,11 @@ static void AnimFlyBallUp(struct Sprite *sprite)
InitSpritePosToAnimAttacker(sprite, TRUE); InitSpritePosToAnimAttacker(sprite, TRUE);
sprite->data[0] = gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[2];
sprite->data[1] = gBattleAnimArgs[3]; sprite->data[1] = gBattleAnimArgs[3];
sprite->callback = sub_810E184; sprite->callback = AnimFlyBallUp_Step;
gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)].invisible = TRUE; gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)].invisible = TRUE;
} }
static void sub_810E184(struct Sprite *sprite) static void AnimFlyBallUp_Step(struct Sprite *sprite)
{ {
if (sprite->data[0] > 0) if (sprite->data[0] > 0)
{ {
@ -510,10 +510,10 @@ static void AnimFlyBallAttack(struct Sprite *sprite)
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
InitAnimLinearTranslation(sprite); InitAnimLinearTranslation(sprite);
sprite->callback = sub_810E24C; sprite->callback = AnimFlyBallAttack_Step;
} }
static void sub_810E24C(struct Sprite *sprite) static void AnimFlyBallAttack_Step(struct Sprite *sprite)
{ {
sprite->data[0] = 1; sprite->data[0] = 1;
AnimTranslateLinear(sprite); AnimTranslateLinear(sprite);
@ -528,7 +528,7 @@ static void sub_810E24C(struct Sprite *sprite)
|| sprite->pos1.x + sprite->pos2.x > 272 || sprite->pos1.x + sprite->pos2.x > 272
|| sprite->pos1.y + sprite->pos2.y > 160) || sprite->pos1.y + sprite->pos2.y > 160)
{ {
gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)].invisible = 0; gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)].invisible = FALSE;
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
} }
@ -652,7 +652,7 @@ static void AnimFallingFeather(struct Sprite *sprite)
sprite->callback = sub_810E520; sprite->callback = sub_810E520;
} }
void sub_810E520(struct Sprite *sprite) static void sub_810E520(struct Sprite *sprite)
{ {
u8 matrixNum, sinIndex; u8 matrixNum, sinIndex;
s16 sinVal = 0; s16 sinVal = 0;
@ -903,7 +903,7 @@ void sub_810E520(struct Sprite *sprite)
} }
} }
void sub_810EA4C(struct Sprite *sprite) static void sub_810EA4C(struct Sprite *sprite)
{ {
sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget); sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget);
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
@ -939,7 +939,7 @@ static void AnimWhirlwindLine(struct Sprite * sprite)
sprite->callback = sub_810EB40; sprite->callback = sub_810EB40;
} }
void sub_810EB40(struct Sprite *sprite) static void sub_810EB40(struct Sprite *sprite)
{ {
sprite->pos2.x += sprite->data[1] >> 8; sprite->pos2.x += sprite->data[1] >> 8;
@ -977,13 +977,13 @@ void AnimTask_DrillPeckHitSplats(u8 task)
DestroyAnimVisualTask(task); DestroyAnimVisualTask(task);
} }
void sub_810EC34(struct Sprite *sprite) static void AnimBounceBallShrink(struct Sprite *sprite)
{ {
switch (sprite->data[0]) switch (sprite->data[0])
{ {
case 0: case 0:
InitSpritePosToAnimAttacker(sprite, 1); InitSpritePosToAnimAttacker(sprite, 1);
gSprites[GetAnimBattlerSpriteId(0)].invisible = 1; gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)].invisible = TRUE;
++sprite->data[0]; ++sprite->data[0];
break; break;
case 1: case 1:
@ -993,7 +993,7 @@ void sub_810EC34(struct Sprite *sprite)
} }
} }
void sub_810EC94(struct Sprite *sprite) static void AnimBounceBallLand(struct Sprite *sprite)
{ {
switch (sprite->data[0]) switch (sprite->data[0])
{ {
@ -1011,23 +1011,23 @@ void sub_810EC94(struct Sprite *sprite)
sprite->pos2.y -= 10; sprite->pos2.y -= 10;
if (sprite->pos1.y + sprite->pos2.y < -32) if (sprite->pos1.y + sprite->pos2.y < -32)
{ {
gSprites[GetAnimBattlerSpriteId(0)].invisible = 0; gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)].invisible = FALSE;
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
break; break;
} }
} }
void AnimDiveBall(struct Sprite *sprite) static void AnimDiveBall(struct Sprite *sprite)
{ {
InitSpritePosToAnimAttacker(sprite, 1); InitSpritePosToAnimAttacker(sprite, 1);
sprite->data[0] = gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[2];
sprite->data[1] = gBattleAnimArgs[3]; sprite->data[1] = gBattleAnimArgs[3];
sprite->callback = sub_810ED70; sprite->callback = AnimDiveBall_Step1;
gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)].invisible = TRUE; gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)].invisible = TRUE;
} }
void sub_810ED70(struct Sprite *sprite) void AnimDiveBall_Step1(struct Sprite *sprite)
{ {
if (sprite->data[0] > 0) if (sprite->data[0] > 0)
{ {
@ -1042,16 +1042,16 @@ void sub_810ED70(struct Sprite *sprite)
{ {
sprite->invisible = TRUE; sprite->invisible = TRUE;
if (sprite->data[3]++ > 20) if (sprite->data[3]++ > 20)
sprite->callback = sub_810EDD0; sprite->callback = AnimDiveBall_Step2;
} }
} }
void sub_810EDD0(struct Sprite *sprite) static void AnimDiveBall_Step2(struct Sprite *sprite)
{ {
sprite->pos2.y += sprite->data[2] >> 8; sprite->pos2.y += sprite->data[2] >> 8;
if (sprite->pos1.y + sprite->pos2.y > -32) if (sprite->pos1.y + sprite->pos2.y > -32)
sprite->invisible = 0; sprite->invisible = FALSE;
if (sprite->pos2.y > 0) if (sprite->pos2.y > 0)
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
@ -1143,10 +1143,10 @@ static void AnimSprayWaterDroplet(struct Sprite *sprite)
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + 32; sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + 32;
} }
sprite->callback = sub_810EFA8; sprite->callback = AnimSprayWaterDroplet_Step;
} }
void sub_810EFA8(struct Sprite *sprite) static void AnimSprayWaterDroplet_Step(struct Sprite *sprite)
{ {
if (sprite->data[2] == 0) if (sprite->data[2] == 0)
{ {
@ -1169,14 +1169,14 @@ void sub_810EFA8(struct Sprite *sprite)
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
void sub_810F004(struct Sprite *sprite) static void sub_810F004(struct Sprite *sprite)
{ {
sprite->data[6] = 0; sprite->data[6] = 0;
sprite->data[7] = 64; sprite->data[7] = 64;
sprite->callback = sub_810F018; sprite->callback = sub_810F018;
} }
void sub_810F018(struct Sprite *sprite) static void sub_810F018(struct Sprite *sprite)
{ {
switch (sprite->data[0]) switch (sprite->data[0])
{ {
@ -1215,10 +1215,10 @@ static void AnimSkyAttackBird(struct Sprite *sprite)
TrySetSpriteRotScale(sprite, 1, 0x100, 0x100, rotation); TrySetSpriteRotScale(sprite, 1, 0x100, 0x100, rotation);
sprite->callback = sub_810F140; sprite->callback = AnimSkyAttackBird_Step;
} }
void sub_810F140(struct Sprite *sprite) void AnimSkyAttackBird_Step(struct Sprite *sprite)
{ {
sprite->data[4] += sprite->data[6]; sprite->data[4] += sprite->data[6];
sprite->data[5] += sprite->data[7]; sprite->data[5] += sprite->data[7];
@ -1235,13 +1235,13 @@ void unref_sub_810F184(u8 taskId)
{ {
if (gBattleAnimArgs[0] == 0) if (gBattleAnimArgs[0] == 0)
{ {
u8 spriteId = GetAnimBattlerSpriteId(0); u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
gSprites[spriteId].invisible = 1; gSprites[spriteId].invisible = TRUE;
} }
else else
{ {
u8 spriteId = GetAnimBattlerSpriteId(0); u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
gSprites[spriteId].invisible = 0; gSprites[spriteId].invisible = FALSE;
} }
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }

View File

@ -11,33 +11,33 @@
#include "util.h" #include "util.h"
static void AnimConfuseRayBallBounce(struct Sprite *); static void AnimConfuseRayBallBounce(struct Sprite *);
static void sub_8111674(struct Sprite *); static void AnimConfuseRayBallBounce_Step1(struct Sprite *);
static void sub_81116E8(struct Sprite *); static void AnimConfuseRayBallBounce_Step2(struct Sprite *);
static void sub_8111764(struct Sprite *); static void sub_8111764(struct Sprite *);
static void AnimConfuseRayBallSpiral(struct Sprite *); static void AnimConfuseRayBallSpiral(struct Sprite *);
static void sub_8111814(struct Sprite *); static void AnimConfuseRayBallSpiral_Step(struct Sprite *);
static void sub_8111914(u8 taskId); static void AnimTask_NightShadeClone_Step1(u8 taskId);
static void sub_811196C(u8 taskId); static void AnimTask_NightShadeClone_Step2(u8 taskId);
static void InitAnimShadowBall(struct Sprite *); static void AnimShadowBall(struct Sprite *);
static void AnimShadowBallStep(struct Sprite *); static void AnimShadowBall_Step(struct Sprite *);
static void AnimLick(struct Sprite *); static void AnimLick(struct Sprite *);
static void sub_8111BB4(struct Sprite *); static void AnimLick_Step(struct Sprite *);
static void sub_8111D78(u8 taskId); static void AnimTask_NightmareClone_Step(u8 taskId);
static void sub_8111E78(u8 taskId); static void AnimTask_SpiteTargetShadow_Step1(u8 taskId);
static void sub_81120DC(u8 taskId); static void AnimTask_SpiteTargetShadow_Step2(u8 taskId);
static void sub_8112170(u8 taskId); static void AnimTask_SpiteTargetShadow_Step3(u8 taskId);
static void sub_8112264(struct Sprite *); static void AnimDestinyBondWhiteShadow(struct Sprite *);
static void sub_8112384(struct Sprite *); static void AnimDestinyBondWhiteShadow_Step(struct Sprite *);
static void sub_81125E0(u8 taskId); static void AnimTask_DestinyBondWhiteShadow_Step(u8 taskId);
static void sub_811280C(u8 taskId); static void AnimTask_CurseStretchingBlackBg_Step1(u8 taskId);
static void sub_8112994(u8 taskId); static void AnimTask_CurseStretchingBlackBg_Step2(u8 taskId);
static void AnimCurseNail(struct Sprite *); static void AnimCurseNail(struct Sprite *);
static void sub_8112A4C(struct Sprite *); static void AnimCurseNail_Step1(struct Sprite *);
static void sub_8112ACC(struct Sprite *); static void AnimCurseNail_Step2(struct Sprite *);
static void sub_8112B44(struct Sprite *); static void AnimCurseNail_End(struct Sprite *);
static void AnimGhostStatusSprite(struct Sprite *); static void AnimGhostStatusSprite(struct Sprite *);
static void sub_8112C4C(struct Sprite *); static void AnimGhostStatusSprite_Step(struct Sprite *);
static void sub_8112D10(u8 taskId); static void AnimTask_GrudgeFlames_Step(u8 taskId);
static void AnimGrudgeFlame(struct Sprite *); static void AnimGrudgeFlame(struct Sprite *);
static void sub_8112F60(struct Sprite *); static void sub_8112F60(struct Sprite *);
static void sub_8112FB8(struct Sprite *); static void sub_8112FB8(struct Sprite *);
@ -95,7 +95,7 @@ const struct SpriteTemplate gShadowBallSpriteTemplate =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gUnknown_08596D54, .affineAnims = gUnknown_08596D54,
.callback = InitAnimShadowBall, .callback = AnimShadowBall,
}; };
const union AnimCmd gUnknown_08596D70[] = const union AnimCmd gUnknown_08596D70[] =
@ -135,7 +135,7 @@ const union AffineAnimCmd *const gUnknown_08596DB4[] =
gUnknown_08596DA4, gUnknown_08596DA4,
}; };
const struct SpriteTemplate gWhiteShadowSpriteTemplate = const struct SpriteTemplate gDestinyBondWhiteShadowSpriteTemplate =
{ {
.tileTag = ANIM_TAG_WHITE_SHADOW, .tileTag = ANIM_TAG_WHITE_SHADOW,
.paletteTag = ANIM_TAG_WHITE_SHADOW, .paletteTag = ANIM_TAG_WHITE_SHADOW,
@ -143,7 +143,7 @@ const struct SpriteTemplate gWhiteShadowSpriteTemplate =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_8112264, .callback = AnimDestinyBondWhiteShadow,
}; };
const struct SpriteTemplate gCurseNailSpriteTemplate = const struct SpriteTemplate gCurseNailSpriteTemplate =
@ -224,20 +224,20 @@ static void AnimConfuseRayBallBounce(struct Sprite *sprite)
sprite->data[3] = sprite->pos1.y; sprite->data[3] = sprite->pos1.y;
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3);
sub_80A6FD4(sprite); sub_80A6FD4(sprite);
sprite->callback = sub_8111674; sprite->callback = AnimConfuseRayBallBounce_Step1;
sprite->data[6] = 16; sprite->data[6] = 16;
SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL)); SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL));
SetGpuReg(REG_OFFSET_BLDALPHA, sprite->data[6]); SetGpuReg(REG_OFFSET_BLDALPHA, sprite->data[6]);
} }
static void sub_8111674(struct Sprite *sprite) static void AnimConfuseRayBallBounce_Step1(struct Sprite *sprite)
{ {
s16 r0; s16 r0;
s16 r2; s16 r2;
sub_8111764(sprite); sub_8111764(sprite);
if (AnimTranslateLinear(sprite)) if (AnimTranslateLinear(sprite))
{ {
sprite->callback = sub_81116E8; sprite->callback = AnimConfuseRayBallBounce_Step2;
return; return;
} }
@ -253,7 +253,7 @@ static void sub_8111674(struct Sprite *sprite)
PlaySE12WithPanning(SE_W109, gAnimCustomPanning); PlaySE12WithPanning(SE_W109, gAnimCustomPanning);
} }
static void sub_81116E8(struct Sprite *sprite) static void AnimConfuseRayBallBounce_Step2(struct Sprite *sprite)
{ {
s16 r2; s16 r2;
s16 r0; s16 r0;
@ -314,11 +314,11 @@ static void sub_8111764(struct Sprite *sprite)
static void AnimConfuseRayBallSpiral(struct Sprite *sprite) static void AnimConfuseRayBallSpiral(struct Sprite *sprite)
{ {
InitSpritePosToAnimTarget(sprite, TRUE); InitSpritePosToAnimTarget(sprite, TRUE);
sprite->callback = sub_8111814; sprite->callback = AnimConfuseRayBallSpiral_Step;
sprite->callback(sprite); sprite->callback(sprite);
} }
static void sub_8111814(struct Sprite *sprite) static void AnimConfuseRayBallSpiral_Step(struct Sprite *sprite)
{ {
u16 temp1; u16 temp1;
sprite->pos2.x = Sin(sprite->data[0], 32); sprite->pos2.x = Sin(sprite->data[0], 32);
@ -350,10 +350,10 @@ void AnimTask_NightShadeClone(u8 taskId)
gTasks[taskId].data[1] = *gBattleAnimArgs; gTasks[taskId].data[1] = *gBattleAnimArgs;
gTasks[taskId].data[2] = 0; gTasks[taskId].data[2] = 0;
gTasks[taskId].data[3] = 16; gTasks[taskId].data[3] = 16;
gTasks[taskId].func = sub_8111914; gTasks[taskId].func = AnimTask_NightShadeClone_Step1;
} }
static void sub_8111914(u8 taskId) static void AnimTask_NightShadeClone_Step1(u8 taskId)
{ {
gTasks[taskId].data[10] += 1; gTasks[taskId].data[10] += 1;
if (gTasks[taskId].data[10] == 3) if (gTasks[taskId].data[10] == 3)
@ -365,11 +365,11 @@ static void sub_8111914(u8 taskId)
if (gTasks[taskId].data[2] != 9) if (gTasks[taskId].data[2] != 9)
return; return;
gTasks[taskId].func = sub_811196C; gTasks[taskId].func = AnimTask_NightShadeClone_Step2;
} }
} }
static void sub_811196C(u8 taskId) static void AnimTask_NightShadeClone_Step2(u8 taskId)
{ {
u8 spriteId; u8 spriteId;
if (gTasks[taskId].data[1] > 0) if (gTasks[taskId].data[1] > 0)
@ -398,7 +398,7 @@ static void sub_811196C(u8 taskId)
// arg 0: duration step 1 (attacker -> center) // arg 0: duration step 1 (attacker -> center)
// arg 1: duration step 2 (spin center) // arg 1: duration step 2 (spin center)
// arg 2: duration step 3 (center -> target) // arg 2: duration step 3 (center -> target)
static void InitAnimShadowBall(struct Sprite *sprite) static void AnimShadowBall(struct Sprite *sprite)
{ {
s16 oldPosX = sprite->pos1.x; s16 oldPosX = sprite->pos1.x;
s16 oldPosY = sprite->pos1.y; s16 oldPosY = sprite->pos1.y;
@ -413,10 +413,10 @@ static void InitAnimShadowBall(struct Sprite *sprite)
sprite->data[5] = sprite->pos1.y << 4; sprite->data[5] = sprite->pos1.y << 4;
sprite->data[6] = ((oldPosX - sprite->pos1.x) << 4) / (gBattleAnimArgs[0] << 1); sprite->data[6] = ((oldPosX - sprite->pos1.x) << 4) / (gBattleAnimArgs[0] << 1);
sprite->data[7] = ((oldPosY - sprite->pos1.y) << 4) / (gBattleAnimArgs[0] << 1); sprite->data[7] = ((oldPosY - sprite->pos1.y) << 4) / (gBattleAnimArgs[0] << 1);
sprite->callback = AnimShadowBallStep; sprite->callback = AnimShadowBall_Step;
} }
static void AnimShadowBallStep(struct Sprite *sprite) static void AnimShadowBall_Step(struct Sprite *sprite)
{ {
switch (sprite->data[0]) switch (sprite->data[0])
{ {
@ -463,10 +463,10 @@ static void AnimShadowBallStep(struct Sprite *sprite)
static void AnimLick(struct Sprite *sprite) static void AnimLick(struct Sprite *sprite)
{ {
InitSpritePosToAnimTarget(sprite, TRUE); InitSpritePosToAnimTarget(sprite, TRUE);
sprite->callback = sub_8111BB4; sprite->callback = AnimLick_Step;
} }
static void sub_8111BB4(struct Sprite *sprite) static void AnimLick_Step(struct Sprite *sprite)
{ {
bool8 r5 = FALSE; bool8 r5 = FALSE;
bool8 r6 = FALSE; bool8 r6 = FALSE;
@ -546,10 +546,10 @@ void AnimTask_NightmareClone(u8 taskId)
gSprites[task->data[0]].data[4] = 0; gSprites[task->data[0]].data[4] = 0;
StoreSpriteCallbackInData6(&gSprites[task->data[0]], SpriteCallbackDummy); StoreSpriteCallbackInData6(&gSprites[task->data[0]], SpriteCallbackDummy);
gSprites[task->data[0]].callback = TranslateSpriteLinearFixedPoint; gSprites[task->data[0]].callback = TranslateSpriteLinearFixedPoint;
task->func = sub_8111D78; task->func = AnimTask_NightmareClone_Step;
} }
static void sub_8111D78(u8 taskId) static void AnimTask_NightmareClone_Step(u8 taskId)
{ {
struct Task *task; struct Task *task;
@ -593,11 +593,11 @@ void AnimTask_SpiteTargetShadow(u8 taskId)
task = &gTasks[taskId]; task = &gTasks[taskId];
task->data[15] = 0; task->data[15] = 0;
task->func = sub_8111E78; task->func = AnimTask_SpiteTargetShadow_Step1;
task->func(taskId); task->func(taskId);
} }
static void sub_8111E78(u8 taskId) static void AnimTask_SpiteTargetShadow_Step1(u8 taskId)
{ {
s16 startLine; s16 startLine;
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
@ -677,7 +677,7 @@ static void sub_8111E78(u8 taskId)
else else
SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG2_ON); SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG2_ON);
task->func = sub_81120DC; task->func = AnimTask_SpiteTargetShadow_Step2;
task->data[15]++; task->data[15]++;
break; break;
default: default:
@ -686,7 +686,7 @@ static void sub_8111E78(u8 taskId)
} }
} }
static void sub_81120DC(u8 taskId) static void AnimTask_SpiteTargetShadow_Step2(u8 taskId)
{ {
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
task->data[1]++; task->data[1]++;
@ -701,12 +701,12 @@ static void sub_81120DC(u8 taskId)
if (task->data[1] == 128) if (task->data[1] == 128)
{ {
task->data[15] = 0; task->data[15] = 0;
task->func = sub_8112170; task->func = AnimTask_SpiteTargetShadow_Step3;
task->func(taskId); task->func(taskId);
} }
} }
static void sub_8112170(u8 taskId) static void AnimTask_SpiteTargetShadow_Step3(u8 taskId)
{ {
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
u8 rank = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget); u8 rank = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget);
@ -742,7 +742,7 @@ static void sub_8112170(u8 taskId)
task->data[15]++; task->data[15]++;
} }
static void sub_8112264(struct Sprite *sprite) static void AnimDestinyBondWhiteShadow(struct Sprite *sprite)
{ {
s16 battler1X, battler1Y; s16 battler1X, battler1Y;
s16 battler2X, battler2Y; s16 battler2X, battler2Y;
@ -775,11 +775,11 @@ static void sub_8112264(struct Sprite *sprite)
sprite->oam.priority = 2; sprite->oam.priority = 2;
sprite->pos1.x = battler1X; sprite->pos1.x = battler1X;
sprite->pos1.y = battler1Y; sprite->pos1.y = battler1Y;
sprite->callback = sub_8112384; sprite->callback = AnimDestinyBondWhiteShadow_Step;
sprite->invisible = 1; sprite->invisible = TRUE;
} }
static void sub_8112384(struct Sprite *sprite) static void AnimDestinyBondWhiteShadow_Step(struct Sprite *sprite)
{ {
if (sprite->data[4]) if (sprite->data[4])
{ {
@ -820,7 +820,7 @@ void AnimTask_DestinyBondWhiteShadow(u8 taskId)
&& battler != (gBattleAnimAttacker ^ 2) && battler != (gBattleAnimAttacker ^ 2)
&& IsBattlerSpriteVisible(battler)) && IsBattlerSpriteVisible(battler))
{ {
spriteId = CreateSprite(&gWhiteShadowSpriteTemplate, baseX, baseY, 55); spriteId = CreateSprite(&gDestinyBondWhiteShadowSpriteTemplate, baseX, baseY, 55);
if (spriteId != MAX_SPRITES) if (spriteId != MAX_SPRITES)
{ {
x = GetBattlerSpriteCoord(battler, 2); x = GetBattlerSpriteCoord(battler, 2);
@ -832,7 +832,7 @@ void AnimTask_DestinyBondWhiteShadow(u8 taskId)
gSprites[spriteId].data[4] = gBattleAnimArgs[1]; gSprites[spriteId].data[4] = gBattleAnimArgs[1];
gSprites[spriteId].data[5] = x; gSprites[spriteId].data[5] = x;
gSprites[spriteId].data[6] = y; gSprites[spriteId].data[6] = y;
gSprites[spriteId].callback = sub_8112384; gSprites[spriteId].callback = AnimDestinyBondWhiteShadow_Step;
task->data[task->data[12] + 13] = spriteId; task->data[task->data[12] + 13] = spriteId;
task->data[12]++; task->data[12]++;
@ -842,7 +842,7 @@ void AnimTask_DestinyBondWhiteShadow(u8 taskId)
} }
else else
{ {
spriteId = CreateSprite(&gWhiteShadowSpriteTemplate, baseX, baseY, 55); spriteId = CreateSprite(&gDestinyBondWhiteShadowSpriteTemplate, baseX, baseY, 55);
if (spriteId != MAX_SPRITES) if (spriteId != MAX_SPRITES)
{ {
x = 48; x = 48;
@ -854,17 +854,17 @@ void AnimTask_DestinyBondWhiteShadow(u8 taskId)
gSprites[spriteId].data[4] = gBattleAnimArgs[1]; gSprites[spriteId].data[4] = gBattleAnimArgs[1];
gSprites[spriteId].data[5] = x; gSprites[spriteId].data[5] = x;
gSprites[spriteId].data[6] = y; gSprites[spriteId].data[6] = y;
gSprites[spriteId].callback = sub_8112384; gSprites[spriteId].callback = AnimDestinyBondWhiteShadow_Step;
task->data[13] = spriteId; task->data[13] = spriteId;
task->data[12] = 1; task->data[12] = 1;
} }
} }
task->func = sub_81125E0; task->func = AnimTask_DestinyBondWhiteShadow_Step;
} }
static void sub_81125E0(u8 taskId) static void AnimTask_DestinyBondWhiteShadow_Step(u8 taskId)
{ {
u16 i; u16 i;
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
@ -974,10 +974,10 @@ void AnimTask_CurseStretchingBlackBg(u8 taskId)
gTasks[taskId].data[4] = bottomDistance; gTasks[taskId].data[4] = bottomDistance;
gTasks[taskId].data[5] = startX; gTasks[taskId].data[5] = startX;
gTasks[taskId].data[6] = startY; gTasks[taskId].data[6] = startY;
gTasks[taskId].func = sub_811280C; gTasks[taskId].func = AnimTask_CurseStretchingBlackBg_Step1;
} }
static void sub_811280C(u8 taskId) static void AnimTask_CurseStretchingBlackBg_Step1(u8 taskId)
{ {
s16 step; s16 step;
s16 leftDistance, rightDistance, topDistance, bottomDistance; s16 leftDistance, rightDistance, topDistance, bottomDistance;
@ -1009,14 +1009,14 @@ static void sub_811280C(u8 taskId)
bottom = 112; bottom = 112;
selectedPalettes = sub_80A75AC(1, 0, 0, 0, 0, 0, 0); selectedPalettes = sub_80A75AC(1, 0, 0, 0, 0, 0, 0);
BeginNormalPaletteFade(selectedPalettes, 0, 16, 16, RGB(0, 0, 0)); BeginNormalPaletteFade(selectedPalettes, 0, 16, 16, RGB(0, 0, 0));
gTasks[taskId].func = sub_8112994; gTasks[taskId].func = AnimTask_CurseStretchingBlackBg_Step2;
} }
gBattle_WIN0H = (left << 8) | right; gBattle_WIN0H = (left << 8) | right;
gBattle_WIN0V = (top << 8) | bottom; gBattle_WIN0V = (top << 8) | bottom;
} }
static void sub_8112994(u8 taskId) static void AnimTask_CurseStretchingBlackBg_Step2(u8 taskId)
{ {
if (!gPaletteFade.active) if (!gPaletteFade.active)
{ {
@ -1053,10 +1053,10 @@ static void AnimCurseNail(struct Sprite *sprite)
sprite->pos1.x += xDelta; sprite->pos1.x += xDelta;
sprite->data[1] = xDelta2; sprite->data[1] = xDelta2;
sprite->data[0] = 60; sprite->data[0] = 60;
sprite->callback = sub_8112A4C; sprite->callback = AnimCurseNail_Step1;
} }
static void sub_8112A4C(struct Sprite *sprite) static void AnimCurseNail_Step1(struct Sprite *sprite)
{ {
u16 var0; u16 var0;
@ -1077,7 +1077,7 @@ static void sub_8112A4C(struct Sprite *sprite)
{ {
sprite->data[0] = 30; sprite->data[0] = 30;
sprite->callback = WaitAnimForDuration; sprite->callback = WaitAnimForDuration;
StoreSpriteCallbackInData6(sprite, sub_8112ACC); StoreSpriteCallbackInData6(sprite, AnimCurseNail_Step2);
} }
else else
{ {
@ -1087,7 +1087,7 @@ static void sub_8112A4C(struct Sprite *sprite)
} }
} }
static void sub_8112ACC(struct Sprite *sprite) static void AnimCurseNail_Step2(struct Sprite *sprite)
{ {
if (sprite->data[0] == 0) if (sprite->data[0] == 0)
{ {
@ -1108,13 +1108,13 @@ static void sub_8112ACC(struct Sprite *sprite)
SetGpuReg(REG_OFFSET_BLDALPHA, (16 - sprite->data[2]) | (sprite->data[2] << 8)); SetGpuReg(REG_OFFSET_BLDALPHA, (16 - sprite->data[2]) | (sprite->data[2] << 8));
if (sprite->data[2] == 16) if (sprite->data[2] == 16)
{ {
sprite->invisible = 1; sprite->invisible = TRUE;
sprite->callback = sub_8112B44; sprite->callback = AnimCurseNail_End;
} }
} }
} }
static void sub_8112B44(struct Sprite *sprite) static void AnimCurseNail_End(struct Sprite *sprite)
{ {
SetGpuReg(REG_OFFSET_BLDCNT, 0); SetGpuReg(REG_OFFSET_BLDCNT, 0);
SetGpuReg(REG_OFFSET_BLDALPHA, 0); SetGpuReg(REG_OFFSET_BLDALPHA, 0);
@ -1159,13 +1159,13 @@ static void AnimGhostStatusSprite(struct Sprite *sprite)
sprite->data[6] = BLDALPHA_BLEND(coeffA, coeffB); sprite->data[6] = BLDALPHA_BLEND(coeffA, coeffB);
if (coeffB == 16 && coeffA == 0) if (coeffB == 16 && coeffA == 0)
{ {
sprite->invisible = 1; sprite->invisible = TRUE;
sprite->callback = sub_8112C4C; sprite->callback = AnimGhostStatusSprite_Step;
} }
} }
} }
static void sub_8112C4C(struct Sprite *sprite) static void AnimGhostStatusSprite_Step(struct Sprite *sprite)
{ {
SetGpuReg(REG_OFFSET_BLDCNT, 0); SetGpuReg(REG_OFFSET_BLDCNT, 0);
SetGpuReg(REG_OFFSET_BLDALPHA, 0); SetGpuReg(REG_OFFSET_BLDALPHA, 0);
@ -1189,10 +1189,10 @@ void AnimTask_GrudgeFlames(u8 taskId)
SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL)); SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL));
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 0x10)); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 0x10));
task->data[8] = 0; task->data[8] = 0;
task->func = sub_8112D10; task->func = AnimTask_GrudgeFlames_Step;
} }
static void sub_8112D10(u8 taskId) static void AnimTask_GrudgeFlames_Step(u8 taskId)
{ {
u16 i; u16 i;
u8 spriteId; u8 spriteId;
@ -1307,7 +1307,7 @@ static void AnimGrudgeFlame(struct Sprite *sprite)
static void sub_8112F60(struct Sprite *sprite) static void sub_8112F60(struct Sprite *sprite)
{ {
sprite->invisible = 1; sprite->invisible = TRUE;
sprite->data[5] = gBattlerSpriteIds[gBattleAnimAttacker]; sprite->data[5] = gBattlerSpriteIds[gBattleAnimAttacker];
sprite->data[0] = 128; sprite->data[0] = 128;
sprite->data[1] = 10; sprite->data[1] = 10;

View File

@ -11,9 +11,10 @@ static void AnimBoneHitProjectile(struct Sprite *);
static void AnimDirtScatter(struct Sprite *); static void AnimDirtScatter(struct Sprite *);
static void AnimMudSportDirt(struct Sprite *); static void AnimMudSportDirt(struct Sprite *);
static void AnimDirtPlumeParticle(struct Sprite *); static void AnimDirtPlumeParticle(struct Sprite *);
static void AnimDirtPlumeParticle_Step(struct Sprite *);
static void AnimDigDirtMound(struct Sprite *); static void AnimDigDirtMound(struct Sprite *);
static void AnimBonemerangProjectileStep(struct Sprite *); static void AnimBonemerangProjectile_Step(struct Sprite *);
static void AnimBonemerangProjectileEnd(struct Sprite *); static void AnimBonemerangProjectile_End(struct Sprite *);
static void AnimMudSportDirtRising(struct Sprite *); static void AnimMudSportDirtRising(struct Sprite *);
static void AnimMudSportDirtFalling(struct Sprite *); static void AnimMudSportDirtFalling(struct Sprite *);
static void AnimTask_DigBounceMovement(u8); static void AnimTask_DigBounceMovement(u8);
@ -21,7 +22,6 @@ static void AnimTask_DigEndBounceMovementSetInvisible(u8);
static void AnimTask_DigSetVisibleUnderground(u8); static void AnimTask_DigSetVisibleUnderground(u8);
static void AnimTask_DigRiseUpFromHole(u8); static void AnimTask_DigRiseUpFromHole(u8);
static void sub_81150E0(u8, s16, s16); static void sub_81150E0(u8, s16, s16);
static void AnimDirtPlumeParticleStep(struct Sprite *);
static void AnimTask_ShakeTerrain(u8); static void AnimTask_ShakeTerrain(u8);
static void AnimTask_ShakeBattlers(u8); static void AnimTask_ShakeBattlers(u8);
static void SetBattlersXOffsetForShake(struct Task *); static void SetBattlersXOffsetForShake(struct Task *);
@ -148,10 +148,10 @@ static void AnimBonemerangProjectile(struct Sprite *sprite)
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3);
sprite->data[5] = -40; sprite->data[5] = -40;
InitAnimArcTranslation(sprite); InitAnimArcTranslation(sprite);
sprite->callback = AnimBonemerangProjectileStep; sprite->callback = AnimBonemerangProjectile_Step;
} }
static void AnimBonemerangProjectileStep(struct Sprite *sprite) static void AnimBonemerangProjectile_Step(struct Sprite *sprite)
{ {
if (TranslateAnimHorizontalArc(sprite)) if (TranslateAnimHorizontalArc(sprite))
{ {
@ -164,11 +164,11 @@ static void AnimBonemerangProjectileStep(struct Sprite *sprite)
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
sprite->data[5] = 40; sprite->data[5] = 40;
InitAnimArcTranslation(sprite); InitAnimArcTranslation(sprite);
sprite->callback = AnimBonemerangProjectileEnd; sprite->callback = AnimBonemerangProjectile_End;
} }
} }
static void AnimBonemerangProjectileEnd(struct Sprite *sprite) static void AnimBonemerangProjectile_End(struct Sprite *sprite)
{ {
if (TranslateAnimHorizontalArc(sprite)) if (TranslateAnimHorizontalArc(sprite))
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
@ -324,7 +324,7 @@ static void AnimTask_DigBounceMovement(u8 taskId)
if (task->data[14] < 0) if (task->data[14] < 0)
task->data[14] = 0; task->data[14] = 0;
gSprites[task->data[10]].invisible = 1; gSprites[task->data[10]].invisible = TRUE;
task->data[0]++; task->data[0]++;
break; break;
case 1: case 1:
@ -363,7 +363,7 @@ static void AnimTask_DigBounceMovement(u8 taskId)
break; break;
case 4: case 4:
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
gSprites[task->data[10]].invisible = 1; gSprites[task->data[10]].invisible = TRUE;
break; break;
} }
} }
@ -525,10 +525,10 @@ void AnimDirtPlumeParticle(struct Sprite *sprite)
sprite->data[4] = sprite->pos1.y + gBattleAnimArgs[3]; sprite->data[4] = sprite->pos1.y + gBattleAnimArgs[3];
sprite->data[5] = gBattleAnimArgs[4]; sprite->data[5] = gBattleAnimArgs[4];
InitAnimArcTranslation(sprite); InitAnimArcTranslation(sprite);
sprite->callback = AnimDirtPlumeParticleStep; sprite->callback = AnimDirtPlumeParticle_Step;
} }
static void AnimDirtPlumeParticleStep(struct Sprite *sprite) static void AnimDirtPlumeParticle_Step(struct Sprite *sprite)
{ {
if (TranslateAnimHorizontalArc(sprite)) if (TranslateAnimHorizontalArc(sprite))
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);

110
src/ice.c
View File

@ -21,33 +21,33 @@ struct HailStruct {
}; };
static void sub_810B6C4(struct Sprite *); static void sub_810B6C4(struct Sprite *);
void sub_810B848(struct Sprite *); static void sub_810B848(struct Sprite *);
void AnimIcePunchSwirlingParticle(struct Sprite *); static void AnimIcePunchSwirlingParticle(struct Sprite *);
void AnimIceBeamParticle(struct Sprite *); static void AnimIceBeamParticle(struct Sprite *);
void AnimIceEffectParticle(struct Sprite *); static void AnimIceEffectParticle(struct Sprite *);
void AnimFlickerIceEffectParticle(struct Sprite *); static void AnimFlickerIceEffectParticle(struct Sprite *);
void AnimSwirlingSnowball_Step1(struct Sprite *); static void AnimSwirlingSnowball(struct Sprite *);
void AnimSwirlingSnowball_Step2(struct Sprite *); static void AnimSwirlingSnowball_Step1(struct Sprite *);
void AnimSwirlingSnowball_Step3(struct Sprite *); static void AnimSwirlingSnowball_Step2(struct Sprite *);
void AnimSwirlingSnowball_End(struct Sprite *); static void AnimSwirlingSnowball_End(struct Sprite *);
void AnimMoveParticleBeyondTarget(struct Sprite *); static void AnimMoveParticleBeyondTarget(struct Sprite *);
void AnimWiggleParticleTowardsTarget(struct Sprite *); static void AnimWiggleParticleTowardsTarget(struct Sprite *);
void AnimWaveFromCenterOfTarget(struct Sprite *); static void AnimWaveFromCenterOfTarget(struct Sprite *);
void InitSwirlingFogAnim(struct Sprite *); static void InitSwirlingFogAnim(struct Sprite *);
void AnimSwirlingFogAnim(struct Sprite *); static void AnimSwirlingFogAnim(struct Sprite *);
void AnimThrowMistBall(struct Sprite *); static void AnimThrowMistBall(struct Sprite *);
static void InitPoisonGasCloudAnim(struct Sprite *); static void InitPoisonGasCloudAnim(struct Sprite *);
void MovePoisonGasCloud(struct Sprite *); static void MovePoisonGasCloud(struct Sprite *);
void AnimHailBegin(struct Sprite *); static void AnimHailBegin(struct Sprite *);
void AnimHailContinue(struct Sprite *); static void AnimHailContinue(struct Sprite *);
void InitIceBallAnim(struct Sprite *); static void InitIceBallAnim(struct Sprite *);
void AnimThrowIceBall(struct Sprite *); static void AnimThrowIceBall(struct Sprite *);
void InitIceBallParticle(struct Sprite *); static void InitIceBallParticle(struct Sprite *);
void AnimIceBallParticle(struct Sprite *); static void AnimIceBallParticle(struct Sprite *);
void AnimTask_Haze2(u8); static void AnimTask_Haze2(u8);
void AnimTask_OverlayFogTiles(u8); static void AnimTask_OverlayFogTiles(u8);
void AnimTask_Hail2(u8); static void AnimTask_Hail2(u8);
bool8 GenerateHailParticle(u8 hailStructId, u8 affineAnimNum, u8 taskId, u8 c); static bool8 GenerateHailParticle(u8 hailStructId, u8 affineAnimNum, u8 taskId, u8 c);
const union AnimCmd gUnknown_08595A48[] = const union AnimCmd gUnknown_08595A48[] =
{ {
@ -249,7 +249,7 @@ const struct SpriteTemplate gSwirlingSnowballSpriteTemplate =
.anims = gUnknown_08595AB0, .anims = gUnknown_08595AB0,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimSwirlingSnowball_Step1, .callback = AnimSwirlingSnowball,
}; };
const struct SpriteTemplate gBlizzardIceCrystalSpriteTemplate = const struct SpriteTemplate gBlizzardIceCrystalSpriteTemplate =
@ -562,7 +562,7 @@ static void sub_810B6C4(struct Sprite *sprite)
sprite->callback = sub_810B848; sprite->callback = sub_810B848;
} }
void sub_810B848(struct Sprite *sprite) static void sub_810B848(struct Sprite *sprite)
{ {
if (sprite->data[0] != 0) if (sprite->data[0] != 0)
{ {
@ -583,7 +583,7 @@ void sub_810B848(struct Sprite *sprite)
// Animates the swirling ice crystals in Ice Punch. // Animates the swirling ice crystals in Ice Punch.
// arg 0: initial position angle around circle (0-256) // arg 0: initial position angle around circle (0-256)
void AnimIcePunchSwirlingParticle(struct Sprite *sprite) static void AnimIcePunchSwirlingParticle(struct Sprite *sprite)
{ {
sprite->data[0] = gBattleAnimArgs[0]; sprite->data[0] = gBattleAnimArgs[0];
sprite->data[1] = 60; sprite->data[1] = 60;
@ -601,7 +601,7 @@ void AnimIcePunchSwirlingParticle(struct Sprite *sprite)
// arg 2: target x offset // arg 2: target x offset
// arg 3: target y offset // arg 3: target y offset
// arg 4: duration // arg 4: duration
void AnimIceBeamParticle(struct Sprite *sprite) static void AnimIceBeamParticle(struct Sprite *sprite)
{ {
InitSpritePosToAnimAttacker(sprite, TRUE); InitSpritePosToAnimAttacker(sprite, TRUE);
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
@ -622,7 +622,7 @@ void AnimIceBeamParticle(struct Sprite *sprite)
// arg 0: target x offset // arg 0: target x offset
// arg 1: target y offset // arg 1: target y offset
// arg 2: ??? unknown boolean // arg 2: ??? unknown boolean
void AnimIceEffectParticle(struct Sprite *sprite) static void AnimIceEffectParticle(struct Sprite *sprite)
{ {
if (gBattleAnimArgs[2] == 0) if (gBattleAnimArgs[2] == 0)
{ {
@ -642,7 +642,7 @@ void AnimIceEffectParticle(struct Sprite *sprite)
sprite->callback = RunStoredCallbackWhenAffineAnimEnds; sprite->callback = RunStoredCallbackWhenAffineAnimEnds;
} }
void AnimFlickerIceEffectParticle(struct Sprite *sprite) static void AnimFlickerIceEffectParticle(struct Sprite *sprite)
{ {
sprite->invisible ^= 1; sprite->invisible ^= 1;
sprite->data[0] += 1; sprite->data[0] += 1;
@ -657,7 +657,7 @@ void AnimFlickerIceEffectParticle(struct Sprite *sprite)
// arg 3: target y offset // arg 3: target y offset
// arg 4: particle speed // arg 4: particle speed
// arg 5: multiple targets? (boolean) // arg 5: multiple targets? (boolean)
void AnimSwirlingSnowball_Step1(struct Sprite *sprite) static void AnimSwirlingSnowball(struct Sprite *sprite)
{ {
int i; int i;
s16 tempDataHolder[8]; s16 tempDataHolder[8];
@ -710,10 +710,10 @@ void AnimSwirlingSnowball_Step1(struct Sprite *sprite)
sprite->data[i] = tempDataHolder[i]; sprite->data[i] = tempDataHolder[i];
sprite->callback = sub_80A718C; sprite->callback = sub_80A718C;
StoreSpriteCallbackInData6(sprite, AnimSwirlingSnowball_Step2); StoreSpriteCallbackInData6(sprite, AnimSwirlingSnowball_Step1);
} }
void AnimSwirlingSnowball_Step2(struct Sprite *sprite) static void AnimSwirlingSnowball_Step1(struct Sprite *sprite)
{ {
s16 tempVar; s16 tempVar;
@ -728,11 +728,11 @@ void AnimSwirlingSnowball_Step2(struct Sprite *sprite)
sprite->data[3] = Sin(sprite->data[0], tempVar); sprite->data[3] = Sin(sprite->data[0], tempVar);
sprite->data[4] = Cos(sprite->data[0], 0xF); sprite->data[4] = Cos(sprite->data[0], 0xF);
sprite->data[5] = 0; sprite->data[5] = 0;
sprite->callback = AnimSwirlingSnowball_Step3; sprite->callback = AnimSwirlingSnowball_Step2;
sprite->callback(sprite); sprite->callback(sprite);
} }
void AnimSwirlingSnowball_Step3(struct Sprite *sprite) static void AnimSwirlingSnowball_Step2(struct Sprite *sprite)
{ {
s16 tempVar; s16 tempVar;
tempVar = GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER ? 20 : -20; tempVar = GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER ? 20 : -20;
@ -756,7 +756,7 @@ void AnimSwirlingSnowball_Step3(struct Sprite *sprite)
} }
} }
void AnimSwirlingSnowball_End(struct Sprite *sprite) static void AnimSwirlingSnowball_End(struct Sprite *sprite)
{ {
sprite->data[0] = 1; sprite->data[0] = 1;
AnimFastTranslateLinear(sprite); AnimFastTranslateLinear(sprite);
@ -777,7 +777,7 @@ void AnimSwirlingSnowball_End(struct Sprite *sprite)
// arg 5: wave amplitude // arg 5: wave amplitude
// arg 6: wave frequency // arg 6: wave frequency
// arg 7: multiple targets? (boolean) // arg 7: multiple targets? (boolean)
void AnimMoveParticleBeyondTarget(struct Sprite *sprite) static void AnimMoveParticleBeyondTarget(struct Sprite *sprite)
{ {
int i; int i;
s16 tempDataHolder[8]; s16 tempDataHolder[8];
@ -835,7 +835,7 @@ void AnimMoveParticleBeyondTarget(struct Sprite *sprite)
} }
// Moves particles in a sine wave towards the target. // Moves particles in a sine wave towards the target.
void AnimWiggleParticleTowardsTarget(struct Sprite *sprite) static void AnimWiggleParticleTowardsTarget(struct Sprite *sprite)
{ {
AnimFastTranslateLinear(sprite); AnimFastTranslateLinear(sprite);
if (sprite->data[0] == 0) if (sprite->data[0] == 0)
@ -856,7 +856,7 @@ void AnimWiggleParticleTowardsTarget(struct Sprite *sprite)
// arg 0: initial x pixel offset // arg 0: initial x pixel offset
// arg 1: initial y pixel offset // arg 1: initial y pixel offset
// arg 2: ??? unknown boolean // arg 2: ??? unknown boolean
void AnimWaveFromCenterOfTarget(struct Sprite *sprite) static void AnimWaveFromCenterOfTarget(struct Sprite *sprite)
{ {
if (sprite->data[0] == 0) if (sprite->data[0] == 0)
{ {
@ -891,7 +891,7 @@ void AnimWaveFromCenterOfTarget(struct Sprite *sprite)
// arg 3: duration // arg 3: duration
// arg 4: animate on opponent? (boolean) // arg 4: animate on opponent? (boolean)
// arg 5: ??? unknown boolean // arg 5: ??? unknown boolean
void InitSwirlingFogAnim(struct Sprite *sprite) static void InitSwirlingFogAnim(struct Sprite *sprite)
{ {
s16 tempVar; s16 tempVar;
u8 battler; u8 battler;
@ -959,7 +959,7 @@ void InitSwirlingFogAnim(struct Sprite *sprite)
} }
// Animates swirling fog initialized by InitSwirlingFogAnim. // Animates swirling fog initialized by InitSwirlingFogAnim.
void AnimSwirlingFogAnim(struct Sprite *sprite) static void AnimSwirlingFogAnim(struct Sprite *sprite)
{ {
if (!AnimTranslateLinear(sprite)) if (!AnimTranslateLinear(sprite))
{ {
@ -1005,7 +1005,7 @@ void AnimTask_HazeScrollingFog(u8 taskId)
gTasks[taskId].func = AnimTask_Haze2; gTasks[taskId].func = AnimTask_Haze2;
} }
void AnimTask_Haze2(u8 taskId) static void AnimTask_Haze2(u8 taskId)
{ {
struct BattleAnimBgData animBg; struct BattleAnimBgData animBg;
@ -1079,7 +1079,7 @@ void AnimTask_Haze2(u8 taskId)
// arg 3: target y offset // arg 3: target y offset
// arg 4: duration // arg 4: duration
// arg 5: ??? unknown (seems to vibrate target mon somehow) // arg 5: ??? unknown (seems to vibrate target mon somehow)
void AnimThrowMistBall(struct Sprite *sprite) static void AnimThrowMistBall(struct Sprite *sprite)
{ {
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2);
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET);
@ -1113,7 +1113,7 @@ void AnimTask_LoadMistTiles(u8 taskId)
gTasks[taskId].func = AnimTask_OverlayFogTiles; gTasks[taskId].func = AnimTask_OverlayFogTiles;
} }
void AnimTask_OverlayFogTiles(u8 taskId) static void AnimTask_OverlayFogTiles(u8 taskId)
{ {
struct BattleAnimBgData animBg; struct BattleAnimBgData animBg;
@ -1230,7 +1230,7 @@ static void InitPoisonGasCloudAnim(struct Sprite *sprite)
sprite->callback = MovePoisonGasCloud; sprite->callback = MovePoisonGasCloud;
} }
void MovePoisonGasCloud(struct Sprite *sprite) static void MovePoisonGasCloud(struct Sprite *sprite)
{ {
int value; int value;
@ -1336,7 +1336,7 @@ void AnimTask_Hail(u8 taskId)
task->func = AnimTask_Hail2; task->func = AnimTask_Hail2;
} }
void AnimTask_Hail2(u8 taskId) static void AnimTask_Hail2(u8 taskId)
{ {
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
switch (task->data[0]) switch (task->data[0])
@ -1381,7 +1381,7 @@ void AnimTask_Hail2(u8 taskId)
} }
} }
bool8 GenerateHailParticle(u8 hailStructId, u8 affineAnimNum, u8 taskId, u8 c) static bool8 GenerateHailParticle(u8 hailStructId, u8 affineAnimNum, u8 taskId, u8 c)
{ {
u8 id; u8 id;
s16 battlerX, battlerY; s16 battlerX, battlerY;
@ -1439,7 +1439,7 @@ bool8 GenerateHailParticle(u8 hailStructId, u8 affineAnimNum, u8 taskId, u8 c)
} }
} }
void AnimHailBegin(struct Sprite *sprite) static void AnimHailBegin(struct Sprite *sprite)
{ {
u8 spriteId; u8 spriteId;
@ -1473,7 +1473,7 @@ void AnimHailBegin(struct Sprite *sprite)
} }
} }
void AnimHailContinue(struct Sprite *sprite) static void AnimHailContinue(struct Sprite *sprite)
{ {
if (++sprite->data[0] == 20) if (++sprite->data[0] == 20)
{ {
@ -1490,7 +1490,7 @@ void AnimHailContinue(struct Sprite *sprite)
// arg 3: target y offset // arg 3: target y offset
// arg 4: duration // arg 4: duration
// arg 5: arc height (negative) // arg 5: arc height (negative)
void InitIceBallAnim(struct Sprite *sprite) static void InitIceBallAnim(struct Sprite *sprite)
{ {
u8 animNum = gAnimDisableStructPtr->rolloutTimerStartValue - gAnimDisableStructPtr->rolloutTimer - 1; u8 animNum = gAnimDisableStructPtr->rolloutTimerStartValue - gAnimDisableStructPtr->rolloutTimer - 1;
@ -1515,7 +1515,7 @@ void InitIceBallAnim(struct Sprite *sprite)
} }
// Throws the ball of ice in Ice Ball. // Throws the ball of ice in Ice Ball.
void AnimThrowIceBall(struct Sprite *sprite) static void AnimThrowIceBall(struct Sprite *sprite)
{ {
if (!TranslateAnimHorizontalArc(sprite)) if (!TranslateAnimHorizontalArc(sprite))
return; return;
@ -1526,7 +1526,7 @@ void AnimThrowIceBall(struct Sprite *sprite)
} }
// Initializes the particles that scatter at the end of the Ice Ball animation. // Initializes the particles that scatter at the end of the Ice Ball animation.
void InitIceBallParticle(struct Sprite *sprite) static void InitIceBallParticle(struct Sprite *sprite)
{ {
s16 randA, randB; s16 randA, randB;
@ -1545,7 +1545,7 @@ void InitIceBallParticle(struct Sprite *sprite)
} }
// Animates the particles created by InitIceBallParticle. // Animates the particles created by InitIceBallParticle.
void AnimIceBallParticle(struct Sprite *sprite) static void AnimIceBallParticle(struct Sprite *sprite)
{ {
sprite->data[3] += sprite->data[1]; sprite->data[3] += sprite->data[1];
sprite->data[4] += sprite->data[2]; sprite->data[4] += sprite->data[2];

View File

@ -6,35 +6,34 @@
#include "trig.h" #include "trig.h"
#include "constants/rgb.h" #include "constants/rgb.h"
void AnimConfusionDuck(struct Sprite *); static void AnimConfusionDuck(struct Sprite *);
void AnimSimplePaletteBlend(struct Sprite *); static void AnimSimplePaletteBlend(struct Sprite *);
u32 UnpackSelectedBattleAnimPalettes(s16); static void AnimSimplePaletteBlend_Step(struct Sprite *);
void sub_81158A4(struct Sprite *); static void AnimComplexPaletteBlend(struct Sprite *);
void sub_81159B4(struct Sprite *); static void AnimComplexPaletteBlend_Step1(struct Sprite *);
static void AnimComplexPaletteBlend_Step2(struct Sprite *);
static void sub_81159B4(struct Sprite *);
static void AnimShakeMonOrBattleTerrain(struct Sprite *); static void AnimShakeMonOrBattleTerrain(struct Sprite *);
static void AnimShakeMonOrBattleTerrain_Step(struct Sprite *);
static void AnimShakeMonOrBattleTerrain_UpdateCoordOffsetEnabled(void);
static void AnimBasicHitSplat(struct Sprite *); static void AnimBasicHitSplat(struct Sprite *);
void sub_8116420(struct Sprite *); static void sub_8116420(struct Sprite *);
static void AnimHitSplatRandom(struct Sprite *); static void AnimHitSplatRandom(struct Sprite *);
static void AnimExtremeSpeedHitSplat(struct Sprite *); static void AnimExtremeSpeedHitSplat(struct Sprite *);
void sub_8116560(struct Sprite *); static void AnimCrossImpact(struct Sprite *);
static void AnimFlashingHitSplat(struct Sprite *); static void AnimFlashingHitSplat(struct Sprite *);
static void AnimConfusionDuckStep(struct Sprite *); static void AnimFlashingHitSplat_Step(struct Sprite *);
static void AnimSimplePaletteBlendStep(struct Sprite *); static void AnimConfusionDuck_Step(struct Sprite *);
static void sub_81158F8(struct Sprite *);
static void sub_8115984(struct Sprite *);
static void BlendColorCycle(u8, u8, u8); static void BlendColorCycle(u8, u8, u8);
static void AnimTask_BlendColorCycleLoop(u8); static void AnimTask_BlendColorCycleLoop(u8);
static void BlendColorCycleExclude(u8, u8, u8); static void BlendColorCycleExclude(u8, u8, u8);
static void AnimTask_BlendColorCycleExcludeLoop(u8); static void AnimTask_BlendColorCycleExcludeLoop(u8);
static void BlendColorCycleByTag(u8, u8, u8); static void BlendColorCycleByTag(u8, u8, u8);
static void AnimTask_BlendColorCycleByTagLoop(u8); static void AnimTask_BlendColorCycleByTagLoop(u8);
static void sub_8115E00(u8); static void AnimTask_FlashAnimTagWithColor_Step1(u8);
static void sub_8115EB8(u8); static void AnimTask_FlashAnimTagWithColor_Step2(u8);
static void sub_8116148(struct Sprite *); static void AnimTask_ShakeBattleTerrain_Step(u8);
static void sub_81161F4(void);
static void sub_81162F8(u8);
static void sub_81163D0(struct Sprite *); static void sub_81163D0(struct Sprite *);
static void sub_81165E4(struct Sprite *);
const union AnimCmd gUnknown_0859722C[] = const union AnimCmd gUnknown_0859722C[] =
{ {
@ -54,7 +53,7 @@ const union AnimCmd gUnknown_08597240[] =
ANIMCMD_JUMP(0), ANIMCMD_JUMP(0),
}; };
const union AnimCmd *const gUnknown_08597254[] = static const union AnimCmd *const sAnimTable_ConfusionDuck[] =
{ {
gUnknown_0859722C, gUnknown_0859722C,
gUnknown_08597240, gUnknown_08597240,
@ -65,7 +64,7 @@ const struct SpriteTemplate gConfusionDuckSpriteTemplate =
.tileTag = ANIM_TAG_DUCK, .tileTag = ANIM_TAG_DUCK,
.paletteTag = ANIM_TAG_DUCK, .paletteTag = ANIM_TAG_DUCK,
.oam = &gOamData_AffineOff_ObjNormal_16x16, .oam = &gOamData_AffineOff_ObjNormal_16x16,
.anims = gUnknown_08597254, .anims = sAnimTable_ConfusionDuck,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimConfusionDuck, .callback = AnimConfusionDuck,
@ -90,7 +89,7 @@ const struct SpriteTemplate gComplexPaletteBlendSpriteTemplate =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_81158A4, .callback = AnimComplexPaletteBlend,
}; };
const union AnimCmd gUnknown_085972A4[] = const union AnimCmd gUnknown_085972A4[] =
@ -157,7 +156,7 @@ const union AffineAnimCmd gUnknown_08597330[] =
AFFINEANIMCMD_END, AFFINEANIMCMD_END,
}; };
const union AffineAnimCmd *const gUnknown_08597348[] = const union AffineAnimCmd *const sAffineAnims_HitSplat[] =
{ {
gUnknown_085972F0, gUnknown_085972F0,
gUnknown_08597300, gUnknown_08597300,
@ -172,7 +171,7 @@ const struct SpriteTemplate gBasicHitSplatSpriteTemplate =
.oam = &gOamData_AffineNormal_ObjBlend_32x32, .oam = &gOamData_AffineNormal_ObjBlend_32x32,
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gUnknown_08597348, .affineAnims = sAffineAnims_HitSplat,
.callback = AnimBasicHitSplat, .callback = AnimBasicHitSplat,
}; };
@ -184,7 +183,7 @@ const struct SpriteTemplate gSpikeHitSplatSpriteTemplate =
.oam = &gOamData_AffineNormal_ObjBlend_32x32, .oam = &gOamData_AffineNormal_ObjBlend_32x32,
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gUnknown_08597348, .affineAnims = sAffineAnims_HitSplat,
.callback = sub_8116420, .callback = sub_8116420,
}; };
@ -195,7 +194,7 @@ const struct SpriteTemplate gWaterHitSplatSpriteTemplate =
.oam = &gOamData_AffineNormal_ObjBlend_32x32, .oam = &gOamData_AffineNormal_ObjBlend_32x32,
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gUnknown_08597348, .affineAnims = sAffineAnims_HitSplat,
.callback = AnimBasicHitSplat, .callback = AnimBasicHitSplat,
}; };
@ -206,7 +205,7 @@ const struct SpriteTemplate gRandomPosHitSplatSpriteTemplate =
.oam = &gOamData_AffineNormal_ObjBlend_32x32, .oam = &gOamData_AffineNormal_ObjBlend_32x32,
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gUnknown_08597348, .affineAnims = sAffineAnims_HitSplat,
.callback = AnimHitSplatRandom, .callback = AnimHitSplatRandom,
}; };
@ -218,7 +217,7 @@ const struct SpriteTemplate gExtremeSpeedHitSplatSpriteTemplate =
.oam = &gOamData_AffineNormal_ObjBlend_32x32, .oam = &gOamData_AffineNormal_ObjBlend_32x32,
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gUnknown_08597348, .affineAnims = sAffineAnims_HitSplat,
.callback = AnimExtremeSpeedHitSplat, .callback = AnimExtremeSpeedHitSplat,
}; };
@ -230,7 +229,7 @@ const struct SpriteTemplate gCrossImpactSpriteTemplate =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_8116560, .callback = AnimCrossImpact,
}; };
const struct SpriteTemplate gFlashingHitSplatSpriteTemplate = const struct SpriteTemplate gFlashingHitSplatSpriteTemplate =
@ -240,7 +239,7 @@ const struct SpriteTemplate gFlashingHitSplatSpriteTemplate =
.oam = &gOamData_AffineNormal_ObjNormal_32x32, .oam = &gOamData_AffineNormal_ObjNormal_32x32,
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gUnknown_08597348, .affineAnims = sAffineAnims_HitSplat,
.callback = AnimFlashingHitSplat, .callback = AnimFlashingHitSplat,
}; };
@ -252,7 +251,7 @@ const struct SpriteTemplate gRevengeHitSplatSpriteTemplate =
.oam = &gOamData_AffineNormal_ObjBlend_32x32, .oam = &gOamData_AffineNormal_ObjBlend_32x32,
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gUnknown_08597348, .affineAnims = sAffineAnims_HitSplat,
.callback = sub_81163D0, .callback = sub_81163D0,
}; };
@ -262,7 +261,7 @@ const struct SpriteTemplate gRevengeHitSplatSpriteTemplate =
// arg 2: initial wave offset // arg 2: initial wave offset
// arg 3: wave period (higher means faster wave) // arg 3: wave period (higher means faster wave)
// arg 4: duration // arg 4: duration
void AnimConfusionDuck(struct Sprite *sprite) static void AnimConfusionDuck(struct Sprite *sprite)
{ {
sprite->pos1.x += gBattleAnimArgs[0]; sprite->pos1.x += gBattleAnimArgs[0];
sprite->pos1.y += gBattleAnimArgs[1]; sprite->pos1.y += gBattleAnimArgs[1];
@ -280,11 +279,11 @@ void AnimConfusionDuck(struct Sprite *sprite)
} }
sprite->data[3] = gBattleAnimArgs[4]; sprite->data[3] = gBattleAnimArgs[4];
sprite->callback = AnimConfusionDuckStep; sprite->callback = AnimConfusionDuck_Step;
sprite->callback(sprite); sprite->callback(sprite);
} }
static void AnimConfusionDuckStep(struct Sprite *sprite) static void AnimConfusionDuck_Step(struct Sprite *sprite)
{ {
sprite->pos2.x = Cos(sprite->data[0], 30); sprite->pos2.x = Cos(sprite->data[0], 30);
sprite->pos2.y = Sin(sprite->data[0], 10); sprite->pos2.y = Sin(sprite->data[0], 10);
@ -305,12 +304,12 @@ static void AnimConfusionDuckStep(struct Sprite *sprite)
// arg 2: start blend amount // arg 2: start blend amount
// arg 3: end blend amount // arg 3: end blend amount
// arg 4: blend color // arg 4: blend color
void AnimSimplePaletteBlend(struct Sprite *sprite) static void AnimSimplePaletteBlend(struct Sprite *sprite)
{ {
u32 selectedPalettes = UnpackSelectedBattleAnimPalettes(gBattleAnimArgs[0]); u32 selectedPalettes = UnpackSelectedBattleAnimPalettes(gBattleAnimArgs[0]);
BeginNormalPaletteFade(selectedPalettes, gBattleAnimArgs[1], gBattleAnimArgs[2], gBattleAnimArgs[3], gBattleAnimArgs[4]); BeginNormalPaletteFade(selectedPalettes, gBattleAnimArgs[1], gBattleAnimArgs[2], gBattleAnimArgs[3], gBattleAnimArgs[4]);
sprite->invisible = 1; sprite->invisible = TRUE;
sprite->callback = AnimSimplePaletteBlendStep; sprite->callback = AnimSimplePaletteBlend_Step;
} }
// Unpacks a bitfield and returns a bitmask of its selected palettes. // Unpacks a bitfield and returns a bitmask of its selected palettes.
@ -334,13 +333,13 @@ u32 UnpackSelectedBattleAnimPalettes(s16 selector)
return sub_80A75AC(battleBackground, attacker, target, attackerPartner, targetPartner, arg5, arg6); return sub_80A75AC(battleBackground, attacker, target, attackerPartner, targetPartner, arg5, arg6);
} }
static void AnimSimplePaletteBlendStep(struct Sprite *sprite) static void AnimSimplePaletteBlend_Step(struct Sprite *sprite)
{ {
if (!gPaletteFade.active) if (!gPaletteFade.active)
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
void sub_81158A4(struct Sprite *sprite) static void AnimComplexPaletteBlend(struct Sprite *sprite)
{ {
u32 selectedPalettes; u32 selectedPalettes;
@ -355,11 +354,11 @@ void sub_81158A4(struct Sprite *sprite)
selectedPalettes = UnpackSelectedBattleAnimPalettes(sprite->data[7]); selectedPalettes = UnpackSelectedBattleAnimPalettes(sprite->data[7]);
BlendPalettes(selectedPalettes, gBattleAnimArgs[4], gBattleAnimArgs[3]); BlendPalettes(selectedPalettes, gBattleAnimArgs[4], gBattleAnimArgs[3]);
sprite->invisible = 1; sprite->invisible = TRUE;
sprite->callback = sub_81158F8; sprite->callback = AnimComplexPaletteBlend_Step1;
} }
static void sub_81158F8(struct Sprite *sprite) static void AnimComplexPaletteBlend_Step1(struct Sprite *sprite)
{ {
u32 selectedPalettes; u32 selectedPalettes;
@ -374,7 +373,7 @@ static void sub_81158F8(struct Sprite *sprite)
if (sprite->data[2] == 0) if (sprite->data[2] == 0)
{ {
sprite->callback = sub_8115984; sprite->callback = AnimComplexPaletteBlend_Step2;
return; return;
} }
@ -389,7 +388,7 @@ static void sub_81158F8(struct Sprite *sprite)
sprite->data[2]--; sprite->data[2]--;
} }
static void sub_8115984(struct Sprite *sprite) static void AnimComplexPaletteBlend_Step2(struct Sprite *sprite)
{ {
u32 selectedPalettes; u32 selectedPalettes;
@ -401,7 +400,7 @@ static void sub_8115984(struct Sprite *sprite)
} }
} }
void sub_81159B4(struct Sprite *sprite) static void sub_81159B4(struct Sprite *sprite)
{ {
sprite->pos1.x += gBattleAnimArgs[0]; sprite->pos1.x += gBattleAnimArgs[0];
sprite->pos1.y += gBattleAnimArgs[1]; sprite->pos1.y += gBattleAnimArgs[1];
@ -660,10 +659,10 @@ void AnimTask_FlashAnimTagWithColor(u8 taskId)
gBattleAnimArgs[4], gBattleAnimArgs[4],
gBattleAnimArgs[3]); gBattleAnimArgs[3]);
gTasks[taskId].func = sub_8115E00; gTasks[taskId].func = AnimTask_FlashAnimTagWithColor_Step1;
} }
static void sub_8115E00(u8 taskId) static void AnimTask_FlashAnimTagWithColor_Step1(u8 taskId)
{ {
u32 selectedPalettes; u32 selectedPalettes;
@ -678,7 +677,7 @@ static void sub_8115E00(u8 taskId)
if (gTasks[taskId].data[2] == 0) if (gTasks[taskId].data[2] == 0)
{ {
gTasks[taskId].func = sub_8115EB8; gTasks[taskId].func = AnimTask_FlashAnimTagWithColor_Step2;
return; return;
} }
@ -707,7 +706,7 @@ static void sub_8115E00(u8 taskId)
gTasks[taskId].data[2]--; gTasks[taskId].data[2]--;
} }
static void sub_8115EB8(u8 taskId) static void AnimTask_FlashAnimTagWithColor_Step2(u8 taskId)
{ {
u32 selectedPalettes; u32 selectedPalettes;
@ -787,7 +786,7 @@ static void AnimShakeMonOrBattleTerrain(struct Sprite *sprite)
{ {
u16 var0; u16 var0;
sprite->invisible = 1; sprite->invisible = TRUE;
sprite->data[0] = -gBattleAnimArgs[0]; sprite->data[0] = -gBattleAnimArgs[0];
sprite->data[1] = gBattleAnimArgs[1]; sprite->data[1] = gBattleAnimArgs[1];
sprite->data[2] = gBattleAnimArgs[1]; sprite->data[2] = gBattleAnimArgs[1];
@ -813,12 +812,12 @@ static void AnimShakeMonOrBattleTerrain(struct Sprite *sprite)
sprite->data[5] = gBattleAnimArgs[3]; sprite->data[5] = gBattleAnimArgs[3];
var0 = sprite->data[5] - 2; var0 = sprite->data[5] - 2;
if (var0 < 2) if (var0 < 2)
sub_81161F4(); AnimShakeMonOrBattleTerrain_UpdateCoordOffsetEnabled();
sprite->callback = sub_8116148; sprite->callback = AnimShakeMonOrBattleTerrain_Step;
} }
static void sub_8116148(struct Sprite *sprite) static void AnimShakeMonOrBattleTerrain_Step(struct Sprite *sprite)
{ {
u8 i; u8 i;
u16 var0; u16 var0;
@ -844,29 +843,29 @@ static void sub_8116148(struct Sprite *sprite)
if (var0 < 2) if (var0 < 2)
{ {
for (i = 0; i < gBattlersCount; i++) for (i = 0; i < gBattlersCount; i++)
gSprites[gBattlerSpriteIds[i]].coordOffsetEnabled = 0; gSprites[gBattlerSpriteIds[i]].coordOffsetEnabled = FALSE;
} }
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
} }
static void sub_81161F4(void) static void AnimShakeMonOrBattleTerrain_UpdateCoordOffsetEnabled(void)
{ {
gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].coordOffsetEnabled = 0; gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].coordOffsetEnabled = FALSE;
gSprites[gBattlerSpriteIds[gBattleAnimTarget]].coordOffsetEnabled = 0; gSprites[gBattlerSpriteIds[gBattleAnimTarget]].coordOffsetEnabled = FALSE;
if (gBattleAnimArgs[4] == 2) if (gBattleAnimArgs[4] == 2)
{ {
gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].coordOffsetEnabled = 1; gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].coordOffsetEnabled = TRUE;
gSprites[gBattlerSpriteIds[gBattleAnimTarget]].coordOffsetEnabled = 1; gSprites[gBattlerSpriteIds[gBattleAnimTarget]].coordOffsetEnabled = TRUE;
} }
else else
{ {
if (gBattleAnimArgs[4] == 0) if (gBattleAnimArgs[4] == 0)
gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].coordOffsetEnabled = 1; gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].coordOffsetEnabled = TRUE;
else else
gSprites[gBattlerSpriteIds[gBattleAnimTarget]].coordOffsetEnabled = 1; gSprites[gBattlerSpriteIds[gBattleAnimTarget]].coordOffsetEnabled = TRUE;
} }
} }
@ -891,11 +890,11 @@ void AnimTask_ShakeBattleTerrain(u8 taskId)
gTasks[taskId].tShakeDelay = gBattleAnimArgs[3]; gTasks[taskId].tShakeDelay = gBattleAnimArgs[3];
gBattle_BG3_X = gBattleAnimArgs[0]; gBattle_BG3_X = gBattleAnimArgs[0];
gBattle_BG3_Y = gBattleAnimArgs[1]; gBattle_BG3_Y = gBattleAnimArgs[1];
gTasks[taskId].func = sub_81162F8; gTasks[taskId].func = AnimTask_ShakeBattleTerrain_Step;
gTasks[taskId].func(taskId); gTasks[taskId].func(taskId);
} }
static void sub_81162F8(u8 taskId) static void AnimTask_ShakeBattleTerrain_Step(u8 taskId)
{ {
if (gTasks[taskId].tTimer == 0) if (gTasks[taskId].tTimer == 0)
{ {
@ -954,7 +953,7 @@ static void sub_81163D0(struct Sprite *sprite)
StoreSpriteCallbackInData6(sprite, sub_810E2C8); StoreSpriteCallbackInData6(sprite, sub_810E2C8);
} }
void sub_8116420(struct Sprite *sprite) static void sub_8116420(struct Sprite *sprite)
{ {
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER && !IsContest()) if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER && !IsContest())
gBattleAnimArgs[1] = -gBattleAnimArgs[1]; gBattleAnimArgs[1] = -gBattleAnimArgs[1];
@ -992,7 +991,7 @@ static void AnimExtremeSpeedHitSplat(struct Sprite *sprite)
sprite->callback = RunStoredCallbackWhenAffineAnimEnds; sprite->callback = RunStoredCallbackWhenAffineAnimEnds;
} }
void sub_8116560(struct Sprite *sprite) static void AnimCrossImpact(struct Sprite *sprite)
{ {
if (gBattleAnimArgs[2] == ANIM_ATTACKER) if (gBattleAnimArgs[2] == ANIM_ATTACKER)
InitSpritePosToAnimAttacker(sprite, 1); InitSpritePosToAnimAttacker(sprite, 1);
@ -1012,10 +1011,10 @@ static void AnimFlashingHitSplat(struct Sprite *sprite)
else else
InitSpritePosToAnimTarget(sprite, TRUE); InitSpritePosToAnimTarget(sprite, TRUE);
sprite->callback = sub_81165E4; sprite->callback = AnimFlashingHitSplat_Step;
} }
static void sub_81165E4(struct Sprite *sprite) static void AnimFlashingHitSplat_Step(struct Sprite *sprite)
{ {
sprite->invisible ^= 1; sprite->invisible ^= 1;
if (sprite->data[0]++ > 12) if (sprite->data[0]++ > 12)

View File

@ -4,14 +4,14 @@
#include "constants/rgb.h" #include "constants/rgb.h"
static void AnimSludgeProjectile(struct Sprite *); static void AnimSludgeProjectile(struct Sprite *);
static void AnimSludgeProjectile_Step(struct Sprite *);
static void AnimAcidPoisonBubble(struct Sprite *); static void AnimAcidPoisonBubble(struct Sprite *);
static void AnimAcidPoisonBubble_Step(struct Sprite *);
static void AnimSludgeBombHitParticle(struct Sprite *); static void AnimSludgeBombHitParticle(struct Sprite *);
static void AnimSludgeBombHitParticle_Step(struct Sprite *);
static void AnimAcidPoisonDroplet(struct Sprite *); static void AnimAcidPoisonDroplet(struct Sprite *);
static void AnimBubbleEffect(struct Sprite *); static void AnimBubbleEffect(struct Sprite *);
static void sub_810DC10(struct Sprite *); static void AnimBubbleEffect_Step(struct Sprite *);
static void sub_810DCB4(struct Sprite *);
static void sub_810DD24(struct Sprite *);
static void AnimBubbleEffectStep(struct Sprite *);
extern const union AnimCmd *const gUnknown_08595200[]; extern const union AnimCmd *const gUnknown_08595200[];
@ -201,10 +201,10 @@ static void AnimSludgeProjectile(struct Sprite *sprite)
InitAnimArcTranslation(sprite); InitAnimArcTranslation(sprite);
sprite->callback = sub_810DC10; sprite->callback = AnimSludgeProjectile_Step;
} }
static void sub_810DC10(struct Sprite *sprite) static void AnimSludgeProjectile_Step(struct Sprite *sprite)
{ {
if (TranslateAnimHorizontalArc(sprite)) if (TranslateAnimHorizontalArc(sprite))
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
@ -229,10 +229,10 @@ static void AnimAcidPoisonBubble(struct Sprite *sprite)
InitAnimArcTranslation(sprite); InitAnimArcTranslation(sprite);
sprite->callback = sub_810DCB4; sprite->callback = AnimAcidPoisonBubble_Step;
} }
static void sub_810DCB4(struct Sprite *sprite) static void AnimAcidPoisonBubble_Step(struct Sprite *sprite)
{ {
if (TranslateAnimHorizontalArc(sprite)) if (TranslateAnimHorizontalArc(sprite))
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
@ -251,10 +251,10 @@ static void AnimSludgeBombHitParticle(struct Sprite *sprite)
sprite->data[5] = sprite->data[1] / gBattleAnimArgs[2]; sprite->data[5] = sprite->data[1] / gBattleAnimArgs[2];
sprite->data[6] = sprite->data[2] / gBattleAnimArgs[2]; sprite->data[6] = sprite->data[2] / gBattleAnimArgs[2];
sprite->callback = sub_810DD24; sprite->callback = AnimSludgeBombHitParticle_Step;
} }
static void sub_810DD24(struct Sprite *sprite) static void AnimSludgeBombHitParticle_Step(struct Sprite *sprite)
{ {
TranslateSpriteLinearFixedPoint(sprite); TranslateSpriteLinearFixedPoint(sprite);
@ -306,10 +306,10 @@ static void AnimBubbleEffect(struct Sprite *sprite)
sprite->pos1.y += gBattleAnimArgs[1]; sprite->pos1.y += gBattleAnimArgs[1];
} }
sprite->callback = AnimBubbleEffectStep; sprite->callback = AnimBubbleEffect_Step;
} }
static void AnimBubbleEffectStep(struct Sprite *sprite) static void AnimBubbleEffect_Step(struct Sprite *sprite)
{ {
sprite->data[0] = (sprite->data[0] + 0xB) & 0xFF; sprite->data[0] = (sprite->data[0] + 0xB) & 0xFF;
sprite->pos2.x = Sin(sprite->data[0], 4); sprite->pos2.x = Sin(sprite->data[0], 4);

View File

@ -9,25 +9,25 @@
#include "constants/songs.h" #include "constants/songs.h"
static void AnimDefensiveWall(struct Sprite *); static void AnimDefensiveWall(struct Sprite *);
static void AnimDefensiveWall_Step1(struct Sprite *);
static void AnimDefensiveWall_Step2(struct Sprite *);
static void AnimDefensiveWall_Step3(struct Sprite *);
static void AnimDefensiveWall_Step4(struct Sprite *);
static void AnimDefensiveWall_Step5(struct Sprite *);
static void AnimWallSparkle(struct Sprite *); static void AnimWallSparkle(struct Sprite *);
void sub_810F634(struct Sprite *); static void AnimBentSpoon(struct Sprite *);
static void AnimQuestionMark(struct Sprite *); static void AnimQuestionMark(struct Sprite *);
static void AnimQuestionMark_Step1(struct Sprite *);
static void AnimQuestionMark_Step2(struct Sprite *);
static void AnimRedX(struct Sprite *); static void AnimRedX(struct Sprite *);
void sub_810FDF0(struct Sprite *); static void sub_810FDF0(struct Sprite *);
static void AnimPsychoBoost(struct Sprite *); static void AnimPsychoBoost(struct Sprite *);
static void sub_810F340(struct Sprite *); static void AnimTask_MeditateStretchAttacker_Step(u8);
static void sub_810F3C8(struct Sprite *); static void AnimTask_Teleport_Step(u8);
static void sub_810F400(struct Sprite *); static void AnimTask_ImprisonOrbs_Step(u8);
static void sub_810F46C(struct Sprite *); static void AnimTask_SkillSwap_Step(u8);
static void sub_810F524(struct Sprite *); static void AnimTask_ExtrasensoryDistortion_Step(u8);
static void sub_810F740(struct Sprite *); static void AnimTask_TransparentCloneGrowAndShrink_Step(u8);
static void sub_810F774(struct Sprite *);
static void sub_810F810(u8);
static void sub_810F898(u8);
static void sub_810F9D4(u8);
static void sub_810FD3C(u8);
static void sub_810FF34(u8);
static void sub_8110134(u8);
const union AffineAnimCmd gUnknown_0859652C[] = const union AffineAnimCmd gUnknown_0859652C[] =
{ {
@ -223,7 +223,7 @@ const struct SpriteTemplate gBentSpoonSpriteTemplate =
.anims = gUnknown_085966D4, .anims = gUnknown_085966D4,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_810F634, .callback = AnimBentSpoon,
}; };
const union AnimCmd gUnknown_085966F4[] = const union AnimCmd gUnknown_085966F4[] =
@ -473,16 +473,16 @@ static void AnimDefensiveWall(struct Sprite *sprite)
if (isContest) if (isContest)
{ {
sprite->pos1.y += 9; sprite->pos1.y += 9;
sprite->callback = sub_810F3C8; sprite->callback = AnimDefensiveWall_Step2;
sprite->callback(sprite); sprite->callback(sprite);
} }
else else
{ {
sprite->callback = sub_810F340; sprite->callback = AnimDefensiveWall_Step1;
} }
} }
static void sub_810F340(struct Sprite *sprite) static void AnimDefensiveWall_Step1(struct Sprite *sprite)
{ {
u8 battler = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); u8 battler = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
if (!sprite->data[7]) if (!sprite->data[7])
@ -492,26 +492,26 @@ static void sub_810F340(struct Sprite *sprite)
} }
if (IsBattlerSpriteVisible(battler)) if (IsBattlerSpriteVisible(battler))
gSprites[gBattlerSpriteIds[battler]].invisible = 1; gSprites[gBattlerSpriteIds[battler]].invisible = TRUE;
battler = BATTLE_PARTNER(battler); battler = BATTLE_PARTNER(battler);
if (IsBattlerSpriteVisible(battler)) if (IsBattlerSpriteVisible(battler))
gSprites[gBattlerSpriteIds[battler]].invisible = 1; gSprites[gBattlerSpriteIds[battler]].invisible = TRUE;
sprite->callback = sub_810F3C8; sprite->callback = AnimDefensiveWall_Step2;
sprite->callback(sprite); sprite->callback(sprite);
} }
static void sub_810F3C8(struct Sprite *sprite) static void AnimDefensiveWall_Step2(struct Sprite *sprite)
{ {
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[3], 16 - sprite->data[3])); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[3], 16 - sprite->data[3]));
if (sprite->data[3] == 13) if (sprite->data[3] == 13)
sprite->callback = sub_810F400; sprite->callback = AnimDefensiveWall_Step3;
else else
sprite->data[3]++; sprite->data[3]++;
} }
static void sub_810F400(struct Sprite *sprite) static void AnimDefensiveWall_Step3(struct Sprite *sprite)
{ {
u16 color; u16 color;
u16 startOffset; u16 startOffset;
@ -529,11 +529,11 @@ static void sub_810F400(struct Sprite *sprite)
gPlttBufferFaded[startOffset + 1] = color; gPlttBufferFaded[startOffset + 1] = color;
if (++sprite->data[2] == 16) if (++sprite->data[2] == 16)
sprite->callback = sub_810F46C; sprite->callback = AnimDefensiveWall_Step4;
} }
} }
static void sub_810F46C(struct Sprite *sprite) static void AnimDefensiveWall_Step4(struct Sprite *sprite)
{ {
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[3], 16 - sprite->data[3])); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[3], 16 - sprite->data[3]));
@ -545,19 +545,19 @@ static void sub_810F46C(struct Sprite *sprite)
u8 battler = battlerCopy = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); u8 battler = battlerCopy = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
if (IsBattlerSpriteVisible(battler)) if (IsBattlerSpriteVisible(battler))
gSprites[gBattlerSpriteIds[battler]].invisible = 0; gSprites[gBattlerSpriteIds[battler]].invisible = FALSE;
battler = BATTLE_PARTNER(battlerCopy); battler = BATTLE_PARTNER(battlerCopy);
if (IsBattlerSpriteVisible(battler)) if (IsBattlerSpriteVisible(battler))
gSprites[gBattlerSpriteIds[battler]].invisible = 0; gSprites[gBattlerSpriteIds[battler]].invisible = FALSE;
} }
sprite->invisible = 1; sprite->invisible = TRUE;
sprite->callback = sub_810F524; sprite->callback = AnimDefensiveWall_Step5;
} }
} }
static void sub_810F524(struct Sprite *sprite) static void AnimDefensiveWall_Step5(struct Sprite *sprite)
{ {
if (!IsContest()) if (!IsContest())
{ {
@ -618,7 +618,7 @@ static void AnimWallSparkle(struct Sprite *sprite)
} }
} }
void sub_810F634(struct Sprite *sprite) static void AnimBentSpoon(struct Sprite *sprite)
{ {
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2);
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET);
@ -655,20 +655,20 @@ static void AnimQuestionMark(struct Sprite *sprite)
if (sprite->pos1.y < 16) if (sprite->pos1.y < 16)
sprite->pos1.y = 16; sprite->pos1.y = 16;
StoreSpriteCallbackInData6(sprite, sub_810F740); StoreSpriteCallbackInData6(sprite, AnimQuestionMark_Step1);
sprite->callback = RunStoredCallbackWhenAnimEnds; sprite->callback = RunStoredCallbackWhenAnimEnds;
} }
static void sub_810F740(struct Sprite *sprite) static void AnimQuestionMark_Step1(struct Sprite *sprite)
{ {
sprite->oam.affineMode = ST_OAM_AFFINE_NORMAL; sprite->oam.affineMode = ST_OAM_AFFINE_NORMAL;
sprite->affineAnims = gUnknown_08596740; sprite->affineAnims = gUnknown_08596740;
sprite->data[0] = 0; sprite->data[0] = 0;
InitSpriteAffineAnim(sprite); InitSpriteAffineAnim(sprite);
sprite->callback = sub_810F774; sprite->callback = AnimQuestionMark_Step2;
} }
static void sub_810F774(struct Sprite *sprite) static void AnimQuestionMark_Step2(struct Sprite *sprite)
{ {
switch (sprite->data[0]) switch (sprite->data[0])
{ {
@ -694,10 +694,10 @@ void AnimTask_MeditateStretchAttacker(u8 taskId)
u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
task->data[0] = spriteId; task->data[0] = spriteId;
PrepareAffineAnimInTaskData(task, spriteId, gUnknown_0859675C); PrepareAffineAnimInTaskData(task, spriteId, gUnknown_0859675C);
task->func = sub_810F810; task->func = AnimTask_MeditateStretchAttacker_Step;
} }
static void sub_810F810(u8 taskId) static void AnimTask_MeditateStretchAttacker_Step(u8 taskId)
{ {
if (!RunAffineAnimFromTaskData(&gTasks[taskId])) if (!RunAffineAnimFromTaskData(&gTasks[taskId]))
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
@ -713,10 +713,10 @@ void AnimTask_Teleport(u8 taskId)
task->data[3] = GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER ? 4 : 8; task->data[3] = GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER ? 4 : 8;
PrepareAffineAnimInTaskData(task, task->data[0], gUnknown_0859677C); PrepareAffineAnimInTaskData(task, task->data[0], gUnknown_0859677C);
task->func = sub_810F898; task->func = AnimTask_Teleport_Step;
} }
static void sub_810F898(u8 taskId) static void AnimTask_Teleport_Step(u8 taskId)
{ {
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
@ -735,7 +735,7 @@ static void sub_810F898(u8 taskId)
} }
else else
{ {
gSprites[task->data[0]].invisible = 1; gSprites[task->data[0]].invisible = TRUE;
gSprites[task->data[0]].pos1.x = 272; gSprites[task->data[0]].pos1.x = 272;
ResetSpriteRotScale(task->data[0]); ResetSpriteRotScale(task->data[0]);
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
@ -762,10 +762,10 @@ void AnimTask_ImprisonOrbs(u8 taskId)
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND);
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(16, 0)); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(16, 0));
task->func = sub_810F9D4; task->func = AnimTask_ImprisonOrbs_Step;
} }
static void sub_810F9D4(u8 taskId) static void AnimTask_ImprisonOrbs_Step(u8 taskId)
{ {
u16 i; u16 i;
u8 spriteId; u8 spriteId;
@ -902,10 +902,10 @@ void AnimTask_SkillSwap(u8 taskId)
} }
task->data[1] = 6; task->data[1] = 6;
task->func = sub_810FD3C; task->func = AnimTask_SkillSwap_Step;
} }
static void sub_810FD3C(u8 taskId) static void AnimTask_SkillSwap_Step(u8 taskId)
{ {
u8 spriteId; u8 spriteId;
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
@ -939,7 +939,7 @@ static void sub_810FD3C(u8 taskId)
} }
} }
void sub_810FDF0(struct Sprite *sprite) static void sub_810FDF0(struct Sprite *sprite)
{ {
if (TranslateAnimHorizontalArc(sprite)) if (TranslateAnimHorizontalArc(sprite))
{ {
@ -1008,10 +1008,10 @@ void AnimTask_ExtrasensoryDistortion(u8 taskId)
scanlineParams.initState = 1; scanlineParams.initState = 1;
scanlineParams.unused9 = 0; scanlineParams.unused9 = 0;
ScanlineEffect_SetParams(scanlineParams); ScanlineEffect_SetParams(scanlineParams);
task->func = sub_810FF34; task->func = AnimTask_ExtrasensoryDistortion_Step;
} }
static void sub_810FF34(u8 taskId) static void AnimTask_ExtrasensoryDistortion_Step(u8 taskId)
{ {
s16 sineIndex, i; s16 sineIndex, i;
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
@ -1081,10 +1081,10 @@ void AnimTask_TransparentCloneGrowAndShrink(u8 taskId)
task->data[13] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); task->data[13] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
task->data[14] = matrixNum; task->data[14] = matrixNum;
task->data[15] = spriteId; task->data[15] = spriteId;
task->func = sub_8110134; task->func = AnimTask_TransparentCloneGrowAndShrink_Step;
} }
static void sub_8110134(u8 taskId) static void AnimTask_TransparentCloneGrowAndShrink_Step(u8 taskId)
{ {
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
@ -1150,7 +1150,7 @@ static void AnimPsychoBoost(struct Sprite *sprite)
if (sprite->data[1] == 0) if (sprite->data[1] == 0)
{ {
sprite->data[0]++; sprite->data[0]++;
sprite->invisible = 1; sprite->invisible = TRUE;
} }
} }

View File

@ -13,22 +13,22 @@ extern const union AnimCmd *const gUnknown_085950E0[];
extern const union AnimCmd *const gUnknown_085954D0[]; extern const union AnimCmd *const gUnknown_085954D0[];
static void AnimFallingRock(struct Sprite *); static void AnimFallingRock(struct Sprite *);
static void AnimFallingRock_Step(struct Sprite *);
static void AnimRockFragment(struct Sprite *); static void AnimRockFragment(struct Sprite *);
static void AnimDirtParticleAcrossScreen(struct Sprite *); static void AnimDirtParticleAcrossScreen(struct Sprite *);
void AnimRaiseSprite(struct Sprite *); static void AnimRaiseSprite(struct Sprite *);
void sub_81110A4(u8 taskId); static void AnimTask_Rollout_Step(u8 taskId);
static void AnimRolloutParticle(struct Sprite *); static void AnimRolloutParticle(struct Sprite *);
static void AnimRockTomb(struct Sprite *); static void AnimRockTomb(struct Sprite *);
static void AnimRockTomb_Step(struct Sprite *sprite);
static void AnimRockBlastRock(struct Sprite *); static void AnimRockBlastRock(struct Sprite *);
static void AnimRockScatter(struct Sprite *); static void AnimRockScatter(struct Sprite *);
static void AnimRockScatter_Step(struct Sprite *sprite);
static void AnimParticleInVortex(struct Sprite *); static void AnimParticleInVortex(struct Sprite *);
static void sub_8110A70(struct Sprite *); static void AnimParticleInVortex_Step(struct Sprite *sprite);
static void sub_8110B80(struct Sprite *sprite); static void AnimTask_LoadSandstormBackground_Step(u8 taskId);
static void sub_8110CB0(u8 taskId);
static void sub_8111214(struct Task *task); static void sub_8111214(struct Task *task);
static u8 GetRolloutCounter(void); static u8 GetRolloutCounter(void);
static void sub_81113C8(struct Sprite *sprite);
static void sub_811149C(struct Sprite *sprite);
const union AnimCmd gUnknown_08596AE0[] = const union AnimCmd gUnknown_08596AE0[] =
{ {
@ -323,12 +323,12 @@ static void AnimFallingRock(struct Sprite *sprite)
sprite->data[4] = -70; sprite->data[4] = -70;
sprite->data[5] = gBattleAnimArgs[2]; sprite->data[5] = gBattleAnimArgs[2];
StoreSpriteCallbackInData6(sprite, sub_8110A70); StoreSpriteCallbackInData6(sprite, AnimFallingRock_Step);
sprite->callback = TranslateSpriteInEllipseOverDuration; sprite->callback = TranslateSpriteInEllipseOverDuration;
sprite->callback(sprite); sprite->callback(sprite);
} }
static void sub_8110A70(struct Sprite *sprite) static void AnimFallingRock_Step(struct Sprite *sprite)
{ {
sprite->pos1.x += sprite->data[5]; sprite->pos1.x += sprite->data[5];
@ -383,10 +383,10 @@ static void AnimParticleInVortex(struct Sprite *sprite)
sprite->data[2] = gBattleAnimArgs[4]; sprite->data[2] = gBattleAnimArgs[4];
sprite->data[3] = gBattleAnimArgs[5]; sprite->data[3] = gBattleAnimArgs[5];
sprite->callback = sub_8110B80; sprite->callback = AnimParticleInVortex_Step;
} }
static void sub_8110B80(struct Sprite *sprite) static void AnimParticleInVortex_Step(struct Sprite *sprite)
{ {
sprite->data[4] += sprite->data[1]; sprite->data[4] += sprite->data[1];
sprite->pos2.y = -(sprite->data[4] >> 8); sprite->pos2.y = -(sprite->data[4] >> 8);
@ -427,10 +427,10 @@ void AnimTask_LoadSandstormBackground(u8 taskId)
var0 = 1; var0 = 1;
gTasks[taskId].data[0] = var0; gTasks[taskId].data[0] = var0;
gTasks[taskId].func = sub_8110CB0; gTasks[taskId].func = AnimTask_LoadSandstormBackground_Step;
} }
static void sub_8110CB0(u8 taskId) static void AnimTask_LoadSandstormBackground_Step(u8 taskId)
{ {
struct BattleAnimBgData animBg; struct BattleAnimBgData animBg;
@ -552,7 +552,7 @@ static void AnimDirtParticleAcrossScreen(struct Sprite *sprite)
// arg 2: terminal y offset // arg 2: terminal y offset
// arg 3: duration // arg 3: duration
// arg 4: sprite size [1,5] // arg 4: sprite size [1,5]
void AnimRaiseSprite(struct Sprite *sprite) static void AnimRaiseSprite(struct Sprite *sprite)
{ {
StartSpriteAnim(sprite, gBattleAnimArgs[4]); StartSpriteAnim(sprite, gBattleAnimArgs[4]);
InitSpritePosToAnimAttacker(sprite, 0); InitSpritePosToAnimAttacker(sprite, 0);
@ -615,10 +615,10 @@ void AnimTask_Rollout(u8 taskId)
task->data[1] = rolloutCounter; task->data[1] = rolloutCounter;
task->data[15] = GetAnimBattlerSpriteId(ANIM_ATTACKER); task->data[15] = GetAnimBattlerSpriteId(ANIM_ATTACKER);
task->func = sub_81110A4; task->func = AnimTask_Rollout_Step;
} }
void sub_81110A4(u8 taskId) static void AnimTask_Rollout_Step(u8 taskId)
{ {
struct Task *task; struct Task *task;
@ -737,7 +737,7 @@ static void AnimRolloutParticle(struct Sprite *sprite)
{ {
if (TranslateAnimHorizontalArc(sprite)) if (TranslateAnimHorizontalArc(sprite))
{ {
u8 taskId = FindTaskIdByFunc(sub_81110A4); u8 taskId = FindTaskIdByFunc(AnimTask_Rollout_Step);
if (taskId != 0xFF) if (taskId != 0xFF)
gTasks[taskId].data[11]--; gTasks[taskId].data[11]--;
@ -764,13 +764,13 @@ static void AnimRockTomb(struct Sprite *sprite)
sprite->data[3] -= gBattleAnimArgs[2]; sprite->data[3] -= gBattleAnimArgs[2];
sprite->data[0] = 3; sprite->data[0] = 3;
sprite->data[1] = gBattleAnimArgs[3]; sprite->data[1] = gBattleAnimArgs[3];
sprite->callback = sub_81113C8; sprite->callback = AnimRockTomb_Step;
sprite->invisible = 1; sprite->invisible = TRUE;
} }
static void sub_81113C8(struct Sprite *sprite) static void AnimRockTomb_Step(struct Sprite *sprite)
{ {
sprite->invisible = 0; sprite->invisible = FALSE;
if (sprite->data[3] != 0) if (sprite->data[3] != 0)
{ {
sprite->pos2.y = sprite->data[2] + sprite->data[3]; sprite->pos2.y = sprite->data[2] + sprite->data[3];
@ -808,10 +808,10 @@ static void AnimRockScatter(struct Sprite *sprite)
sprite->data[5] = gBattleAnimArgs[2]; sprite->data[5] = gBattleAnimArgs[2];
StartSpriteAnim(sprite, gBattleAnimArgs[3]); StartSpriteAnim(sprite, gBattleAnimArgs[3]);
sprite->callback = sub_811149C; sprite->callback = AnimRockScatter_Step;
} }
static void sub_811149C(struct Sprite *sprite) static void AnimRockScatter_Step(struct Sprite *sprite)
{ {
sprite->data[0] += 8; sprite->data[0] += 8;
sprite->data[3] += sprite->data[1]; sprite->data[3] += sprite->data[1];

View File

@ -13,46 +13,46 @@
#include "constants/battle.h" #include "constants/battle.h"
#include "constants/rgb.h" #include "constants/rgb.h"
void sub_810721C(struct Sprite *); static void sub_810721C(struct Sprite *);
void sub_8107228(struct Sprite *); static void sub_8107228(struct Sprite *);
static void AnimMovingWaterBubble(struct Sprite *); static void AnimMovingWaterBubble(struct Sprite *);
void sub_8107380(struct Sprite *); static void AnimMovingWaterBubble_Step1(struct Sprite *);
void sub_8107408(struct Sprite *); static void AnimMovingWaterBubble_Step2(struct Sprite *);
void sub_8107430(struct Sprite *); static void AnimMovingWaterBubble_Step3(struct Sprite *);
static void AnimAuroraBeamRings(struct Sprite *); static void AnimAuroraBeamRings(struct Sprite *);
void sub_81074E4(struct Sprite *); static void AnimAuroraBeamRings_Step(struct Sprite *);
static void AnimToTargetInSinWave(struct Sprite *); static void AnimToTargetInSinWave(struct Sprite *);
void sub_8107674(struct Sprite *); static void AnimToTargetInSinWave_Step(struct Sprite *);
static void AnimHydroCannonCharge(struct Sprite *); static void AnimHydroCannonCharge(struct Sprite *);
static void AnimWaitForHydroCannonChargeEnd(struct Sprite *); static void AnimHydroCannonCharge_Step(struct Sprite *);
static void AnimHydroCannonBeam(struct Sprite *); static void AnimHydroCannonBeam(struct Sprite *);
static void AnimWaterGunDroplet(struct Sprite *); static void AnimWaterGunDroplet(struct Sprite *);
static void AnimSmallBubblePair(struct Sprite *); static void AnimSmallBubblePair(struct Sprite *);
void sub_810790C(struct Sprite *); static void AnimSmallBubblePair_Step(struct Sprite *);
void sub_8108034(struct Sprite *); static void AnimSmallDriftingBubbles(struct Sprite *);
void sub_8108098(struct Sprite *); static void AnimSmallDriftingBubbles_Step(struct Sprite *);
void sub_810851C(struct Sprite *); static void sub_810851C(struct Sprite *);
void sub_81087C0(struct Sprite *); static void sub_81087C0(struct Sprite *);
void sub_810886C(struct Sprite *); static void sub_810886C(struct Sprite *);
void sub_8108B2C(struct Sprite *); static void sub_8108B2C(struct Sprite *);
void sub_8108B94(struct Sprite *); static void sub_8108B94(struct Sprite *);
static void AnimWaterPulseBubble(struct Sprite *); static void AnimWaterPulseBubble(struct Sprite *);
void sub_8108C08(struct Sprite *); static void AnimWaterPulseBubble_Step(struct Sprite *);
void sub_8108C54(struct Sprite *); static void sub_8108C54(struct Sprite *);
void AnimWaterPulseRing_Step(struct Sprite *); static void AnimWaterPulseRing_Step(struct Sprite *);
void sub_810756C(u8); static void sub_810756C(u8);
static void AnimTask_RunSinAnimTimer(u8); static void AnimTask_RunSinAnimTimer(u8);
void sub_8107B84(u8); static void sub_8107B84(u8);
void sub_8107CC4(u8); static void sub_8107CC4(u8);
void sub_8107D58(u8); static void sub_8107D58(u8);
void sub_8108140(u8); static void AnimTask_WaterSpoutLaunch_Step(u8);
void sub_810862C(u8); static void AnimTask_WaterSpoutRain_Step(u8);
void sub_8108978(u8); static void sub_8108978(u8);
u8 sub_8108384(void); static u8 sub_8108384(void);
void sub_8108408(struct Task*, u8); static void sub_8108408(struct Task*, u8);
void sub_810871C(struct Task*, u8); static void sub_810871C(struct Task*, u8);
void sub_8108AC0(struct Task*); static void sub_8108AC0(struct Task*);
void sub_8108D54(struct Sprite*, int, int); static void sub_8108D54(struct Sprite*, int, int);
extern const union AffineAnimCmd *const gGrowingRingAffineAnimTable[]; extern const union AffineAnimCmd *const gGrowingRingAffineAnimTable[];
extern const union AffineAnimCmd *const gUnknown_08596208[]; extern const union AffineAnimCmd *const gUnknown_08596208[];
@ -369,7 +369,7 @@ const struct SpriteTemplate gSmallDriftingBubblesSpriteTemplate =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_8108034, .callback = AnimSmallDriftingBubbles,
}; };
const struct SpriteTemplate gUnknown_08595268 = const struct SpriteTemplate gUnknown_08595268 =
@ -500,12 +500,12 @@ void AnimTask_CreateRaindrops(u8 taskId)
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }
void sub_810721C(struct Sprite *sprite) static void sub_810721C(struct Sprite *sprite)
{ {
sprite->callback = sub_8107228; sprite->callback = sub_8107228;
} }
void sub_8107228(struct Sprite *sprite) static void sub_8107228(struct Sprite *sprite)
{ {
if (++sprite->data[0] <= 13) if (++sprite->data[0] <= 13)
{ {
@ -550,11 +550,11 @@ static void AnimMovingWaterBubble(struct Sprite *sprite)
gSprites[spriteId].data[2] = gBattleAnimArgs[5]; gSprites[spriteId].data[2] = gBattleAnimArgs[5];
gSprites[spriteId].data[3] = (u8)gBattleAnimArgs[4] * 256; gSprites[spriteId].data[3] = (u8)gBattleAnimArgs[4] * 256;
gSprites[spriteId].data[4] = gBattleAnimArgs[6]; gSprites[spriteId].data[4] = gBattleAnimArgs[6];
sprite->callback = sub_8107380; sprite->callback = AnimMovingWaterBubble_Step1;
sprite->callback(sprite); sprite->callback(sprite);
} }
void sub_8107380(struct Sprite *sprite) static void AnimMovingWaterBubble_Step1(struct Sprite *sprite)
{ {
u8 otherSpriteId = sprite->data[5]; u8 otherSpriteId = sprite->data[5];
u8 timer = gSprites[otherSpriteId].data[4]; u8 timer = gSprites[otherSpriteId].data[4];
@ -571,19 +571,19 @@ void sub_8107380(struct Sprite *sprite)
} }
else else
{ {
sprite->callback = sub_8107408; sprite->callback = AnimMovingWaterBubble_Step2;
DestroySprite(&gSprites[otherSpriteId]); DestroySprite(&gSprites[otherSpriteId]);
} }
} }
void sub_8107408(struct Sprite *sprite) static void AnimMovingWaterBubble_Step2(struct Sprite *sprite)
{ {
sprite->animPaused = FALSE; sprite->animPaused = FALSE;
sprite->callback = RunStoredCallbackWhenAnimEnds; sprite->callback = RunStoredCallbackWhenAnimEnds;
StoreSpriteCallbackInData6(sprite, sub_8107430); StoreSpriteCallbackInData6(sprite, AnimMovingWaterBubble_Step3);
} }
void sub_8107430(struct Sprite *sprite) static void AnimMovingWaterBubble_Step3(struct Sprite *sprite)
{ {
sprite->data[0] = 10; sprite->data[0] = 10;
sprite->callback = WaitAnimForDuration; sprite->callback = WaitAnimForDuration;
@ -605,12 +605,12 @@ static void AnimAuroraBeamRings(struct Sprite *sprite)
sprite->data[3] = sprite->pos1.y; sprite->data[3] = sprite->pos1.y;
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3];
InitAnimLinearTranslation(sprite); InitAnimLinearTranslation(sprite);
sprite->callback = sub_81074E4; sprite->callback = AnimAuroraBeamRings_Step;
sprite->affineAnimPaused = TRUE; sprite->affineAnimPaused = TRUE;
sprite->callback(sprite); sprite->callback(sprite);
} }
void sub_81074E4(struct Sprite *sprite) static void AnimAuroraBeamRings_Step(struct Sprite *sprite)
{ {
if ((u16)gBattleAnimArgs[ARG_RET_ID] == 0xFFFF) if ((u16)gBattleAnimArgs[ARG_RET_ID] == 0xFFFF)
{ {
@ -630,7 +630,7 @@ void AnimTask_RotateAuroraRingColors(u8 taskId)
} }
#ifdef NONMATCHING #ifdef NONMATCHING
void sub_810756C(u8 taskId) static void sub_810756C(u8 taskId)
{ {
int i; int i;
u16 palIndex; u16 palIndex;
@ -654,7 +654,7 @@ void sub_810756C(u8 taskId)
} }
#else #else
NAKED NAKED
void sub_810756C(u8 taskId) static void sub_810756C(u8 taskId)
{ {
asm_unified("push {r4-r7,lr}\n\ asm_unified("push {r4-r7,lr}\n\
lsls r0, 24\n\ lsls r0, 24\n\
@ -746,11 +746,11 @@ static void AnimToTargetInSinWave(struct Sprite *sprite)
{ {
sprite->data[6] = retArg * 256; sprite->data[6] = retArg * 256;
} }
sprite->callback = sub_8107674; sprite->callback = AnimToTargetInSinWave_Step;
sprite->callback(sprite); sprite->callback(sprite);
} }
void sub_8107674(struct Sprite *sprite) static void AnimToTargetInSinWave_Step(struct Sprite *sprite)
{ {
if (AnimTranslateLinear(sprite)) if (AnimTranslateLinear(sprite))
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
@ -807,10 +807,10 @@ static void AnimHydroCannonCharge(struct Sprite *sprite)
sprite->pos2.x = -10; sprite->pos2.x = -10;
sprite->subpriority = priority + 2; sprite->subpriority = priority + 2;
} }
sprite->callback = AnimWaitForHydroCannonChargeEnd; sprite->callback = AnimHydroCannonCharge_Step;
} }
static void AnimWaitForHydroCannonChargeEnd(struct Sprite *sprite) static void AnimHydroCannonCharge_Step(struct Sprite *sprite)
{ {
if (sprite->affineAnimEnded) if (sprite->affineAnimEnded)
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
@ -863,10 +863,10 @@ static void AnimSmallBubblePair(struct Sprite *sprite)
else else
InitSpritePosToAnimAttacker(sprite, TRUE); InitSpritePosToAnimAttacker(sprite, TRUE);
sprite->data[7] = gBattleAnimArgs[2]; sprite->data[7] = gBattleAnimArgs[2];
sprite->callback = sub_810790C; sprite->callback = AnimSmallBubblePair_Step;
} }
void sub_810790C(struct Sprite *sprite) static void AnimSmallBubblePair_Step(struct Sprite *sprite)
{ {
sprite->data[0] = (sprite->data[0] + 11) & 0xFF; sprite->data[0] = (sprite->data[0] + 11) & 0xFF;
sprite->pos2.x = Sin(sprite->data[0], 4); sprite->pos2.x = Sin(sprite->data[0], 4);
@ -1177,7 +1177,7 @@ _08107B58:\n\
#endif #endif
#ifdef NONMATCHING #ifdef NONMATCHING
void sub_8107B84(u8 taskId) static void sub_8107B84(u8 taskId)
{ {
struct BattleAnimBgData animBg; struct BattleAnimBgData animBg;
u8 i; u8 i;
@ -1227,7 +1227,7 @@ void sub_8107B84(u8 taskId)
} }
#else #else
NAKED NAKED
void sub_8107B84(u8 taskId) static void sub_8107B84(u8 taskId)
{ {
asm_unified("push {r4-r7,lr}\n\ asm_unified("push {r4-r7,lr}\n\
sub sp, 0x10\n\ sub sp, 0x10\n\
@ -1387,7 +1387,7 @@ _08107CA8:\n\
} }
#endif #endif
void sub_8107CC4(u8 taskId) static void sub_8107CC4(u8 taskId)
{ {
u16 *BGptrX = &gBattle_BG1_X; u16 *BGptrX = &gBattle_BG1_X;
u16 *BGptrY = &gBattle_BG1_Y; u16 *BGptrY = &gBattle_BG1_Y;
@ -1410,7 +1410,7 @@ void sub_8107CC4(u8 taskId)
} }
} }
void sub_8107D58(u8 taskId) static void sub_8107D58(u8 taskId)
{ {
s16 i; s16 i;
struct ScanlineEffectParams params; struct ScanlineEffectParams params;
@ -1476,7 +1476,7 @@ void sub_8107D58(u8 taskId)
} }
} }
void sub_8108034(struct Sprite *sprite) static void AnimSmallDriftingBubbles(struct Sprite *sprite)
{ {
s16 randData; s16 randData;
s16 randData2; s16 randData2;
@ -1489,10 +1489,10 @@ void sub_8108034(struct Sprite *sprite)
randData2 = 256 - randData2; randData2 = 256 - randData2;
sprite->data[1] = randData; sprite->data[1] = randData;
sprite->data[2] = randData2; sprite->data[2] = randData2;
sprite->callback = sub_8108098; sprite->callback = AnimSmallDriftingBubbles_Step;
} }
void sub_8108098(struct Sprite *sprite) static void AnimSmallDriftingBubbles_Step(struct Sprite *sprite)
{ {
sprite->data[3] += sprite->data[1]; sprite->data[3] += sprite->data[1];
sprite->data[4] += sprite->data[2]; sprite->data[4] += sprite->data[2];
@ -1513,10 +1513,10 @@ void AnimTask_WaterSpoutLaunch(u8 taskId)
task->data[5] = gSprites[task->data[15]].pos1.y; task->data[5] = gSprites[task->data[15]].pos1.y;
task->data[1] = sub_8108384(); task->data[1] = sub_8108384();
PrepareBattlerSpriteForRotScale(task->data[15], ST_OAM_OBJ_NORMAL); PrepareBattlerSpriteForRotScale(task->data[15], ST_OAM_OBJ_NORMAL);
task->func = sub_8108140; task->func = AnimTask_WaterSpoutLaunch_Step;
} }
void sub_8108140(u8 taskId) static void AnimTask_WaterSpoutLaunch_Step(u8 taskId)
{ {
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
@ -1601,7 +1601,7 @@ void sub_8108140(u8 taskId)
} }
} }
u8 sub_8108384(void) static u8 sub_8108384(void)
{ {
u8 i; u8 i;
u16 hp; u16 hp;
@ -1633,7 +1633,7 @@ u8 sub_8108384(void)
return 3; return 3;
} }
void sub_8108408(struct Task *task, u8 taskId) static void sub_8108408(struct Task *task, u8 taskId)
{ {
s16 i; s16 i;
s16 attackerCoordX = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); s16 attackerCoordX = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
@ -1666,7 +1666,7 @@ void sub_8108408(struct Task *task, u8 taskId)
} }
} }
void sub_810851C(struct Sprite *sprite) static void sub_810851C(struct Sprite *sprite)
{ {
switch (sprite->data[0]) switch (sprite->data[0])
{ {
@ -1706,10 +1706,10 @@ void AnimTask_WaterSpoutRain(u8 taskId)
task->data[5] = 98; task->data[5] = 98;
task->data[7] = task->data[4] + 49; task->data[7] = task->data[4] + 49;
task->data[12] = task->data[1] * 5 + 5; task->data[12] = task->data[1] * 5 + 5;
task->func = sub_810862C; task->func = AnimTask_WaterSpoutRain_Step;
} }
void sub_810862C(u8 taskId) static void AnimTask_WaterSpoutRain_Step(u8 taskId)
{ {
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
u8 taskId2; u8 taskId2;
@ -1752,7 +1752,7 @@ void sub_810862C(u8 taskId)
} }
} }
void sub_810871C(struct Task *task, u8 taskId) static void sub_810871C(struct Task *task, u8 taskId)
{ {
u16 yPosArg = ((gSineTable[task->data[8]] + 3) >> 4) + task->data[6]; u16 yPosArg = ((gSineTable[task->data[8]] + 3) >> 4) + task->data[6];
u8 spriteId = CreateSprite(&gUnknown_08595268, task->data[7], 0, 0); u8 spriteId = CreateSprite(&gUnknown_08595268, task->data[7], 0, 0);
@ -1770,7 +1770,7 @@ void sub_810871C(struct Task *task, u8 taskId)
task->data[7] = (ISO_RANDOMIZE2(task->data[7]) % task->data[5]) + task->data[4]; task->data[7] = (ISO_RANDOMIZE2(task->data[7]) % task->data[5]) + task->data[4];
} }
void sub_81087C0(struct Sprite *sprite) static void sub_81087C0(struct Sprite *sprite)
{ {
if (sprite->data[0] == 0) if (sprite->data[0] == 0)
{ {
@ -1791,7 +1791,7 @@ void sub_81087C0(struct Sprite *sprite)
} }
} }
void sub_810886C(struct Sprite *sprite) static void sub_810886C(struct Sprite *sprite)
{ {
if (++sprite->data[1] > 1) if (++sprite->data[1] > 1)
{ {
@ -1823,7 +1823,7 @@ void AnimTask_WaterSport(u8 taskId)
task->func = sub_8108978; task->func = sub_8108978;
} }
void sub_8108978(u8 taskId) static void sub_8108978(u8 taskId)
{ {
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
@ -1892,7 +1892,7 @@ void sub_8108978(u8 taskId)
} }
} }
void sub_8108AC0(struct Task *task) static void sub_8108AC0(struct Task *task)
{ {
u8 spriteId; u8 spriteId;
@ -1913,7 +1913,7 @@ void sub_8108AC0(struct Task *task)
} }
} }
void sub_8108B2C(struct Sprite *sprite) static void sub_8108B2C(struct Sprite *sprite)
{ {
if (TranslateAnimHorizontalArc(sprite)) if (TranslateAnimHorizontalArc(sprite))
{ {
@ -1928,7 +1928,7 @@ void sub_8108B2C(struct Sprite *sprite)
} }
} }
void sub_8108B94(struct Sprite *sprite) static void sub_8108B94(struct Sprite *sprite)
{ {
u16 i; u16 i;
@ -1954,10 +1954,10 @@ static void AnimWaterPulseBubble(struct Sprite *sprite)
sprite->data[1] = gBattleAnimArgs[3]; sprite->data[1] = gBattleAnimArgs[3];
sprite->data[2] = gBattleAnimArgs[4]; sprite->data[2] = gBattleAnimArgs[4];
sprite->data[3] = gBattleAnimArgs[5]; sprite->data[3] = gBattleAnimArgs[5];
sprite->callback = sub_8108C08; sprite->callback = AnimWaterPulseBubble_Step;
} }
void sub_8108C08(struct Sprite *sprite) static void AnimWaterPulseBubble_Step(struct Sprite *sprite)
{ {
sprite->data[4] -= sprite->data[0]; sprite->data[4] -= sprite->data[0];
sprite->pos2.y = sprite->data[4] / 10; sprite->pos2.y = sprite->data[4] / 10;
@ -1967,7 +1967,7 @@ void sub_8108C08(struct Sprite *sprite)
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
void sub_8108C54(struct Sprite *sprite) static void sub_8108C54(struct Sprite *sprite)
{ {
sprite->data[3] += sprite->data[1]; sprite->data[3] += sprite->data[1];
sprite->data[4] += sprite->data[2]; sprite->data[4] += sprite->data[2];
@ -1990,7 +1990,7 @@ void AnimWaterPulseRing(struct Sprite *sprite)
sprite->callback = AnimWaterPulseRing_Step; sprite->callback = AnimWaterPulseRing_Step;
} }
void AnimWaterPulseRing_Step(struct Sprite *sprite) static void AnimWaterPulseRing_Step(struct Sprite *sprite)
{ {
int xDiff = sprite->data[1] - sprite->pos1.x; int xDiff = sprite->data[1] - sprite->pos1.x;
int yDiff = sprite->data[2] - sprite->pos1.y; int yDiff = sprite->data[2] - sprite->pos1.y;
@ -2008,7 +2008,7 @@ void AnimWaterPulseRing_Step(struct Sprite *sprite)
} }
#ifdef NONMATCHING #ifdef NONMATCHING
void sub_8108D54(struct Sprite *sprite, int xDiff, int yDiff) static void sub_8108D54(struct Sprite *sprite, int xDiff, int yDiff)
{ {
s16 something = sprite->data[0] / 2; s16 something = sprite->data[0] / 2;
s16 combinedX = sprite->pos1.x + sprite->pos2.x; s16 combinedX = sprite->pos1.x + sprite->pos2.x;
@ -2043,7 +2043,7 @@ void sub_8108D54(struct Sprite *sprite, int xDiff, int yDiff)
} }
#else #else
NAKED NAKED
void sub_8108D54(struct Sprite *sprite, int xDiff, int yDiff) static void sub_8108D54(struct Sprite *sprite, int xDiff, int yDiff)
{ {
asm_unified("push {r4-r7,lr}\n\ asm_unified("push {r4-r7,lr}\n\
mov r7, r10\n\ mov r7, r10\n\