2018-10-25 23:46:23 +02:00
|
|
|
#include "global.h"
|
|
|
|
#include "battle_anim.h"
|
2019-02-19 22:08:40 +01:00
|
|
|
#include "palette.h"
|
|
|
|
#include "trig.h"
|
|
|
|
#include "constants/battle_anim.h"
|
2018-10-25 23:46:23 +02:00
|
|
|
#include "constants/rgb.h"
|
2019-03-03 09:54:44 +01:00
|
|
|
#include "random.h"
|
|
|
|
|
2020-02-15 00:11:04 +01:00
|
|
|
extern const struct SpriteTemplate gFlashingHitSplatSpriteTemplate;
|
2018-10-25 23:46:23 +02:00
|
|
|
|
2020-02-15 00:11:04 +01:00
|
|
|
static void AnimEllipticalGust(struct Sprite *);
|
2020-02-20 22:22:33 +01:00
|
|
|
static void AnimEllipticalGust_Step(struct Sprite *);
|
2020-02-15 00:11:04 +01:00
|
|
|
static void AnimGustToTarget(struct Sprite *);
|
2020-02-20 22:22:33 +01:00
|
|
|
static void AnimGustToTarget_Step(struct Sprite *);
|
|
|
|
static void AnimAirWaveCrescent(struct Sprite *);
|
2020-02-15 00:11:04 +01:00
|
|
|
static void AnimFlyBallUp(struct Sprite *);
|
2020-02-20 22:22:33 +01:00
|
|
|
static void AnimFlyBallUp_Step(struct Sprite *);
|
2020-02-15 00:11:04 +01:00
|
|
|
static void AnimFlyBallAttack(struct Sprite *);
|
2020-02-20 22:22:33 +01:00
|
|
|
static void AnimFlyBallAttack_Step(struct Sprite *);
|
2020-02-15 00:11:04 +01:00
|
|
|
static void AnimFallingFeather(struct Sprite *);
|
2021-02-27 18:04:45 +01:00
|
|
|
static void AnimFallingFeather_Step(struct Sprite *);
|
|
|
|
static void AnimWhirlwindLine_Step(struct Sprite *);
|
2021-04-11 19:21:22 +02:00
|
|
|
static void AnimUnusedBubbleThrow(struct Sprite *);
|
2020-02-20 02:22:53 +01:00
|
|
|
static void AnimWhirlwindLine(struct Sprite *);
|
2020-02-20 22:22:33 +01:00
|
|
|
static void AnimBounceBallShrink(struct Sprite *);
|
|
|
|
static void AnimBounceBallLand(struct Sprite *);
|
2020-02-15 00:11:04 +01:00
|
|
|
static void AnimDiveBall(struct Sprite *);
|
2020-02-20 22:22:33 +01:00
|
|
|
static void AnimDiveBall_Step1(struct Sprite *);
|
|
|
|
static void AnimDiveBall_Step2(struct Sprite *);
|
2020-02-15 00:11:04 +01:00
|
|
|
static void AnimDiveWaterSplash(struct Sprite *);
|
2020-02-14 22:05:43 +01:00
|
|
|
static void AnimSprayWaterDroplet(struct Sprite *);
|
2020-02-20 22:22:33 +01:00
|
|
|
static void AnimSprayWaterDroplet_Step(struct Sprite *);
|
2021-04-11 19:21:22 +02:00
|
|
|
static void AnimUnusedFlashingLight(struct Sprite *);
|
|
|
|
static void AnimUnusedFlashingLight_Step(struct Sprite *);
|
2020-02-16 23:49:24 +01:00
|
|
|
static void AnimSkyAttackBird(struct Sprite *);
|
2020-02-20 22:22:33 +01:00
|
|
|
static void AnimSkyAttackBird_Step(struct Sprite *);
|
|
|
|
static void AnimTask_AnimateGustTornadoPalette_Step(u8);
|
2019-03-03 09:54:44 +01:00
|
|
|
|
2019-02-19 22:08:40 +01:00
|
|
|
|
2020-02-15 00:11:04 +01:00
|
|
|
const struct SpriteTemplate gEllipticalGustSpriteTemplate =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_GUST,
|
|
|
|
.paletteTag = ANIM_TAG_GUST,
|
2019-10-15 01:26:47 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_32x64,
|
2018-10-25 23:46:23 +02:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2020-02-15 00:11:04 +01:00
|
|
|
.callback = AnimEllipticalGust,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
static const union AffineAnimCmd sAffineAnim_GustToTarget[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x10, 0x100, 0, 0),
|
|
|
|
AFFINEANIMCMD_FRAME(0xA, 0x0, 0, 24),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
static const union AffineAnimCmd *const sAffineAnims_GustToTarget[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
2020-02-21 18:38:20 +01:00
|
|
|
sAffineAnim_GustToTarget,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-15 00:11:04 +01:00
|
|
|
const struct SpriteTemplate gGustToTargetSpriteTemplate =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_GUST,
|
|
|
|
.paletteTag = ANIM_TAG_GUST,
|
2019-10-15 01:26:47 +02:00
|
|
|
.oam = &gOamData_AffineNormal_ObjNormal_32x64,
|
2018-10-25 23:46:23 +02:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2020-02-21 18:38:20 +01:00
|
|
|
.affineAnims = sAffineAnims_GustToTarget,
|
2020-02-15 00:11:04 +01:00
|
|
|
.callback = AnimGustToTarget,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
static const union AnimCmd sAffineAnim_AirWaveCrescent[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(0, 3),
|
|
|
|
ANIMCMD_FRAME(0, 3, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(0, 3, .vFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(0, 3, .vFlip = TRUE, .hFlip = TRUE),
|
|
|
|
ANIMCMD_JUMP(0),
|
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
static const union AnimCmd *const sAffineAnims_AirWaveCrescent[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
2020-02-21 18:38:20 +01:00
|
|
|
sAffineAnim_AirWaveCrescent,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-14 22:05:43 +01:00
|
|
|
const struct SpriteTemplate gAirWaveCrescentSpriteTemplate =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_AIR_WAVE_2,
|
|
|
|
.paletteTag = ANIM_TAG_AIR_WAVE_2,
|
2019-10-15 01:26:47 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_32x16,
|
2020-02-21 18:38:20 +01:00
|
|
|
.anims = sAffineAnims_AirWaveCrescent,
|
2018-10-25 23:46:23 +02:00
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2020-02-20 22:22:33 +01:00
|
|
|
.callback = AnimAirWaveCrescent,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
static const union AffineAnimCmd sAffineAnim_FlyBallUp[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x10, 0x100, 0, 0),
|
|
|
|
AFFINEANIMCMD_FRAME(0x28, 0x0, 0, 6),
|
|
|
|
AFFINEANIMCMD_FRAME(0x0, 0xFFE0, 0, 5),
|
|
|
|
AFFINEANIMCMD_FRAME(0xFFF0, 0x20, 0, 10),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
static const union AffineAnimCmd *const sAffineAnims_FlyBallUp[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
2020-02-21 18:38:20 +01:00
|
|
|
sAffineAnim_FlyBallUp,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
static const union AffineAnimCmd sAffineAnim_FlyBallAttack_0[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x0, 0x0, 50, 1),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
static const union AffineAnimCmd sAffineAnim_FlyBallAttack_1[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x0, 0x0, -40, 1),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
static const union AffineAnimCmd *const sAffineAnims_FlyBallAttack[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
2020-02-21 18:38:20 +01:00
|
|
|
sAffineAnim_FlyBallAttack_0,
|
|
|
|
sAffineAnim_FlyBallAttack_1,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-15 00:11:04 +01:00
|
|
|
const struct SpriteTemplate gFlyBallUpSpriteTemplate =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_ROUND_SHADOW,
|
|
|
|
.paletteTag = ANIM_TAG_ROUND_SHADOW,
|
2019-10-15 01:26:47 +02:00
|
|
|
.oam = &gOamData_AffineDouble_ObjNormal_64x64,
|
2018-10-25 23:46:23 +02:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2020-02-21 18:38:20 +01:00
|
|
|
.affineAnims = sAffineAnims_FlyBallUp,
|
2020-02-15 00:11:04 +01:00
|
|
|
.callback = AnimFlyBallUp,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-15 00:11:04 +01:00
|
|
|
const struct SpriteTemplate gFlyBallAttackSpriteTemplate =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_ROUND_SHADOW,
|
|
|
|
.paletteTag = ANIM_TAG_ROUND_SHADOW,
|
2019-10-15 01:26:47 +02:00
|
|
|
.oam = &gOamData_AffineNormal_ObjNormal_64x64,
|
2018-10-25 23:46:23 +02:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2020-02-21 18:38:20 +01:00
|
|
|
.affineAnims = sAffineAnims_FlyBallAttack,
|
2020-02-15 00:11:04 +01:00
|
|
|
.callback = AnimFlyBallAttack,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
static const union AnimCmd sAnim_FallingFeather_0[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(0, 0),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
static const union AnimCmd sAnim_FallingFeather_1[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(16, 0, .hFlip = TRUE),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
static const union AnimCmd *const sAnims_FallingFeather[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
2020-02-21 18:38:20 +01:00
|
|
|
sAnim_FallingFeather_0,
|
|
|
|
sAnim_FallingFeather_1,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-15 00:11:04 +01:00
|
|
|
const struct SpriteTemplate gFallingFeatherSpriteTemplate =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_WHITE_FEATHER,
|
|
|
|
.paletteTag = ANIM_TAG_WHITE_FEATHER,
|
2019-10-15 01:26:47 +02:00
|
|
|
.oam = &gOamData_AffineNormal_ObjNormal_32x32,
|
2020-02-21 18:38:20 +01:00
|
|
|
.anims = sAnims_FallingFeather,
|
2018-10-25 23:46:23 +02:00
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2020-02-15 00:11:04 +01:00
|
|
|
.callback = AnimFallingFeather,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2021-02-27 18:04:45 +01:00
|
|
|
// Unused
|
2021-04-11 19:21:22 +02:00
|
|
|
static const struct SpriteTemplate sUnusedBubbleThrowSpriteTemplate =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_SMALL_BUBBLES,
|
|
|
|
.paletteTag = ANIM_TAG_SMALL_BUBBLES,
|
2019-10-15 01:26:47 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_16x16,
|
2018-10-25 23:46:23 +02:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2021-04-11 19:21:22 +02:00
|
|
|
.callback = AnimUnusedBubbleThrow,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
static const union AnimCmd sAnim_WhirlwindLines[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
ANIMCMD_FRAME(0, 1),
|
|
|
|
ANIMCMD_FRAME(8, 1),
|
|
|
|
ANIMCMD_FRAME(16, 1),
|
|
|
|
ANIMCMD_FRAME(8, 1, .hFlip = TRUE),
|
|
|
|
ANIMCMD_FRAME(0, 1, .hFlip = TRUE),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
static const union AnimCmd *const sAnims_WhirlwindLines[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
2020-02-21 18:38:20 +01:00
|
|
|
sAnim_WhirlwindLines,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-20 02:22:53 +01:00
|
|
|
const struct SpriteTemplate gWhirlwindLineSpriteTemplate =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_WHIRLWIND_LINES,
|
|
|
|
.paletteTag = ANIM_TAG_WHIRLWIND_LINES,
|
2019-10-15 01:26:47 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_32x16,
|
2020-02-21 18:38:20 +01:00
|
|
|
.anims = sAnims_WhirlwindLines,
|
2018-10-25 23:46:23 +02:00
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2020-02-20 02:22:53 +01:00
|
|
|
.callback = AnimWhirlwindLine,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
static const union AffineAnimCmd sAffineAnim_BounceBallShrink[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x10, 0x100, 0, 0),
|
|
|
|
AFFINEANIMCMD_FRAME(0x28, 0x0, 0, 6),
|
|
|
|
AFFINEANIMCMD_FRAME(0x0, 0xFFE0, 0, 5),
|
|
|
|
AFFINEANIMCMD_FRAME(0xFFEC, 0x0, 0, 7),
|
|
|
|
AFFINEANIMCMD_FRAME(0xFFEC, 0xFFEC, 0, 5),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
static const union AffineAnimCmd *const sAffineAnims_BounceBallShrink[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
2020-02-21 18:38:20 +01:00
|
|
|
sAffineAnim_BounceBallShrink,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-14 22:05:43 +01:00
|
|
|
const struct SpriteTemplate gBounceBallShrinkSpriteTemplate =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_ROUND_SHADOW,
|
|
|
|
.paletteTag = ANIM_TAG_ROUND_SHADOW,
|
2019-10-15 01:26:47 +02:00
|
|
|
.oam = &gOamData_AffineDouble_ObjNormal_64x64,
|
2018-10-25 23:46:23 +02:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2020-02-21 18:38:20 +01:00
|
|
|
.affineAnims = sAffineAnims_BounceBallShrink,
|
2020-02-20 22:22:33 +01:00
|
|
|
.callback = AnimBounceBallShrink,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
static const union AffineAnimCmd sAffineAnim_BounceBallLand[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0xA0, 0x100, 0, 0),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
static const union AffineAnimCmd *const sAffineAnims_BounceBallLand[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
2020-02-21 18:38:20 +01:00
|
|
|
sAffineAnim_BounceBallLand,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-14 22:05:43 +01:00
|
|
|
const struct SpriteTemplate gBounceBallLandSpriteTemplate =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_ROUND_SHADOW,
|
|
|
|
.paletteTag = ANIM_TAG_ROUND_SHADOW,
|
2019-10-15 01:26:47 +02:00
|
|
|
.oam = &gOamData_AffineDouble_ObjNormal_64x64,
|
2018-10-25 23:46:23 +02:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2020-02-21 18:38:20 +01:00
|
|
|
.affineAnims = sAffineAnims_BounceBallLand,
|
2020-02-20 22:22:33 +01:00
|
|
|
.callback = AnimBounceBallLand,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
static const union AffineAnimCmd sAffineAnim_DiveBall[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x10, 0x100, 0, 0),
|
|
|
|
AFFINEANIMCMD_FRAME(0x28, 0x0, 0, 6),
|
|
|
|
AFFINEANIMCMD_FRAME(0x0, 0xFFE0, 0, 5),
|
|
|
|
AFFINEANIMCMD_FRAME(0xFFF0, 0x20, 0, 10),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
static const union AffineAnimCmd *const sAffineAnims_DiveBall[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
2020-02-21 18:38:20 +01:00
|
|
|
sAffineAnim_DiveBall,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-15 00:11:04 +01:00
|
|
|
const struct SpriteTemplate gDiveBallSpriteTemplate =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_ROUND_SHADOW,
|
|
|
|
.paletteTag = ANIM_TAG_ROUND_SHADOW,
|
2019-10-15 01:26:47 +02:00
|
|
|
.oam = &gOamData_AffineDouble_ObjNormal_64x64,
|
2018-10-25 23:46:23 +02:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
2020-02-21 18:38:20 +01:00
|
|
|
.affineAnims = sAffineAnims_DiveBall,
|
2020-02-15 00:11:04 +01:00
|
|
|
.callback = AnimDiveBall,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2021-02-27 18:04:45 +01:00
|
|
|
static const union AffineAnimCmd sAnim_Unused_085964A8[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
AFFINEANIMCMD_FRAME(0x100, 0x0, 0, 0),
|
|
|
|
AFFINEANIMCMD_FRAME(0x0, 0x20, 0, 12),
|
|
|
|
AFFINEANIMCMD_FRAME(0x0, 0xFFE0, 0, 11),
|
|
|
|
AFFINEANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
2020-02-21 18:38:20 +01:00
|
|
|
// Unused
|
2021-02-27 18:04:45 +01:00
|
|
|
static const union AffineAnimCmd *const sAnims_Unused_085964C8[] =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
2021-02-27 18:04:45 +01:00
|
|
|
sAnim_Unused_085964A8,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-15 00:11:04 +01:00
|
|
|
const struct SpriteTemplate gDiveWaterSplashSpriteTemplate =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_SPLASH,
|
|
|
|
.paletteTag = ANIM_TAG_SPLASH,
|
2019-10-15 01:26:47 +02:00
|
|
|
.oam = &gOamData_AffineDouble_ObjNormal_64x64,
|
2018-10-25 23:46:23 +02:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2020-02-15 00:11:04 +01:00
|
|
|
.callback = AnimDiveWaterSplash,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-14 22:05:43 +01:00
|
|
|
const struct SpriteTemplate gSprayWaterDropletSpriteTemplate =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_SWEAT_BEAD,
|
|
|
|
.paletteTag = ANIM_TAG_SWEAT_BEAD,
|
2019-10-15 01:26:47 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjNormal_8x8,
|
2018-10-25 23:46:23 +02:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2020-02-14 22:05:43 +01:00
|
|
|
.callback = AnimSprayWaterDroplet,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2021-02-27 18:04:45 +01:00
|
|
|
// Unused
|
2021-04-11 19:21:22 +02:00
|
|
|
static const struct SpriteTemplate sUnusedFlashingLightSpriteTemplate =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_CIRCLE_OF_LIGHT,
|
|
|
|
.paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT,
|
2019-10-15 01:26:47 +02:00
|
|
|
.oam = &gOamData_AffineOff_ObjBlend_64x64,
|
2018-10-25 23:46:23 +02:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2021-04-11 19:21:22 +02:00
|
|
|
.callback = AnimUnusedFlashingLight,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
|
|
|
|
2020-02-16 23:49:24 +01:00
|
|
|
const struct SpriteTemplate gSkyAttackBirdSpriteTemplate =
|
2018-10-25 23:46:23 +02:00
|
|
|
{
|
|
|
|
.tileTag = ANIM_TAG_BIRD,
|
|
|
|
.paletteTag = ANIM_TAG_BIRD,
|
2019-10-15 01:26:47 +02:00
|
|
|
.oam = &gOamData_AffineDouble_ObjNormal_64x64,
|
2018-10-25 23:46:23 +02:00
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
2020-02-16 23:49:24 +01:00
|
|
|
.callback = AnimSkyAttackBird,
|
2018-10-25 23:46:23 +02:00
|
|
|
};
|
2019-02-19 22:08:40 +01:00
|
|
|
|
|
|
|
|
2020-02-15 00:11:04 +01:00
|
|
|
static void AnimEllipticalGust(struct Sprite *sprite)
|
2019-02-19 22:08:40 +01:00
|
|
|
{
|
|
|
|
InitSpritePosToAnimTarget(sprite, FALSE);
|
|
|
|
sprite->pos1.y += 20;
|
|
|
|
sprite->data[1] = 191;
|
2020-02-20 22:22:33 +01:00
|
|
|
sprite->callback = AnimEllipticalGust_Step;
|
2019-02-19 22:08:40 +01:00
|
|
|
sprite->callback(sprite);
|
|
|
|
}
|
|
|
|
|
2020-02-20 22:22:33 +01:00
|
|
|
static void AnimEllipticalGust_Step(struct Sprite *sprite)
|
2019-03-05 09:02:05 +01:00
|
|
|
{
|
2019-02-19 22:08:40 +01:00
|
|
|
sprite->pos2.x = Sin(sprite->data[1], 32);
|
|
|
|
sprite->pos2.y = Cos(sprite->data[1], 8);
|
|
|
|
sprite->data[1] += 5;
|
|
|
|
sprite->data[1] &= 0xFF;
|
|
|
|
if (++sprite->data[0] == 71)
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
|
2020-02-15 00:11:04 +01:00
|
|
|
// Animates the palette on the gust tornado to make it look like its spinning
|
|
|
|
void AnimTask_AnimateGustTornadoPalette(u8 taskId)
|
2019-02-19 22:08:40 +01:00
|
|
|
{
|
|
|
|
gTasks[taskId].data[0] = gBattleAnimArgs[1];
|
|
|
|
gTasks[taskId].data[1] = gBattleAnimArgs[0];
|
|
|
|
gTasks[taskId].data[2] = IndexOfSpritePaletteTag(ANIM_TAG_GUST);
|
2020-02-20 22:22:33 +01:00
|
|
|
gTasks[taskId].func = AnimTask_AnimateGustTornadoPalette_Step;
|
2019-02-19 22:08:40 +01:00
|
|
|
}
|
|
|
|
|
2020-02-20 22:22:33 +01:00
|
|
|
static void AnimTask_AnimateGustTornadoPalette_Step(u8 taskId)
|
2019-02-19 22:08:40 +01:00
|
|
|
{
|
|
|
|
u8 data2;
|
|
|
|
u16 temp;
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
int i, base;
|
2019-02-19 22:08:40 +01:00
|
|
|
|
|
|
|
if (gTasks[taskId].data[10]++ == gTasks[taskId].data[1])
|
|
|
|
{
|
|
|
|
gTasks[taskId].data[10] = 0;
|
|
|
|
data2 = gTasks[taskId].data[2];
|
|
|
|
temp = gPlttBufferFaded[16 * data2 + 0x108];
|
|
|
|
i = 7;
|
|
|
|
base = data2 * 16;
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
do
|
|
|
|
{
|
2019-02-19 22:08:40 +01:00
|
|
|
gPlttBufferFaded[base + 0x101 + i] = gPlttBufferFaded[base + 0x100 + i];
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
i--;
|
|
|
|
} while (i > 0);
|
2019-02-19 22:08:40 +01:00
|
|
|
|
|
|
|
gPlttBufferFaded[base + 0x101] = temp;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (--gTasks[taskId].data[0] == 0)
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|
|
|
|
|
2020-02-15 00:11:04 +01:00
|
|
|
static void AnimGustToTarget(struct Sprite *sprite)
|
2019-02-19 22:08:40 +01:00
|
|
|
{
|
|
|
|
InitSpritePosToAnimAttacker(sprite, TRUE);
|
|
|
|
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
|
|
|
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
|
|
|
|
|
|
|
|
sprite->data[0] = gBattleAnimArgs[4];
|
|
|
|
sprite->data[1] = sprite->pos1.x;
|
|
|
|
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + gBattleAnimArgs[2];
|
|
|
|
sprite->data[3] = sprite->pos1.y;
|
|
|
|
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[3];
|
|
|
|
InitAnimLinearTranslation(sprite);
|
|
|
|
sprite->callback = RunStoredCallbackWhenAffineAnimEnds;
|
2020-02-20 22:22:33 +01:00
|
|
|
StoreSpriteCallbackInData6(sprite, AnimGustToTarget_Step);
|
2019-02-19 22:08:40 +01:00
|
|
|
}
|
|
|
|
|
2020-02-20 22:22:33 +01:00
|
|
|
static void AnimGustToTarget_Step(struct Sprite *sprite)
|
2019-02-19 22:08:40 +01:00
|
|
|
{
|
|
|
|
if (AnimTranslateLinear(sprite))
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
|
2020-02-20 22:22:33 +01:00
|
|
|
static void AnimAirWaveCrescent(struct Sprite *sprite)
|
2019-02-19 22:08:40 +01:00
|
|
|
{
|
|
|
|
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
|
|
|
{
|
|
|
|
gBattleAnimArgs[0] = -gBattleAnimArgs[0];
|
|
|
|
gBattleAnimArgs[1] = -gBattleAnimArgs[1];
|
|
|
|
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
|
|
|
|
gBattleAnimArgs[3] = -gBattleAnimArgs[3];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IsContest())
|
|
|
|
{
|
|
|
|
gBattleAnimArgs[1] = -gBattleAnimArgs[1];
|
|
|
|
gBattleAnimArgs[3] = -gBattleAnimArgs[3];
|
|
|
|
}
|
|
|
|
|
|
|
|
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2);
|
|
|
|
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET);
|
|
|
|
sprite->pos1.x += gBattleAnimArgs[0];
|
|
|
|
sprite->pos1.y += gBattleAnimArgs[1];
|
|
|
|
sprite->data[0] = gBattleAnimArgs[4];
|
|
|
|
|
|
|
|
if (gBattleAnimArgs[6] == 0)
|
|
|
|
{
|
|
|
|
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
|
|
|
|
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SetAverageBattlerPositions(gBattleAnimTarget, 1, &sprite->data[2], &sprite->data[4]);
|
|
|
|
}
|
|
|
|
|
|
|
|
sprite->data[2] = sprite->data[2] + gBattleAnimArgs[2];
|
|
|
|
sprite->data[4] = sprite->data[4] + gBattleAnimArgs[3];
|
|
|
|
sprite->callback = StartAnimLinearTranslation;
|
|
|
|
|
|
|
|
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
|
|
|
|
SeekSpriteAnim(sprite, gBattleAnimArgs[5]);
|
|
|
|
}
|
|
|
|
|
2020-02-15 00:11:04 +01:00
|
|
|
static void AnimFlyBallUp(struct Sprite *sprite)
|
2019-02-19 22:08:40 +01:00
|
|
|
{
|
|
|
|
InitSpritePosToAnimAttacker(sprite, TRUE);
|
|
|
|
sprite->data[0] = gBattleAnimArgs[2];
|
|
|
|
sprite->data[1] = gBattleAnimArgs[3];
|
2020-02-20 22:22:33 +01:00
|
|
|
sprite->callback = AnimFlyBallUp_Step;
|
2020-02-15 00:11:04 +01:00
|
|
|
gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)].invisible = TRUE;
|
2019-02-19 22:08:40 +01:00
|
|
|
}
|
|
|
|
|
2020-02-20 22:22:33 +01:00
|
|
|
static void AnimFlyBallUp_Step(struct Sprite *sprite)
|
2019-02-19 22:08:40 +01:00
|
|
|
{
|
|
|
|
if (sprite->data[0] > 0)
|
|
|
|
{
|
|
|
|
sprite->data[0]--;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite->data[2] += sprite->data[1];
|
|
|
|
sprite->pos2.y -= (sprite->data[2] >> 8);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sprite->pos1.y + sprite->pos2.y < -32)
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
|
2020-02-15 00:11:04 +01:00
|
|
|
static void AnimFlyBallAttack(struct Sprite *sprite)
|
2019-02-19 22:08:40 +01:00
|
|
|
{
|
|
|
|
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
|
|
|
{
|
|
|
|
sprite->pos1.x = 272;
|
|
|
|
sprite->pos1.y = -32;
|
|
|
|
StartSpriteAffineAnim(sprite, 1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite->pos1.x = -32;
|
|
|
|
sprite->pos1.y = -32;
|
|
|
|
}
|
|
|
|
|
|
|
|
sprite->data[0] = gBattleAnimArgs[0];
|
|
|
|
sprite->data[1] = sprite->pos1.x;
|
|
|
|
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
|
|
|
|
sprite->data[3] = sprite->pos1.y;
|
|
|
|
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
|
|
|
|
|
|
|
|
InitAnimLinearTranslation(sprite);
|
2020-02-20 22:22:33 +01:00
|
|
|
sprite->callback = AnimFlyBallAttack_Step;
|
2019-02-19 22:08:40 +01:00
|
|
|
}
|
|
|
|
|
2020-02-20 22:22:33 +01:00
|
|
|
static void AnimFlyBallAttack_Step(struct Sprite *sprite)
|
2019-02-19 22:08:40 +01:00
|
|
|
{
|
|
|
|
sprite->data[0] = 1;
|
|
|
|
AnimTranslateLinear(sprite);
|
|
|
|
if (((u16)sprite->data[3] >> 8) > 200)
|
|
|
|
{
|
|
|
|
sprite->pos1.x += sprite->pos2.x;
|
|
|
|
sprite->pos2.x = 0;
|
|
|
|
sprite->data[3] &= 0xFF;
|
|
|
|
}
|
|
|
|
|
2019-03-05 09:02:05 +01:00
|
|
|
if (sprite->pos1.x + sprite->pos2.x < -32
|
|
|
|
|| sprite->pos1.x + sprite->pos2.x > 272
|
|
|
|
|| sprite->pos1.y + sprite->pos2.y > 160)
|
2019-02-19 22:08:40 +01:00
|
|
|
{
|
2020-02-20 22:22:33 +01:00
|
|
|
gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)].invisible = FALSE;
|
2019-02-19 22:08:40 +01:00
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-22 00:22:18 +01:00
|
|
|
void DestroyAnimSpriteAfterTimer(struct Sprite *sprite)
|
2019-02-19 22:08:40 +01:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (sprite->data[0]-- <= 0)
|
2019-02-19 22:08:40 +01:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (sprite->oam.affineMode & ST_OAM_AFFINE_ON_MASK)
|
|
|
|
{
|
|
|
|
FreeOamMatrix(sprite->oam.matrixNum);
|
|
|
|
sprite->oam.affineMode = ST_OAM_AFFINE_OFF;
|
|
|
|
}
|
2020-08-09 23:09:55 +02:00
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
DestroySprite(sprite);
|
|
|
|
gAnimVisualTaskCount--;
|
|
|
|
}
|
2019-02-19 22:08:40 +01:00
|
|
|
}
|
|
|
|
|
2019-03-05 09:02:05 +01:00
|
|
|
struct FeatherDanceData
|
|
|
|
{
|
2019-10-11 23:42:02 +02:00
|
|
|
u16 unk0_0a:1;
|
|
|
|
u16 unk0_0b:1;
|
|
|
|
u16 unk0_0c:1;
|
|
|
|
u16 unk0_0d:1;
|
|
|
|
u16 unk0_1:4;
|
|
|
|
u16 unk1:8;
|
2019-03-05 09:02:05 +01:00
|
|
|
u16 unk2;
|
|
|
|
s16 unk4;
|
|
|
|
u16 unk6;
|
|
|
|
u16 unk8;
|
|
|
|
u16 unkA;
|
|
|
|
u8 unkC[2];
|
|
|
|
u16 unkE_0:1;
|
|
|
|
u16 unkE_1:15;
|
|
|
|
};
|
|
|
|
|
2020-02-15 00:11:04 +01:00
|
|
|
static void AnimFallingFeather(struct Sprite *sprite)
|
2019-02-19 22:08:40 +01:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
u8 battler, matrixNum, sinIndex;
|
2020-10-21 10:04:59 +02:00
|
|
|
s16 spriteCoord;
|
2019-02-19 22:08:40 +01:00
|
|
|
|
2019-03-05 09:02:05 +01:00
|
|
|
struct FeatherDanceData *data = (struct FeatherDanceData *)sprite->data;
|
2019-02-19 22:08:40 +01:00
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gBattleAnimArgs[7] & 0x100)
|
|
|
|
battler = gBattleAnimAttacker;
|
|
|
|
else
|
|
|
|
battler = gBattleAnimTarget;
|
2019-02-19 22:08:40 +01:00
|
|
|
|
2019-03-05 09:02:05 +01:00
|
|
|
if (GetBattlerSide(battler) == B_SIDE_PLAYER)
|
2019-02-19 22:08:40 +01:00
|
|
|
gBattleAnimArgs[0] = -gBattleAnimArgs[0];
|
|
|
|
|
2019-03-05 09:02:05 +01:00
|
|
|
sprite->pos1.x = GetBattlerSpriteCoord(battler, BATTLER_COORD_ATTR_HEIGHT) + gBattleAnimArgs[0];
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
spriteCoord = GetBattlerSpriteCoord(battler, BATTLER_COORD_ATTR_WIDTH);
|
|
|
|
sprite->pos1.y = spriteCoord + gBattleAnimArgs[1];
|
2019-02-19 22:08:40 +01:00
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
data->unk8 = sprite->pos1.y << 8;
|
|
|
|
data->unkE_1 = spriteCoord + gBattleAnimArgs[6];
|
2019-03-05 09:02:05 +01:00
|
|
|
data->unk0_0c = 1;
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
data->unk2 = gBattleAnimArgs[2] & 0xFF;
|
|
|
|
data->unkA = (gBattleAnimArgs[2] >> 8) & 0xFF;
|
2019-03-05 09:02:05 +01:00
|
|
|
data->unk4 = gBattleAnimArgs[3];
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
data->unk6 = gBattleAnimArgs[4];
|
|
|
|
*(u16*)(data->unkC) = gBattleAnimArgs[5];
|
2019-02-19 22:08:40 +01:00
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (data->unk2 >= 64 && data->unk2 <= 191)
|
2019-02-19 22:08:40 +01:00
|
|
|
{
|
|
|
|
if (!IsContest())
|
2019-03-05 09:02:05 +01:00
|
|
|
sprite->oam.priority = GetBattlerSpriteBGPriority(battler) + 1;
|
2019-02-19 22:08:40 +01:00
|
|
|
else
|
2019-03-05 09:02:05 +01:00
|
|
|
sprite->oam.priority = GetBattlerSpriteBGPriority(battler);
|
2019-02-19 22:08:40 +01:00
|
|
|
|
2019-03-05 09:02:05 +01:00
|
|
|
data->unkE_0 = 0;
|
2019-02-19 22:08:40 +01:00
|
|
|
|
2019-03-05 09:02:05 +01:00
|
|
|
if (!(data->unk4 & 0x8000))
|
2019-02-19 22:08:40 +01:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
sprite->hFlip ^= 1;
|
|
|
|
sprite->animNum = sprite->hFlip;
|
|
|
|
|
|
|
|
sprite->animBeginning = 1;
|
|
|
|
sprite->animEnded = 0;
|
2019-02-19 22:08:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-03-05 09:02:05 +01:00
|
|
|
sprite->oam.priority = GetBattlerSpriteBGPriority(battler);
|
|
|
|
data->unkE_0 = 1;
|
2019-02-19 22:08:40 +01:00
|
|
|
|
2019-03-05 09:02:05 +01:00
|
|
|
if (data->unk4 & 0x8000)
|
2019-02-19 22:08:40 +01:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
sprite->hFlip ^= 1;
|
|
|
|
sprite->animNum = sprite->hFlip;
|
|
|
|
|
|
|
|
sprite->animBeginning = 1;
|
|
|
|
sprite->animEnded = 0;
|
2019-02-19 22:08:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
data->unk0_1 = data->unk2 >> 6;
|
|
|
|
sprite->pos2.x = (gSineTable[data->unk2] * data->unkC[0]) >> 8;
|
2019-02-19 22:08:40 +01:00
|
|
|
matrixNum = sprite->oam.matrixNum;
|
|
|
|
|
2019-03-05 09:02:05 +01:00
|
|
|
sinIndex = (-sprite->pos2.x >> 1) + data->unkA;
|
2020-10-21 10:04:59 +02:00
|
|
|
spriteCoord = gSineTable[sinIndex];
|
2019-02-19 22:08:40 +01:00
|
|
|
|
|
|
|
gOamMatrices[matrixNum].a = gOamMatrices[matrixNum].d = gSineTable[sinIndex + 64];
|
2020-10-21 10:04:59 +02:00
|
|
|
gOamMatrices[matrixNum].b = spriteCoord;
|
|
|
|
gOamMatrices[matrixNum].c = -spriteCoord;
|
2019-02-19 22:08:40 +01:00
|
|
|
|
2021-02-27 18:04:45 +01:00
|
|
|
sprite->callback = AnimFallingFeather_Step;
|
2019-02-19 22:08:40 +01:00
|
|
|
}
|
2019-03-03 09:54:44 +01:00
|
|
|
|
2021-02-27 18:04:45 +01:00
|
|
|
static void AnimFallingFeather_Step(struct Sprite *sprite)
|
2019-03-05 09:02:05 +01:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
u8 matrixNum, sinIndex;
|
2019-03-05 09:02:05 +01:00
|
|
|
s16 sinVal = 0;
|
|
|
|
struct FeatherDanceData *data = (struct FeatherDanceData *)sprite->data;
|
|
|
|
if (data->unk0_0a)
|
|
|
|
{
|
|
|
|
if (data->unk1-- % 256 == 0)
|
|
|
|
{
|
|
|
|
data->unk0_0a = 0;
|
|
|
|
data->unk1 = 0;
|
|
|
|
}
|
|
|
|
}
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
else
|
2019-03-05 09:02:05 +01:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
switch (data->unk2 / 64)
|
2020-08-09 23:09:55 +02:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
case 0:
|
2020-10-21 10:04:59 +02:00
|
|
|
if ((u8)data->unk0_1 == 1) //casts to u8 here are necessary for matching
|
2019-03-05 09:02:05 +01:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
data->unk0_0d = 1;
|
|
|
|
data->unk0_0a = 1;
|
|
|
|
data->unk1 = 0;
|
2019-03-05 09:02:05 +01:00
|
|
|
}
|
2020-10-21 10:04:59 +02:00
|
|
|
else if ((u8)data->unk0_1 == 3)
|
2019-03-05 09:02:05 +01:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
data->unk0_0b ^= 1;
|
|
|
|
data->unk0_0a = 1;
|
|
|
|
data->unk1 = 0;
|
2019-03-05 09:02:05 +01:00
|
|
|
}
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
else if (data->unk0_0d)
|
2019-03-05 09:02:05 +01:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
sprite->hFlip ^= 1;
|
|
|
|
sprite->animNum = sprite->hFlip;
|
|
|
|
sprite->animBeginning = TRUE;
|
|
|
|
sprite->animEnded = FALSE;
|
|
|
|
if (data->unk0_0c)
|
2020-08-09 23:09:55 +02:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (!IsContest())
|
2020-08-09 23:09:55 +02:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (!data->unkE_0)
|
|
|
|
{
|
|
|
|
sprite->oam.priority--;
|
|
|
|
data->unkE_0 ^= 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite->oam.priority++;
|
|
|
|
data->unkE_0 ^= 1;
|
|
|
|
}
|
2020-08-09 23:09:55 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (!data->unkE_0)
|
|
|
|
{
|
|
|
|
sprite->subpriority -= 12;
|
|
|
|
data->unkE_0 ^= 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite->subpriority += 12;
|
|
|
|
data->unkE_0 ^= 1;
|
|
|
|
}
|
2020-08-09 23:09:55 +02:00
|
|
|
}
|
|
|
|
}
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
data->unk0_0d = 0;
|
|
|
|
}
|
|
|
|
data->unk0_1 = 0;
|
|
|
|
break;
|
|
|
|
case 1:
|
2020-10-21 10:04:59 +02:00
|
|
|
if ((u8)data->unk0_1 == 0)
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
{
|
|
|
|
data->unk0_0d = 1;
|
|
|
|
data->unk0_0a = 1;
|
|
|
|
data->unk1 = 0;
|
|
|
|
}
|
2020-10-21 10:04:59 +02:00
|
|
|
else if ((u8)data->unk0_1 == 2)
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
{
|
|
|
|
data->unk0_0a = 1;
|
|
|
|
data->unk1 = 0;
|
|
|
|
}
|
|
|
|
else if (data->unk0_0d)
|
|
|
|
{
|
|
|
|
sprite->hFlip ^= 1;
|
|
|
|
sprite->animNum = sprite->hFlip;
|
|
|
|
sprite->animBeginning = TRUE;
|
|
|
|
sprite->animEnded = FALSE;
|
|
|
|
if (data->unk0_0c)
|
2020-08-09 23:09:55 +02:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (!IsContest())
|
2020-08-09 23:09:55 +02:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (!data->unkE_0)
|
|
|
|
{
|
|
|
|
sprite->oam.priority--;
|
|
|
|
data->unkE_0 ^= 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite->oam.priority++;
|
|
|
|
data->unkE_0 ^= 1;
|
|
|
|
}
|
2020-08-09 23:09:55 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (!data->unkE_0)
|
|
|
|
{
|
|
|
|
sprite->subpriority -= 12;
|
|
|
|
data->unkE_0 ^= 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite->subpriority += 12;
|
|
|
|
data->unkE_0 ^= 1;
|
|
|
|
}
|
2020-08-09 23:09:55 +02:00
|
|
|
}
|
|
|
|
}
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
data->unk0_0d = 0;
|
2019-03-05 09:02:05 +01:00
|
|
|
}
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
data->unk0_1 = 1;
|
|
|
|
break;
|
|
|
|
case 2:
|
2020-10-21 10:04:59 +02:00
|
|
|
if ((u8)data->unk0_1 == 3)
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
{
|
|
|
|
data->unk0_0d = 1;
|
|
|
|
data->unk0_0a = 1;
|
|
|
|
data->unk1 = 0;
|
|
|
|
}
|
2020-10-21 10:04:59 +02:00
|
|
|
else if ((u8)data->unk0_1 == 1)
|
2019-03-05 09:02:05 +01:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
data->unk0_0a = 1;
|
|
|
|
data->unk1 = 0;
|
|
|
|
}
|
|
|
|
else if (data->unk0_0d)
|
|
|
|
{
|
|
|
|
sprite->hFlip ^= 1;
|
|
|
|
sprite->animNum = sprite->hFlip;
|
|
|
|
sprite->animBeginning = TRUE;
|
|
|
|
sprite->animEnded = FALSE;
|
|
|
|
if (data->unk0_0c)
|
2020-08-09 23:09:55 +02:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (!IsContest())
|
2020-08-09 23:09:55 +02:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (!data->unkE_0)
|
|
|
|
{
|
|
|
|
sprite->oam.priority--;
|
|
|
|
data->unkE_0 ^= 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite->oam.priority++;
|
|
|
|
data->unkE_0 ^= 1;
|
|
|
|
}
|
2020-08-09 23:09:55 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (!data->unkE_0)
|
|
|
|
{
|
|
|
|
sprite->subpriority -= 12;
|
|
|
|
data->unkE_0 ^= 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite->subpriority += 12;
|
|
|
|
data->unkE_0 ^= 1;
|
|
|
|
}
|
2020-08-09 23:09:55 +02:00
|
|
|
}
|
|
|
|
}
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
data->unk0_0d = 0;
|
|
|
|
}
|
|
|
|
data->unk0_1 = 2;
|
|
|
|
break;
|
|
|
|
case 3:
|
2020-10-21 10:04:59 +02:00
|
|
|
if ((u8)data->unk0_1 == 2)
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
{
|
|
|
|
data->unk0_0d = 1;
|
|
|
|
}
|
2020-10-21 10:04:59 +02:00
|
|
|
else if ((u8)data->unk0_1 == 0)
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
{
|
|
|
|
data->unk0_0b ^= 1;
|
|
|
|
data->unk0_0a = 1;
|
|
|
|
data->unk1 = 0;
|
|
|
|
}
|
|
|
|
else if (data->unk0_0d)
|
|
|
|
{
|
|
|
|
sprite->hFlip ^= 1;
|
|
|
|
sprite->animNum = sprite->hFlip;
|
|
|
|
sprite->animBeginning = TRUE;
|
|
|
|
sprite->animEnded = FALSE;
|
|
|
|
if (data->unk0_0c)
|
2019-03-05 09:02:05 +01:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (!IsContest())
|
2019-03-05 09:02:05 +01:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (!data->unkE_0)
|
|
|
|
{
|
|
|
|
sprite->oam.priority--;
|
|
|
|
data->unkE_0 ^= 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite->oam.priority++;
|
|
|
|
data->unkE_0 ^= 1;
|
|
|
|
}
|
2019-03-05 09:02:05 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (!data->unkE_0)
|
|
|
|
{
|
|
|
|
sprite->subpriority -= 12;
|
|
|
|
data->unkE_0 ^= 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite->subpriority += 12;
|
|
|
|
data->unkE_0 ^= 1;
|
|
|
|
}
|
2019-03-05 09:02:05 +01:00
|
|
|
}
|
|
|
|
}
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
data->unk0_0d = 0;
|
2019-03-05 09:02:05 +01:00
|
|
|
}
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
data->unk0_1 = 3;
|
|
|
|
break;
|
2019-03-05 09:02:05 +01:00
|
|
|
}
|
2020-10-21 10:04:59 +02:00
|
|
|
|
|
|
|
sprite->pos2.x = ((s32)data->unkC[data->unk0_0b] * gSineTable[data->unk2]) >> 8;
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
matrixNum = sprite->oam.matrixNum;
|
2019-03-05 09:02:05 +01:00
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
sinIndex = (-sprite->pos2.x >> 1) + data->unkA;
|
|
|
|
sinVal = gSineTable[sinIndex];
|
2019-03-05 09:02:05 +01:00
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
gOamMatrices[matrixNum].a = gOamMatrices[matrixNum].d = gSineTable[sinIndex + 64];
|
|
|
|
gOamMatrices[matrixNum].b = sinVal;
|
|
|
|
gOamMatrices[matrixNum].c = -sinVal;
|
2019-03-05 09:02:05 +01:00
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
data->unk8 += data->unk6;
|
|
|
|
sprite->pos1.y = data->unk8 >> 8;
|
|
|
|
if (data->unk4 & 0x8000)
|
|
|
|
data->unk2 = (data->unk2 - (data->unk4 & 0x7FFF)) & 0xFF;
|
|
|
|
else
|
|
|
|
data->unk2 = (data->unk2 + (data->unk4 & 0x7FFF)) & 0xFF;
|
2020-08-09 23:09:55 +02:00
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (sprite->pos1.y + sprite->pos2.y >= data->unkE_1)
|
|
|
|
{
|
|
|
|
sprite->data[0] = 0;
|
|
|
|
sprite->callback = DestroyAnimSpriteAfterTimer;
|
|
|
|
}
|
2019-03-05 09:02:05 +01:00
|
|
|
}
|
|
|
|
}
|
2019-03-03 09:54:44 +01:00
|
|
|
|
2021-04-11 19:21:22 +02:00
|
|
|
static void AnimUnusedBubbleThrow(struct Sprite *sprite)
|
2019-03-03 09:54:44 +01:00
|
|
|
{
|
|
|
|
sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget);
|
|
|
|
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
|
|
|
|
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
|
|
|
|
sprite->callback = TranslateAnimSpriteToTargetMonLocation;
|
|
|
|
}
|
|
|
|
|
2020-02-20 02:22:53 +01:00
|
|
|
static void AnimWhirlwindLine(struct Sprite * sprite)
|
2019-03-03 09:54:44 +01:00
|
|
|
{
|
2021-02-27 18:04:45 +01:00
|
|
|
u16 offset;
|
2019-03-03 09:54:44 +01:00
|
|
|
u8 mult;
|
|
|
|
|
2020-02-20 02:22:53 +01:00
|
|
|
if (gBattleAnimArgs[2] == ANIM_ATTACKER)
|
2019-03-03 09:54:44 +01:00
|
|
|
InitSpritePosToAnimAttacker(sprite, 0);
|
|
|
|
else
|
|
|
|
InitSpritePosToAnimTarget(sprite, FALSE);
|
2019-03-05 09:02:05 +01:00
|
|
|
|
2020-02-20 02:22:53 +01:00
|
|
|
if ((gBattleAnimArgs[2] == ANIM_ATTACKER && !GetBattlerSide(gBattleAnimAttacker))
|
|
|
|
|| (gBattleAnimArgs[2] == ANIM_TARGET && !GetBattlerSide(gBattleAnimTarget)))
|
2019-03-03 09:54:44 +01:00
|
|
|
{
|
|
|
|
sprite->pos1.x += 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
SeekSpriteAnim(sprite, gBattleAnimArgs[4]);
|
|
|
|
sprite->pos1.x -= 32;
|
|
|
|
sprite->data[1] = 0x0ccc;
|
|
|
|
|
2021-02-27 18:04:45 +01:00
|
|
|
offset = gBattleAnimArgs[4];
|
2019-03-03 09:54:44 +01:00
|
|
|
mult = 12;
|
2021-02-27 18:04:45 +01:00
|
|
|
sprite->pos2.x += mult * offset;
|
|
|
|
sprite->data[0] = offset;
|
2019-03-03 09:54:44 +01:00
|
|
|
sprite->data[7] = gBattleAnimArgs[3];
|
2021-02-27 18:04:45 +01:00
|
|
|
sprite->callback = AnimWhirlwindLine_Step;
|
2019-03-03 09:54:44 +01:00
|
|
|
}
|
|
|
|
|
2021-02-27 18:04:45 +01:00
|
|
|
static void AnimWhirlwindLine_Step(struct Sprite *sprite)
|
2019-03-03 09:54:44 +01:00
|
|
|
{
|
|
|
|
sprite->pos2.x += sprite->data[1] >> 8;
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (++sprite->data[0] == 6)
|
2019-03-03 09:54:44 +01:00
|
|
|
{
|
|
|
|
sprite->data[0] = 0;
|
|
|
|
sprite->pos2.x = 0;
|
|
|
|
StartSpriteAnim(sprite, 0);
|
|
|
|
}
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (--sprite->data[7] == -1)
|
2019-03-03 09:54:44 +01:00
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
|
2020-02-15 00:11:04 +01:00
|
|
|
void AnimTask_DrillPeckHitSplats(u8 task)
|
2019-03-03 09:54:44 +01:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (!(gTasks[task].data[0] % 32))
|
2019-03-03 09:54:44 +01:00
|
|
|
{
|
|
|
|
gAnimVisualTaskCount++;
|
|
|
|
|
|
|
|
gBattleAnimArgs[0] = Sin(gTasks[task].data[0], -13);
|
|
|
|
gBattleAnimArgs[1] = Cos(gTasks[task].data[0], -13);
|
|
|
|
gBattleAnimArgs[2] = 1;
|
|
|
|
gBattleAnimArgs[3] = 3;
|
|
|
|
|
2020-02-15 00:11:04 +01:00
|
|
|
CreateSpriteAndAnimate(&gFlashingHitSplatSpriteTemplate,
|
2019-03-03 09:54:44 +01:00
|
|
|
GetBattlerSpriteCoord(gBattleAnimTarget, 2),
|
|
|
|
GetBattlerSpriteCoord(gBattleAnimTarget, 3),
|
|
|
|
3);
|
|
|
|
}
|
|
|
|
|
|
|
|
gTasks[task].data[0] += 8;
|
|
|
|
|
|
|
|
if (gTasks[task].data[0] > 255)
|
|
|
|
DestroyAnimVisualTask(task);
|
|
|
|
}
|
|
|
|
|
2020-02-20 22:22:33 +01:00
|
|
|
static void AnimBounceBallShrink(struct Sprite *sprite)
|
2019-03-03 09:54:44 +01:00
|
|
|
{
|
|
|
|
switch (sprite->data[0])
|
|
|
|
{
|
2019-03-05 09:02:05 +01:00
|
|
|
case 0:
|
|
|
|
InitSpritePosToAnimAttacker(sprite, 1);
|
2020-02-20 22:22:33 +01:00
|
|
|
gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)].invisible = TRUE;
|
2019-03-05 09:02:05 +01:00
|
|
|
++sprite->data[0];
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (sprite->affineAnimEnded)
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
break;
|
2019-03-03 09:54:44 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-20 22:22:33 +01:00
|
|
|
static void AnimBounceBallLand(struct Sprite *sprite)
|
2019-03-03 09:54:44 +01:00
|
|
|
{
|
|
|
|
switch (sprite->data[0])
|
|
|
|
{
|
2019-03-05 09:02:05 +01:00
|
|
|
case 0:
|
|
|
|
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 1);
|
|
|
|
sprite->pos2.y = -sprite->pos1.y - 32;
|
|
|
|
sprite->data[0]++;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
sprite->pos2.y += 10;
|
|
|
|
if (sprite->pos2.y >= 0)
|
|
|
|
++sprite->data[0];
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
sprite->pos2.y -= 10;
|
|
|
|
if (sprite->pos1.y + sprite->pos2.y < -32)
|
|
|
|
{
|
2020-02-20 22:22:33 +01:00
|
|
|
gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)].invisible = FALSE;
|
2019-03-05 09:02:05 +01:00
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
break;
|
2019-03-03 09:54:44 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-20 22:22:33 +01:00
|
|
|
static void AnimDiveBall(struct Sprite *sprite)
|
2019-03-03 09:54:44 +01:00
|
|
|
{
|
|
|
|
InitSpritePosToAnimAttacker(sprite, 1);
|
|
|
|
sprite->data[0] = gBattleAnimArgs[2];
|
|
|
|
sprite->data[1] = gBattleAnimArgs[3];
|
2020-02-20 22:22:33 +01:00
|
|
|
sprite->callback = AnimDiveBall_Step1;
|
2020-02-15 00:11:04 +01:00
|
|
|
gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)].invisible = TRUE;
|
2019-03-03 09:54:44 +01:00
|
|
|
}
|
|
|
|
|
2020-02-20 22:22:33 +01:00
|
|
|
void AnimDiveBall_Step1(struct Sprite *sprite)
|
2019-03-03 09:54:44 +01:00
|
|
|
{
|
|
|
|
if (sprite->data[0] > 0)
|
2019-03-05 09:02:05 +01:00
|
|
|
{
|
2019-03-03 09:54:44 +01:00
|
|
|
sprite->data[0]--;
|
2019-03-05 09:02:05 +01:00
|
|
|
}
|
2019-03-03 09:54:44 +01:00
|
|
|
else if (sprite->pos1.y + sprite->pos2.y > -32)
|
|
|
|
{
|
|
|
|
sprite->data[2] += sprite->data[1];
|
|
|
|
sprite->pos2.y -= (sprite->data[2] >> 8);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-02-15 00:11:04 +01:00
|
|
|
sprite->invisible = TRUE;
|
2019-03-03 09:54:44 +01:00
|
|
|
if (sprite->data[3]++ > 20)
|
2020-02-20 22:22:33 +01:00
|
|
|
sprite->callback = AnimDiveBall_Step2;
|
2019-03-03 09:54:44 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-20 22:22:33 +01:00
|
|
|
static void AnimDiveBall_Step2(struct Sprite *sprite)
|
2019-03-03 09:54:44 +01:00
|
|
|
{
|
|
|
|
sprite->pos2.y += sprite->data[2] >> 8;
|
|
|
|
|
|
|
|
if (sprite->pos1.y + sprite->pos2.y > -32)
|
2020-02-20 22:22:33 +01:00
|
|
|
sprite->invisible = FALSE;
|
2019-03-03 09:54:44 +01:00
|
|
|
|
|
|
|
if (sprite->pos2.y > 0)
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
|
2020-02-15 00:11:04 +01:00
|
|
|
static void AnimDiveWaterSplash(struct Sprite *sprite)
|
2019-03-03 09:54:44 +01:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
u32 matrixNum;
|
|
|
|
int t1, t2;
|
2019-03-05 09:02:05 +01:00
|
|
|
|
2019-03-03 09:54:44 +01:00
|
|
|
switch (sprite->data[0])
|
|
|
|
{
|
2019-03-05 16:52:40 +01:00
|
|
|
case 0:
|
|
|
|
if (!gBattleAnimArgs[0])
|
|
|
|
{
|
|
|
|
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0);
|
|
|
|
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 0);
|
|
|
|
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 1);
|
|
|
|
}
|
2019-03-03 09:54:44 +01:00
|
|
|
|
2021-02-27 18:04:45 +01:00
|
|
|
sprite->data[1] = 0x200;
|
2019-03-05 09:02:05 +01:00
|
|
|
|
2021-02-27 18:04:45 +01:00
|
|
|
TrySetSpriteRotScale(sprite, 0, 0x100, sprite->data[1], 0);
|
2019-03-05 16:52:40 +01:00
|
|
|
sprite->data[0]++;
|
|
|
|
break;
|
|
|
|
case 1:
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (sprite->data[2] <= 11)
|
2019-03-05 16:52:40 +01:00
|
|
|
sprite->data[1] -= 40;
|
|
|
|
else
|
|
|
|
sprite->data[1] += 40;
|
2019-03-03 09:54:44 +01:00
|
|
|
|
2019-03-05 16:52:40 +01:00
|
|
|
sprite->data[2]++;
|
2019-03-03 09:54:44 +01:00
|
|
|
|
2021-02-27 18:04:45 +01:00
|
|
|
TrySetSpriteRotScale(sprite, 0, 0x100, sprite->data[1], 0);
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
|
2019-03-05 16:52:40 +01:00
|
|
|
matrixNum = sprite->oam.matrixNum;
|
2019-03-03 09:54:44 +01:00
|
|
|
|
2021-02-27 18:04:45 +01:00
|
|
|
t1 = 0x3D00;
|
2019-03-05 16:52:40 +01:00
|
|
|
t2 = t1 / gOamMatrices[matrixNum].d + 1;
|
2019-03-05 09:02:05 +01:00
|
|
|
|
2019-03-05 16:52:40 +01:00
|
|
|
if (t2 > 128)
|
|
|
|
t2 = 128;
|
2019-03-03 09:54:44 +01:00
|
|
|
|
2019-03-05 16:52:40 +01:00
|
|
|
t2 = (64 - t2) / 2;
|
|
|
|
sprite->pos2.y = t2;
|
2019-03-03 09:54:44 +01:00
|
|
|
|
2019-03-05 16:52:40 +01:00
|
|
|
if (sprite->data[2] == 24)
|
|
|
|
{
|
2021-02-27 18:04:45 +01:00
|
|
|
ResetSpriteRotScale_PreserveAffine(sprite);
|
2019-03-05 16:52:40 +01:00
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
break;
|
2019-03-03 09:54:44 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-14 22:05:43 +01:00
|
|
|
// Launches a water droplet away from the specified battler. Used by Astonish and Dive
|
|
|
|
static void AnimSprayWaterDroplet(struct Sprite *sprite)
|
2019-03-03 09:54:44 +01:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
int v1 = 0x1ff & Random2();
|
|
|
|
int v2 = 0x7f & Random2();
|
2019-03-03 09:54:44 +01:00
|
|
|
|
|
|
|
if (v1 % 2)
|
|
|
|
sprite->data[0] = 736 + v1;
|
|
|
|
else
|
|
|
|
sprite->data[0] = 736 - v1;
|
|
|
|
|
|
|
|
if (v2 % 2)
|
|
|
|
sprite->data[1] = 896 + v2;
|
|
|
|
else
|
|
|
|
sprite->data[1] = 896 - v2;
|
2019-03-05 09:02:05 +01:00
|
|
|
|
2019-03-03 09:54:44 +01:00
|
|
|
sprite->data[2] = gBattleAnimArgs[0];
|
|
|
|
|
|
|
|
if (sprite->data[2])
|
2019-08-10 18:09:06 +02:00
|
|
|
sprite->oam.matrixNum = ST_OAM_HFLIP;
|
2019-03-03 09:54:44 +01:00
|
|
|
|
|
|
|
if (gBattleAnimArgs[1] == 0)
|
|
|
|
{
|
|
|
|
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0);
|
|
|
|
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + 32;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 0);
|
|
|
|
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + 32;
|
|
|
|
}
|
|
|
|
|
2020-02-20 22:22:33 +01:00
|
|
|
sprite->callback = AnimSprayWaterDroplet_Step;
|
2019-03-03 09:54:44 +01:00
|
|
|
}
|
|
|
|
|
2020-02-20 22:22:33 +01:00
|
|
|
static void AnimSprayWaterDroplet_Step(struct Sprite *sprite)
|
2019-03-03 09:54:44 +01:00
|
|
|
{
|
|
|
|
if (sprite->data[2] == 0)
|
|
|
|
{
|
|
|
|
sprite->pos2.x += sprite->data[0] >> 8;
|
|
|
|
sprite->pos2.y -= sprite->data[1] >> 8;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite->pos2.x -= sprite->data[0] >> 8;
|
|
|
|
sprite->pos2.y -= sprite->data[1] >> 8;
|
|
|
|
}
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
sprite->data[0] = sprite->data[0];
|
2019-03-03 09:54:44 +01:00
|
|
|
sprite->data[1] -= 32;
|
|
|
|
|
|
|
|
if (sprite->data[0] < 0)
|
|
|
|
sprite->data[0] = 0;
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (++sprite->data[3] == 31)
|
2019-03-03 09:54:44 +01:00
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:21:22 +02:00
|
|
|
static void AnimUnusedFlashingLight(struct Sprite *sprite)
|
2019-03-03 09:54:44 +01:00
|
|
|
{
|
|
|
|
sprite->data[6] = 0;
|
|
|
|
sprite->data[7] = 64;
|
2021-04-11 19:21:22 +02:00
|
|
|
sprite->callback = AnimUnusedFlashingLight_Step;
|
2019-03-03 09:54:44 +01:00
|
|
|
}
|
|
|
|
|
2021-04-11 19:21:22 +02:00
|
|
|
static void AnimUnusedFlashingLight_Step(struct Sprite *sprite)
|
2019-03-03 09:54:44 +01:00
|
|
|
{
|
|
|
|
switch (sprite->data[0])
|
|
|
|
{
|
2019-03-05 09:02:05 +01:00
|
|
|
case 0:
|
|
|
|
if (++sprite->data[1] > 8)
|
|
|
|
{
|
|
|
|
sprite->data[1] = 0;
|
|
|
|
sprite->invisible ^= 1;
|
|
|
|
if (++sprite->data[2] > 5 && sprite->invisible)
|
|
|
|
sprite->data[0]++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
DestroyAnimSprite(sprite);
|
|
|
|
break;
|
2019-03-03 09:54:44 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-16 23:49:24 +01:00
|
|
|
static void AnimSkyAttackBird(struct Sprite *sprite)
|
2019-03-03 09:54:44 +01:00
|
|
|
{
|
|
|
|
u16 rotation;
|
2019-03-05 09:02:05 +01:00
|
|
|
s16 posx = sprite->pos1.x;
|
|
|
|
s16 posy = sprite->pos1.y;
|
2019-03-03 09:54:44 +01:00
|
|
|
|
|
|
|
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
|
|
|
|
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
|
|
|
|
|
|
|
|
sprite->data[4] = sprite->pos1.x << 4;
|
|
|
|
sprite->data[5] = sprite->pos1.y << 4;
|
|
|
|
|
|
|
|
sprite->data[6] = ((posx - sprite->pos1.x) << 4) / 12;
|
|
|
|
sprite->data[7] = ((posy - sprite->pos1.y) << 4) / 12;
|
|
|
|
|
|
|
|
rotation = ArcTan2Neg(posx - sprite->pos1.x, posy - sprite->pos1.y);
|
2020-11-03 00:43:11 +01:00
|
|
|
rotation -= 16384;
|
2019-03-03 09:54:44 +01:00
|
|
|
|
|
|
|
TrySetSpriteRotScale(sprite, 1, 0x100, 0x100, rotation);
|
|
|
|
|
2020-02-20 22:22:33 +01:00
|
|
|
sprite->callback = AnimSkyAttackBird_Step;
|
2019-03-03 09:54:44 +01:00
|
|
|
}
|
|
|
|
|
2020-02-20 22:22:33 +01:00
|
|
|
void AnimSkyAttackBird_Step(struct Sprite *sprite)
|
2019-03-03 09:54:44 +01:00
|
|
|
{
|
|
|
|
sprite->data[4] += sprite->data[6];
|
|
|
|
sprite->data[5] += sprite->data[7];
|
|
|
|
|
|
|
|
sprite->pos1.x = sprite->data[4] >> 4;
|
|
|
|
sprite->pos1.y = sprite->data[5] >> 4;
|
|
|
|
|
2019-03-05 09:02:05 +01:00
|
|
|
if (sprite->pos1.x > 285 || sprite->pos1.x < -45
|
|
|
|
|| sprite->pos1.y > 157 || sprite->pos1.y < -45)
|
2019-03-03 09:54:44 +01:00
|
|
|
DestroySpriteAndMatrix(sprite);
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:21:22 +02:00
|
|
|
// Unused
|
|
|
|
static void AnimTask_SetAttackerVisibility(u8 taskId)
|
2019-03-03 09:54:44 +01:00
|
|
|
{
|
|
|
|
if (gBattleAnimArgs[0] == 0)
|
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
2020-02-20 22:22:33 +01:00
|
|
|
gSprites[spriteId].invisible = TRUE;
|
2019-03-03 09:54:44 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
2020-02-20 22:22:33 +01:00
|
|
|
gSprites[spriteId].invisible = FALSE;
|
2019-03-03 09:54:44 +01:00
|
|
|
}
|
|
|
|
DestroyAnimVisualTask(taskId);
|
|
|
|
}
|