mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-02-04 02:10:01 +01:00
add feint and pluck animation sprites and implementations
This commit is contained in:
parent
aade9f5f5a
commit
5f7b5ba453
@ -134,7 +134,7 @@ gBattleAnims_Moves::
|
||||
.4byte Move_FOCUS_ENERGY
|
||||
.4byte Move_BIDE
|
||||
.4byte Move_METRONOME
|
||||
.4byte Move_MIRROR_MOVE @ doesn´t have an actual animation
|
||||
.4byte Move_MIRROR_MOVE @ doesn<EFBFBD>t have an actual animation
|
||||
.4byte Move_SELF_DESTRUCT
|
||||
.4byte Move_EGG_BOMB
|
||||
.4byte Move_LICK
|
||||
@ -894,9 +894,43 @@ Move_NATURAL_GIFT:
|
||||
end
|
||||
|
||||
Move_FEINT:
|
||||
loadspritegfx ANIM_TAG_FEINT
|
||||
createsprite gFeintSwipeSpriteTemplate, ANIM_ATTACKER, 10, -32, 0, 15
|
||||
playsewithpan SE_W013B, SOUND_PAN_ATTACKER
|
||||
delay 15
|
||||
playsewithpan SE_W013B, SOUND_PAN_ATTACKER
|
||||
delay 15
|
||||
waitforvisualfinish
|
||||
delay 5
|
||||
createsprite gFeintZoomSpriteTemplate, ANIM_ATTACKER, 10, 0, 0
|
||||
playsewithpan SE_W025B, SOUND_PAN_TARGET
|
||||
waitforvisualfinish
|
||||
end
|
||||
|
||||
Move_PLUCK:
|
||||
loadspritegfx ANIM_TAG_SEED_BROWN
|
||||
loadspritegfx ANIM_TAG_IMPACT
|
||||
playsewithpan SE_W077, SOUND_PAN_ATTACKER
|
||||
createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, -10, -5, 1, 2
|
||||
createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 2, 3, 0, 30, 2, 1
|
||||
createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 2, 7, 1, 20, 1, 1
|
||||
createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 2, -3, 5, 40, 2, -1
|
||||
createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 2, 4, -4, 50, 3, -1
|
||||
delay 30
|
||||
playsewithpan SE_W077, SOUND_PAN_ATTACKER
|
||||
createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 5, 10, 1, 2
|
||||
createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 2, 3, -4, 30, 1, 1
|
||||
createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 2, 7, -6, 20, 0, 1
|
||||
createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 2, -3, -9, 40, 1, -1
|
||||
createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 2, 4, -4, 50, 2, -1
|
||||
delay 30
|
||||
playsewithpan SE_W077, SOUND_PAN_ATTACKER
|
||||
createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 1, 2
|
||||
createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 2, -3, -4, 30, 1, 1
|
||||
createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 2, 7, -6, 50, 0, 1
|
||||
createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 2, -4, -10, 40, 1, 1
|
||||
createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 2, 4, -4, 40, 1, 2
|
||||
waitforvisualfinish
|
||||
end
|
||||
|
||||
Move_TAILWIND:
|
||||
|
BIN
graphics/battle_anims/sprites/feint-punch.png
Normal file
BIN
graphics/battle_anims/sprites/feint-punch.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 236 B |
BIN
graphics/battle_anims/sprites/seed-new.png
Normal file
BIN
graphics/battle_anims/sprites/seed-new.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 238 B |
@ -300,9 +300,11 @@
|
||||
#define ANIM_TAG_PURPLE_JAB (ANIM_SPRITES_START + 290)
|
||||
#define ANIM_TAG_TOXIC_SPIKES (ANIM_SPRITES_START + 291)
|
||||
#define ANIM_TAG_ENERGY_BALL (ANIM_SPRITES_START + 292)
|
||||
#define ANIM_TAG_MEGA_STONE (ANIM_SPRITES_START + 293)
|
||||
#define ANIM_TAG_MEGA_SYMBOL (ANIM_SPRITES_START + 294)
|
||||
#define ANIM_TAG_MEGA_PARTICLES (ANIM_SPRITES_START + 295)
|
||||
#define ANIM_TAG_SEED_BROWN (ANIM_SPRITES_START + 293)
|
||||
#define ANIM_TAG_FEINT (ANIM_SPRITES_START + 294)
|
||||
#define ANIM_TAG_MEGA_STONE (ANIM_SPRITES_START + 295)
|
||||
#define ANIM_TAG_MEGA_SYMBOL (ANIM_SPRITES_START + 296)
|
||||
#define ANIM_TAG_MEGA_PARTICLES (ANIM_SPRITES_START + 297)
|
||||
|
||||
// battlers
|
||||
#define ANIM_ATTACKER 0
|
||||
|
@ -4137,6 +4137,8 @@ extern const u32 gBattleAnimSpriteGfx_AirWave[];
|
||||
extern const u32 gBattleAnimSpriteGfx_Orb[];
|
||||
extern const u32 gBattleAnimSpriteGfx_Sword[];
|
||||
extern const u32 gBattleAnimSpriteGfx_Seed[];
|
||||
extern const u32 gBattleAnimSpriteGfx_SeedBrown[];
|
||||
extern const u32 gBattleAnimSpriteGfx_Feint[];
|
||||
extern const u32 gBattleAnimSpriteGfx_Explosion6[];
|
||||
extern const u32 gBattleAnimSpriteGfx_PinkOrb[];
|
||||
extern const u32 gBattleAnimSpriteGfx_Gust[];
|
||||
@ -4417,6 +4419,8 @@ extern const u32 gBattleAnimSpritePal_AirWave[];
|
||||
extern const u32 gBattleAnimSpritePal_Orb[];
|
||||
extern const u32 gBattleAnimSpritePal_Sword[];
|
||||
extern const u32 gBattleAnimSpritePal_Seed[];
|
||||
extern const u32 gBattleAnimSpritePal_SeedBrown[];
|
||||
extern const u32 gBattleAnimSpritePal_Feint[];
|
||||
extern const u32 gBattleAnimSpritePal_Explosion6[];
|
||||
extern const u32 gBattleAnimSpritePal_PinkOrb[];
|
||||
extern const u32 gBattleAnimSpritePal_Gust[];
|
||||
|
@ -1418,6 +1418,8 @@ const struct CompressedSpriteSheet gBattleAnimPicTable[] =
|
||||
{gBattleAnimSpriteGfx_PurpleJab, 0x0100, ANIM_TAG_PURPLE_JAB},
|
||||
{gBattleAnimSpriteGfx_Spikes, 0x0080, ANIM_TAG_TOXIC_SPIKES},
|
||||
{gBattleAnimSpriteGfx_EnergyBall, 0x0200, ANIM_TAG_ENERGY_BALL},
|
||||
{gBattleAnimSpriteGfx_SeedBrown, 0x0080, ANIM_TAG_SEED_BROWN},
|
||||
{gBattleAnimSpriteGfx_Feint, 0x0800, ANIM_TAG_FEINT},
|
||||
{gBattleAnimSpriteGfx_MegaStone, 0x800, ANIM_TAG_MEGA_STONE},
|
||||
{gBattleAnimSpriteGfx_MegaSymbol, 0x0200, ANIM_TAG_MEGA_SYMBOL},
|
||||
{gBattleAnimSpriteGfx_MegaParticles, 0x0180, ANIM_TAG_MEGA_PARTICLES},
|
||||
@ -1718,6 +1720,8 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] =
|
||||
{gBattleAnimSpritePal_PurpleJab, ANIM_TAG_PURPLE_JAB},
|
||||
{gBattleAnimSpritePal_ToxicSpikes, ANIM_TAG_TOXIC_SPIKES},
|
||||
{gBattleAnimSpritePal_EnergyBall, ANIM_TAG_ENERGY_BALL},
|
||||
{gBattleAnimSpritePal_SeedBrown, ANIM_TAG_SEED_BROWN},
|
||||
{gBattleAnimSpritePal_Feint, ANIM_TAG_FEINT},
|
||||
{gBattleAnimSpritePal_MegaStone, ANIM_TAG_MEGA_STONE},
|
||||
{gBattleAnimSpritePal_MegaSymbol, ANIM_TAG_MEGA_SYMBOL},
|
||||
{gBattleAnimSpritePal_MegaParticles, ANIM_TAG_MEGA_PARTICLES},
|
||||
|
@ -29,6 +29,7 @@ void AnimPetalDanceBigFlower(struct Sprite *);
|
||||
void AnimPetalDanceSmallFlower(struct Sprite *);
|
||||
void AnimRazorLeafParticle(struct Sprite *);
|
||||
void AnimLeechSeed(struct Sprite *);
|
||||
static void AnimPluck(struct Sprite *);
|
||||
void AnimTranslateLinearSingleSineWave(struct Sprite *);
|
||||
void AnimMoveTwisterParticle(struct Sprite *);
|
||||
void AnimConstrictBinding(struct Sprite *);
|
||||
@ -153,6 +154,8 @@ static void sub_8103300(struct Sprite *);
|
||||
static void sub_8103320(struct Sprite *);
|
||||
static void sub_81033F0(struct Sprite *);
|
||||
static void sub_810342C(struct Sprite *);
|
||||
static void AnimMoveFeintSwipe(struct Sprite *);
|
||||
static void AnimMoveFeintZoom(struct Sprite *);
|
||||
|
||||
const union AnimCmd gUnknown_085920F0[] =
|
||||
{
|
||||
@ -172,6 +175,40 @@ const union AnimCmd *const gUnknown_08592114[] =
|
||||
gUnknown_085920F0,
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd sFeintAffineSwipe[] = { AFFINEANIMCMD_END };
|
||||
static const union AffineAnimCmd sFeintAffineZoom[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0x200, 0x200, 0, 0),
|
||||
AFFINEANIMCMD_FRAME(-30, -30, 0, 10),
|
||||
AFFINEANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd * const sFeintAffineAnims[] = {
|
||||
sFeintAffineZoom,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gFeintSwipeSpriteTemplate =
|
||||
{
|
||||
.tileTag = ANIM_TAG_FEINT,
|
||||
.paletteTag = ANIM_TAG_FEINT,
|
||||
.oam = &gUnknown_0852497C,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = AnimMoveFeintSwipe,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gFeintZoomSpriteTemplate =
|
||||
{
|
||||
.tileTag = ANIM_TAG_FEINT,
|
||||
.paletteTag = ANIM_TAG_FEINT,
|
||||
.oam = &gUnknown_0852497C,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = sFeintAffineAnims,
|
||||
.callback = AnimMoveFeintZoom,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gSleepPowderParticleSpriteTemplate =
|
||||
{
|
||||
.tileTag = ANIM_TAG_SLEEP_POWDER,
|
||||
@ -404,6 +441,17 @@ const struct SpriteTemplate gLeechSeedSpriteTemplate =
|
||||
.callback = AnimLeechSeed,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gPluckParticleSpriteTemplate =
|
||||
{
|
||||
.tileTag = ANIM_TAG_SEED_BROWN,
|
||||
.paletteTag = ANIM_TAG_SEED_BROWN,
|
||||
.oam = &gUnknown_0852490C,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = AnimPluck,
|
||||
};
|
||||
|
||||
const union AnimCmd gUnknown_085922D4[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 1),
|
||||
@ -2636,6 +2684,99 @@ static void AnimHyperBeamOrbStep(struct Sprite* sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void AnimPluckParticle(struct Sprite* sprite)
|
||||
{
|
||||
if(sprite->data[0] > 0)
|
||||
{
|
||||
s16 yVelocity = sprite->data[5];
|
||||
s16 xVelocity = sprite->data[2];
|
||||
sprite->pos1.y -= yVelocity;
|
||||
sprite->pos1.x += xVelocity;
|
||||
if((sprite->data[0] % 7) == 0)
|
||||
{
|
||||
sprite->data[5] = yVelocity-1;
|
||||
}
|
||||
sprite->data[0]--;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->callback = DestroyAnimSprite;
|
||||
}
|
||||
}
|
||||
|
||||
// brown seed particle (jumps up, falls down.)
|
||||
// used by Pluck.
|
||||
// arg 0: initial x offset from target
|
||||
// arg 1: initial y offset from target
|
||||
// arg 2: lifetime of the particle
|
||||
// arg 3: upward velocity initial (decreases over time)
|
||||
// arg 4: horizontal velocity (stays the same)
|
||||
static void AnimPluck(struct Sprite* sprite)
|
||||
{
|
||||
InitSpritePosToAnimTarget(sprite, TRUE);
|
||||
|
||||
sprite->data[0] = gBattleAnimArgs[2]; //lifetime of the particle
|
||||
sprite->data[5] = gBattleAnimArgs[3]; //upward velocity
|
||||
sprite->data[2] = gBattleAnimArgs[4]; //horizontal velocity
|
||||
sprite->pos1.x += gBattleAnimArgs[0];
|
||||
sprite->pos1.y += gBattleAnimArgs[1];
|
||||
sprite->callback = AnimPluckParticle;
|
||||
}
|
||||
|
||||
static void AnimMoveFeintSwipeStep(struct Sprite* sprite)
|
||||
{
|
||||
switch(sprite->data[5])
|
||||
{
|
||||
case 0:
|
||||
if(AnimTranslateLinear(sprite))
|
||||
{
|
||||
//Not the most elegant solution here, but it works without messing up the sprites coordinates
|
||||
sprite->pos2.x = 0;
|
||||
sprite->pos1.x += 64;
|
||||
sprite->data[5]++;
|
||||
sprite->data[0] = sprite->data[6];
|
||||
sprite->data[1] = sprite->pos1.x;
|
||||
sprite->data[2] = sprite->pos1.x - 64;
|
||||
sprite->data[3] = sprite->pos1.y;
|
||||
sprite->data[4] = sprite->pos1.y;
|
||||
InitAnimLinearTranslation(sprite);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if(AnimTranslateLinear(sprite))
|
||||
{
|
||||
sprite->callback = DestroyAnimSprite;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void AnimMoveFeintSwipe(struct Sprite* sprite)
|
||||
{
|
||||
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
||||
{
|
||||
gBattleAnimArgs[0] = -gBattleAnimArgs[0];
|
||||
}
|
||||
InitSpritePosToAnimTarget(sprite, TRUE);
|
||||
sprite->data[0] = gBattleAnimArgs[2];
|
||||
sprite->data[6] = gBattleAnimArgs[2];
|
||||
sprite->data[1] = sprite->pos1.x;
|
||||
sprite->data[2] = sprite->pos1.x + 64;
|
||||
sprite->data[3] = sprite->pos1.y;
|
||||
sprite->data[4] = sprite->pos1.y;
|
||||
sprite->data[5] = 0;
|
||||
InitAnimLinearTranslation(sprite);
|
||||
sprite->callback = AnimMoveFeintSwipeStep;
|
||||
}
|
||||
|
||||
static void AnimMoveFeintZoom(struct Sprite* sprite)
|
||||
{
|
||||
InitSpritePosToAnimTarget(sprite, TRUE);
|
||||
StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
|
||||
sprite->callback = RunStoredCallbackWhenAffineAnimEnds;
|
||||
}
|
||||
|
||||
// seed (sprouts a sapling from a seed.)
|
||||
// Used by Leech Seed.
|
||||
// arg 0: initial x pixel offset
|
||||
|
@ -48,6 +48,7 @@ const u32 gBattleAnimSpriteGfx_AirWave[] = INCBIN_U32("graphics/battle_anims/spr
|
||||
const u32 gBattleAnimSpriteGfx_Orb[] = INCBIN_U32("graphics/battle_anims/sprites/orb.4bpp.lz");
|
||||
const u32 gBattleAnimSpriteGfx_Sword[] = INCBIN_U32("graphics/battle_anims/sprites/sword.4bpp.lz");
|
||||
const u32 gBattleAnimSpriteGfx_Seed[] = INCBIN_U32("graphics/battle_anims/sprites/seed.4bpp.lz");
|
||||
const u32 gBattleAnimSpriteGfx_SeedBrown[] = INCBIN_U32("graphics/battle_anims/sprites/seed-new.4bpp.lz");
|
||||
|
||||
const u32 gBattleAnimSpritePal_RainDrops[] = INCBIN_U32("graphics/battle_anims/sprites/rain_drops.gbapal.lz");
|
||||
const u32 gBattleAnimSpritePal_Bone[] = INCBIN_U32("graphics/battle_anims/sprites/bone.gbapal.lz");
|
||||
@ -55,6 +56,7 @@ const u32 gBattleAnimSpritePal_AirWave[] = INCBIN_U32("graphics/battle_anims/spr
|
||||
const u32 gBattleAnimSpritePal_Orb[] = INCBIN_U32("graphics/battle_anims/sprites/orb.gbapal.lz");
|
||||
const u32 gBattleAnimSpritePal_Sword[] = INCBIN_U32("graphics/battle_anims/sprites/sword.gbapal.lz");
|
||||
const u32 gBattleAnimSpritePal_Seed[] = INCBIN_U32("graphics/battle_anims/sprites/seed.gbapal.lz");
|
||||
const u32 gBattleAnimSpritePal_SeedBrown[] = INCBIN_U32("graphics/battle_anims/sprites/seed-new.gbapal.lz");
|
||||
|
||||
const u32 gBattleAnimSpriteGfx_Needle[] = INCBIN_U32("graphics/battle_anims/sprites/needle.4bpp.lz");
|
||||
const u32 gBattleAnimSpritePal_Needle[] = INCBIN_U32("graphics/battle_anims/sprites/needle.gbapal.lz");
|
||||
@ -114,6 +116,9 @@ const u32 gBattleAnimSpritePal_Hit2[] = INCBIN_U32("graphics/battle_anims/sprite
|
||||
const u32 gBattleAnimSpritePal_WavingHand[] = INCBIN_U32("graphics/battle_anims/sprites/waving_hand.gbapal.lz");
|
||||
const u32 gBattleAnimSpriteGfx_WavingHand[] = INCBIN_U32("graphics/battle_anims/sprites/waving_hand.4bpp.lz");
|
||||
|
||||
const u32 gBattleAnimSpriteGfx_Feint[] = INCBIN_U32("graphics/battle_anims/sprites/feint-punch.4bpp.lz");
|
||||
const u32 gBattleAnimSpritePal_Feint[] = INCBIN_U32("graphics/battle_anims/sprites/feint-punch.gbapal.lz");
|
||||
|
||||
const u32 gBattleAnimSpriteGfx_ClosingEye[] = INCBIN_U32("graphics/battle_anims/sprites/closing_eye.4bpp.lz");
|
||||
const u32 gBattleAnimSpritePal_ClosingEye[] = INCBIN_U32("graphics/battle_anims/sprites/closing_eye.gbapal.lz");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user