2018-12-18 04:56:34 +01:00
|
|
|
#include "global.h"
|
2019-09-09 03:07:54 +02:00
|
|
|
#include "malloc.h"
|
2018-12-18 04:56:34 +01:00
|
|
|
#include "battle_anim.h"
|
|
|
|
#include "battle_interface.h"
|
|
|
|
#include "decompress.h"
|
|
|
|
#include "gpu_regs.h"
|
|
|
|
#include "graphics.h"
|
|
|
|
#include "main.h"
|
|
|
|
#include "math_util.h"
|
|
|
|
#include "palette.h"
|
|
|
|
#include "random.h"
|
|
|
|
#include "scanline_effect.h"
|
|
|
|
#include "sound.h"
|
|
|
|
#include "trig.h"
|
|
|
|
#include "util.h"
|
|
|
|
#include "constants/rgb.h"
|
|
|
|
#include "constants/songs.h"
|
|
|
|
|
|
|
|
void sub_8103448(struct Sprite *);
|
|
|
|
void sub_8103498(struct Sprite *);
|
|
|
|
void sub_810358C(struct Sprite *);
|
|
|
|
void sub_8103620(struct Sprite *);
|
2018-12-18 05:08:08 +01:00
|
|
|
void Anim_KinesisZapEnergy(struct Sprite *);
|
|
|
|
void Anim_SwordsDanceBlade(struct Sprite *);
|
2018-12-18 04:56:34 +01:00
|
|
|
void AnimSonicBoomProjectile(struct Sprite *);
|
2019-10-20 15:54:16 +02:00
|
|
|
void AnimAirWaveProjectile(struct Sprite *);
|
2018-12-18 04:56:34 +01:00
|
|
|
void sub_8103FE8(struct Sprite *);
|
2019-10-20 10:47:56 +02:00
|
|
|
void AnimCoinThrow(struct Sprite *);
|
|
|
|
void AnimFallingCoin(struct Sprite *);
|
|
|
|
void AnimBulletSeed(struct Sprite *);
|
2019-10-20 11:01:12 +02:00
|
|
|
void AnimRazorWindTornado(struct Sprite *);
|
|
|
|
void AnimViceGripPincer(struct Sprite *);
|
|
|
|
void AnimGuillotinePincer(struct Sprite *);
|
|
|
|
void AnimBreathPuff(struct Sprite *);
|
|
|
|
void AnimAngerMark(struct Sprite *);
|
|
|
|
void AnimPencil(struct Sprite *);
|
2019-10-20 11:16:45 +02:00
|
|
|
void AnimBlendThinRing(struct Sprite *);
|
|
|
|
void AnimHyperVoiceRing(struct Sprite *);
|
|
|
|
void AnimUproarRing(struct Sprite *);
|
|
|
|
void AnimSoftBoiledEgg(struct Sprite *);
|
|
|
|
void AnimSpeedDust(struct Sprite *);
|
2019-10-20 11:55:02 +02:00
|
|
|
void AnimHealBellMusicNote(struct Sprite *);
|
|
|
|
void AnimMagentaHeart(struct Sprite *);
|
|
|
|
void AnimRedHeartProjectile(struct Sprite *);
|
|
|
|
void AnimParticuleBurst(struct Sprite *);
|
|
|
|
void AnimRedHeartRising(struct Sprite *);
|
2018-12-18 04:56:34 +01:00
|
|
|
void AnimOrbitFast(struct Sprite *);
|
|
|
|
void AnimOrbitScatter(struct Sprite *);
|
2019-10-20 11:55:02 +02:00
|
|
|
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 *);
|
2019-10-20 15:54:16 +02:00
|
|
|
void AnimJaggedMusicNote(struct Sprite *);
|
|
|
|
void AnimPerishSongMusicNote2(struct Sprite *);
|
|
|
|
void AnimPerishSongMusicNote(struct Sprite *);
|
|
|
|
void AnimGuardRing(struct Sprite *);
|
2018-12-18 04:56:34 +01:00
|
|
|
static void sub_81034D8(struct Sprite *);
|
|
|
|
static void sub_8103658(struct Sprite *);
|
|
|
|
static void sub_8103680(struct Sprite *);
|
2018-12-18 05:08:08 +01:00
|
|
|
static void AnimTask_WithdrawStep(u8);
|
2019-10-20 15:54:16 +02:00
|
|
|
static void AnimSwordsDanceBladeStep(struct Sprite *);
|
2018-12-18 04:56:34 +01:00
|
|
|
static void sub_8104018(struct Sprite *);
|
2019-10-20 10:47:56 +02:00
|
|
|
static void AnimFallingCoin_Step(struct Sprite *);
|
|
|
|
static void AnimBulletSeed_Step1(struct Sprite *);
|
|
|
|
static void AnimBulletSeed_Step2(struct Sprite *);
|
2019-10-20 11:01:12 +02:00
|
|
|
static void AnimViceGripPincerStep(struct Sprite *);
|
|
|
|
static void AnimGuillotinePincerStep1(struct Sprite *);
|
|
|
|
static void AnimGuillotinePincerStep2(struct Sprite *);
|
|
|
|
static void AnimGuillotinePincerStep3(struct Sprite *);
|
2018-12-18 05:08:08 +01:00
|
|
|
static void AnimTask_GrowAndGreyscaleStep(u8);
|
|
|
|
static void AnimTask_MinimizeStep1(u8);
|
|
|
|
static void CreateMinimizeSprite(struct Task *, u8);
|
|
|
|
static void ClonedMinizeSprite_Step(struct Sprite *);
|
2018-12-18 04:56:34 +01:00
|
|
|
static void AnimTask_SplashStep(u8);
|
2018-12-18 05:08:08 +01:00
|
|
|
static void AnimTask_GrowAndShrinkStep(u8);
|
2019-10-20 11:01:12 +02:00
|
|
|
static void ThrashMoveMonStep(u8);
|
2019-10-20 15:54:16 +02:00
|
|
|
static void ThrashMoveMon(u8);
|
|
|
|
static void AnimTask_SketchDrawMon(u8);
|
2019-10-20 11:01:12 +02:00
|
|
|
static void AnimPencil_Step(struct Sprite *);
|
2019-10-20 11:16:45 +02:00
|
|
|
static void AnimSoftBoiledEgg_Step1(struct Sprite *);
|
|
|
|
static void AnimSoftBoiledEgg_Step2(struct Sprite *);
|
|
|
|
static void AnimSoftBoiledEgg_Step3(struct Sprite *);
|
|
|
|
static void AnimSoftBoiledEgg_Step3_Callback1(struct Sprite *);
|
|
|
|
static void AnimSoftBoiledEgg_Step3_Callback2(struct Sprite *);
|
|
|
|
static void AnimSoftBoiledEgg_Step4(struct Sprite *);
|
|
|
|
static void AnimSoftBoiledEgg_Step4_Callback(struct Sprite *);
|
2019-10-20 15:54:16 +02:00
|
|
|
static void StretchAttacker_Step(u8);
|
|
|
|
static void ExtremeSpeedImpact_Step(u8);
|
|
|
|
static void ExtremeSpeedMonReappear_Step(u8);
|
2019-10-20 11:16:45 +02:00
|
|
|
static void SpeedDust_Step1(u8);
|
2019-10-20 11:55:02 +02:00
|
|
|
static void FakeOutStep1(u8);
|
|
|
|
static void FakeOutStep2(u8);
|
|
|
|
static void AnimRedHeartProjectile_Step(struct Sprite *);
|
|
|
|
static void AnimRedHeartRising_Step(struct Sprite *);
|
2019-10-20 15:54:16 +02:00
|
|
|
static void HeartsBackground_Step(u8);
|
2018-12-18 04:56:34 +01:00
|
|
|
static void sub_81065EC(u8);
|
|
|
|
static void AnimOrbitFastStep(struct Sprite *);
|
|
|
|
static void AnimOrbitScatterStep(struct Sprite *);
|
|
|
|
static void sub_8106D5C(struct Sprite *);
|
|
|
|
static void sub_8106DD4(u8);
|
|
|
|
static void sub_8106EC8(struct Sprite *);
|
|
|
|
static void sub_8107018(struct Sprite *);
|
|
|
|
static void sub_810703C(struct Sprite *);
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
// Unused
|
2018-12-18 04:56:34 +01:00
|
|
|
const struct SpriteTemplate gUnknown_08593264 =
|
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_FINGER,
|
|
|
|
.paletteTag = ANIM_TAG_FINGER,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_32x32,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
|
|
|
.callback = sub_8103448,
|
|
|
|
};
|
|
|
|
|
|
|
|
const union AnimCmd gUnknown_0859327C[] =
|
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(4, 1),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
|
|
|
const union AnimCmd *const gUnknown_08593284[] =
|
|
|
|
{
|
|
|
|
gUnknown_0859327C,
|
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
// Unused
|
2018-12-18 04:56:34 +01:00
|
|
|
const struct SpriteTemplate gUnknown_08593288 =
|
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_MUSIC_NOTES,
|
|
|
|
.paletteTag = ANIM_TAG_MUSIC_NOTES,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_16x16,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
|
|
|
.callback = sub_8103498,
|
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
// Unused
|
2018-12-18 04:56:34 +01:00
|
|
|
const struct SpriteTemplate gUnknown_085932A0 =
|
|
|
|
{
|
|
|
|
.tileTag = 0,
|
|
|
|
.paletteTag = 0,
|
|
|
|
.oam = &gDummyOamData,
|
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
|
|
|
.callback = sub_810358C,
|
|
|
|
};
|
|
|
|
|
|
|
|
extern const union AffineAnimCmd *const gUnknown_08597060[];
|
2019-10-20 10:47:56 +02:00
|
|
|
// Unused
|
2018-12-18 04:56:34 +01:00
|
|
|
const struct SpriteTemplate gUnknown_085932B8 =
|
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_CLAMP,
|
|
|
|
.paletteTag = ANIM_TAG_CLAMP,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineNormal_ObjBlend_64x64,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gUnknown_08597060,
|
|
|
|
.callback = sub_8103620,
|
|
|
|
};
|
|
|
|
|
|
|
|
const union AnimCmd gUnknown_085932D0[] =
|
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(0, 9),
|
|
|
|
ANIMCMD_FRAME(16, 3),
|
|
|
|
ANIMCMD_FRAME(32, 3),
|
|
|
|
ANIMCMD_FRAME(48, 3),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
|
|
|
const union AnimCmd *const gUnknown_085932E4[] =
|
|
|
|
{
|
|
|
|
gUnknown_085932D0,
|
|
|
|
};
|
|
|
|
|
|
|
|
const union AffineAnimCmd gUnknown_085932E8[] =
|
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x50, 0x50, 0, 0),
|
|
|
|
AFFINEANIMCMD_FRAME(0x9, 0x9, 0, 18),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
|
|
|
const union AffineAnimCmd *const gUnknown_08593300[] =
|
|
|
|
{
|
|
|
|
gUnknown_085932E8,
|
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
// Unused
|
2018-12-18 04:56:34 +01:00
|
|
|
const struct SpriteTemplate gUnknown_08593304 =
|
|
|
|
{
|
2019-04-06 16:32:02 +02:00
|
|
|
.tileTag = ANIM_TAG_EXPLOSION_6,
|
|
|
|
.paletteTag = ANIM_TAG_EXPLOSION_6,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineNormal_ObjNormal_32x32,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gUnknown_085932E4,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gUnknown_08593300,
|
2019-10-14 21:05:40 +02:00
|
|
|
.callback = AnimSparklingParticle,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const union AnimCmd gKinesisZapEnergyAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(0, 3, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(8, 3, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(16, 3, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(24, 3, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(32, 3, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(40, 3, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(48, 3, .hFlip = TRUE),
|
|
|
|
ANIMCMD_LOOP(1),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const union AnimCmd *const gKinesisZapEnergyAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 10:47:56 +02:00
|
|
|
gKinesisZapEnergyAnimCmds,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
const struct SpriteTemplate gKinesisZapEnergySpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_ALERT,
|
|
|
|
.paletteTag = ANIM_TAG_ALERT,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_32x16,
|
2019-10-20 10:47:56 +02:00
|
|
|
.anims = gKinesisZapEnergyAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2018-12-18 05:08:08 +01:00
|
|
|
.callback = Anim_KinesisZapEnergy,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const union AffineAnimCmd gSwordsDanceBladeAffineAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x10, 0x100, 0, 0),
|
|
|
|
AFFINEANIMCMD_FRAME(0x14, 0x0, 0, 12),
|
|
|
|
AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 32),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const union AffineAnimCmd *const gSwordsDanceBladeAffineAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 10:47:56 +02:00
|
|
|
gSwordsDanceBladeAffineAnimCmds,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
const struct SpriteTemplate gSwordsDanceBladeSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_SWORD,
|
|
|
|
.paletteTag = ANIM_TAG_SWORD,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineNormal_ObjBlend_32x64,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2019-10-20 10:47:56 +02:00
|
|
|
.affineAnims = gSwordsDanceBladeAffineAnimTable,
|
2018-12-18 05:08:08 +01:00
|
|
|
.callback = Anim_SwordsDanceBlade,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
const struct SpriteTemplate gSonicBoomSpriteTemplate =
|
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_AIR_WAVE,
|
|
|
|
.paletteTag = ANIM_TAG_AIR_WAVE,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineDouble_ObjBlend_32x16,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
|
|
|
.callback = AnimSonicBoomProjectile,
|
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const struct SpriteTemplate gAirWaveProjectileSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_AIR_WAVE,
|
|
|
|
.paletteTag = ANIM_TAG_AIR_WAVE,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjBlend_32x16,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 15:54:16 +02:00
|
|
|
.callback = AnimAirWaveProjectile,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const union AffineAnimCmd gGrowingRingAffineAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x20, 0x20, 0, 0),
|
|
|
|
AFFINEANIMCMD_FRAME(0x7, 0x7, 0, -56),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const union AffineAnimCmd gWaterPulseRingAffineAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x5, 0x5, 0, 10),
|
|
|
|
AFFINEANIMCMD_FRAME(0xFFF6, 0xFFF6, 0, 10),
|
|
|
|
AFFINEANIMCMD_FRAME(0xA, 0xA, 0, 10),
|
|
|
|
AFFINEANIMCMD_FRAME(0xFFF6, 0xFFF6, 0, 10),
|
|
|
|
AFFINEANIMCMD_FRAME(0xA, 0xA, 0, 10),
|
|
|
|
AFFINEANIMCMD_FRAME(0xFFF6, 0xFFF6, 0, 10),
|
|
|
|
AFFINEANIMCMD_FRAME(0xA, 0xA, 0, 10),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const union AffineAnimCmd *const gGrowingRingAffineAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 10:47:56 +02:00
|
|
|
gGrowingRingAffineAnimCmds,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const union AffineAnimCmd *const gWaterPulseRingAffineAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 10:47:56 +02:00
|
|
|
gWaterPulseRingAffineAnimCmds,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
const struct SpriteTemplate gSupersonicWaveSpriteTemplate =
|
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_GOLD_RING,
|
|
|
|
.paletteTag = ANIM_TAG_GOLD_RING,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineDouble_ObjNormal_16x32,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2019-10-20 10:47:56 +02:00
|
|
|
.affineAnims = gGrowingRingAffineAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.callback = TranslateAnimSpriteToTargetMonLocation,
|
|
|
|
};
|
|
|
|
|
|
|
|
const struct SpriteTemplate gScreechWaveSpriteTemplate =
|
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_PURPLE_RING,
|
|
|
|
.paletteTag = ANIM_TAG_PURPLE_RING,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineDouble_ObjNormal_16x32,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2019-10-20 10:47:56 +02:00
|
|
|
.affineAnims = gGrowingRingAffineAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.callback = TranslateAnimSpriteToTargetMonLocation,
|
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const struct SpriteTemplate gMetalSoundSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_METAL_SOUND_WAVES,
|
|
|
|
.paletteTag = ANIM_TAG_METAL_SOUND_WAVES,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineDouble_ObjNormal_32x64,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2019-10-20 10:47:56 +02:00
|
|
|
.affineAnims = gGrowingRingAffineAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.callback = TranslateAnimSpriteToTargetMonLocation,
|
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const struct SpriteTemplate gWaterPulseRingSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_BLUE_RING_2,
|
|
|
|
.paletteTag = ANIM_TAG_BLUE_RING_2,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineDouble_ObjNormal_16x32,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2019-10-20 10:47:56 +02:00
|
|
|
.affineAnims = gWaterPulseRingAffineAnimTable,
|
|
|
|
.callback = AnimWaterPulseRing,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const struct SpriteTemplate gEggThrowSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_LARGE_FRESH_EGG,
|
|
|
|
.paletteTag = ANIM_TAG_LARGE_FRESH_EGG,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_16x16,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 10:47:56 +02:00
|
|
|
.callback = AnimThrowProjectile,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
// Unused
|
2018-12-18 04:56:34 +01:00
|
|
|
const struct SpriteTemplate gUnknown_085934A0 =
|
|
|
|
{
|
2019-04-06 16:32:02 +02:00
|
|
|
.tileTag = ANIM_TAG_VOID_LINES,
|
|
|
|
.paletteTag = ANIM_TAG_VOID_LINES,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjBlend_64x64,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
|
|
|
.callback = sub_8103FE8,
|
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const union AnimCmd gCoinAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(8, 1),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const union AnimCmd *const gCoinAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 10:47:56 +02:00
|
|
|
gCoinAnimCmds,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const union AffineAnimCmd gFallingCoinAffineAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x0, 0x0, 10, 1),
|
|
|
|
AFFINEANIMCMD_JUMP(0),
|
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const union AffineAnimCmd *const gFallingCoinAffineAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 10:47:56 +02:00
|
|
|
gFallingCoinAffineAnimCmds,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const struct SpriteTemplate gCoinThrowSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_COIN,
|
|
|
|
.paletteTag = ANIM_TAG_COIN,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineNormal_ObjNormal_16x16,
|
2019-10-20 10:47:56 +02:00
|
|
|
.anims = gCoinAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 10:47:56 +02:00
|
|
|
.callback = AnimCoinThrow,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const struct SpriteTemplate gFallingCoinSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_COIN,
|
|
|
|
.paletteTag = ANIM_TAG_COIN,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineNormal_ObjNormal_16x16,
|
2019-10-20 10:47:56 +02:00
|
|
|
.anims = gCoinAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.images = NULL,
|
2019-10-20 10:47:56 +02:00
|
|
|
.affineAnims = gFallingCoinAffineAnimTable,
|
|
|
|
.callback = AnimFallingCoin,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const union AffineAnimCmd gBulletSeedAffineAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x0, 0x0, 20, 1),
|
|
|
|
AFFINEANIMCMD_JUMP(0),
|
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const union AffineAnimCmd *const gBulletSeedAffineAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 10:47:56 +02:00
|
|
|
gBulletSeedAffineAnimCmds,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const struct SpriteTemplate gBulletSeedSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_SEED,
|
|
|
|
.paletteTag = ANIM_TAG_SEED,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineNormal_ObjNormal_16x16,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2019-10-20 10:47:56 +02:00
|
|
|
.affineAnims = gBulletSeedAffineAnimTable,
|
|
|
|
.callback = AnimBulletSeed,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const union AffineAnimCmd gRazorWindTornadoAffineAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x10, 0x100, 0, 0),
|
|
|
|
AFFINEANIMCMD_FRAME(0x4, 0x0, 0, 40),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
const union AffineAnimCmd *const gRazorWindTornadoAffineAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 10:47:56 +02:00
|
|
|
gRazorWindTornadoAffineAnimCmds,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
const struct SpriteTemplate gRazorWindTornadoSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_GUST,
|
|
|
|
.paletteTag = ANIM_TAG_GUST,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineNormal_ObjNormal_32x64,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2019-10-20 10:47:56 +02:00
|
|
|
.affineAnims = gRazorWindTornadoAffineAnimTable,
|
2019-10-20 11:01:12 +02:00
|
|
|
.callback = AnimRazorWindTornado,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
const union AnimCmd gViceGripAnimCmds1[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(0, 3),
|
|
|
|
ANIMCMD_FRAME(16, 3),
|
|
|
|
ANIMCMD_FRAME(32, 20),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
const union AnimCmd gViceGripAnimCmds2[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(0, 3, .vFlip = TRUE, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(16, 3, .vFlip = TRUE, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(32, 20, .vFlip = TRUE, .hFlip = TRUE),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
const union AnimCmd *const gViceGripAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 11:01:12 +02:00
|
|
|
gViceGripAnimCmds1,
|
|
|
|
gViceGripAnimCmds2,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
const struct SpriteTemplate gViceGripSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_CUT,
|
|
|
|
.paletteTag = ANIM_TAG_CUT,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjBlend_32x32,
|
2019-10-20 11:01:12 +02:00
|
|
|
.anims = gViceGripAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 11:01:12 +02:00
|
|
|
.callback = AnimViceGripPincer,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
const union AnimCmd gGuillotineAnimCmds1[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(0, 2),
|
|
|
|
ANIMCMD_FRAME(16, 2),
|
|
|
|
ANIMCMD_FRAME(32, 1),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
const union AnimCmd gGuillotineAnimCmds2[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(0, 2, .vFlip = TRUE, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(16, 2, .vFlip = TRUE, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(32, 1, .vFlip = TRUE, .hFlip = TRUE),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
const union AnimCmd *const gGuillotineAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 11:01:12 +02:00
|
|
|
gGuillotineAnimCmds1,
|
|
|
|
gGuillotineAnimCmds2,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
const struct SpriteTemplate gGuillotineSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_CUT,
|
|
|
|
.paletteTag = ANIM_TAG_CUT,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjBlend_32x32,
|
2019-10-20 11:01:12 +02:00
|
|
|
.anims = gGuillotineAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 11:01:12 +02:00
|
|
|
.callback = AnimGuillotinePincer,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
const union AffineAnimCmd gSplashEffectAffineAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(-6, 4, 0, 8),
|
|
|
|
AFFINEANIMCMD_FRAME(10, -10, 0, 8),
|
|
|
|
AFFINEANIMCMD_FRAME(-4, 6, 0, 8),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
const union AffineAnimCmd gGrowAndShrinkAffineAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(-4, -5, 0, 12),
|
|
|
|
AFFINEANIMCMD_FRAME(0, 0, 0, 24),
|
|
|
|
AFFINEANIMCMD_FRAME(4, 5, 0, 12),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
const union AnimCmd gBreathPuffAnimCmds1[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(0, 4, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(4, 40, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(8, 4, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(12, 4, .hFlip = TRUE),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
const union AnimCmd gBreathPuffAnimCmds2[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(0, 4),
|
|
|
|
ANIMCMD_FRAME(4, 40),
|
|
|
|
ANIMCMD_FRAME(8, 4),
|
|
|
|
ANIMCMD_FRAME(12, 4),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
const union AnimCmd *const gBreathPuffAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 11:01:12 +02:00
|
|
|
gBreathPuffAnimCmds1,
|
|
|
|
gBreathPuffAnimCmds2,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
const struct SpriteTemplate gBreathPuffSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_BREATH,
|
|
|
|
.paletteTag = ANIM_TAG_BREATH,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_16x16,
|
2019-10-20 11:01:12 +02:00
|
|
|
.anims = gBreathPuffAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 11:01:12 +02:00
|
|
|
.callback = AnimBreathPuff,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
const union AffineAnimCmd gAngerMarkAffineAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0xB, 0xB, 0, 8),
|
|
|
|
AFFINEANIMCMD_FRAME(0xFFF5, 0xFFF5, 0, 8),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
const union AffineAnimCmd *const gAngerMarkAffineAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 11:01:12 +02:00
|
|
|
gAngerMarkAffineAnimCmds,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
const struct SpriteTemplate gAngerMarkSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_ANGER,
|
|
|
|
.paletteTag = ANIM_TAG_ANGER,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineNormal_ObjNormal_16x16,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2019-10-20 11:01:12 +02:00
|
|
|
.affineAnims = gAngerMarkAffineAnimTable,
|
|
|
|
.callback = AnimAngerMark,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
const union AffineAnimCmd gThrashMoveMonAffineAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(-10, 9, 0, 7),
|
|
|
|
AFFINEANIMCMD_FRAME(20, -20, 0, 7),
|
|
|
|
AFFINEANIMCMD_FRAME(-20, 20, 0, 7),
|
|
|
|
AFFINEANIMCMD_FRAME(10, -9, 0, 7),
|
|
|
|
AFFINEANIMCMD_LOOP(2),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
const struct SpriteTemplate gPencilSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_PENCIL,
|
|
|
|
.paletteTag = ANIM_TAG_PENCIL,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_32x32,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 11:01:12 +02:00
|
|
|
.callback = AnimPencil,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
const struct SpriteTemplate gSnoreZSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_SNORE_Z,
|
|
|
|
.paletteTag = ANIM_TAG_SNORE_Z,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_32x32,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 11:01:12 +02:00
|
|
|
.callback = AnimSnoreZ,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
const union AnimCmd gExplosionAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(0, 5),
|
|
|
|
ANIMCMD_FRAME(16, 5),
|
|
|
|
ANIMCMD_FRAME(32, 5),
|
|
|
|
ANIMCMD_FRAME(48, 5),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
const union AnimCmd *const gExplosionAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 11:01:12 +02:00
|
|
|
gExplosionAnimCmds,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
2019-10-20 11:01:12 +02:00
|
|
|
|
|
|
|
const struct SpriteTemplate gExplosionSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_EXPLOSION,
|
|
|
|
.paletteTag = ANIM_TAG_EXPLOSION,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_32x32,
|
2019-10-20 11:01:12 +02:00
|
|
|
.anims = gExplosionAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-14 21:05:40 +02:00
|
|
|
.callback = AnimSparklingParticle,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
const union AffineAnimCmd gSoftBoiledEggAffineAnimCmds1[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x0, 0x0, -8, 2),
|
|
|
|
AFFINEANIMCMD_FRAME(0x0, 0x0, 8, 4),
|
|
|
|
AFFINEANIMCMD_FRAME(0x0, 0x0, -8, 2),
|
|
|
|
AFFINEANIMCMD_JUMP(0),
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
const union AffineAnimCmd gSoftBoiledEggAffineAnimCmds2[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
const union AffineAnimCmd gSoftBoiledEggAffineAnimCmds3[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0xFFF8, 0x4, 0, 8),
|
|
|
|
AFFINEANIMCMD_LOOP(0),
|
|
|
|
AFFINEANIMCMD_FRAME(0x10, 0xFFF8, 0, 8),
|
|
|
|
AFFINEANIMCMD_FRAME(0xFFF0, 0x8, 0, 8),
|
|
|
|
AFFINEANIMCMD_LOOP(1),
|
|
|
|
AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0),
|
|
|
|
AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 15),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
const union AffineAnimCmd *const gSoftBoiledEggAffineAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 11:16:45 +02:00
|
|
|
gSoftBoiledEggAffineAnimCmds1,
|
|
|
|
gSoftBoiledEggAffineAnimCmds2,
|
|
|
|
gSoftBoiledEggAffineAnimCmds3,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
2019-10-20 11:16:45 +02:00
|
|
|
|
|
|
|
const struct SpriteTemplate gSoftBoiledEggSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_BREAKING_EGG,
|
|
|
|
.paletteTag = ANIM_TAG_BREAKING_EGG,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineDouble_ObjBlend_32x32,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2019-10-20 11:16:45 +02:00
|
|
|
.affineAnims = gSoftBoiledEggAffineAnimTable,
|
|
|
|
.callback = AnimSoftBoiledEgg,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
const union AffineAnimCmd gThingRingExpandingAffineAnimCmds1[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x10, 0x10, 0, 0),
|
|
|
|
AFFINEANIMCMD_FRAME(0x10, 0x10, 0, 30),
|
|
|
|
AFFINEANIMCMD_END_ALT(1),
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
const union AffineAnimCmd gThingRingExpandingAffineAnimCmds2[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x10, 0x10, 0, 0),
|
|
|
|
AFFINEANIMCMD_FRAME(0x20, 0x20, 0, 15),
|
|
|
|
AFFINEANIMCMD_END_ALT(1),
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
const union AffineAnimCmd gHyperVoiceRingAffineAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x10, 0x10, 0, 0),
|
|
|
|
AFFINEANIMCMD_FRAME(0xB, 0xB, 0, 45),
|
|
|
|
AFFINEANIMCMD_END_ALT(1),
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
const union AffineAnimCmd *const gThingRingExpandingAffineAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 11:16:45 +02:00
|
|
|
gThingRingExpandingAffineAnimCmds1,
|
|
|
|
gThingRingExpandingAffineAnimCmds2,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
const union AffineAnimCmd *const gHyperVoiceRingAffineAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 11:16:45 +02:00
|
|
|
gHyperVoiceRingAffineAnimCmds,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
const struct SpriteTemplate gThinRingExpandingSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_THIN_RING,
|
|
|
|
.paletteTag = ANIM_TAG_THIN_RING,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineDouble_ObjNormal_64x64,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2019-10-20 11:16:45 +02:00
|
|
|
.affineAnims = gThingRingExpandingAffineAnimTable,
|
2019-10-14 21:05:40 +02:00
|
|
|
.callback = AnimSparklingParticle,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
2019-10-20 11:16:45 +02:00
|
|
|
|
|
|
|
const union AffineAnimCmd gThingRingShrinkingAffineAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x200, 0x200, 0, 0),
|
|
|
|
AFFINEANIMCMD_FRAME(0xFFF0, 0xFFF0, 0, 30),
|
|
|
|
AFFINEANIMCMD_END_ALT(1),
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
const union AffineAnimCmd *const gThingRingShrinkingAffineAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 11:16:45 +02:00
|
|
|
gThingRingShrinkingAffineAnimCmds,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
const struct SpriteTemplate gThingRingShrinkingSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_THIN_RING,
|
|
|
|
.paletteTag = ANIM_TAG_THIN_RING,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineDouble_ObjBlend_64x64,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2019-10-20 11:16:45 +02:00
|
|
|
.affineAnims = gThingRingShrinkingAffineAnimTable,
|
2019-10-14 21:05:40 +02:00
|
|
|
.callback = AnimSparklingParticle,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
const struct SpriteTemplate gBlendThinRingExpandingSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_THIN_RING,
|
|
|
|
.paletteTag = ANIM_TAG_THIN_RING,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineDouble_ObjBlend_64x64,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2019-10-20 11:16:45 +02:00
|
|
|
.affineAnims = gThingRingExpandingAffineAnimTable,
|
|
|
|
.callback = AnimBlendThinRing,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
const struct SpriteTemplate gHyperVoiceRingSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_THIN_RING,
|
|
|
|
.paletteTag = ANIM_TAG_THIN_RING,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineDouble_ObjBlend_64x64,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2019-10-20 11:16:45 +02:00
|
|
|
.affineAnims = gHyperVoiceRingAffineAnimTable,
|
|
|
|
.callback = AnimHyperVoiceRing,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
const struct SpriteTemplate gUproarRingSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_THIN_RING,
|
|
|
|
.paletteTag = ANIM_TAG_THIN_RING,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineDouble_ObjBlend_64x64,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2019-10-20 11:16:45 +02:00
|
|
|
.affineAnims = gThingRingExpandingAffineAnimTable,
|
|
|
|
.callback = AnimUproarRing,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const union AffineAnimCmd gStretchAttackerAffineAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(96, -13, 0, 8),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
const union AnimCmd gSpeedDustAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(0, 3),
|
|
|
|
ANIMCMD_FRAME(4, 3),
|
|
|
|
ANIMCMD_FRAME(8, 3),
|
|
|
|
ANIMCMD_FRAME(4, 3),
|
|
|
|
ANIMCMD_FRAME(0, 3),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
const union AnimCmd *const gSpeedDustAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 11:16:45 +02:00
|
|
|
gSpeedDustAnimCmds,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
const struct SpriteTemplate gSpeedDustSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_SPEED_DUST,
|
|
|
|
.paletteTag = ANIM_TAG_SPEED_DUST,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_16x16,
|
2019-10-20 11:16:45 +02:00
|
|
|
.anims = gSpeedDustAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 11:16:45 +02:00
|
|
|
.callback = AnimSpeedDust,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const s8 gSpeedDustPosTable[][2] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
{30, 28},
|
|
|
|
{-20, 24},
|
|
|
|
{16, 26},
|
|
|
|
{-10, 28},
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const union AnimCmd gBellAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(0, 6),
|
|
|
|
ANIMCMD_FRAME(16, 6),
|
|
|
|
ANIMCMD_FRAME(32, 15),
|
|
|
|
ANIMCMD_FRAME(16, 6),
|
|
|
|
ANIMCMD_FRAME(0, 6),
|
|
|
|
ANIMCMD_FRAME(16, 6, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(32, 15, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(16, 6, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(0, 6),
|
|
|
|
ANIMCMD_FRAME(16, 6),
|
|
|
|
ANIMCMD_FRAME(32, 15),
|
|
|
|
ANIMCMD_FRAME(16, 6),
|
|
|
|
ANIMCMD_FRAME(0, 6),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const union AnimCmd *const gBellAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 11:55:02 +02:00
|
|
|
gBellAnimCmds,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const struct SpriteTemplate gBellSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_BELL,
|
|
|
|
.paletteTag = ANIM_TAG_BELL,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_32x32,
|
2019-10-20 11:55:02 +02:00
|
|
|
.anims = gBellAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-14 21:05:40 +02:00
|
|
|
.callback = AnimSparklingParticle,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const u16 gMusicNotePaletteTagsTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
ANIM_TAG_MUSIC_NOTES_2,
|
|
|
|
ANIM_SPRITES_START - 1,
|
|
|
|
ANIM_SPRITES_START - 2,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const struct SpriteTemplate gHealBellMusicNoteSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_MUSIC_NOTES_2,
|
|
|
|
.paletteTag = ANIM_TAG_MUSIC_NOTES_2,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_16x16,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 11:55:02 +02:00
|
|
|
.callback = AnimHealBellMusicNote,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-04-02 08:36:22 +02:00
|
|
|
const struct SpriteTemplate gMagentaHeartSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_MAGENTA_HEART,
|
|
|
|
.paletteTag = ANIM_TAG_MAGENTA_HEART,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_16x16,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 11:55:02 +02:00
|
|
|
.callback = AnimMagentaHeart,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
const union AffineAnimCmd gUnknown_08593988[] =
|
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x000A, 0xFFF3, 0x00, 0x0A),
|
|
|
|
AFFINEANIMCMD_FRAME(0xFFF6, 0x000D, 0x00, 0x0A),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const struct SpriteTemplate gRedHeartProjectileSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_RED_HEART,
|
|
|
|
.paletteTag = ANIM_TAG_RED_HEART,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_16x16,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 11:55:02 +02:00
|
|
|
.callback = AnimRedHeartProjectile,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const struct SpriteTemplate gRedHeartBurstSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_RED_HEART,
|
|
|
|
.paletteTag = ANIM_TAG_RED_HEART,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_16x16,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 11:55:02 +02:00
|
|
|
.callback = AnimParticuleBurst,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const struct SpriteTemplate gRedHeartRisingSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_RED_HEART,
|
|
|
|
.paletteTag = ANIM_TAG_RED_HEART,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_16x16,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 11:55:02 +02:00
|
|
|
.callback = AnimRedHeartRising,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const union AffineAnimCmd gHiddenPowerOrbAffineAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0),
|
|
|
|
AFFINEANIMCMD_FRAME(0x8, 0x8, 0, 1),
|
|
|
|
AFFINEANIMCMD_JUMP(1),
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const union AffineAnimCmd *const gHiddenPowerOrbAffineAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 11:55:02 +02:00
|
|
|
gHiddenPowerOrbAffineAnimCmds,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
const struct SpriteTemplate gHiddenPowerOrbSpriteTemplate =
|
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_RED_ORB,
|
|
|
|
.paletteTag = ANIM_TAG_RED_ORB,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineNormal_ObjNormal_16x16,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2019-10-20 11:55:02 +02:00
|
|
|
.affineAnims = gHiddenPowerOrbAffineAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.callback = AnimOrbitFast,
|
|
|
|
};
|
|
|
|
|
|
|
|
const struct SpriteTemplate gHiddenPowerOrbScatterSpriteTemplate =
|
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_RED_ORB,
|
|
|
|
.paletteTag = ANIM_TAG_RED_ORB,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineDouble_ObjNormal_16x16,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2019-10-20 11:55:02 +02:00
|
|
|
.affineAnims = gHiddenPowerOrbAffineAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.callback = AnimOrbitScatter,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const union AffineAnimCmd gSpitUpOrbAffineAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0),
|
|
|
|
AFFINEANIMCMD_FRAME(0x8, 0x8, 0, 1),
|
|
|
|
AFFINEANIMCMD_JUMP(1),
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const union AffineAnimCmd *const gSpitUpOrbAffineAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 11:55:02 +02:00
|
|
|
gSpitUpOrbAffineAnimCmds,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const struct SpriteTemplate gSpitUpOrbSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_RED_ORB_2,
|
|
|
|
.paletteTag = ANIM_TAG_RED_ORB_2,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineDouble_ObjNormal_8x8,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2019-10-20 11:55:02 +02:00
|
|
|
.affineAnims = gSpitUpOrbAffineAnimTable,
|
|
|
|
.callback = AnimSpitUpOrb,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const union AnimCmd gEyeSparkleAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(0, 4),
|
|
|
|
ANIMCMD_FRAME(4, 4),
|
|
|
|
ANIMCMD_FRAME(8, 4),
|
|
|
|
ANIMCMD_FRAME(4, 4),
|
|
|
|
ANIMCMD_FRAME(0, 4),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const union AnimCmd *const gEyeSparkleAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 11:55:02 +02:00
|
|
|
gEyeSparkleAnimCmds,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const struct SpriteTemplate gEyeSparkleSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_EYE_SPARKLE,
|
|
|
|
.paletteTag = ANIM_TAG_EYE_SPARKLE,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_16x16,
|
2019-10-20 11:55:02 +02:00
|
|
|
.anims = gEyeSparkleAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 11:55:02 +02:00
|
|
|
.callback = AnimEyeSparkle,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const union AnimCmd gAngelSpriteAnimCmds[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(0, 24),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const union AnimCmd *const gAngelSpriteAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 11:55:02 +02:00
|
|
|
gAngelSpriteAnimCmds,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const struct SpriteTemplate gAngelSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_ANGEL,
|
|
|
|
.paletteTag = ANIM_TAG_ANGEL,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_32x32,
|
2019-10-20 11:55:02 +02:00
|
|
|
.anims = gAngelSpriteAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 11:55:02 +02:00
|
|
|
.callback = AnimAngel,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const struct SpriteTemplate gPinkHeartSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_PINK_HEART,
|
|
|
|
.paletteTag = ANIM_TAG_PINK_HEART,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_16x16,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 11:55:02 +02:00
|
|
|
.callback = AnimPinkHeart,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const union AnimCmd gDevilAnimCmds1[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(0, 3),
|
|
|
|
ANIMCMD_JUMP(0),
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const union AnimCmd gDevilAnimCmds2[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(16, 3),
|
|
|
|
ANIMCMD_JUMP(0),
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const union AnimCmd *const gDevilAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 11:55:02 +02:00
|
|
|
gDevilAnimCmds1,
|
|
|
|
gDevilAnimCmds2,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const struct SpriteTemplate gDevilSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_DEVIL,
|
|
|
|
.paletteTag = ANIM_TAG_DEVIL,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_32x32,
|
2019-10-20 11:55:02 +02:00
|
|
|
.anims = gDevilAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 11:55:02 +02:00
|
|
|
.callback = AnimDevil,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
const union AnimCmd gUnknown_08593B08[] =
|
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(0, 4),
|
|
|
|
ANIMCMD_FRAME(16, 4),
|
|
|
|
ANIMCMD_FRAME(32, 4),
|
|
|
|
ANIMCMD_FRAME(48, 4),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
|
|
|
const union AnimCmd gUnknown_08593B1C[] =
|
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(0, 4, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(16, 4, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(32, 4, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(48, 4, .hFlip = TRUE),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const union AnimCmd *const gFurySwipesAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
gUnknown_08593B08,
|
|
|
|
gUnknown_08593B1C,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const struct SpriteTemplate gFurySwipesSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_SWIPE,
|
|
|
|
.paletteTag = ANIM_TAG_SWIPE,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_32x32,
|
2019-10-20 11:55:02 +02:00
|
|
|
.anims = gFurySwipesAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 11:55:02 +02:00
|
|
|
.callback = AnimFurySwipes,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const union AnimCmd gMovementWavesAnimCmds1[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(0, 8),
|
|
|
|
ANIMCMD_FRAME(16, 8),
|
|
|
|
ANIMCMD_FRAME(32, 8),
|
|
|
|
ANIMCMD_FRAME(16, 8),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const union AnimCmd gMovementWavesAnimCmds2[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(16, 8, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(32, 8, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(16, 8, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(0, 8, .hFlip = TRUE),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const union AnimCmd *const gMovementWavesAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 11:55:02 +02:00
|
|
|
gMovementWavesAnimCmds1,
|
|
|
|
gMovementWavesAnimCmds2,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
const struct SpriteTemplate gMovmentWavesSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_MOVEMENT_WAVES,
|
|
|
|
.paletteTag = ANIM_TAG_MOVEMENT_WAVES,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_32x32,
|
2019-10-20 11:55:02 +02:00
|
|
|
.anims = gMovementWavesAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 11:55:02 +02:00
|
|
|
.callback = AnimMovmentWaves,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
const union AffineAnimCmd gUnknown_08593B98[] =
|
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(-12, 8, 0, 4),
|
|
|
|
AFFINEANIMCMD_FRAME(20, -20, 0, 4),
|
|
|
|
AFFINEANIMCMD_FRAME(-8, 12, 0, 4),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
const struct SpriteTemplate gJaggedMusicNoteSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_JAGGED_MUSIC_NOTE,
|
|
|
|
.paletteTag = ANIM_TAG_JAGGED_MUSIC_NOTE,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_32x32,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2019-10-20 15:54:16 +02:00
|
|
|
.callback = AnimJaggedMusicNote,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
const union AffineAnimCmd gPerishSongMusicNoteAffineAnimCmds1[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 5),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
const union AffineAnimCmd gPerishSongMusicNoteAffineAnimCmds2[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x0, 0x0, -8, 16),
|
|
|
|
AFFINEANIMCMD_END_ALT(1),
|
|
|
|
};
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
const union AffineAnimCmd gPerishSongMusicNoteAffineAnimCmds3[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x0, 0x0, 8, 16),
|
|
|
|
AFFINEANIMCMD_END_ALT(1),
|
|
|
|
};
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
const union AffineAnimCmd *const gPerishSongMusicNoteAffineAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 15:54:16 +02:00
|
|
|
gPerishSongMusicNoteAffineAnimCmds1,
|
|
|
|
gPerishSongMusicNoteAffineAnimCmds2,
|
|
|
|
gPerishSongMusicNoteAffineAnimCmds3,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-14 21:05:40 +02:00
|
|
|
extern const union AnimCmd *const gMusicNotesAnimTable[];
|
2019-10-20 15:54:16 +02:00
|
|
|
const struct SpriteTemplate gPerishSongMusicNoteSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_MUSIC_NOTES_2,
|
|
|
|
.paletteTag = ANIM_TAG_MUSIC_NOTES_2,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineNormal_ObjNormal_16x16,
|
2019-10-14 21:05:40 +02:00
|
|
|
.anims = gMusicNotesAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.images = NULL,
|
2019-10-20 15:54:16 +02:00
|
|
|
.affineAnims = gPerishSongMusicNoteAffineAnimTable,
|
|
|
|
.callback = AnimPerishSongMusicNote,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
const struct SpriteTemplate gPerishSongMusicNote2SpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_MUSIC_NOTES_2,
|
|
|
|
.paletteTag = ANIM_TAG_MUSIC_NOTES_2,
|
2019-10-16 19:26:08 +02:00
|
|
|
.oam = &gOamData_AffineNormal_ObjNormal_16x16,
|
2019-10-14 21:05:40 +02:00
|
|
|
.anims = gMusicNotesAnimTable,
|
2018-12-18 04:56:34 +01:00
|
|
|
.images = NULL,
|
2019-10-20 15:54:16 +02:00
|
|
|
.affineAnims = gPerishSongMusicNoteAffineAnimTable,
|
|
|
|
.callback = AnimPerishSongMusicNote2,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
const union AffineAnimCmd gGuardRingAffineAnimCmds1[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
const union AffineAnimCmd gGuardRingAffineAnimCmds2[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x200, 0x100, 0, 0),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
const union AffineAnimCmd *const gGuardRingAffineAnimTable[] =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-10-20 15:54:16 +02:00
|
|
|
gGuardRingAffineAnimCmds1,
|
|
|
|
gGuardRingAffineAnimCmds2,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
const struct SpriteTemplate gGuardRingSpriteTemplate =
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_GUARD_RING,
|
|
|
|
.paletteTag = ANIM_TAG_GUARD_RING,
|
2019-10-16 19:32:02 +02:00
|
|
|
.oam = &gOamData_AffineDouble_ObjBlend_64x32,
|
2018-12-18 04:56:34 +01:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2019-10-20 15:54:16 +02:00
|
|
|
.affineAnims = gGuardRingAffineAnimTable,
|
|
|
|
.callback = AnimGuardRing,
|
2018-12-18 04:56:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
void sub_8103448(struct Sprite *sprite)
|
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
SetSpriteCoordsToAnimAttackerCoords(sprite);
|
2018-12-20 04:13:26 +01:00
|
|
|
SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]);
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->pos1.y += gBattleAnimArgs[1];
|
|
|
|
sprite->data[1] = gBattleAnimArgs[2];
|
|
|
|
sprite->data[2] = gBattleAnimArgs[4];
|
|
|
|
sprite->data[3] = gBattleAnimArgs[5];
|
|
|
|
sprite->data[4] = gBattleAnimArgs[3];
|
2018-12-18 05:08:08 +01:00
|
|
|
StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
|
2019-02-06 20:17:09 +01:00
|
|
|
sprite->callback = TranslateSpriteInEllipseOverDuration;
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->callback(sprite);
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_8103498(struct Sprite *sprite)
|
|
|
|
{
|
|
|
|
u8 battler;
|
|
|
|
if (gBattleAnimArgs[0] == 0)
|
|
|
|
battler = gBattleAnimAttacker;
|
|
|
|
else
|
|
|
|
battler = gBattleAnimTarget;
|
|
|
|
|
2019-10-14 22:51:45 +02:00
|
|
|
SetSpriteNextToMonHead(battler, sprite);
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->data[0] = 0;
|
|
|
|
sprite->data[1] = 0;
|
|
|
|
sprite->callback = sub_81034D8;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_81034D8(struct Sprite *sprite)
|
|
|
|
{
|
|
|
|
switch (sprite->data[0])
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sprite->pos2.y -= 3;
|
|
|
|
if (++sprite->data[1] == 6)
|
|
|
|
sprite->data[0]++;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
sprite->pos2.y += 3;
|
|
|
|
if (--sprite->data[1] == 0)
|
|
|
|
sprite->data[0]++;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (++sprite->data[1] == 64)
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_810353C(struct Sprite *sprite)
|
|
|
|
{
|
|
|
|
s16 temp;
|
|
|
|
gSprites[sprite->data[2]].pos2.x += sprite->data[1];
|
|
|
|
temp = sprite->data[1];
|
|
|
|
sprite->data[1] = -temp;
|
|
|
|
if (sprite->data[0] == 0)
|
|
|
|
{
|
|
|
|
gSprites[sprite->data[2]].pos2.x = 0;
|
2018-12-18 05:08:08 +01:00
|
|
|
DestroySpriteAndMatrix(sprite);
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
sprite->data[0]--;
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_810358C(struct Sprite *sprite)
|
|
|
|
{
|
|
|
|
u8 spriteId;
|
|
|
|
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
|
|
|
|
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
|
|
|
|
spriteId = gBattlerSpriteIds[gBattleAnimTarget];
|
|
|
|
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
|
|
|
sprite->pos1.x -= gBattleAnimArgs[0];
|
|
|
|
else
|
|
|
|
sprite->pos1.x += gBattleAnimArgs[0];
|
|
|
|
|
|
|
|
sprite->pos1.y += gBattleAnimArgs[1];
|
|
|
|
sprite->data[0] = gBattleAnimArgs[2];
|
|
|
|
sprite->data[1] = gBattleAnimArgs[3];
|
|
|
|
sprite->data[2] = spriteId;
|
|
|
|
sprite->callback = sub_810353C;
|
|
|
|
sprite->invisible = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_8103620(struct Sprite *sprite)
|
|
|
|
{
|
2018-12-20 04:13:26 +01:00
|
|
|
InitSpritePosToAnimAttacker(sprite, TRUE);
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->data[0] = gBattleAnimArgs[2];
|
|
|
|
sprite->data[1] = gBattleAnimArgs[3];
|
|
|
|
sprite->data[5] = gBattleAnimArgs[4];
|
|
|
|
sprite->callback = WaitAnimForDuration;
|
|
|
|
StoreSpriteCallbackInData6(sprite, sub_8103658);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_8103658(struct Sprite *sprite)
|
|
|
|
{
|
|
|
|
sprite->data[0] = sprite->data[1];
|
|
|
|
sprite->data[2] = sprite->pos1.x;
|
|
|
|
sprite->data[4] = sprite->pos1.y + 15;
|
|
|
|
sprite->callback = StartAnimLinearTranslation;
|
|
|
|
StoreSpriteCallbackInData6(sprite, sub_8103680);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_8103680(struct Sprite *sprite)
|
|
|
|
{
|
|
|
|
if (sprite->data[5] == 0)
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
else
|
|
|
|
sprite->data[5]--;
|
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
// Rotates the attacking mon sprite downwards and then back upwards to its original position.
|
|
|
|
// No args.
|
|
|
|
void AnimTask_Withdraw(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
PrepareBattlerSpriteForRotScale(gBattlerSpriteIds[gBattleAnimAttacker], ST_OAM_OBJ_NORMAL);
|
|
|
|
gTasks[taskId].func = AnimTask_WithdrawStep;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
static void AnimTask_WithdrawStep(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
u8 spriteId = gBattlerSpriteIds[gBattleAnimAttacker];
|
|
|
|
s16 rotation;
|
2018-12-18 05:08:08 +01:00
|
|
|
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
|
2018-12-18 04:56:34 +01:00
|
|
|
rotation = -gTasks[taskId].data[0];
|
|
|
|
else
|
|
|
|
rotation = gTasks[taskId].data[0];
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
SetSpriteRotScale(spriteId, 0x100, 0x100, rotation);
|
2018-12-18 04:56:34 +01:00
|
|
|
if (gTasks[taskId].data[1] == 0)
|
|
|
|
{
|
|
|
|
gTasks[taskId].data[0] += 0xB0;
|
2018-12-18 05:08:08 +01:00
|
|
|
// this y position update gets overwritten by SetBattlerSpriteYOffsetFromRotation()
|
2018-12-18 04:56:34 +01:00
|
|
|
gSprites[spriteId].pos2.y++;
|
|
|
|
}
|
|
|
|
else if (gTasks[taskId].data[1] == 1)
|
|
|
|
{
|
|
|
|
if (++gTasks[taskId].data[3] == 30)
|
|
|
|
gTasks[taskId].data[1] = 2;
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gTasks[taskId].data[0] -= 0xB0;
|
2018-12-18 05:08:08 +01:00
|
|
|
// this y position update gets overwritten by SetBattlerSpriteYOffsetFromRotation()
|
2018-12-18 04:56:34 +01:00
|
|
|
gSprites[spriteId].pos2.y--;
|
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
SetBattlerSpriteYOffsetFromRotation(spriteId);
|
2018-12-18 04:56:34 +01:00
|
|
|
if (gTasks[taskId].data[0] == 0xF20 || gTasks[taskId].data[0] == 0)
|
|
|
|
{
|
|
|
|
if (gTasks[taskId].data[1] == 2)
|
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
ResetSpriteRotScale(spriteId);
|
2018-12-18 04:56:34 +01:00
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gTasks[taskId].data[1]++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-01 00:08:37 +01:00
|
|
|
// Animates a "zap of energy" used in KINESIS.
|
2018-12-18 05:08:08 +01:00
|
|
|
// arg 0: x pixel offset
|
|
|
|
// arg 1: y pixel offset
|
|
|
|
// arg 2: vertical flip
|
|
|
|
void Anim_KinesisZapEnergy(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
SetSpriteCoordsToAnimAttackerCoords(sprite);
|
2018-12-18 04:56:34 +01:00
|
|
|
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
|
|
|
sprite->pos1.x -= gBattleAnimArgs[0];
|
|
|
|
else
|
|
|
|
sprite->pos1.x += gBattleAnimArgs[0];
|
|
|
|
|
|
|
|
sprite->pos1.y += gBattleAnimArgs[1];
|
|
|
|
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
|
|
|
{
|
|
|
|
sprite->hFlip = 1;
|
|
|
|
if (gBattleAnimArgs[2])
|
|
|
|
sprite->vFlip = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (gBattleAnimArgs[2])
|
|
|
|
sprite->vFlip = 1;
|
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
sprite->callback = RunStoredCallbackWhenAnimEnds;
|
2018-12-18 04:56:34 +01:00
|
|
|
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
|
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
// Animates a sword that rises into the air after a brief pause.
|
|
|
|
// arg 0: x pixel offset
|
|
|
|
// arg 1: y pixel offset
|
|
|
|
void Anim_SwordsDanceBlade(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2018-12-20 04:13:26 +01:00
|
|
|
InitSpritePosToAnimAttacker(sprite, FALSE);
|
2018-12-18 05:08:08 +01:00
|
|
|
sprite->callback = RunStoredCallbackWhenAffineAnimEnds;
|
2019-10-20 15:54:16 +02:00
|
|
|
StoreSpriteCallbackInData6(sprite, AnimSwordsDanceBladeStep);
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
static void AnimSwordsDanceBladeStep(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
sprite->data[0] = 6;
|
|
|
|
sprite->data[2] = sprite->pos1.x;
|
|
|
|
sprite->data[4] = sprite->pos1.y - 32;
|
|
|
|
sprite->callback = StartAnimLinearTranslation;
|
|
|
|
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Moves a projectile towards the target mon. The sprite is rotated to be pointing
|
|
|
|
// in the same direction it's moving.
|
|
|
|
// arg 0: initial x pixel offset
|
|
|
|
// arg 1: initial y pixel offset
|
|
|
|
// arg 2: target x pixel offset
|
|
|
|
// arg 3: target y pixel offset
|
|
|
|
// arg 4: duration
|
|
|
|
void AnimSonicBoomProjectile(struct Sprite *sprite)
|
|
|
|
{
|
|
|
|
s16 targetXPos;
|
|
|
|
s16 targetYPos;
|
|
|
|
u16 rotation;
|
|
|
|
|
|
|
|
if (IsContest())
|
|
|
|
{
|
|
|
|
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
|
|
|
|
}
|
2019-09-04 23:06:59 +02:00
|
|
|
else if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
|
|
|
|
gBattleAnimArgs[1] = -gBattleAnimArgs[1];
|
|
|
|
gBattleAnimArgs[3] = -gBattleAnimArgs[3];
|
|
|
|
}
|
|
|
|
|
2018-12-20 04:13:26 +01:00
|
|
|
InitSpritePosToAnimAttacker(sprite, TRUE);
|
2018-12-18 04:56:34 +01:00
|
|
|
targetXPos = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[2];
|
|
|
|
targetYPos = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3];
|
|
|
|
rotation = ArcTan2Neg(targetXPos - sprite->pos1.x, targetYPos - sprite->pos1.y);
|
|
|
|
rotation += 0xF000;
|
|
|
|
if (IsContest())
|
|
|
|
rotation -= 0x6000;
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
TrySetSpriteRotScale(sprite, FALSE, 0x100, 0x100, rotation);
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->data[0] = gBattleAnimArgs[4];
|
|
|
|
sprite->data[2] = targetXPos;
|
|
|
|
sprite->data[4] = targetYPos;
|
|
|
|
sprite->callback = StartAnimLinearTranslation;
|
|
|
|
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
|
|
|
|
}
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
static void AnimAirWaveProjectile_Step2(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
if (sprite->data[0]-- <= 0)
|
|
|
|
{
|
|
|
|
gTasks[sprite->data[7]].data[1]--;
|
|
|
|
DestroySprite(sprite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
static void AnimAirWaveProjectile_Step1(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[sprite->data[7]];
|
|
|
|
if (sprite->data[0] > task->data[5])
|
|
|
|
{
|
|
|
|
sprite->data[5] += sprite->data[3];
|
|
|
|
sprite->data[6] += sprite->data[4];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite->data[5] -= sprite->data[3];
|
|
|
|
sprite->data[6] -= sprite->data[4];
|
|
|
|
}
|
|
|
|
|
|
|
|
sprite->data[1] += sprite->data[5];
|
|
|
|
sprite->data[2] += sprite->data[6];
|
|
|
|
if (1 & task->data[7])
|
|
|
|
sprite->pos2.x = ((u16)sprite->data[1] >> 8) * -1;
|
|
|
|
else
|
|
|
|
sprite->pos2.x = (u16)sprite->data[1] >> 8;
|
|
|
|
|
|
|
|
if (1 & task->data[8])
|
|
|
|
sprite->pos2.y = ((u16)sprite->data[2] / 256u) * -1;
|
|
|
|
else
|
|
|
|
sprite->pos2.y = (u16)sprite->data[2] / 256u;
|
|
|
|
|
|
|
|
if (sprite->data[0]-- <= 0)
|
|
|
|
{
|
|
|
|
sprite->data[0] = 30;
|
2019-10-20 15:54:16 +02:00
|
|
|
sprite->callback = AnimAirWaveProjectile_Step2;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
void AnimAirWaveProjectile(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
s16 a;
|
|
|
|
s16 b;
|
|
|
|
s16 c;
|
|
|
|
|
|
|
|
struct Task* task = &gTasks[sprite->data[7]];
|
|
|
|
sprite->data[1] += (-2 & task->data[7]);
|
|
|
|
sprite->data[2] += (-2 & task->data[8]);
|
|
|
|
if (1 & task->data[7])
|
|
|
|
sprite->pos2.x = ((u16)sprite->data[1] >> 8) * -1;
|
|
|
|
else
|
|
|
|
sprite->pos2.x = (u16)sprite->data[1] >> 8;
|
|
|
|
|
|
|
|
if (1 & task->data[8])
|
|
|
|
sprite->pos2.y = ((u16)sprite->data[2] / 256u) * -1;
|
|
|
|
else
|
|
|
|
sprite->pos2.y = (u16)sprite->data[2] / 256u;
|
|
|
|
|
|
|
|
if (sprite->data[0]-- <= 0)
|
|
|
|
{
|
|
|
|
sprite->data[0] = 8;
|
|
|
|
task->data[5] = 4;
|
|
|
|
a = sub_8151624(0x1000);
|
|
|
|
sprite->pos1.x += sprite->pos2.x;
|
|
|
|
sprite->pos1.y += sprite->pos2.y;
|
|
|
|
sprite->pos2.y = 0;
|
|
|
|
sprite->pos2.x = 0;
|
|
|
|
if (task->data[11] >= sprite->pos1.x)
|
|
|
|
b = (task->data[11] - sprite->pos1.x) << 8;
|
|
|
|
else
|
|
|
|
b = (sprite->pos1.x - task->data[11]) << 8;
|
|
|
|
|
|
|
|
if (task->data[12] >= sprite->pos1.y)
|
|
|
|
c = (task->data[12] - sprite->pos1.y) << 8;
|
|
|
|
else
|
|
|
|
c = (sprite->pos1.y - task->data[12]) << 8;
|
|
|
|
|
|
|
|
sprite->data[2] = 0;
|
|
|
|
sprite->data[1] = 0;
|
|
|
|
sprite->data[6] = 0;
|
|
|
|
sprite->data[5] = 0;
|
|
|
|
sprite->data[3] = sub_8151534(sub_8151534(b, a), sub_8151624(0x1C0));
|
|
|
|
sprite->data[4] = sub_8151534(sub_8151534(c, a), sub_8151624(0x1C0));
|
2019-10-20 15:54:16 +02:00
|
|
|
sprite->callback = AnimAirWaveProjectile_Step1;
|
2019-03-01 00:08:37 +01:00
|
|
|
}
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
static void AirCutterProjectileStep2(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
if (gTasks[taskId].data[1] == 0)
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
static void AirCutterProjectileStep1(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
if (gTasks[taskId].data[0]-- <= 0)
|
|
|
|
{
|
|
|
|
u8 spriteId;
|
|
|
|
struct Sprite *sprite;
|
2019-10-20 10:47:56 +02:00
|
|
|
spriteId = CreateSprite(&gAirWaveProjectileSpriteTemplate, gTasks[taskId].data[9], gTasks[taskId].data[10], gTasks[taskId].data[2] - gTasks[taskId].data[1]);
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite = &gSprites[spriteId];
|
|
|
|
switch (gTasks[taskId].data[4])
|
|
|
|
{
|
|
|
|
case 1:
|
2019-08-10 18:09:06 +02:00
|
|
|
sprite->oam.matrixNum |= (ST_OAM_HFLIP | ST_OAM_VFLIP);
|
2018-12-18 04:56:34 +01:00
|
|
|
break;
|
|
|
|
case 2:
|
2019-08-10 18:09:06 +02:00
|
|
|
sprite->oam.matrixNum = ST_OAM_HFLIP;
|
2018-12-18 04:56:34 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
sprite->data[0] = gTasks[taskId].data[5] - gTasks[taskId].data[6];
|
|
|
|
sprite->data[7] = taskId;
|
|
|
|
gTasks[taskId].data[gTasks[taskId].data[1] + 13] = spriteId;
|
|
|
|
gTasks[taskId].data[0] = gTasks[taskId].data[3];
|
|
|
|
gTasks[taskId].data[1]++;
|
|
|
|
PlaySE12WithPanning(SE_W059B, BattleAnimAdjustPanning(-63));
|
|
|
|
if (gTasks[taskId].data[1] > 2)
|
2019-10-20 10:47:56 +02:00
|
|
|
gTasks[taskId].func = AirCutterProjectileStep2;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
void AnimTask_AirCutterProjectile(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
s16 attackerY = 0;
|
|
|
|
s16 attackerX = 0;
|
|
|
|
s16 targetX = 0;
|
|
|
|
s16 targetY = 0;
|
|
|
|
s16 xDiff, yDiff;
|
2018-12-18 04:56:34 +01:00
|
|
|
|
|
|
|
if (IsContest())
|
|
|
|
{
|
|
|
|
gTasks[taskId].data[4] = 2;
|
|
|
|
gBattleAnimArgs[0] = -gBattleAnimArgs[0];
|
|
|
|
if (gBattleAnimArgs[2] & 1)
|
|
|
|
gBattleAnimArgs[2] &= ~1;
|
|
|
|
else
|
|
|
|
gBattleAnimArgs[2] |= 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-09-04 23:45:04 +02:00
|
|
|
if ((gBattlerPositions[gBattleAnimTarget] & BIT_SIDE) == B_SIDE_PLAYER)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
gTasks[taskId].data[4] = 1;
|
|
|
|
gBattleAnimArgs[0] = -gBattleAnimArgs[0];
|
|
|
|
gBattleAnimArgs[1] = -gBattleAnimArgs[1];
|
|
|
|
if (gBattleAnimArgs[2] & 1)
|
|
|
|
gBattleAnimArgs[2] &= ~1;
|
|
|
|
else
|
|
|
|
gBattleAnimArgs[2] |= 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
attackerX = gTasks[taskId].data[9] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X);
|
|
|
|
attackerY = gTasks[taskId].data[10] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y);
|
2018-12-18 04:56:34 +01:00
|
|
|
if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
|
|
|
&& IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimTarget)))
|
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
SetAverageBattlerPositions(gBattleAnimTarget, 0, &targetX, &targetY);
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
targetX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X);
|
|
|
|
targetY = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y);
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
targetX = gTasks[taskId].data[11] = targetX + gBattleAnimArgs[0];
|
|
|
|
targetY = gTasks[taskId].data[12] = targetY + gBattleAnimArgs[1];
|
|
|
|
if (targetX >= attackerX)
|
|
|
|
xDiff = targetX - attackerX;
|
2018-12-18 04:56:34 +01:00
|
|
|
else
|
2018-12-18 05:08:08 +01:00
|
|
|
xDiff = attackerX - targetX;
|
2018-12-18 04:56:34 +01:00
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
gTasks[taskId].data[5] = sub_8151534(xDiff, sub_8151624(gBattleAnimArgs[2] & ~1));
|
2018-12-18 04:56:34 +01:00
|
|
|
gTasks[taskId].data[6] = sub_8151534(gTasks[taskId].data[5], 0x80);
|
|
|
|
gTasks[taskId].data[7] = gBattleAnimArgs[2];
|
2018-12-18 05:08:08 +01:00
|
|
|
if (targetY >= attackerY)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
yDiff = targetY - attackerY;
|
|
|
|
gTasks[taskId].data[8] = sub_8151534(yDiff, sub_8151624(gTasks[taskId].data[5])) & ~1;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
yDiff = attackerY - targetY;
|
|
|
|
gTasks[taskId].data[8] = sub_8151534(yDiff, sub_8151624(gTasks[taskId].data[5])) | 1;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
gTasks[taskId].data[3] = gBattleAnimArgs[3];
|
|
|
|
if (gBattleAnimArgs[4] & 0x80)
|
|
|
|
{
|
|
|
|
gBattleAnimArgs[4] ^= 0x80;
|
|
|
|
if (gBattleAnimArgs[4] >= 64)
|
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
u16 var = GetBattlerSpriteSubpriority(gBattleAnimTarget) + (gBattleAnimArgs[4] - 64);
|
2018-12-18 04:56:34 +01:00
|
|
|
gTasks[taskId].data[2] = var;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
u16 var = GetBattlerSpriteSubpriority(gBattleAnimTarget) - gBattleAnimArgs[4];
|
2018-12-18 04:56:34 +01:00
|
|
|
gTasks[taskId].data[2] = var;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (gBattleAnimArgs[4] >= 64)
|
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
u16 var = GetBattlerSpriteSubpriority(gBattleAnimTarget) + (gBattleAnimArgs[4] - 64);
|
2018-12-18 04:56:34 +01:00
|
|
|
gTasks[taskId].data[2] = var;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
u16 var = GetBattlerSpriteSubpriority(gBattleAnimTarget) - gBattleAnimArgs[4];
|
2018-12-18 04:56:34 +01:00
|
|
|
gTasks[taskId].data[2] = var;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gTasks[taskId].data[2] < 3)
|
|
|
|
gTasks[taskId].data[2] = 3;
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
gTasks[taskId].func = AirCutterProjectileStep1;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void sub_8103FE8(struct Sprite *sprite)
|
|
|
|
{
|
2018-12-20 04:13:26 +01:00
|
|
|
InitSpritePosToAnimAttacker(sprite, FALSE);
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->data[0] = 0x100 + (IndexOfSpritePaletteTag(gUnknown_085934A0.paletteTag) << 4);
|
|
|
|
sprite->callback = sub_8104018;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_8104018(struct Sprite *sprite)
|
|
|
|
{
|
2019-04-10 20:49:10 +02:00
|
|
|
u16 id, val;
|
2018-12-18 04:56:34 +01:00
|
|
|
int i;
|
2019-04-10 20:49:10 +02:00
|
|
|
|
2018-12-18 04:56:34 +01:00
|
|
|
if (++sprite->data[1] == 2)
|
|
|
|
{
|
|
|
|
sprite->data[1] = 0;
|
2019-04-10 20:49:10 +02:00
|
|
|
id = sprite->data[0];
|
|
|
|
val = gPlttBufferFaded[8 + id];
|
|
|
|
for (i = 8; i < 16; i++)
|
|
|
|
gPlttBufferFaded[i + id] = gPlttBufferFaded[i + id + 1];
|
|
|
|
|
|
|
|
gPlttBufferFaded[id + 15] = val;
|
2018-12-18 04:56:34 +01:00
|
|
|
|
|
|
|
if (++sprite->data[2] == 24)
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
void AnimCoinThrow(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
s16 r6;
|
|
|
|
s16 r7;
|
|
|
|
u16 var;
|
|
|
|
|
2018-12-20 04:13:26 +01:00
|
|
|
InitSpritePosToAnimAttacker(sprite, TRUE);
|
2018-12-18 04:56:34 +01:00
|
|
|
r6 = GetBattlerSpriteCoord(gBattleAnimTarget, 2);
|
|
|
|
r7 = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3];
|
|
|
|
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
|
|
|
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
|
|
|
|
|
|
|
|
r6 += gBattleAnimArgs[2];
|
|
|
|
var = ArcTan2Neg(r6 - sprite->pos1.x, r7 - sprite->pos1.y);
|
|
|
|
var += 0xC000;
|
2018-12-18 05:08:08 +01:00
|
|
|
TrySetSpriteRotScale(sprite, FALSE, 0x100, 0x100, var);
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->data[0] = gBattleAnimArgs[4];
|
|
|
|
sprite->data[2] = r6;
|
|
|
|
sprite->data[4] = r7;
|
|
|
|
sprite->callback = sub_80A7000;
|
|
|
|
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
|
|
|
|
}
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
void AnimFallingCoin(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
sprite->data[2] = -16;
|
|
|
|
sprite->pos1.y += 8;
|
2019-10-20 10:47:56 +02:00
|
|
|
sprite->callback = AnimFallingCoin_Step;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
static void AnimFallingCoin_Step(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
sprite->data[0] += 0x80;
|
|
|
|
sprite->pos2.x = sprite->data[0] >> 8;
|
|
|
|
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
|
|
|
|
sprite->pos2.x = -sprite->pos2.x;
|
|
|
|
|
|
|
|
sprite->pos2.y = Sin(sprite->data[1], sprite->data[2]);
|
|
|
|
sprite->data[1] += 5;
|
|
|
|
if (sprite->data[1] > 126)
|
|
|
|
{
|
|
|
|
sprite->data[1] = 0;
|
|
|
|
sprite->data[2] /= 2;
|
|
|
|
if (++sprite->data[3] == 2)
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
void AnimBulletSeed(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2018-12-20 04:13:26 +01:00
|
|
|
InitSpritePosToAnimAttacker(sprite, TRUE);
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->data[0] = 20;
|
2018-12-18 05:08:08 +01:00
|
|
|
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
|
|
|
|
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->callback = StartAnimLinearTranslation;
|
|
|
|
sprite->affineAnimPaused = 1;
|
2019-10-20 10:47:56 +02:00
|
|
|
StoreSpriteCallbackInData6(sprite, AnimBulletSeed_Step1);
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
static void AnimBulletSeed_Step1(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
u16 rand;
|
|
|
|
s16* ptr;
|
|
|
|
PlaySE12WithPanning(SE_W030, BattleAnimAdjustPanning(63));
|
|
|
|
sprite->pos1.x += sprite->pos2.x;
|
|
|
|
sprite->pos1.y += sprite->pos2.y;
|
|
|
|
sprite->pos2.y = 0;
|
|
|
|
sprite->pos2.x = 0;
|
|
|
|
ptr = &sprite->data[7];
|
|
|
|
for (i = 0; i < 8; i++)
|
|
|
|
ptr[i - 7] = 0;
|
|
|
|
|
|
|
|
rand = Random2();
|
|
|
|
sprite->data[6] = 0xFFF4 - (rand & 7);
|
|
|
|
rand = Random2();
|
|
|
|
sprite->data[7] = (rand % 0xA0) + 0xA0;
|
2019-10-20 10:47:56 +02:00
|
|
|
sprite->callback = AnimBulletSeed_Step2;
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->affineAnimPaused = 0;
|
|
|
|
}
|
|
|
|
|
2019-10-20 10:47:56 +02:00
|
|
|
static void AnimBulletSeed_Step2(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
sprite->data[0] += sprite->data[7];
|
|
|
|
sprite->pos2.x = sprite->data[0] >> 8;
|
|
|
|
if (sprite->data[7] & 1)
|
|
|
|
sprite->pos2.x = -sprite->pos2.x;
|
|
|
|
|
|
|
|
sprite->pos2.y = Sin(sprite->data[1], sprite->data[6]);
|
|
|
|
sprite->data[1] += 8;
|
|
|
|
if (sprite->data[1] > 126)
|
|
|
|
{
|
|
|
|
sprite->data[1] = 0;
|
|
|
|
sprite->data[2] /= 2;
|
|
|
|
if (++sprite->data[3] == 1)
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
// Moves a tornado in a circlular motion.
|
|
|
|
// arg 0: initial x pixel offset
|
|
|
|
// arg 1: initial y pixel offset
|
|
|
|
// arg 2: wave amplitude
|
|
|
|
// arg 3: unused
|
|
|
|
// arg 4: initial wave offset
|
|
|
|
// arg 5: wave period (higher means faster wave)
|
|
|
|
// arg 6: duration
|
2019-10-20 11:01:12 +02:00
|
|
|
void AnimRazorWindTornado(struct Sprite *sprite)
|
2018-12-18 05:08:08 +01:00
|
|
|
{
|
2018-12-20 04:13:26 +01:00
|
|
|
InitSpritePosToAnimAttacker(sprite, FALSE);
|
2018-12-18 04:56:34 +01:00
|
|
|
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
|
|
|
|
sprite->pos1.y += 16;
|
|
|
|
|
|
|
|
sprite->data[0] = gBattleAnimArgs[4];
|
|
|
|
sprite->data[1] = gBattleAnimArgs[2];
|
|
|
|
sprite->data[2] = gBattleAnimArgs[5];
|
|
|
|
sprite->data[3] = gBattleAnimArgs[6];
|
|
|
|
sprite->data[4] = gBattleAnimArgs[3];
|
2018-12-18 05:08:08 +01:00
|
|
|
sprite->callback = TranslateSpriteInCircleOverDuration;
|
2018-12-18 04:56:34 +01:00
|
|
|
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
|
|
|
|
sprite->callback(sprite);
|
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
// Animates a single pincer line that extends towards the center of the target mon.
|
|
|
|
// arg 0: invert
|
2019-10-20 11:01:12 +02:00
|
|
|
void AnimViceGripPincer(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
s16 startXOffset = 32;
|
|
|
|
s16 startYOffset = -32;
|
|
|
|
s16 endXOffset = 16;
|
|
|
|
s16 endYOffset = -16;
|
2018-12-18 04:56:34 +01:00
|
|
|
if (gBattleAnimArgs[0])
|
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
startXOffset = -32;
|
|
|
|
startYOffset = 32;
|
|
|
|
endXOffset = -16;
|
|
|
|
endYOffset = 16;
|
2018-12-18 04:56:34 +01:00
|
|
|
StartSpriteAnim(sprite, 1);
|
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
sprite->pos1.x += startXOffset;
|
|
|
|
sprite->pos1.y += startYOffset;
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->data[0] = 6;
|
2018-12-18 05:08:08 +01:00
|
|
|
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + endXOffset;
|
|
|
|
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + endYOffset;
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->callback = StartAnimLinearTranslation;
|
2019-10-20 11:01:12 +02:00
|
|
|
StoreSpriteCallbackInData6(sprite, AnimViceGripPincerStep);
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
static void AnimViceGripPincerStep(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
if (sprite->animEnded)
|
2018-12-18 04:56:34 +01:00
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
// Animates a single pincer line that extends towards the center of the target mon, and then back out.
|
|
|
|
// arg 0: animation id
|
2019-10-20 11:01:12 +02:00
|
|
|
void AnimGuillotinePincer(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
s16 startXOffset = 32;
|
|
|
|
s16 startYOffset = -32;
|
|
|
|
s16 endXOffset = 16;
|
|
|
|
s16 endYOffset = -16;
|
|
|
|
if (gBattleAnimArgs[0])
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
startXOffset = -32;
|
|
|
|
startYOffset = 32;
|
|
|
|
endXOffset = -16;
|
|
|
|
endYOffset = 16;
|
2018-12-18 04:56:34 +01:00
|
|
|
StartSpriteAnim(sprite, gBattleAnimArgs[0]);
|
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
sprite->pos1.x += startXOffset;
|
|
|
|
sprite->pos1.y += startYOffset;
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->data[0] = 6;
|
|
|
|
sprite->data[1] = sprite->pos1.x;
|
2018-12-18 05:08:08 +01:00
|
|
|
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + endXOffset;
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->data[3] = sprite->pos1.y;
|
2018-12-18 05:08:08 +01:00
|
|
|
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + endYOffset;
|
2018-12-18 04:56:34 +01:00
|
|
|
InitAnimLinearTranslation(sprite);
|
|
|
|
sprite->data[5] = gBattleAnimArgs[0];
|
|
|
|
sprite->data[6] = sprite->data[0];
|
2019-10-20 11:01:12 +02:00
|
|
|
sprite->callback = AnimGuillotinePincerStep1;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
static void AnimGuillotinePincerStep1(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2018-12-20 04:13:26 +01:00
|
|
|
if (AnimTranslateLinear(sprite) && sprite->animEnded)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
SeekSpriteAnim(sprite, 0);
|
|
|
|
sprite->animPaused = 1;
|
|
|
|
sprite->pos1.x += sprite->pos2.x;
|
|
|
|
sprite->pos1.y += sprite->pos2.y;
|
|
|
|
sprite->pos2.x = 2;
|
|
|
|
sprite->pos2.y = -2;
|
|
|
|
sprite->data[0] = sprite->data[6];
|
|
|
|
sprite->data[1] ^= 1;
|
|
|
|
sprite->data[2] ^= 1;
|
|
|
|
sprite->data[4] = 0;
|
|
|
|
sprite->data[3] = 0;
|
2019-10-20 11:01:12 +02:00
|
|
|
sprite->callback = AnimGuillotinePincerStep2;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
static void AnimGuillotinePincerStep2(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
if (sprite->data[3])
|
|
|
|
{
|
|
|
|
sprite->pos2.x = -sprite->pos2.x;
|
|
|
|
sprite->pos2.y = -sprite->pos2.y;
|
|
|
|
}
|
|
|
|
|
|
|
|
sprite->data[3] ^= 1;
|
|
|
|
if (++sprite->data[4] == 51)
|
|
|
|
{
|
|
|
|
sprite->pos2.y = 0;
|
|
|
|
sprite->pos2.x = 0;
|
|
|
|
sprite->data[4] = 0;
|
|
|
|
sprite->data[3] = 0;
|
|
|
|
sprite->animPaused = 0;
|
|
|
|
StartSpriteAnim(sprite, sprite->data[5] ^ 1);
|
2019-10-20 11:01:12 +02:00
|
|
|
sprite->callback = AnimGuillotinePincerStep3;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
static void AnimGuillotinePincerStep3(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2018-12-20 04:13:26 +01:00
|
|
|
if (AnimTranslateLinear(sprite))
|
2018-12-18 04:56:34 +01:00
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
// Scales up the target mon sprite, and sets the palette to greyscale.
|
|
|
|
// Used in MOVE_DISABLE.
|
|
|
|
// No args.
|
|
|
|
void AnimTask_GrowAndGreyscale(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET);
|
2018-12-18 05:08:08 +01:00
|
|
|
PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_BLEND);
|
|
|
|
SetSpriteRotScale(spriteId, 0xD0, 0xD0, 0);
|
|
|
|
SetGreyscaleOrOriginalPalette(gSprites[spriteId].oam.paletteNum + 16, FALSE);
|
2018-12-18 04:56:34 +01:00
|
|
|
gTasks[taskId].data[0] = 80;
|
2018-12-18 05:08:08 +01:00
|
|
|
gTasks[taskId].func = AnimTask_GrowAndGreyscaleStep;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
static void AnimTask_GrowAndGreyscaleStep(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
if (--gTasks[taskId].data[0] == -1)
|
|
|
|
{
|
|
|
|
u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET);
|
2018-12-18 05:08:08 +01:00
|
|
|
ResetSpriteRotScale(spriteId);
|
|
|
|
SetGreyscaleOrOriginalPalette(gSprites[spriteId].oam.paletteNum + 16, TRUE);
|
2018-12-18 04:56:34 +01:00
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
// Shrinks and grows the attacking mon several times. Also creates transparent versions of the
|
|
|
|
// mon's sprite while it is shrinking.
|
|
|
|
// No args.
|
|
|
|
void AnimTask_Minimize(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[taskId];
|
|
|
|
u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
|
|
|
task->data[0] = spriteId;
|
2018-12-18 05:08:08 +01:00
|
|
|
PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL);
|
2018-12-18 04:56:34 +01:00
|
|
|
task->data[1] = 0;
|
|
|
|
task->data[2] = 0;
|
|
|
|
task->data[3] = 0;
|
|
|
|
task->data[4] = 0x100;
|
|
|
|
task->data[5] = 0;
|
|
|
|
task->data[6] = 0;
|
2018-12-18 05:08:08 +01:00
|
|
|
task->data[7] = GetBattlerSpriteSubpriority(gBattleAnimAttacker);
|
|
|
|
task->func = AnimTask_MinimizeStep1;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
static void AnimTask_MinimizeStep1(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[taskId];
|
|
|
|
switch (task->data[1])
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
if (task->data[2] == 0 || task->data[2] == 3 || task->data[2] == 6)
|
2018-12-18 05:08:08 +01:00
|
|
|
CreateMinimizeSprite(task, taskId);
|
2018-12-18 04:56:34 +01:00
|
|
|
task->data[2]++;
|
|
|
|
task->data[4] += 0x28;
|
2018-12-18 05:08:08 +01:00
|
|
|
SetSpriteRotScale(task->data[0], task->data[4], task->data[4], 0);
|
|
|
|
SetBattlerSpriteYOffsetFromYScale(task->data[0]);
|
2018-12-18 04:56:34 +01:00
|
|
|
if (task->data[2] == 32)
|
|
|
|
{
|
|
|
|
task->data[5]++;
|
|
|
|
task->data[1]++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (task->data[6] == 0)
|
|
|
|
{
|
|
|
|
if (task->data[5] == 3)
|
|
|
|
{
|
|
|
|
task->data[2] = 0;
|
|
|
|
task->data[1] = 3;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
task->data[2] = 0;
|
|
|
|
task->data[3] = 0;
|
|
|
|
task->data[4] = 0x100;
|
2018-12-18 05:08:08 +01:00
|
|
|
SetSpriteRotScale(task->data[0], task->data[4], task->data[4], 0);
|
|
|
|
SetBattlerSpriteYOffsetFromYScale(task->data[0]);
|
2018-12-18 04:56:34 +01:00
|
|
|
task->data[1] = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
task->data[1] = 0;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
if (++task->data[2] > 32)
|
|
|
|
{
|
|
|
|
task->data[2] = 0;
|
|
|
|
task->data[1]++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
task->data[2] += 2;
|
|
|
|
task->data[4] -= 0x50;
|
2018-12-18 05:08:08 +01:00
|
|
|
SetSpriteRotScale(task->data[0], task->data[4], task->data[4], 0);
|
|
|
|
SetBattlerSpriteYOffsetFromYScale(task->data[0]);
|
2018-12-18 04:56:34 +01:00
|
|
|
if (task->data[2] == 32)
|
|
|
|
{
|
|
|
|
task->data[2] = 0;
|
|
|
|
task->data[1]++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 5:
|
2018-12-18 05:08:08 +01:00
|
|
|
ResetSpriteRotScale(task->data[0]);
|
2018-12-18 04:56:34 +01:00
|
|
|
gSprites[task->data[15]].pos2.y = 0;
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
static void CreateMinimizeSprite(struct Task* task, u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
u16 matrixNum;
|
2018-12-18 05:08:08 +01:00
|
|
|
s16 spriteId = CloneBattlerSpriteWithBlend(ANIM_ATTACKER);
|
2018-12-18 04:56:34 +01:00
|
|
|
if (spriteId >= 0)
|
|
|
|
{
|
|
|
|
if ((matrixNum = AllocOamMatrix()) == 0xFF)
|
|
|
|
{
|
|
|
|
obj_delete_but_dont_free_vram(&gSprites[spriteId]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gSprites[spriteId].oam.objMode = ST_OAM_OBJ_BLEND;
|
|
|
|
gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_DOUBLE;
|
|
|
|
gSprites[spriteId].affineAnimPaused = TRUE;
|
|
|
|
gSprites[spriteId].oam.matrixNum = matrixNum;
|
|
|
|
gSprites[spriteId].subpriority = task->data[7] - task->data[3];
|
|
|
|
task->data[3]++;
|
|
|
|
task->data[6]++;
|
|
|
|
gSprites[spriteId].data[0] = 16;
|
|
|
|
gSprites[spriteId].data[1] = taskId;
|
|
|
|
gSprites[spriteId].data[2] = 6;
|
2018-12-18 05:08:08 +01:00
|
|
|
gSprites[spriteId].callback = ClonedMinizeSprite_Step;
|
|
|
|
SetSpriteRotScale(spriteId, task->data[4], task->data[4], 0);
|
2018-12-18 04:56:34 +01:00
|
|
|
gSprites[spriteId].oam.affineMode = 1;
|
|
|
|
CalcCenterToCornerVec(&gSprites[spriteId], gSprites[spriteId].oam.shape, gSprites[spriteId].oam.size, gSprites[spriteId].oam.affineMode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
static void ClonedMinizeSprite_Step(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
if (--sprite->data[0] == 0)
|
|
|
|
{
|
|
|
|
gTasks[sprite->data[1]].data[sprite->data[2]]--;
|
|
|
|
FreeOamMatrix(sprite->oam.matrixNum);
|
|
|
|
obj_delete_but_dont_free_vram(sprite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Task to facilitate expanding and hopping effect seen in Splash.
|
|
|
|
// arg 0: anim battler
|
|
|
|
// arg 1: num hops
|
|
|
|
void AnimTask_Splash(u8 taskId)
|
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[taskId];
|
|
|
|
if (gBattleAnimArgs[1] == 0)
|
|
|
|
{
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
u8 spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
|
|
|
|
task->data[0] = spriteId;
|
|
|
|
task->data[1] = 0;
|
|
|
|
task->data[2] = gBattleAnimArgs[1];
|
|
|
|
task->data[3] = 0;
|
|
|
|
task->data[4] = 0;
|
2018-12-18 05:08:08 +01:00
|
|
|
PrepareAffineAnimInTaskData(task, spriteId, gSplashEffectAffineAnimCmds);
|
2018-12-18 04:56:34 +01:00
|
|
|
task->func = AnimTask_SplashStep;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void AnimTask_SplashStep(u8 taskId)
|
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[taskId];
|
|
|
|
switch (task->data[1])
|
|
|
|
{
|
|
|
|
case 0:
|
2018-12-18 05:08:08 +01:00
|
|
|
RunAffineAnimFromTaskData(task);
|
2018-12-18 04:56:34 +01:00
|
|
|
task->data[4] += 3;
|
|
|
|
gSprites[task->data[0]].pos2.y += task->data[4];
|
|
|
|
if (++task->data[3] > 7)
|
|
|
|
{
|
|
|
|
task->data[3] = 0;
|
|
|
|
task->data[1]++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
2018-12-18 05:08:08 +01:00
|
|
|
RunAffineAnimFromTaskData(task);
|
2018-12-18 04:56:34 +01:00
|
|
|
gSprites[task->data[0]].pos2.y += task->data[4];
|
|
|
|
if (++task->data[3] > 7)
|
|
|
|
{
|
|
|
|
task->data[3] = 0;
|
|
|
|
task->data[1]++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (task->data[4] != 0)
|
|
|
|
{
|
|
|
|
gSprites[task->data[0]].pos2.y -= 2;
|
|
|
|
task->data[4] -= 2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
task->data[1]++;
|
|
|
|
break;
|
|
|
|
case 3:
|
2018-12-18 05:08:08 +01:00
|
|
|
if (!RunAffineAnimFromTaskData(task))
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
if (--task->data[2] == 0)
|
|
|
|
{
|
|
|
|
gSprites[task->data[0]].pos2.y = 0;
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
PrepareAffineAnimInTaskData(task, task->data[0], gSplashEffectAffineAnimCmds);
|
2018-12-18 04:56:34 +01:00
|
|
|
task->data[1] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
// Grows, pauses, then shrinks the attacking mon.
|
|
|
|
// Used by MOVE_SWAGGER and MOVE_BULK_UP
|
|
|
|
// No args.
|
|
|
|
void AnimTask_GrowAndShrink(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[taskId];
|
|
|
|
u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
2018-12-18 05:08:08 +01:00
|
|
|
PrepareAffineAnimInTaskData(task, spriteId, gGrowAndShrinkAffineAnimCmds);
|
|
|
|
task->func = AnimTask_GrowAndShrinkStep;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
static void AnimTask_GrowAndShrinkStep(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[taskId];
|
2018-12-18 05:08:08 +01:00
|
|
|
if (!RunAffineAnimFromTaskData(task))
|
2018-12-18 04:56:34 +01:00
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
// Animates a little puff of the mon's breath.
|
|
|
|
// Used by MOVE_SWAGGER and MOVE_BULK_UP
|
|
|
|
// No args.
|
2019-10-20 11:01:12 +02:00
|
|
|
void AnimBreathPuff(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
StartSpriteAnim(sprite, 0);
|
2018-12-18 05:08:08 +01:00
|
|
|
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) + 32;
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->data[1] = 64;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
StartSpriteAnim(sprite, 1);
|
2018-12-18 05:08:08 +01:00
|
|
|
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) - 32;
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->data[1] = -64;
|
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET);
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->data[0] = 52;
|
|
|
|
sprite->data[2] = 0;
|
|
|
|
sprite->data[3] = 0;
|
|
|
|
sprite->data[4] = 0;
|
|
|
|
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
|
2019-02-06 20:17:09 +01:00
|
|
|
sprite->callback = TranslateSpriteLinearFixedPoint;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
// Animates an "angry" mark above a mon's head.
|
|
|
|
// arg 0: target mon (0 = attacker, 1 = target)
|
|
|
|
// arg 1: x pixel offset
|
|
|
|
// arg 2: y pixel offset
|
2019-10-20 11:01:12 +02:00
|
|
|
void AnimAngerMark(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
u8 battler;
|
2018-12-18 05:08:08 +01:00
|
|
|
if (!gBattleAnimArgs[0])
|
2018-12-18 04:56:34 +01:00
|
|
|
battler = gBattleAnimAttacker;
|
|
|
|
else
|
|
|
|
battler = gBattleAnimTarget;
|
|
|
|
|
|
|
|
if (GetBattlerSide(battler) == B_SIDE_OPPONENT)
|
|
|
|
gBattleAnimArgs[1] *= -1;
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
sprite->pos1.x = GetBattlerSpriteCoord(battler, BATTLER_COORD_X_2) + gBattleAnimArgs[1];
|
|
|
|
sprite->pos1.y = GetBattlerSpriteCoord(battler, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[2];
|
2018-12-18 04:56:34 +01:00
|
|
|
if (sprite->pos1.y < 8)
|
|
|
|
sprite->pos1.y = 8;
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
|
|
|
|
sprite->callback = RunStoredCallbackWhenAffineAnimEnds;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// left/right movements
|
2019-10-20 15:54:16 +02:00
|
|
|
void AnimTask_ThrashMoveMonHorizontal(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[taskId];
|
|
|
|
u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
|
|
|
task->data[0] = spriteId;
|
|
|
|
task->data[1] = 0;
|
2019-10-20 11:01:12 +02:00
|
|
|
PrepareAffineAnimInTaskData(task, spriteId, gThrashMoveMonAffineAnimCmds);
|
|
|
|
task->func = ThrashMoveMonStep;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
static void ThrashMoveMonStep(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[taskId];
|
2018-12-18 05:08:08 +01:00
|
|
|
if (!RunAffineAnimFromTaskData(task))
|
2018-12-18 04:56:34 +01:00
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|
|
|
|
|
|
|
|
// up/down movements
|
2019-10-20 15:54:16 +02:00
|
|
|
void AnimTask_ThrashMoveMonVertical(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[taskId];
|
|
|
|
task->data[0] = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
|
|
|
task->data[1] = 0;
|
|
|
|
task->data[2] = 4;
|
|
|
|
task->data[3] = 7;
|
|
|
|
task->data[4] = 3;
|
|
|
|
task->data[5] = gSprites[task->data[0]].pos1.x;
|
|
|
|
task->data[6] = gSprites[task->data[0]].pos1.y;
|
|
|
|
task->data[7] = 0;
|
|
|
|
task->data[8] = 0;
|
|
|
|
task->data[9] = 2;
|
|
|
|
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT)
|
|
|
|
task->data[2] *= -1;
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
task->func = ThrashMoveMon;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
static void ThrashMoveMon(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[taskId];
|
|
|
|
if (++task->data[7] > 2)
|
|
|
|
{
|
|
|
|
task->data[7] = 0;
|
|
|
|
task->data[8]++;
|
|
|
|
if (task->data[8] & 1)
|
|
|
|
gSprites[task->data[0]].pos1.y += task->data[9];
|
|
|
|
else
|
|
|
|
gSprites[task->data[0]].pos1.y -= task->data[9];
|
|
|
|
}
|
|
|
|
switch (task->data[1])
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
gSprites[task->data[0]].pos1.x += task->data[2];
|
|
|
|
if (--task->data[3] == 0)
|
|
|
|
{
|
|
|
|
task->data[3] = 14;
|
|
|
|
task->data[1] = 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
gSprites[task->data[0]].pos1.x -= task->data[2];
|
|
|
|
if (--task->data[3] == 0)
|
|
|
|
{
|
|
|
|
task->data[3] = 7;
|
|
|
|
task->data[1] = 2;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
gSprites[task->data[0]].pos1.x += task->data[2];
|
|
|
|
if (--task->data[3] == 0)
|
|
|
|
{
|
|
|
|
if (--task->data[4] != 0)
|
|
|
|
{
|
|
|
|
task->data[3] = 7;
|
|
|
|
task->data[1] = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((task->data[8] & 1) != 0)
|
|
|
|
gSprites[task->data[0]].pos1.y -= task->data[9];
|
|
|
|
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_8104E74(u8 taskId)
|
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[taskId];
|
|
|
|
struct ScanlineEffectParams params;
|
|
|
|
|
|
|
|
s16 i;
|
|
|
|
task->data[0] = GetBattlerYCoordWithElevation(gBattleAnimTarget) + 32;
|
|
|
|
task->data[1] = 4;
|
|
|
|
task->data[2] = 0;
|
|
|
|
task->data[3] = 0;
|
|
|
|
task->data[4] = 0;
|
|
|
|
task->data[5] = 0;
|
2018-12-30 17:58:42 +01:00
|
|
|
task->data[15] = GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_HEIGHT);
|
2018-12-18 04:56:34 +01:00
|
|
|
|
2018-12-20 04:13:26 +01:00
|
|
|
if (GetBattlerSpriteBGPriorityRank(gBattleAnimTarget) == 1)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
task->data[6] = gBattle_BG1_X;
|
|
|
|
params.dmaDest = (u16 *)REG_ADDR_BG1HOFS;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
task->data[6] = gBattle_BG2_X;
|
|
|
|
params.dmaDest = (u16 *)REG_ADDR_BG2HOFS;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = task->data[0] - 0x40; i <= task->data[0]; i++)
|
|
|
|
{
|
|
|
|
if (i >= 0)
|
|
|
|
{
|
|
|
|
gScanlineEffectRegBuffers[0][i] = task->data[6] + 0xF0;
|
|
|
|
gScanlineEffectRegBuffers[1][i] = task->data[6] + 0xF0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
params.dmaControl = SCANLINE_EFFECT_DMACNT_16BIT;
|
|
|
|
params.initState = 1;
|
|
|
|
params.unused9 = 0;
|
|
|
|
ScanlineEffect_SetParams(params);
|
2019-10-20 15:54:16 +02:00
|
|
|
task->func = AnimTask_SketchDrawMon;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
static void AnimTask_SketchDrawMon(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[taskId];
|
|
|
|
|
|
|
|
switch (task->data[4])
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
if (++task->data[5] > 20)
|
|
|
|
task->data[4]++;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (++task->data[1] > 3)
|
|
|
|
{
|
|
|
|
task->data[1] = 0;
|
|
|
|
task->data[2] = task->data[3] & 3;
|
|
|
|
task->data[5] = task->data[0] - task->data[3];
|
|
|
|
switch (task->data[2])
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
task->data[5] -= 2;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
task->data[5] += 1;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
task->data[5] += 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (task->data[5] >= 0)
|
|
|
|
{
|
|
|
|
gScanlineEffectRegBuffers[0][task->data[5]] = task->data[6];
|
|
|
|
gScanlineEffectRegBuffers[1][task->data[5]] = task->data[6];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (++task->data[3] >= task->data[15])
|
|
|
|
{
|
|
|
|
gScanlineEffect.state = 3;
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
void AnimPencil(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 0) - 16;
|
|
|
|
sprite->pos1.y = GetBattlerYCoordWithElevation(gBattleAnimTarget) + 16;
|
|
|
|
sprite->data[0] = 0;
|
|
|
|
sprite->data[1] = 0;
|
|
|
|
sprite->data[2] = 0;
|
|
|
|
sprite->data[3] = 16;
|
|
|
|
sprite->data[4] = 0;
|
2018-12-30 17:58:42 +01:00
|
|
|
sprite->data[5] = GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_HEIGHT) + 2;
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->data[6] = BattleAnimAdjustPanning(63);
|
2019-10-20 11:01:12 +02:00
|
|
|
sprite->callback = AnimPencil_Step;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 11:01:12 +02:00
|
|
|
static void AnimPencil_Step(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
switch (sprite->data[0])
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
if (++sprite->data[2] > 1)
|
|
|
|
{
|
|
|
|
sprite->data[2] = 0;
|
|
|
|
sprite->invisible = !sprite->invisible;
|
|
|
|
}
|
|
|
|
if (++sprite->data[1] > 16)
|
|
|
|
{
|
|
|
|
sprite->invisible = 0;
|
|
|
|
sprite->data[0]++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (++sprite->data[1] > 3 && sprite->data[2] < sprite->data[5])
|
|
|
|
{
|
|
|
|
sprite->data[1] = 0;
|
|
|
|
sprite->pos1.y -= 1;
|
|
|
|
sprite->data[2]++;
|
|
|
|
if (sprite->data[2] % 10 == 0)
|
|
|
|
PlaySE12WithPanning(SE_W166, sprite->data[6]);
|
|
|
|
}
|
|
|
|
sprite->data[4] += sprite->data[3];
|
|
|
|
if (sprite->data[4] > 31)
|
|
|
|
{
|
|
|
|
sprite->data[4] = 0x40 - sprite->data[4];
|
|
|
|
sprite->data[3] *= -1;
|
|
|
|
}
|
|
|
|
else if (sprite->data[4] <= -32)
|
|
|
|
{
|
|
|
|
sprite->data[4] = -0x40 - sprite->data[4];
|
|
|
|
sprite->data[3] *= -1;
|
|
|
|
}
|
|
|
|
sprite->pos2.x = sprite->data[4];
|
|
|
|
if (sprite->data[5] == sprite->data[2])
|
|
|
|
{
|
|
|
|
sprite->data[1] = 0;
|
|
|
|
sprite->data[2] = 0;
|
|
|
|
sprite->data[0]++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (++sprite->data[2] > 1)
|
|
|
|
{
|
|
|
|
sprite->data[2] = 0;
|
|
|
|
sprite->invisible = !sprite->invisible;
|
|
|
|
}
|
|
|
|
if (++sprite->data[1] > 16)
|
|
|
|
{
|
|
|
|
sprite->invisible = 0;
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
void AnimBlendThinRing(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
u8 battler = 0;
|
|
|
|
u16 sp0 = 0;
|
|
|
|
u16 sp1 = 0;
|
|
|
|
u8 r4;
|
|
|
|
|
|
|
|
if (gBattleAnimArgs[2] == 0)
|
|
|
|
battler = gBattleAnimAttacker;
|
|
|
|
else
|
|
|
|
battler = gBattleAnimTarget;
|
|
|
|
|
|
|
|
r4 = gBattleAnimArgs[3] ^ 1;
|
|
|
|
if (IsDoubleBattle() && IsBattlerSpriteVisible(BATTLE_PARTNER(battler)))
|
|
|
|
{
|
|
|
|
SetAverageBattlerPositions(battler, r4, &sp0, &sp1);
|
|
|
|
if (r4 == 0)
|
|
|
|
r4 = GetBattlerSpriteCoord(battler, 0);
|
|
|
|
else
|
|
|
|
r4 = GetBattlerSpriteCoord(battler, 2);
|
|
|
|
|
|
|
|
if (GetBattlerSide(battler) != B_SIDE_PLAYER)
|
|
|
|
gBattleAnimArgs[0] -= (sp0 - r4) - gBattleAnimArgs[0]; // This is weird.
|
|
|
|
else
|
|
|
|
gBattleAnimArgs[0] = sp0 - r4;
|
|
|
|
}
|
|
|
|
|
2019-10-14 21:05:40 +02:00
|
|
|
sprite->callback = AnimSparklingParticle;
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->callback(sprite);
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_8105284(struct Sprite *sprite)
|
|
|
|
{
|
2018-12-20 04:13:26 +01:00
|
|
|
if (AnimTranslateLinear(sprite))
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
FreeSpriteOamMatrix(sprite);
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
void AnimHyperVoiceRing(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
u16 r9 = 0;
|
|
|
|
u16 r6 = 0;
|
|
|
|
s16 sp0 = 0;
|
|
|
|
s16 sp1 = 0;
|
|
|
|
u8 sp4;
|
|
|
|
u8 battler1;
|
|
|
|
u8 battler2;
|
|
|
|
u8 r10;
|
|
|
|
|
|
|
|
if (gBattleAnimArgs[5] == 0)
|
|
|
|
{
|
|
|
|
battler1 = gBattleAnimAttacker;
|
|
|
|
battler2 = gBattleAnimTarget;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
battler1 = gBattleAnimTarget;
|
|
|
|
battler2 = gBattleAnimAttacker;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!gBattleAnimArgs[6])
|
|
|
|
{
|
|
|
|
r10 = 0;
|
|
|
|
sp4 = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
r10 = 2;
|
|
|
|
sp4 = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GetBattlerSide(battler1) != B_SIDE_PLAYER)
|
|
|
|
{
|
|
|
|
r9 = GetBattlerSpriteCoord(battler1, r10) + gBattleAnimArgs[0];
|
|
|
|
if (IsBattlerSpriteVisible(BATTLE_PARTNER(battler2)))
|
|
|
|
sprite->subpriority = gSprites[gBattlerSpriteIds[BATTLE_PARTNER(battler2)]].subpriority - 1;
|
|
|
|
else
|
|
|
|
sprite->subpriority = gSprites[gBattlerSpriteIds[battler2]].subpriority - 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
r9 = GetBattlerSpriteCoord(battler1, r10) - gBattleAnimArgs[0];
|
|
|
|
if (!IsContest() && IsBattlerSpriteVisible(BATTLE_PARTNER(battler1)))
|
|
|
|
{
|
|
|
|
if (gSprites[gBattlerSpriteIds[battler1]].pos1.x < gSprites[gBattlerSpriteIds[BATTLE_PARTNER(battler1)]].pos1.x)
|
|
|
|
sprite->subpriority = gSprites[gBattlerSpriteIds[BATTLE_PARTNER(battler1)]].subpriority + 1;
|
|
|
|
else
|
|
|
|
sprite->subpriority = gSprites[gBattlerSpriteIds[battler1]].subpriority - 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite->subpriority = gSprites[gBattlerSpriteIds[battler1]].subpriority - 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
r6 = GetBattlerSpriteCoord(battler1, sp4) + gBattleAnimArgs[1];
|
|
|
|
if (!IsContest() && IsBattlerSpriteVisible(BATTLE_PARTNER(battler2)))
|
|
|
|
{
|
|
|
|
SetAverageBattlerPositions(battler2, gBattleAnimArgs[6], &sp0, &sp1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sp0 = GetBattlerSpriteCoord(battler2, r10);
|
|
|
|
sp1 = GetBattlerSpriteCoord(battler2, sp4);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GetBattlerSide(battler2))
|
|
|
|
sp0 += gBattleAnimArgs[3];
|
|
|
|
else
|
|
|
|
sp0 -= gBattleAnimArgs[3];
|
|
|
|
|
|
|
|
sp1 += gBattleAnimArgs[4];
|
|
|
|
sprite->pos1.x = sprite->data[1] = r9;
|
|
|
|
sprite->pos1.y = sprite->data[3] = r6;
|
|
|
|
sprite->data[2] = sp0;
|
|
|
|
sprite->data[4] = sp1;
|
|
|
|
sprite->data[0] = gBattleAnimArgs[0];
|
|
|
|
InitAnimLinearTranslation(sprite);
|
|
|
|
sprite->callback = sub_8105284;
|
|
|
|
sprite->callback(sprite);
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
void AnimUproarRing(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
u8 index = IndexOfSpritePaletteTag(ANIM_TAG_THIN_RING);
|
|
|
|
if (index != 0xFF)
|
|
|
|
{
|
|
|
|
BlendPalette(((index << 20) + 0x1010000) >> 16, 15, gBattleAnimArgs[5], gBattleAnimArgs[4]);
|
|
|
|
}
|
|
|
|
|
|
|
|
StartSpriteAffineAnim(sprite, 1);
|
2019-10-14 21:05:40 +02:00
|
|
|
sprite->callback = AnimSparklingParticle;
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->callback(sprite);
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
void AnimSoftBoiledEgg(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
s16 r1;
|
2018-12-20 04:13:26 +01:00
|
|
|
InitSpritePosToAnimAttacker(sprite, FALSE);
|
2018-12-18 04:56:34 +01:00
|
|
|
r1 = GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER ? -160 : 160;
|
|
|
|
sprite->data[0] = 0x380;
|
|
|
|
sprite->data[1] = r1;
|
|
|
|
sprite->data[7] = gBattleAnimArgs[2];
|
2019-10-20 11:16:45 +02:00
|
|
|
sprite->callback = AnimSoftBoiledEgg_Step1;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
static void AnimSoftBoiledEgg_Step1(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
s16 add;
|
|
|
|
sprite->pos2.y -= (sprite->data[0] >> 8);
|
|
|
|
sprite->pos2.x = sprite->data[1] >> 8;
|
|
|
|
sprite->data[0] -= 32;
|
|
|
|
add = GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER ? -160 : 160;
|
|
|
|
sprite->data[1] += add;
|
|
|
|
if (sprite->pos2.y > 0)
|
|
|
|
{
|
|
|
|
sprite->pos1.y += sprite->pos2.y;
|
|
|
|
sprite->pos1.x += sprite->pos2.x;
|
|
|
|
sprite->pos2.y = 0;
|
|
|
|
sprite->pos2.x = 0;
|
|
|
|
sprite->data[0] = 0;
|
|
|
|
StartSpriteAffineAnim(sprite, 1);
|
2019-10-20 11:16:45 +02:00
|
|
|
sprite->callback = AnimSoftBoiledEgg_Step2;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
static void AnimSoftBoiledEgg_Step2(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
if (sprite->data[0]++ > 19)
|
|
|
|
{
|
|
|
|
StartSpriteAffineAnim(sprite, 2);
|
2019-10-20 11:16:45 +02:00
|
|
|
sprite->callback = AnimSoftBoiledEgg_Step3;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
static void AnimSoftBoiledEgg_Step3(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
if (sprite->affineAnimEnded)
|
|
|
|
{
|
|
|
|
StartSpriteAffineAnim(sprite, 1);
|
|
|
|
sprite->data[0] = 0;
|
|
|
|
if (sprite->data[7] == 0)
|
|
|
|
{
|
|
|
|
sprite->oam.tileNum += 16;
|
2019-10-20 11:16:45 +02:00
|
|
|
sprite->callback = AnimSoftBoiledEgg_Step3_Callback1;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite->oam.tileNum += 32;
|
2019-10-20 11:16:45 +02:00
|
|
|
sprite->callback = AnimSoftBoiledEgg_Step4;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
static void AnimSoftBoiledEgg_Step3_Callback1(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
sprite->pos2.y -= 2;
|
|
|
|
if (++sprite->data[0] == 9)
|
|
|
|
{
|
|
|
|
sprite->data[0] = 16;
|
|
|
|
sprite->data[1] = 0;
|
|
|
|
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND);
|
|
|
|
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND((u16)sprite->data[0], 0));
|
2019-10-20 11:16:45 +02:00
|
|
|
sprite->callback = AnimSoftBoiledEgg_Step3_Callback2;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
static void AnimSoftBoiledEgg_Step3_Callback2(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
if (sprite->data[1]++ % 3 == 0)
|
|
|
|
{
|
|
|
|
sprite->data[0]--;
|
|
|
|
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[0], 16 - sprite->data[0]));
|
|
|
|
if (sprite->data[0] == 0)
|
2019-10-20 11:16:45 +02:00
|
|
|
sprite->callback = AnimSoftBoiledEgg_Step4;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
static void AnimSoftBoiledEgg_Step4(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
if ((u16)gBattleAnimArgs[7] == 0xFFFF)
|
|
|
|
{
|
|
|
|
sprite->invisible = 1;
|
|
|
|
if (sprite->data[7] == 0)
|
2019-10-20 11:16:45 +02:00
|
|
|
sprite->callback = AnimSoftBoiledEgg_Step4_Callback;
|
2018-12-18 04:56:34 +01:00
|
|
|
else
|
|
|
|
sprite->callback = DestroyAnimSprite;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
static void AnimSoftBoiledEgg_Step4_Callback(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
SetGpuReg(REG_OFFSET_BLDCNT, 0);
|
|
|
|
SetGpuReg(REG_OFFSET_BLDALPHA, 0);
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
void AnimTask_StretchAttacker(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[taskId];
|
|
|
|
u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
|
|
|
task->data[0] = spriteId;
|
2019-10-20 11:55:02 +02:00
|
|
|
PrepareAffineAnimInTaskData(task, spriteId, gStretchAttackerAffineAnimCmds);
|
2019-10-20 15:54:16 +02:00
|
|
|
task->func = StretchAttacker_Step;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
static void StretchAttacker_Step(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[taskId];
|
2018-12-18 05:08:08 +01:00
|
|
|
if (!RunAffineAnimFromTaskData(task))
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
gSprites[task->data[0]].pos2.y = 0;
|
|
|
|
gSprites[task->data[0]].invisible = 1;
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
void AnimTask_ExtremeSpeedImpact(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[taskId];
|
|
|
|
task->data[0] = 0;
|
|
|
|
task->data[1] = 0;
|
|
|
|
task->data[2] = 0;
|
|
|
|
task->data[3] = 0;
|
|
|
|
task->data[12] = 3;
|
|
|
|
if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
|
|
|
|
{
|
|
|
|
task->data[13] = 0xFFFF;
|
|
|
|
task->data[14] = 8;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
task->data[13] = 1;
|
|
|
|
task->data[14] = -8;
|
|
|
|
}
|
|
|
|
|
|
|
|
task->data[15] = GetAnimBattlerSpriteId(ANIM_TARGET);
|
2019-10-20 15:54:16 +02:00
|
|
|
task->func = ExtremeSpeedImpact_Step;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
static void ExtremeSpeedImpact_Step(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[taskId];
|
|
|
|
|
|
|
|
switch (task->data[0])
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
gSprites[task->data[15]].pos2.x += task->data[14];
|
|
|
|
task->data[1] = 0;
|
|
|
|
task->data[2] = 0;
|
|
|
|
task->data[3] = 0;
|
|
|
|
task->data[0]++;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (++task->data[1] > 1)
|
|
|
|
{
|
|
|
|
task->data[1] = 0;
|
|
|
|
task->data[2]++;
|
|
|
|
if (task->data[2] & 1)
|
|
|
|
gSprites[task->data[15]].pos2.x += 6;
|
|
|
|
else
|
|
|
|
gSprites[task->data[15]].pos2.x -= 6;
|
|
|
|
|
|
|
|
if (++task->data[3] > 4)
|
|
|
|
{
|
|
|
|
if (task->data[2] & 1)
|
|
|
|
gSprites[task->data[15]].pos2.x -= 6;
|
|
|
|
|
|
|
|
task->data[0]++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (--task->data[12] != 0)
|
|
|
|
task->data[0] = 0;
|
|
|
|
else
|
|
|
|
task->data[0]++;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
gSprites[task->data[15]].pos2.x += task->data[13];
|
|
|
|
if (gSprites[task->data[15]].pos2.x == 0)
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
void AnimTask_ExtremeSpeedMonReappear(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[taskId];
|
|
|
|
task->data[0] = 0;
|
|
|
|
task->data[1] = 0;
|
|
|
|
task->data[2] = 0;
|
|
|
|
task->data[3] = 0;
|
|
|
|
task->data[4] = 1;
|
|
|
|
task->data[13] = 14;
|
|
|
|
task->data[14] = 2;
|
|
|
|
task->data[15] = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
2019-10-20 15:54:16 +02:00
|
|
|
task->func = ExtremeSpeedMonReappear_Step;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
static void ExtremeSpeedMonReappear_Step(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[taskId];
|
|
|
|
if (task->data[0] == 0 && ++task->data[1] > task->data[4])
|
|
|
|
{
|
|
|
|
task->data[1] = 0;
|
|
|
|
if (++task->data[2] & 1)
|
|
|
|
gSprites[task->data[15]].invisible = 0;
|
|
|
|
else
|
|
|
|
gSprites[task->data[15]].invisible = 1;
|
|
|
|
|
|
|
|
if (++task->data[3] >= task->data[13])
|
|
|
|
{
|
|
|
|
if (++task->data[4] < task->data[14])
|
|
|
|
{
|
|
|
|
task->data[1] = 0;
|
|
|
|
task->data[2] = 0;
|
|
|
|
task->data[3] = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gSprites[task->data[15]].invisible = 0;
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
void AnimTask_SpeedDust(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[taskId];
|
|
|
|
task->data[0] = 0;
|
|
|
|
task->data[1] = 4;
|
|
|
|
task->data[2] = 0;
|
|
|
|
task->data[3] = 0;
|
|
|
|
task->data[4] = 0;
|
|
|
|
task->data[5] = 0;
|
|
|
|
task->data[6] = 0;
|
|
|
|
task->data[7] = 0;
|
|
|
|
task->data[8] = 0;
|
|
|
|
task->data[13] = 0;
|
|
|
|
task->data[14] = GetBattlerSpriteCoord(gBattleAnimAttacker, ANIM_ATTACKER);
|
|
|
|
task->data[15] = GetBattlerSpriteCoord(gBattleAnimAttacker, ANIM_TARGET);
|
2019-10-20 11:16:45 +02:00
|
|
|
task->func = SpeedDust_Step1;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
static void SpeedDust_Step1(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
struct Task* task = &gTasks[taskId];
|
|
|
|
switch (task->data[8])
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
if (++task->data[4] > 1)
|
|
|
|
{
|
|
|
|
task->data[4] = 0;
|
|
|
|
task->data[5] = (task->data[5] + 1) & 1;
|
|
|
|
if (++task->data[6] > 20)
|
|
|
|
{
|
|
|
|
if (task->data[7] == 0)
|
|
|
|
{
|
|
|
|
task->data[6] = 0;
|
|
|
|
task->data[8] = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
task->data[8] = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
task->data[5] = 0;
|
|
|
|
if (++task->data[4] > 20)
|
|
|
|
{
|
|
|
|
task->data[7] = 1;
|
|
|
|
task->data[8] = 0;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
task->data[5] = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (task->data[0])
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
if (++task->data[1] > 4)
|
|
|
|
{
|
|
|
|
u8 spriteId;
|
|
|
|
task->data[1] = 0;
|
2019-10-20 11:16:45 +02:00
|
|
|
spriteId = CreateSprite(&gSpeedDustSpriteTemplate, task->data[14], task->data[15], 0);
|
2018-12-18 04:56:34 +01:00
|
|
|
if (spriteId != MAX_SPRITES)
|
|
|
|
{
|
|
|
|
gSprites[spriteId].data[0] = taskId;
|
|
|
|
gSprites[spriteId].data[1] = 13;
|
2019-10-20 11:55:02 +02:00
|
|
|
gSprites[spriteId].pos2.x = gSpeedDustPosTable[task->data[2]][0];
|
|
|
|
gSprites[spriteId].pos2.y = gSpeedDustPosTable[task->data[2]][1];
|
2018-12-18 04:56:34 +01:00
|
|
|
task->data[13]++;
|
|
|
|
if (++task->data[2] > 3)
|
|
|
|
{
|
|
|
|
task->data[2] = 0;
|
|
|
|
if (++task->data[3] > 5)
|
|
|
|
task->data[0]++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (task->data[13] == 0)
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:16:45 +02:00
|
|
|
void AnimSpeedDust(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
sprite->invisible = gTasks[sprite->data[0]].data[5];
|
|
|
|
if (sprite->animEnded)
|
|
|
|
{
|
|
|
|
gTasks[sprite->data[0]].data[sprite->data[1]]--;
|
|
|
|
DestroySprite(sprite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_8105CB4(u8 taskId)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
u8 paletteNums[3];
|
|
|
|
|
|
|
|
paletteNums[0] = IndexOfSpritePaletteTag(ANIM_TAG_MUSIC_NOTES_2);
|
|
|
|
for (i = 1; i < 3; i++)
|
|
|
|
paletteNums[i] = AllocSpritePalette(ANIM_SPRITES_START - i);
|
|
|
|
|
|
|
|
gMonSpritesGfxPtr->field_17C = AllocZeroed(0x2000);
|
2019-04-06 16:38:55 +02:00
|
|
|
LZDecompressWram(gBattleAnimSpritePal_MusicNotes2, gMonSpritesGfxPtr->field_17C);
|
2018-12-18 04:56:34 +01:00
|
|
|
for (i = 0; i < 3; i++)
|
|
|
|
LoadPalette(&gMonSpritesGfxPtr->field_17C[i * 32], (u16)((paletteNums[i] << 4) + 0x100), 32);
|
|
|
|
|
|
|
|
FREE_AND_SET_NULL(gMonSpritesGfxPtr->field_17C);
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_8105D60(u8 taskId)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < 3; i++)
|
2019-10-20 11:55:02 +02:00
|
|
|
FreeSpritePaletteByTag(gMusicNotePaletteTagsTable[i]);
|
2018-12-18 04:56:34 +01:00
|
|
|
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
static void SetMusicNotePalette(struct Sprite *sprite, u8 a, u8 b)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
u8 tile;
|
|
|
|
tile = (b & 1);
|
|
|
|
tile = ((-tile | tile) >> 31) & 32;
|
|
|
|
sprite->oam.tileNum += tile + (a << 2);
|
2019-10-20 11:55:02 +02:00
|
|
|
sprite->oam.paletteNum = IndexOfSpritePaletteTag(gMusicNotePaletteTagsTable[b >> 1]);
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
void AnimHealBellMusicNote(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2018-12-20 04:13:26 +01:00
|
|
|
InitSpritePosToAnimAttacker(sprite, FALSE);
|
2018-12-18 04:56:34 +01:00
|
|
|
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
|
|
|
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
|
|
|
|
|
|
|
|
sprite->data[0] = gBattleAnimArgs[4];
|
|
|
|
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 0) + gBattleAnimArgs[2];
|
|
|
|
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + gBattleAnimArgs[3];
|
|
|
|
sprite->callback = StartAnimLinearTranslation;
|
|
|
|
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
|
2019-10-20 11:55:02 +02:00
|
|
|
SetMusicNotePalette(sprite, gBattleAnimArgs[5], gBattleAnimArgs[6]);
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
void AnimMagentaHeart(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
if (++sprite->data[0] == 1)
|
2018-12-20 04:13:26 +01:00
|
|
|
InitSpritePosToAnimAttacker(sprite, FALSE);
|
2018-12-18 04:56:34 +01:00
|
|
|
|
|
|
|
sprite->pos2.x = Sin(sprite->data[1], 8);
|
|
|
|
sprite->pos2.y = sprite->data[2] >> 8;
|
|
|
|
sprite->data[1] = (sprite->data[1] + 7) & 0xFF;
|
|
|
|
sprite->data[2] -= 0x80;
|
|
|
|
if (sprite->data[0] == 60)
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
void AnimTask_FakeOut(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
u16 win0h = IsContest() ? 0x98 : 0xF0;
|
|
|
|
u16 win0v = 0;
|
|
|
|
|
|
|
|
gBattle_WIN0H = win0h;
|
|
|
|
gBattle_WIN0V = 0xA0;
|
|
|
|
SetGpuReg(REG_OFFSET_WIN0H, gBattle_WIN0H);
|
|
|
|
SetGpuReg(REG_OFFSET_WIN0V, gBattle_WIN0V);
|
|
|
|
SetGpuReg(REG_OFFSET_WININ, 0x3F1F);
|
|
|
|
SetGpuReg(REG_OFFSET_WINOUT, 0x3F3F);
|
2018-12-26 13:43:07 +01:00
|
|
|
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG3 | BLDCNT_EFFECT_DARKEN);
|
2018-12-18 04:56:34 +01:00
|
|
|
SetGpuReg(REG_OFFSET_BLDY, 0x10);
|
|
|
|
gTasks[taskId].data[0] = win0v;
|
|
|
|
gTasks[taskId].data[1] = win0h;
|
2019-10-20 11:55:02 +02:00
|
|
|
gTasks[taskId].func = FakeOutStep1;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
static void FakeOutStep1(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
gTasks[taskId].data[0] += 13;
|
|
|
|
gTasks[taskId].data[1] -= 13;
|
|
|
|
if (gTasks[taskId].data[0] >= gTasks[taskId].data[1])
|
|
|
|
{
|
|
|
|
gBattle_WIN0H = 0;
|
2019-10-20 11:55:02 +02:00
|
|
|
gTasks[taskId].func = FakeOutStep2;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gBattle_WIN0H = gTasks[taskId].data[1] | (gTasks[taskId].data[0] << 8);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
static void FakeOutStep2(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
if (++gTasks[taskId].data[10] == 5)
|
|
|
|
{
|
|
|
|
gTasks[taskId].data[11] = 0x88;
|
|
|
|
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG3 | BLDCNT_EFFECT_LIGHTEN);
|
|
|
|
BlendPalettes(sub_80A75AC(1, 0, 0, 0, 0, 0, 0), 16, RGB(31, 31, 31));
|
|
|
|
}
|
|
|
|
else if (gTasks[taskId].data[10] > 4)
|
|
|
|
{
|
|
|
|
gBattle_WIN0H = 0;
|
|
|
|
gBattle_WIN0V = 0;
|
|
|
|
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR);
|
|
|
|
SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR | WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR);
|
|
|
|
SetGpuReg(REG_OFFSET_BLDCNT, 0);
|
|
|
|
SetGpuReg(REG_OFFSET_BLDY, 0);
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_8106020(u8 taskId)
|
|
|
|
{
|
|
|
|
u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET);
|
|
|
|
if (++gTasks[taskId].data[0] == 1)
|
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
PrepareAffineAnimInTaskData(&gTasks[taskId], GetAnimBattlerSpriteId(1), gUnknown_08593988);
|
2018-12-18 04:56:34 +01:00
|
|
|
gSprites[spriteId].pos2.x = 4;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gSprites[spriteId].pos2.x = -gSprites[spriteId].pos2.x;
|
2018-12-18 05:08:08 +01:00
|
|
|
if (!RunAffineAnimFromTaskData(&gTasks[taskId]))
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
gSprites[spriteId].pos2.x = 0;
|
|
|
|
gSprites[spriteId].pos2.y = 0;
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_81060B0(u8 taskId)
|
|
|
|
{
|
|
|
|
u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
|
|
|
if (++gTasks[taskId].data[0] == 1)
|
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
PrepareAffineAnimInTaskData(&gTasks[taskId], GetAnimBattlerSpriteId(0), gUnknown_08593988);
|
2018-12-18 04:56:34 +01:00
|
|
|
gSprites[spriteId].pos2.x = 4;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gSprites[spriteId].pos2.x = -gSprites[spriteId].pos2.x;
|
2018-12-18 05:08:08 +01:00
|
|
|
if (!RunAffineAnimFromTaskData(&gTasks[taskId]))
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
gSprites[spriteId].pos2.x = 0;
|
|
|
|
gSprites[spriteId].pos2.y = 0;
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
void AnimRedHeartProjectile(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2018-12-20 04:13:26 +01:00
|
|
|
InitSpritePosToAnimAttacker(sprite, TRUE);
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->data[0] = 95;
|
|
|
|
sprite->data[1] = sprite->pos1.x;
|
|
|
|
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2);
|
|
|
|
sprite->data[3] = sprite->pos1.y;
|
|
|
|
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3);
|
|
|
|
InitAnimLinearTranslation(sprite);
|
2019-10-20 11:55:02 +02:00
|
|
|
sprite->callback = AnimRedHeartProjectile_Step;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
static void AnimRedHeartProjectile_Step(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2018-12-20 04:13:26 +01:00
|
|
|
if (!AnimTranslateLinear(sprite))
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
sprite->pos2.y += Sin(sprite->data[5], 14);
|
|
|
|
sprite->data[5] = (sprite->data[5] + 4) & 0xFF;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
void AnimParticuleBurst(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
if (sprite->data[0] == 0)
|
|
|
|
{
|
|
|
|
sprite->data[1] = gBattleAnimArgs[0];
|
|
|
|
sprite->data[2] = gBattleAnimArgs[1];
|
|
|
|
sprite->data[0]++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite->data[4] += sprite->data[1];
|
|
|
|
sprite->pos2.x = sprite->data[4] >> 8;
|
|
|
|
sprite->pos2.y = Sin(sprite->data[3], sprite->data[2]);
|
|
|
|
sprite->data[3] = (sprite->data[3] + 3) & 0xFF;
|
|
|
|
if (sprite->data[3] > 100)
|
|
|
|
sprite->invisible = sprite->data[3] % 2;
|
|
|
|
|
|
|
|
if (sprite->data[3] > 120)
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
void AnimRedHeartRising(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
sprite->pos1.x = gBattleAnimArgs[0];
|
|
|
|
sprite->pos1.y = 160;
|
|
|
|
sprite->data[0] = gBattleAnimArgs[2];
|
|
|
|
sprite->data[1] = gBattleAnimArgs[1];
|
|
|
|
sprite->callback = WaitAnimForDuration;
|
2019-10-20 11:55:02 +02:00
|
|
|
StoreSpriteCallbackInData6(sprite, AnimRedHeartRising_Step);
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
static void AnimRedHeartRising_Step(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
s16 y;
|
|
|
|
sprite->data[2] += sprite->data[1];
|
|
|
|
sprite->pos2.y = -((u16)sprite->data[2] >> 8);
|
|
|
|
sprite->pos2.x = Sin(sprite->data[3], 4);
|
|
|
|
sprite->data[3] = (sprite->data[3] + 3) & 0xFF;
|
|
|
|
y = sprite->pos1.y + sprite->pos2.y;
|
|
|
|
if (y <= 72)
|
|
|
|
{
|
|
|
|
sprite->invisible = sprite->data[3] % 2;
|
|
|
|
if (y <= 64)
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-02 08:36:22 +02:00
|
|
|
void AnimTask_HeartsBackground(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-02-06 20:17:09 +01:00
|
|
|
struct BattleAnimBgData animBg;
|
2018-12-18 04:56:34 +01:00
|
|
|
|
|
|
|
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_TGT1_BG1 | BLDCNT_EFFECT_BLEND);
|
|
|
|
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16));
|
|
|
|
SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 3);
|
|
|
|
SetAnimBgAttribute(1, BG_ANIM_SCREEN_SIZE, 0);
|
|
|
|
if (!IsContest())
|
|
|
|
SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1);
|
|
|
|
|
|
|
|
gBattle_BG1_X = 0;
|
|
|
|
gBattle_BG1_Y = 0;
|
|
|
|
SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X);
|
|
|
|
SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y);
|
2019-02-06 20:17:09 +01:00
|
|
|
sub_80A6B30(&animBg);
|
|
|
|
AnimLoadCompressedBgGfx(animBg.bgId, &gUnknown_08C232E0, animBg.tilesOffset);
|
|
|
|
sub_80A6D60(&animBg, &gUnknown_08C23D78, 0);
|
|
|
|
LoadCompressedPalette(&gUnknown_08C23D50, animBg.paletteId * 16, 32);
|
2019-10-20 15:54:16 +02:00
|
|
|
gTasks[taskId].func = HeartsBackground_Step;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
static void HeartsBackground_Step(u8 taskId)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2019-02-06 20:17:09 +01:00
|
|
|
struct BattleAnimBgData animBg;
|
2018-12-18 04:56:34 +01:00
|
|
|
|
|
|
|
switch (gTasks[taskId].data[12])
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
if (++gTasks[taskId].data[10] == 4)
|
|
|
|
{
|
|
|
|
gTasks[taskId].data[10] = 0;
|
|
|
|
gTasks[taskId].data[11]++;
|
|
|
|
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 16 - gTasks[taskId].data[11]));
|
|
|
|
if (gTasks[taskId].data[11] == 16)
|
|
|
|
{
|
|
|
|
gTasks[taskId].data[12]++;
|
|
|
|
gTasks[taskId].data[11] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (++gTasks[taskId].data[11] == 141)
|
|
|
|
{
|
|
|
|
gTasks[taskId].data[11] = 16;
|
|
|
|
gTasks[taskId].data[12]++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (++gTasks[taskId].data[10] == 4)
|
|
|
|
{
|
|
|
|
gTasks[taskId].data[10] = 0;
|
|
|
|
gTasks[taskId].data[11]--;
|
|
|
|
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 16 - gTasks[taskId].data[11]));
|
|
|
|
if (gTasks[taskId].data[11] == 0)
|
|
|
|
{
|
|
|
|
gTasks[taskId].data[12]++;
|
|
|
|
gTasks[taskId].data[11] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
2019-02-06 20:17:09 +01:00
|
|
|
sub_80A6B30(&animBg);
|
|
|
|
sub_80A6C68(animBg.bgId);
|
2018-12-18 04:56:34 +01:00
|
|
|
gTasks[taskId].data[12]++;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
if (!IsContest())
|
|
|
|
SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0);
|
|
|
|
|
|
|
|
SetGpuReg(REG_OFFSET_BLDCNT, 0);
|
|
|
|
SetGpuReg(REG_OFFSET_BLDALPHA, 0);
|
|
|
|
SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1);
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_81064F8(u8 taskId)
|
|
|
|
{
|
2019-02-06 20:17:09 +01:00
|
|
|
struct BattleAnimBgData animBg;
|
2018-12-18 04:56:34 +01:00
|
|
|
|
|
|
|
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_TGT1_BG1 | BLDCNT_EFFECT_BLEND);
|
|
|
|
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16));
|
|
|
|
SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1);
|
|
|
|
SetAnimBgAttribute(1, BG_ANIM_SCREEN_SIZE, 0);
|
|
|
|
if (!IsContest())
|
|
|
|
SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1);
|
|
|
|
|
|
|
|
gBattle_BG1_X = 0;
|
|
|
|
gBattle_BG1_Y = 0;
|
|
|
|
SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X);
|
|
|
|
SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y);
|
2019-02-06 20:17:09 +01:00
|
|
|
sub_80A6B30(&animBg);
|
2018-12-18 04:56:34 +01:00
|
|
|
if (IsContest())
|
2019-04-06 18:38:15 +02:00
|
|
|
sub_80A6D60(&animBg, &gBattleAnimBgTilemap_ScaryFaceContest, 0);
|
2018-12-18 04:56:34 +01:00
|
|
|
else if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_OPPONENT)
|
2019-04-06 18:38:15 +02:00
|
|
|
sub_80A6D60(&animBg, &gBattleAnimBgTilemap_ScaryFacePlayer, 0);
|
2018-12-18 04:56:34 +01:00
|
|
|
else
|
2019-04-06 18:38:15 +02:00
|
|
|
sub_80A6D60(&animBg, &gBattleAnimBgTilemap_ScaryFaceOpponent, 0);
|
2018-12-18 04:56:34 +01:00
|
|
|
|
2019-02-06 20:17:09 +01:00
|
|
|
AnimLoadCompressedBgGfx(animBg.bgId, gUnknown_08C249F8, animBg.tilesOffset);
|
|
|
|
LoadCompressedPalette(gUnknown_08C249D0, animBg.paletteId * 16, 32);
|
2018-12-18 04:56:34 +01:00
|
|
|
gTasks[taskId].func = sub_81065EC;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_81065EC(u8 taskId)
|
|
|
|
{
|
2019-02-06 20:17:09 +01:00
|
|
|
struct BattleAnimBgData animBg;
|
2018-12-18 04:56:34 +01:00
|
|
|
|
|
|
|
switch (gTasks[taskId].data[12])
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
if (++gTasks[taskId].data[10] == 2)
|
|
|
|
{
|
|
|
|
gTasks[taskId].data[10] = 0;
|
|
|
|
gTasks[taskId].data[11]++;
|
|
|
|
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 16 - gTasks[taskId].data[11]));
|
|
|
|
if (gTasks[taskId].data[11] == 14)
|
|
|
|
{
|
|
|
|
gTasks[taskId].data[12]++;
|
|
|
|
gTasks[taskId].data[11] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (++gTasks[taskId].data[11] == 21)
|
|
|
|
{
|
|
|
|
gTasks[taskId].data[11] = 14;
|
|
|
|
gTasks[taskId].data[12]++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (++gTasks[taskId].data[10] == 2)
|
|
|
|
{
|
|
|
|
gTasks[taskId].data[10] = 0;
|
|
|
|
gTasks[taskId].data[11]--;
|
|
|
|
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 16 - gTasks[taskId].data[11]));
|
|
|
|
if (gTasks[taskId].data[11] == 0)
|
|
|
|
{
|
|
|
|
gTasks[taskId].data[12]++;
|
|
|
|
gTasks[taskId].data[11] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
2019-02-06 20:17:09 +01:00
|
|
|
sub_80A6B30(&animBg);
|
2018-12-18 04:56:34 +01:00
|
|
|
sub_80A6C68(1);
|
|
|
|
sub_80A6C68(2);
|
|
|
|
gTasks[taskId].data[12]++;
|
|
|
|
// fall through
|
|
|
|
case 4:
|
|
|
|
if (!IsContest())
|
|
|
|
SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0);
|
|
|
|
|
|
|
|
SetGpuReg(REG_OFFSET_BLDCNT, 0);
|
|
|
|
SetGpuReg(REG_OFFSET_BLDALPHA, 0);
|
|
|
|
SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1);
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Orbits a sphere in an ellipse around the mon.
|
|
|
|
// Used by MOVE_HIDDEN_POWER
|
|
|
|
// arg 0: duration
|
|
|
|
// arg 1: initial wave offset
|
|
|
|
void AnimOrbitFast(struct Sprite *sprite)
|
|
|
|
{
|
|
|
|
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
|
|
|
|
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
|
|
|
|
sprite->affineAnimPaused = 1;
|
|
|
|
sprite->data[0] = gBattleAnimArgs[0];
|
|
|
|
sprite->data[1] = gBattleAnimArgs[1];
|
2018-12-18 05:08:08 +01:00
|
|
|
sprite->data[7] = GetBattlerSpriteSubpriority(gBattleAnimAttacker);
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->callback = AnimOrbitFastStep;
|
|
|
|
sprite->callback(sprite);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void AnimOrbitFastStep(struct Sprite *sprite)
|
|
|
|
{
|
2019-03-01 00:08:37 +01:00
|
|
|
if (sprite->data[1] >= 64 && sprite->data[1] <= 191)
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->subpriority = sprite->data[7] + 1;
|
|
|
|
else
|
|
|
|
sprite->subpriority = sprite->data[7] - 1;
|
|
|
|
|
|
|
|
sprite->pos2.x = Sin(sprite->data[1], sprite->data[2] >> 8);
|
|
|
|
sprite->pos2.y = Cos(sprite->data[1], sprite->data[3] >> 8);
|
|
|
|
sprite->data[1] = (sprite->data[1] + 9) & 0xFF;
|
|
|
|
switch (sprite->data[5])
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
sprite->data[2] -= 0x400;
|
|
|
|
sprite->data[3] -= 0x100;
|
|
|
|
if (++sprite->data[4] == sprite->data[0])
|
|
|
|
{
|
|
|
|
sprite->data[5] = 2;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 0:
|
|
|
|
sprite->data[2] += 0x400;
|
|
|
|
sprite->data[3] += 0x100;
|
|
|
|
if (++sprite->data[4] == sprite->data[0])
|
|
|
|
{
|
|
|
|
sprite->data[4] = 0;
|
|
|
|
sprite->data[5] = 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((u16)gBattleAnimArgs[7] == 0xFFFF)
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Moves orbs away from the mon, based on where they are in their orbit.
|
|
|
|
// Used in MOVE_HIDDEN_POWER.
|
|
|
|
// arg 0: initial wave offset
|
|
|
|
void AnimOrbitScatter(struct Sprite *sprite)
|
|
|
|
{
|
|
|
|
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
|
|
|
|
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
|
|
|
|
sprite->data[0] = Sin(gBattleAnimArgs[0], 10);
|
|
|
|
sprite->data[1] = Cos(gBattleAnimArgs[0], 7);
|
|
|
|
sprite->callback = AnimOrbitScatterStep;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void AnimOrbitScatterStep(struct Sprite *sprite)
|
|
|
|
{
|
|
|
|
sprite->pos2.x += sprite->data[0];
|
|
|
|
sprite->pos2.y += sprite->data[1];
|
|
|
|
if (sprite->pos1.x + sprite->pos2.x + 16 > 272u || sprite->pos1.y + sprite->pos2.y > 160 || sprite->pos1.y + sprite->pos2.y < -16)
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
static void AnimSpitUpOrb_Step(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
sprite->pos2.x += sprite->data[0];
|
|
|
|
sprite->pos2.y += sprite->data[1];
|
|
|
|
if (sprite->data[3]++ >= sprite->data[2])
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
void AnimSpitUpOrb(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
|
|
|
|
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
|
|
|
|
sprite->data[0] = Sin(gBattleAnimArgs[0], 10);
|
|
|
|
sprite->data[1] = Cos(gBattleAnimArgs[0], 7);
|
|
|
|
sprite->data[2] = gBattleAnimArgs[1];
|
2019-10-20 11:55:02 +02:00
|
|
|
sprite->callback = AnimSpitUpOrb_Step;
|
2018-12-18 04:56:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_810699C(struct Sprite *sprite)
|
|
|
|
{
|
|
|
|
if (sprite->animEnded)
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
void AnimEyeSparkle(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
2018-12-20 04:13:26 +01:00
|
|
|
InitSpritePosToAnimAttacker(sprite, TRUE);
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->callback = sub_810699C;
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
void AnimAngel(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
s16 var0;
|
|
|
|
if (!sprite->data[0])
|
|
|
|
{
|
|
|
|
sprite->pos1.x += gBattleAnimArgs[0];
|
|
|
|
sprite->pos1.y += gBattleAnimArgs[1];
|
|
|
|
}
|
|
|
|
|
|
|
|
sprite->data[0]++;
|
|
|
|
var0 = (sprite->data[0] * 10) & 0xFF;
|
|
|
|
sprite->pos2.x = Sin(var0, 80) >> 8;
|
|
|
|
if (sprite->data[0] < 80)
|
|
|
|
sprite->pos2.y = (sprite->data[0] / 2) + (Cos(var0, 80) >> 8);
|
|
|
|
|
|
|
|
if (sprite->data[0] > 90)
|
|
|
|
{
|
|
|
|
sprite->data[2]++;
|
|
|
|
sprite->pos2.x -= sprite->data[2] / 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sprite->data[0] > 100)
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_8106A64(struct Sprite *sprite)
|
|
|
|
{
|
|
|
|
sprite->data[5]++;
|
|
|
|
sprite->pos2.x = Sin(sprite->data[3], 5);
|
|
|
|
sprite->pos2.y = sprite->data[5] / 2;
|
|
|
|
sprite->data[3] = (sprite->data[3] + 3) & 0xFF;
|
|
|
|
if (sprite->data[5] > 20)
|
|
|
|
sprite->invisible = sprite->data[5] % 2;
|
|
|
|
|
|
|
|
if (sprite->data[5] > 30)
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
void AnimPinkHeart(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
if (sprite->data[0] == 0)
|
|
|
|
{
|
|
|
|
sprite->data[1] = gBattleAnimArgs[0];
|
|
|
|
sprite->data[2] = gBattleAnimArgs[1];
|
|
|
|
sprite->data[0]++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite->data[4] += sprite->data[1];
|
|
|
|
sprite->pos2.x = sprite->data[4] >> 8;
|
|
|
|
sprite->pos2.y = Sin(sprite->data[3], sprite->data[2]);
|
|
|
|
sprite->data[3] = (sprite->data[3] + 3) & 0xFF;
|
|
|
|
if (sprite->data[3] > 70)
|
|
|
|
{
|
|
|
|
sprite->callback = sub_8106A64;
|
|
|
|
sprite->pos1.x += sprite->pos2.x;
|
|
|
|
sprite->pos1.y += sprite->pos2.y;
|
|
|
|
sprite->pos2.x = 0;
|
|
|
|
sprite->pos2.y = 0;
|
|
|
|
sprite->data[3] = Random2() % 180;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
void AnimDevil(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
if (sprite->data[3] == 0)
|
|
|
|
{
|
|
|
|
sprite->pos1.x += gBattleAnimArgs[0];
|
|
|
|
sprite->pos1.y += gBattleAnimArgs[1];
|
|
|
|
StartSpriteAnim(sprite, 0);
|
2018-12-18 05:08:08 +01:00
|
|
|
sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimTarget) - 1;
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->data[2] = 1;
|
|
|
|
}
|
|
|
|
sprite->data[0] += sprite->data[2];
|
|
|
|
sprite->data[1] = (sprite->data[0] * 4) % 256;
|
|
|
|
if (sprite->data[1] < 0)
|
|
|
|
sprite->data[1] = 0;
|
|
|
|
sprite->pos2.x = Cos(sprite->data[1], 30 - sprite->data[0] / 4);
|
|
|
|
sprite->pos2.y = Sin(sprite->data[1], 10 - sprite->data[0] / 8);
|
|
|
|
if (sprite->data[1] > 128 && sprite->data[2] > 0)
|
|
|
|
sprite->data[2] = -1;
|
|
|
|
if (sprite->data[1] == 0 && sprite->data[2] < 0)
|
|
|
|
sprite->data[2] = 1;
|
|
|
|
sprite->data[3]++;
|
|
|
|
if (sprite->data[3] < 10 || sprite->data[3] > 80)
|
|
|
|
sprite->invisible = sprite->data[0] % 2;
|
|
|
|
else
|
|
|
|
sprite->invisible = FALSE;
|
|
|
|
if (sprite->data[3] > 90)
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
void AnimFurySwipes(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
if (sprite->data[0] == 0)
|
|
|
|
{
|
|
|
|
sprite->pos1.x += gBattleAnimArgs[0];
|
|
|
|
sprite->pos1.y += gBattleAnimArgs[1];
|
|
|
|
StartSpriteAnim(sprite, gBattleAnimArgs[2]);
|
|
|
|
sprite->data[0]++;
|
|
|
|
}
|
|
|
|
else if (sprite->animEnded)
|
|
|
|
{
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 11:55:02 +02:00
|
|
|
void AnimMovmentWaves(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
if (!gBattleAnimArgs[2])
|
|
|
|
{
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!gBattleAnimArgs[0])
|
|
|
|
{
|
|
|
|
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
|
|
|
|
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 2);
|
|
|
|
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 3);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!gBattleAnimArgs[1])
|
|
|
|
sprite->pos1.x += 32;
|
|
|
|
else
|
|
|
|
sprite->pos1.x -= 32;
|
|
|
|
|
|
|
|
sprite->data[0] = gBattleAnimArgs[2];
|
|
|
|
sprite->data[1] = gBattleAnimArgs[1];
|
|
|
|
StartSpriteAnim(sprite, sprite->data[1]);
|
|
|
|
sprite->callback = sub_8106D5C;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_8106D5C(struct Sprite *sprite)
|
|
|
|
{
|
|
|
|
if (sprite->animEnded)
|
|
|
|
{
|
|
|
|
if (--sprite->data[0])
|
|
|
|
StartSpriteAnim(sprite, sprite->data[1]);
|
|
|
|
else
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_8106D90(u8 taskId)
|
|
|
|
{
|
|
|
|
u8 spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
|
|
|
|
|
2018-12-18 05:08:08 +01:00
|
|
|
PrepareAffineAnimInTaskData(&gTasks[taskId], spriteId, gUnknown_08593B98);
|
2018-12-18 04:56:34 +01:00
|
|
|
gTasks[taskId].func = sub_8106DD4;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_8106DD4(u8 taskId)
|
|
|
|
{
|
2018-12-18 05:08:08 +01:00
|
|
|
if (!RunAffineAnimFromTaskData(&gTasks[taskId]))
|
2018-12-18 04:56:34 +01:00
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
void AnimJaggedMusicNote(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
int var1;
|
|
|
|
u8 battler = !gBattleAnimArgs[0] ? gBattleAnimAttacker : gBattleAnimTarget;
|
|
|
|
|
|
|
|
if (GetBattlerSide(battler) == B_SIDE_OPPONENT)
|
|
|
|
gBattleAnimArgs[1] *= -1;
|
|
|
|
|
|
|
|
sprite->pos1.x = GetBattlerSpriteCoord(battler, 2) + gBattleAnimArgs[1];
|
|
|
|
sprite->pos1.y = GetBattlerSpriteCoord(battler, 3) + gBattleAnimArgs[2];
|
|
|
|
sprite->data[0] = 0;
|
|
|
|
sprite->data[1] = (u16)sprite->pos1.x << 3;
|
|
|
|
sprite->data[2] = (u16)sprite->pos1.y << 3;
|
|
|
|
|
|
|
|
var1 = gBattleAnimArgs[1] << 3;
|
|
|
|
if (var1 < 0)
|
|
|
|
var1 += 7;
|
|
|
|
sprite->data[3] = var1 >> 3;
|
|
|
|
|
|
|
|
var1 = gBattleAnimArgs[2] << 3;
|
|
|
|
if (var1 < 0)
|
|
|
|
var1 += 7;
|
|
|
|
sprite->data[4] = var1 >> 3;
|
|
|
|
|
|
|
|
sprite->oam.tileNum += gBattleAnimArgs[3] * 16;
|
|
|
|
sprite->callback = sub_8106EC8;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_8106EC8(struct Sprite *sprite)
|
|
|
|
{
|
|
|
|
sprite->data[1] += sprite->data[3];
|
|
|
|
sprite->data[2] += sprite->data[4];
|
|
|
|
sprite->pos1.x = sprite->data[1] >> 3;
|
|
|
|
sprite->pos1.y = sprite->data[2] >> 3;
|
|
|
|
if (++sprite->data[0] > 16)
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
void AnimPerishSongMusicNote2(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
if (!sprite->data[0])
|
|
|
|
{
|
|
|
|
sprite->data[1] = 120 - gBattleAnimArgs[0];
|
|
|
|
sprite->invisible = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (++sprite->data[0] == sprite->data[1])
|
2018-12-18 05:08:08 +01:00
|
|
|
SetGreyscaleOrOriginalPalette(sprite->oam.paletteNum + 16, 0);
|
2018-12-18 04:56:34 +01:00
|
|
|
|
|
|
|
if (sprite->data[0] == sprite->data[1] + 80)
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
void AnimPerishSongMusicNote(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
int index;
|
|
|
|
int var2;
|
|
|
|
|
|
|
|
if (!sprite->data[0])
|
|
|
|
{
|
|
|
|
sprite->pos1.x = 120;
|
|
|
|
sprite->pos1.y = (gBattleAnimArgs[0] + (((u16)gBattleAnimArgs[0]) >> 31)) / 2 - 15;
|
|
|
|
|
|
|
|
StartSpriteAnim(sprite, gBattleAnimArgs[1]);
|
|
|
|
|
|
|
|
sprite->data[5] = 120;
|
|
|
|
sprite->data[3] = gBattleAnimArgs[2];
|
|
|
|
}
|
|
|
|
|
|
|
|
sprite->data[0]++;
|
|
|
|
|
|
|
|
sprite->data[1] = (sprite->data[0] + ((u16)sprite->data[0] >> 31)) / 2;
|
|
|
|
index = ((sprite->data[0] * 3) + (u16)sprite->data[3]);
|
|
|
|
var2 = 0xFF;
|
|
|
|
sprite->data[6] = (sprite->data[6] + 10) & 0xFF;
|
|
|
|
|
|
|
|
index &= var2;
|
|
|
|
sprite->pos2.x = Cos(index, 100);
|
|
|
|
|
|
|
|
sprite->pos2.y = sprite->data[1] + Sin(index, 10) + Cos(sprite->data[6], 4);
|
|
|
|
|
|
|
|
if (sprite->data[0] > sprite->data[5])
|
|
|
|
{
|
|
|
|
sprite->callback = sub_8107018;
|
|
|
|
|
|
|
|
sprite->data[0] = 0;
|
2019-02-06 20:17:09 +01:00
|
|
|
SetSpritePrimaryCoordsFromSecondaryCoords(sprite);
|
2018-12-18 04:56:34 +01:00
|
|
|
sprite->data[2] = 5;
|
|
|
|
sprite->data[4] = 0;
|
|
|
|
sprite->data[3] = 0;
|
|
|
|
|
|
|
|
StartSpriteAffineAnim(sprite, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_8107018(struct Sprite *sprite)
|
|
|
|
{
|
|
|
|
if (++sprite->data[0] > 10)
|
|
|
|
{
|
|
|
|
sprite->data[0] = 0;
|
|
|
|
sprite->callback = sub_810703C;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_810703C(struct Sprite *sprite)
|
|
|
|
{
|
|
|
|
sprite->data[3] += sprite->data[2];
|
|
|
|
sprite->pos2.y = sprite->data[3];
|
|
|
|
|
|
|
|
sprite->data[2]++;
|
|
|
|
|
|
|
|
if (sprite->data[3] > 48 && sprite->data[2] > 0)
|
|
|
|
{
|
|
|
|
sprite->data[2] = sprite->data[4] - 5;
|
|
|
|
sprite->data[4]++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sprite->data[4] > 3)
|
|
|
|
{
|
|
|
|
int var1 = sprite->data[2];
|
|
|
|
sprite->invisible = var1 - (((s32)(var1 + ((u32)var1 >> 31)) >> 1) << 1);
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sprite->data[4] == 4)
|
|
|
|
{
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 15:54:16 +02:00
|
|
|
void AnimGuardRing(struct Sprite *sprite)
|
2018-12-18 04:56:34 +01:00
|
|
|
{
|
|
|
|
if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimAttacker)))
|
|
|
|
{
|
|
|
|
SetAverageBattlerPositions(gBattleAnimAttacker, 0, &sprite->pos1.x, &sprite->pos1.y);
|
|
|
|
sprite->pos1.y += 40;
|
|
|
|
|
|
|
|
StartSpriteAffineAnim(sprite, 1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0);
|
|
|
|
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + 40;
|
|
|
|
}
|
|
|
|
|
|
|
|
sprite->data[0] = 13;
|
|
|
|
sprite->data[2] = sprite->pos1.x;
|
|
|
|
sprite->data[4] = sprite->pos1.y - 72;
|
|
|
|
|
|
|
|
sprite->callback = StartAnimLinearTranslation;
|
|
|
|
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
|
|
|
|
}
|
|
|
|
|
|
|
|
void AnimTask_IsFuryCutterHitRight(u8 taskId)
|
|
|
|
{
|
|
|
|
gBattleAnimArgs[7] = gAnimDisableStructPtr->furyCutterCounter & 1;
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|
|
|
|
|
|
|
|
void AnimTask_GetFuryCutterHitCount(u8 taskId)
|
|
|
|
{
|
|
|
|
gBattleAnimArgs[7] = gAnimDisableStructPtr->furyCutterCounter;
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|