From 5f7b5ba453a8f5313aba9116866136ca2e091f48 Mon Sep 17 00:00:00 2001 From: Karathan Date: Tue, 2 Jul 2019 06:22:05 +0200 Subject: [PATCH 1/7] add feint and pluck animation sprites and implementations --- data/battle_anim_scripts.s | 36 ++++- graphics/battle_anims/sprites/feint-punch.png | Bin 0 -> 236 bytes graphics/battle_anims/sprites/seed-new.png | Bin 0 -> 238 bytes include/constants/battle_anim.h | 8 +- include/graphics.h | 4 + src/battle_anim.c | 4 + src/battle_anim_effects_1.c | 141 ++++++++++++++++++ src/graphics.c | 5 + 8 files changed, 194 insertions(+), 4 deletions(-) create mode 100644 graphics/battle_anims/sprites/feint-punch.png create mode 100644 graphics/battle_anims/sprites/seed-new.png diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index d83802964..e093b6d69 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -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�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: diff --git a/graphics/battle_anims/sprites/feint-punch.png b/graphics/battle_anims/sprites/feint-punch.png new file mode 100644 index 0000000000000000000000000000000000000000..5769415193f8436787b8da3cefbd02d0e6fc6b03 GIT binary patch literal 236 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0J3?w7mbKU|e{s5m4*VGbSATu*7tEH~}|Ns9Y zKa8IP`HUq&e!&b5&u*lFI7!~_E({&4vK~MVXMsm#F#`j)FbFd;%$g$s6l5>)^mS!_ z%+AEZ%qo$5qa7#|=IP=X;&D7VL4tKLgLHz33mcP3pu&Dzq(#-`_>Hw>%niic3>7^s)dDPJgX}e8JPdLI^a~>NJ2M^Um$__g@nLa#J_%%M zNswPK!+%t8AfVeBC>P-A;us<^b?$jC8leBs_&k|nkLtDf%Qg#{U&X}1g{52vlZOvjkpBa5>2P*!CR5LOhVtn6T Sb4(a$HiM_DpUXO@geCw0HB>_Y literal 0 HcmV?d00001 diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index add0fbbae..921677d3e 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -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 diff --git a/include/graphics.h b/include/graphics.h index 20963d425..a6772fc72 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -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[]; diff --git a/src/battle_anim.c b/src/battle_anim.c index 7442a04cf..fd65e40cb 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -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}, diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 600b59b8b..cfcdca6d2 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -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 diff --git a/src/graphics.c b/src/graphics.c index 93bf9a7b5..4d5c2f753 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -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"); From 501ae2739079ab4075e12af35d2c40e0cfe6512f Mon Sep 17 00:00:00 2001 From: Karathan Date: Tue, 2 Jul 2019 18:26:59 +0200 Subject: [PATCH 2/7] add trump card, fix a few issues with pluck --- data/battle_anim_scripts.s | 71 +++++-- .../sprites/trump-card-particles.png | Bin 0 -> 140 bytes graphics/battle_anims/sprites/trump-cards.png | Bin 0 -> 143 bytes include/constants/battle_anim.h | 2 + include/graphics.h | 4 + src/battle_anim.c | 4 + src/battle_anim_effects_1.c | 194 +++++++++++++++++- src/graphics.c | 6 + 8 files changed, 265 insertions(+), 16 deletions(-) create mode 100644 graphics/battle_anims/sprites/trump-card-particles.png create mode 100644 graphics/battle_anims/sprites/trump-cards.png diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index e093b6d69..8d7e14d6a 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -911,25 +911,25 @@ 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 + createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 40, -10, -5, 1, 2 + createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 40, 3, 0, 20, 2, 1 + createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 40, 7, 1, 20, 1, 1 + createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 40, -3, 5, 25, 2, -1 + createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 40, 4, -4, 30, 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 + createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 40, 5, 10, 1, 2 + createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 40, 3, -4, 20, 1, 1 + createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 40, 7, -6, 20, 0, 1 + createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 40, -3, -9, 25, 1, -1 + createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 40, 4, -4, 30, 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 + createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 40, 0, 0, 1, 2 + createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 40, -3, -4, 20, 1, 1 + createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 40, 7, -6, 25, 0, 1 + createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 40, -4, -10, 25, 1, 1 + createsprite gPluckParticleSpriteTemplate, ANIM_ATTACKER, 40, 4, -4, 25, 1, 2 waitforvisualfinish end @@ -1163,6 +1163,47 @@ Move_PSYCHO_SHIFT: end Move_TRUMP_CARD: + loadspritegfx ANIM_TAG_TRUMP_CARD + loadspritegfx ANIM_TAG_CUT + loadspritegfx ANIM_TAG_TRUMP_CARD_PARTICLES + monbg ANIM_TARGET + setalpha 12, 8 + playsewithpan SE_W013B, SOUND_PAN_TARGET + createsprite gTrumpCardSpriteTemplate, ANIM_ATTACKER, 40, 40, 0, 0, 32 + delay 2 + createsprite gTrumpCardSpriteTemplate, ANIM_ATTACKER, 40, 40, 0, 1, 32 + delay 2 + playsewithpan SE_W013B, SOUND_PAN_TARGET + createsprite gTrumpCardSpriteTemplate, ANIM_ATTACKER, 40, 40, 0, 0, 32 + delay 2 + createsprite gTrumpCardSpriteTemplate, ANIM_ATTACKER, 40, 40, 0, 2, 32 + delay 2 + playsewithpan SE_W013B, SOUND_PAN_TARGET + createsprite gTrumpCardSpriteTemplate, ANIM_ATTACKER, 40, 40, 0, 2, 32 + delay 2 + createsprite gTrumpCardSpriteTemplate, ANIM_ATTACKER, 40, 40, 0, 2, 32 + delay 2 + playsewithpan SE_W013B, SOUND_PAN_TARGET + playsewithpan SE_W015, SOUND_PAN_TARGET + createsprite gCuttingSliceSpriteTemplate, ANIM_ATTACKER, 2, 40, -32, 0 + createsprite gTrumpCardSpriteTemplate, ANIM_ATTACKER, 40, 40, 0, 1, 32 + delay 2 + createsprite gTrumpCardSpriteTemplate, ANIM_ATTACKER, 40, 40, 0, 1, 32 + delay 3 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 10, 1 + createsprite gTrumpCardParticleSpriteTempalte, ANIM_ATTACKER, 40, 0, 0, 1, 12, -5, -4, 0 + createsprite gTrumpCardParticleSpriteTempalte, ANIM_ATTACKER, 40, 0, 0, 0, 13, 5, 4, 1 + createsprite gTrumpCardParticleSpriteTempalte, ANIM_ATTACKER, 40, 0, 0, 1, 8, -3, 0, 2 + createsprite gTrumpCardParticleSpriteTempalte, ANIM_ATTACKER, 40, 0, 0, 2, 12, -5, 4, 3 + delay 2 + createsprite gTrumpCardParticleSpriteTempalte, ANIM_ATTACKER, 40, 0, 0, 1, 10, 1, -4, 4 + createsprite gTrumpCardParticleSpriteTempalte, ANIM_ATTACKER, 40, 0, 0, 0, 13, 5, 6, 1 + createsprite gTrumpCardParticleSpriteTempalte, ANIM_ATTACKER, 40, 0, 0, 1, 12, -2, 1, 3 + createsprite gTrumpCardParticleSpriteTempalte, ANIM_ATTACKER, 40, 0, 0, 2, 13, -2, 1, 2 + waitforvisualfinish + clearmonbg ANIM_TARGET + blendoff + waitforvisualfinish end Move_HEAL_BLOCK: diff --git a/graphics/battle_anims/sprites/trump-card-particles.png b/graphics/battle_anims/sprites/trump-card-particles.png new file mode 100644 index 0000000000000000000000000000000000000000..cec1a463cd69dce456ea81ace2cb1093f7f29220 GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^96&6=!3-onu=^+hDaPU;cPEB*=VV?2IXnSAA+A6= zBjWe}?CfvvGydzd9R~7QN`m}?8UFwOzggFz1IU;2ba4#fn38bg=d#Wzp$PzJrYAT6 literal 0 HcmV?d00001 diff --git a/graphics/battle_anims/sprites/trump-cards.png b/graphics/battle_anims/sprites/trump-cards.png new file mode 100644 index 0000000000000000000000000000000000000000..64c3b00167e625dcaf3e685c554e5e8236e3f155 GIT binary patch literal 143 zcmeAS@N?(olHy`uVBq!ia0vp^0zhoQ!3-qz8@W<}6k~CayA#8@b22Z19G(E55LY0b z5%K$fcJ{aT8UOX!4g>itB|(0{4FCWC->mD<0pu%sx;TbtOiWHt;5TqOC?K+cGoh(T kQNuy_01vBk0E0dQLxUTWVEMw{uRz5Np00i_>zopr0HGQtBLDyZ literal 0 HcmV?d00001 diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 921677d3e..5fb55fcf7 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -305,6 +305,8 @@ #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) +#define ANIM_TAG_TRUMP_CARD (ANIM_SPRITES_START + 298) +#define ANIM_TAG_TRUMP_CARD_PARTICLES (ANIM_SPRITES_START + 299) // battlers #define ANIM_ATTACKER 0 diff --git a/include/graphics.h b/include/graphics.h index a6772fc72..19fe39b16 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4411,6 +4411,8 @@ extern const u32 gBattleAnimBgTilemap_ScaryFaceOpponent[]; extern const u32 gBattleAnimBgTilemap_ScaryFaceContest[]; extern const u32 gBattleAnimSpriteGfx_Bird[]; extern const u32 gBattleAnimSpriteGfx_CrossImpact[]; +extern const u32 gBattleAnimSpriteGfx_TrumpCard[]; +extern const u32 gBattleAnimSpriteGfx_TrumpCardParticles[]; extern const u32 gBattleAnimSpritePal_Bone[]; extern const u32 gBattleAnimSpritePal_Spark[]; @@ -4696,6 +4698,8 @@ extern const u32 gBattleAnimSpritePal_CrossImpact[]; extern const u32 gBattleAnimSpritePal_Slash2[]; extern const u32 gBattleAnimSpritePal_WhipHit[]; extern const u32 gBattleAnimSpritePal_BlueRing2[]; +extern const u32 gBattleAnimSpritePal_TrumpCard[]; +extern const u32 gBattleAnimSpritePal_TrumpCardParticles[]; extern const u32 gBattleAnimBgImage_Dark[]; extern const u32 gBattleAnimBgImage_Ghost[]; diff --git a/src/battle_anim.c b/src/battle_anim.c index fd65e40cb..78f2073dd 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -1423,6 +1423,8 @@ const struct CompressedSpriteSheet gBattleAnimPicTable[] = {gBattleAnimSpriteGfx_MegaStone, 0x800, ANIM_TAG_MEGA_STONE}, {gBattleAnimSpriteGfx_MegaSymbol, 0x0200, ANIM_TAG_MEGA_SYMBOL}, {gBattleAnimSpriteGfx_MegaParticles, 0x0180, ANIM_TAG_MEGA_PARTICLES}, + {gBattleAnimSpriteGfx_TrumpCard, 0x0180, ANIM_TAG_TRUMP_CARD}, + {gBattleAnimSpriteGfx_TrumpCardParticles, 0x0060, ANIM_TAG_TRUMP_CARD_PARTICLES}, }; const struct CompressedSpritePalette gBattleAnimPaletteTable[] = @@ -1725,6 +1727,8 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] = {gBattleAnimSpritePal_MegaStone, ANIM_TAG_MEGA_STONE}, {gBattleAnimSpritePal_MegaSymbol, ANIM_TAG_MEGA_SYMBOL}, {gBattleAnimSpritePal_MegaParticles, ANIM_TAG_MEGA_PARTICLES}, + {gBattleAnimSpritePal_TrumpCard, ANIM_TAG_TRUMP_CARD}, + {gBattleAnimSpritePal_TrumpCardParticles, ANIM_TAG_TRUMP_CARD_PARTICLES}, }; const struct BattleAnimBackground gBattleAnimBackgroundTable[] = diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index cfcdca6d2..c2655fd44 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -156,6 +156,8 @@ static void sub_81033F0(struct Sprite *); static void sub_810342C(struct Sprite *); static void AnimMoveFeintSwipe(struct Sprite *); static void AnimMoveFeintZoom(struct Sprite *); +static void AnimMoveTrumpCard(struct Sprite *); +static void AnimMoveTrumpCardParticle(struct Sprite* sprite); const union AnimCmd gUnknown_085920F0[] = { @@ -183,10 +185,122 @@ static const union AffineAnimCmd sFeintAffineZoom[] = AFFINEANIMCMD_END, }; -static const union AffineAnimCmd * const sFeintAffineAnims[] = { +static const union AffineAnimCmd sTrumpCardAffine0[] = +{ + AFFINEANIMCMD_FRAME(0xC0, 0xC0, 30, 0), + AFFINEANIMCMD_END, +}; + +static const union AffineAnimCmd sTrumpCardAffine1[] = +{ + AFFINEANIMCMD_FRAME(0xA0, 0xA0, 40, 0), + AFFINEANIMCMD_END, +}; + +static const union AffineAnimCmd sTrumpCardAffine2[] = +{ + AFFINEANIMCMD_FRAME(0xD0, 0xD0, -20, 0), + AFFINEANIMCMD_END, +}; + +static const union AffineAnimCmd sTrumpCardAffine3[] = +{ + AFFINEANIMCMD_FRAME(0xE0, 0xE0, 40, 0), + AFFINEANIMCMD_END, +}; + +static const union AffineAnimCmd sTrumpCardAffine4[] = +{ + AFFINEANIMCMD_FRAME(0xF0, 0xF0, 60, 0), + AFFINEANIMCMD_END, +}; + +static const union AffineAnimCmd * const sTrumpCardAffineAnims[] = +{ + sTrumpCardAffine0, + sTrumpCardAffine1, + sTrumpCardAffine2, + sTrumpCardAffine3, + sTrumpCardAffine4 +}; + +static const union AffineAnimCmd * const sFeintAffineAnims[] = +{ sFeintAffineZoom, }; +static const union AnimCmd sTrumpCardFrame0[] = +{ + ANIMCMD_FRAME(0, 0), + ANIMCMD_END +}; + +static const union AnimCmd sTrumpCardFrame1[] = +{ + ANIMCMD_FRAME(4, 0), + ANIMCMD_END +}; + +static const union AnimCmd sTrumpCardFrame2[] = +{ + ANIMCMD_FRAME(8, 0), + ANIMCMD_END +}; + +static const union AnimCmd sTrumpCardParticleFrame0[] = +{ + ANIMCMD_FRAME(0, 0), + ANIMCMD_END +}; + +static const union AnimCmd sTrumpCardParticleFrame1[] = +{ + ANIMCMD_FRAME(1, 0), + ANIMCMD_END +}; + +static const union AnimCmd sTrumpCardParticleFrame2[] = +{ + ANIMCMD_FRAME(2, 0), + ANIMCMD_END +}; + +static const union AnimCmd * const sTrumpCardAnims[] = +{ + sTrumpCardFrame0, + sTrumpCardFrame1, + sTrumpCardFrame2 +}; + +static const union AnimCmd * const sTrumpCardParticleAnims[] = +{ + sTrumpCardParticleFrame0, + sTrumpCardParticleFrame1, + sTrumpCardParticleFrame2, +}; + +const struct SpriteTemplate gTrumpCardParticleSpriteTempalte = +{ + .tileTag = ANIM_TAG_TRUMP_CARD_PARTICLES, + .paletteTag = ANIM_TAG_TRUMP_CARD_PARTICLES, + .oam = &gUnknown_085249C4, + .anims = sTrumpCardParticleAnims, + .images = NULL, + .affineAnims = sTrumpCardAffineAnims, + .callback = AnimMoveTrumpCardParticle +}; + +const struct SpriteTemplate gTrumpCardSpriteTemplate = +{ + .tileTag = ANIM_TAG_TRUMP_CARD, + .paletteTag = ANIM_TAG_TRUMP_CARD, + .oam = &gUnknown_085249CC, + .anims = sTrumpCardAnims, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimMoveTrumpCard +}; + const struct SpriteTemplate gFeintSwipeSpriteTemplate = { .tileTag = ANIM_TAG_FEINT, @@ -2777,6 +2891,84 @@ static void AnimMoveFeintZoom(struct Sprite* sprite) sprite->callback = RunStoredCallbackWhenAffineAnimEnds; } +static void AnimMoveTrumpCardArc(struct Sprite* sprite) +{ + if(AnimTranslateLinear(sprite)) + { + DestroyAnimSprite(sprite); + } + else + { + sprite->pos2.y = Sin(sprite->data[5], -20); + sprite->data[5] -= sprite->data[6]; + } + +} + +static void AnimMoveTrumpCard(struct Sprite* sprite) +{ + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + { + gBattleAnimArgs[0] = -gBattleAnimArgs[0]; + } + InitSpritePosToAnimTarget(sprite, TRUE); + StartSpriteAnim(sprite, gBattleAnimArgs[2]); + sprite->data[0] = gBattleAnimArgs[3]; + sprite->data[1] = sprite->pos1.x; + sprite->data[2] = sprite->pos1.x - 80; + sprite->data[3] = sprite->pos1.y; + sprite->data[4] = sprite->pos1.y; + sprite->data[5] = 128; + sprite->data[6] = 128 / sprite->data[0]; + InitAnimLinearTranslation(sprite); + sprite->callback = AnimMoveTrumpCardArc; +} + +static void AnimMoveTrumpCardParticleAlive(struct Sprite* sprite) +{ + if(sprite->data[0] > 0) + { + s16 yVelocity = sprite->data[2]; + s16 xVelocity = sprite->data[1]; + sprite->pos1.y -= yVelocity; + sprite->pos1.x += xVelocity; + if((sprite->data[0] % 2) == 0) + { + if(xVelocity > 0) + xVelocity--; + else if(xVelocity < 0) + xVelocity++; + + if(yVelocity > 0) + yVelocity--; + else if(yVelocity < 0) + yVelocity++; + sprite->data[1] = xVelocity; + sprite->data[2] = yVelocity; + } + sprite->data[0]--; + } + else + { + sprite->callback = DestroyAnimSprite; + } +} + +static void AnimMoveTrumpCardParticle(struct Sprite* sprite) +{ + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + { + gBattleAnimArgs[0] = -gBattleAnimArgs[0]; + } + InitSpritePosToAnimTarget(sprite, TRUE); + StartSpriteAnim(sprite, gBattleAnimArgs[2]); + StartSpriteAffineAnim(sprite, gBattleAnimArgs[6]); + sprite->data[0] = gBattleAnimArgs[3]; //lifespan + sprite->data[1] = gBattleAnimArgs[4]; //horizontal velocity, decaying + sprite->data[2] = gBattleAnimArgs[5]; //vertical velocity, decaying + sprite->callback = AnimMoveTrumpCardParticleAlive; +} + // seed (sprouts a sapling from a seed.) // Used by Leech Seed. // arg 0: initial x pixel offset diff --git a/src/graphics.c b/src/graphics.c index 4d5c2f753..043dab6de 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -119,6 +119,12 @@ const u32 gBattleAnimSpriteGfx_WavingHand[] = INCBIN_U32("graphics/battle_anims/ 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_TrumpCard[] = INCBIN_U32("graphics/battle_anims/sprites/trump-cards.4bpp.lz"); +const u32 gBattleAnimSpritePal_TrumpCard[] = INCBIN_U32("graphics/battle_anims/sprites/trump-cards.gbapal.lz"); + +const u32 gBattleAnimSpriteGfx_TrumpCardParticles[] = INCBIN_U32("graphics/battle_anims/sprites/trump-card-particles.4bpp.lz"); +const u32 gBattleAnimSpritePal_TrumpCardParticles[] = INCBIN_U32("graphics/battle_anims/sprites/trump-card-particles.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"); From f1c82abc7e01c2e617d00ad3e7f789a8b02de477 Mon Sep 17 00:00:00 2001 From: Karathan Date: Tue, 2 Jul 2019 18:32:42 +0200 Subject: [PATCH 3/7] fix change requests --- data/battle_anim_scripts.s | 2 +- .../sprites/{seed-new.png => seed_new.png} | Bin ...-card-particles.png => trump_card_particles.png} | Bin .../sprites/{trump-cards.png => trump_cards.png} | Bin src/graphics.c | 12 ++++++------ 5 files changed, 7 insertions(+), 7 deletions(-) rename graphics/battle_anims/sprites/{seed-new.png => seed_new.png} (100%) rename graphics/battle_anims/sprites/{trump-card-particles.png => trump_card_particles.png} (100%) rename graphics/battle_anims/sprites/{trump-cards.png => trump_cards.png} (100%) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 8d7e14d6a..507d6ccdc 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -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't have an actual animation .4byte Move_SELF_DESTRUCT .4byte Move_EGG_BOMB .4byte Move_LICK diff --git a/graphics/battle_anims/sprites/seed-new.png b/graphics/battle_anims/sprites/seed_new.png similarity index 100% rename from graphics/battle_anims/sprites/seed-new.png rename to graphics/battle_anims/sprites/seed_new.png diff --git a/graphics/battle_anims/sprites/trump-card-particles.png b/graphics/battle_anims/sprites/trump_card_particles.png similarity index 100% rename from graphics/battle_anims/sprites/trump-card-particles.png rename to graphics/battle_anims/sprites/trump_card_particles.png diff --git a/graphics/battle_anims/sprites/trump-cards.png b/graphics/battle_anims/sprites/trump_cards.png similarity index 100% rename from graphics/battle_anims/sprites/trump-cards.png rename to graphics/battle_anims/sprites/trump_cards.png diff --git a/src/graphics.c b/src/graphics.c index 043dab6de..c7783221a 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -48,7 +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 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"); @@ -56,7 +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 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"); @@ -119,11 +119,11 @@ const u32 gBattleAnimSpriteGfx_WavingHand[] = INCBIN_U32("graphics/battle_anims/ 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_TrumpCard[] = INCBIN_U32("graphics/battle_anims/sprites/trump-cards.4bpp.lz"); -const u32 gBattleAnimSpritePal_TrumpCard[] = INCBIN_U32("graphics/battle_anims/sprites/trump-cards.gbapal.lz"); +const u32 gBattleAnimSpriteGfx_TrumpCard[] = INCBIN_U32("graphics/battle_anims/sprites/trump_cards.4bpp.lz"); +const u32 gBattleAnimSpritePal_TrumpCard[] = INCBIN_U32("graphics/battle_anims/sprites/trump_cards.gbapal.lz"); -const u32 gBattleAnimSpriteGfx_TrumpCardParticles[] = INCBIN_U32("graphics/battle_anims/sprites/trump-card-particles.4bpp.lz"); -const u32 gBattleAnimSpritePal_TrumpCardParticles[] = INCBIN_U32("graphics/battle_anims/sprites/trump-card-particles.gbapal.lz"); +const u32 gBattleAnimSpriteGfx_TrumpCardParticles[] = INCBIN_U32("graphics/battle_anims/sprites/trump_card_particles.4bpp.lz"); +const u32 gBattleAnimSpritePal_TrumpCardParticles[] = INCBIN_U32("graphics/battle_anims/sprites/trump_card_particles.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"); From e9884154a9231eb85b93203d342938be560d4fd2 Mon Sep 17 00:00:00 2001 From: Karathan Date: Wed, 3 Jul 2019 03:02:22 +0200 Subject: [PATCH 4/7] added acupressure and wring out --- data/battle_anim_scripts.s | 8 ++ data/battle_scripts_1.s | 2 + .../battle_anims/sprites/accupressure.png | Bin 0 -> 358 bytes graphics/battle_anims/sprites/wring_out.png | Bin 0 -> 271 bytes include/constants/battle_anim.h | 2 + include/graphics.h | 5 + src/battle_anim.c | 4 + src/battle_anim_effects_1.c | 117 ++++++++++++++++++ src/graphics.c | 6 + 9 files changed, 144 insertions(+) create mode 100644 graphics/battle_anims/sprites/accupressure.png create mode 100644 graphics/battle_anims/sprites/wring_out.png diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 507d6ccdc..b60538e0b 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -968,6 +968,11 @@ Move_TAILWIND: end Move_ACUPRESSURE: + loadspritegfx ANIM_TAG_ACCUPRESSURE + loadspritegfx ANIM_TAG_SPARK_2 + createsprite gAccupressureSpriteTemplate, ANIM_ATTACKER, 40, 0, -40, 40 + waitforvisualfinish + call ElectricityEffect end Move_METAL_BURST: @@ -1231,6 +1236,9 @@ Move_HEAL_BLOCK: end Move_WRING_OUT: + loadspritegfx ANIM_TAG_WRING_OUT + createsprite gWringOutHandSpriteTemplate, ANIM_TARGET, 40, 0, 0, 48, 3, 32 + waitforvisualfinish end Move_POWER_TRICK: diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 50494a1bd..c2d89a7d5 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -608,6 +608,8 @@ BattleScript_EffectAcupressureTry: attackstring ppreduce tryaccupressure BS_TARGET, BattleScript_ButItFailed + attackanimation + waitanimation setgraphicalstatchangevalues playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 statbuffchange MOVE_EFFECT_CERTAIN, BattleScript_MoveEnd diff --git a/graphics/battle_anims/sprites/accupressure.png b/graphics/battle_anims/sprites/accupressure.png new file mode 100644 index 0000000000000000000000000000000000000000..0da836ff3fec4d52d5a2d30f4ae9cffb83aac295 GIT binary patch literal 358 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfvxd5LKS0D`p5gri<0SP-+95}Gy z#Elydz~IG)4t8*0pd71sZz_izopr07S5TX#fBK literal 0 HcmV?d00001 diff --git a/graphics/battle_anims/sprites/wring_out.png b/graphics/battle_anims/sprites/wring_out.png new file mode 100644 index 0000000000000000000000000000000000000000..b96ffdbd2ef8a2299ba41e449ec322afb52c2af9 GIT binary patch literal 271 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyjKx9jP7LeL$-D$|L<4+6T=R=^ zflNz@JZ=ldrPZ!4!i{7)70{IRo za5yjBc<28K<~fDIC+e;rIeJ5VTF;a~yMBT0gjeqT-e+dV+)~cdyd*x4f%`zoa+S&UVh$R= zE-+7QmtWeks_FE*_pAnwe67z{96$X$(Jqi*?bnJpCOea-d;Z0UYkp?=)sYss8R$R; MPgg&ebxsLQ0G_&SY5)KL literal 0 HcmV?d00001 diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 5fb55fcf7..48b921bd0 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -307,6 +307,8 @@ #define ANIM_TAG_MEGA_PARTICLES (ANIM_SPRITES_START + 297) #define ANIM_TAG_TRUMP_CARD (ANIM_SPRITES_START + 298) #define ANIM_TAG_TRUMP_CARD_PARTICLES (ANIM_SPRITES_START + 299) +#define ANIM_TAG_ACCUPRESSURE (ANIM_SPRITES_START + 300) +#define ANIM_TAG_WRING_OUT (ANIM_SPRITES_START + 301) // battlers #define ANIM_ATTACKER 0 diff --git a/include/graphics.h b/include/graphics.h index 19fe39b16..ab012b347 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4413,6 +4413,8 @@ extern const u32 gBattleAnimSpriteGfx_Bird[]; extern const u32 gBattleAnimSpriteGfx_CrossImpact[]; extern const u32 gBattleAnimSpriteGfx_TrumpCard[]; extern const u32 gBattleAnimSpriteGfx_TrumpCardParticles[]; +extern const u32 gBattleAnimSpriteGfx_Accupressure[]; +extern const u32 gBattleAnimSpriteGfx_WringOut[]; extern const u32 gBattleAnimSpritePal_Bone[]; extern const u32 gBattleAnimSpritePal_Spark[]; @@ -4700,6 +4702,8 @@ extern const u32 gBattleAnimSpritePal_WhipHit[]; extern const u32 gBattleAnimSpritePal_BlueRing2[]; extern const u32 gBattleAnimSpritePal_TrumpCard[]; extern const u32 gBattleAnimSpritePal_TrumpCardParticles[]; +extern const u32 gBattleAnimSpritePal_Accupressure[]; +extern const u32 gBattleAnimSpritePal_WringOut[]; extern const u32 gBattleAnimBgImage_Dark[]; extern const u32 gBattleAnimBgImage_Ghost[]; @@ -4753,6 +4757,7 @@ extern const u32 gBattleAnimBgTilemap_InAir[]; extern const u32 gBattleAnimBgTilemap_Aurora[]; extern const u32 gBattleAnimBgTilemap_Fissure[]; + extern const u32 gMetalShineGfx[]; extern const u32 gMetalShinePalette[]; extern const u32 gMetalShineTilemap[]; diff --git a/src/battle_anim.c b/src/battle_anim.c index 78f2073dd..bfbe10520 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -1425,6 +1425,8 @@ const struct CompressedSpriteSheet gBattleAnimPicTable[] = {gBattleAnimSpriteGfx_MegaParticles, 0x0180, ANIM_TAG_MEGA_PARTICLES}, {gBattleAnimSpriteGfx_TrumpCard, 0x0180, ANIM_TAG_TRUMP_CARD}, {gBattleAnimSpriteGfx_TrumpCardParticles, 0x0060, ANIM_TAG_TRUMP_CARD_PARTICLES}, + {gBattleAnimSpriteGfx_Accupressure, 0x0200, ANIM_TAG_ACCUPRESSURE}, + {gBattleAnimSpriteGfx_WringOut, 0x0200, ANIM_TAG_WRING_OUT}, }; const struct CompressedSpritePalette gBattleAnimPaletteTable[] = @@ -1729,6 +1731,8 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] = {gBattleAnimSpritePal_MegaParticles, ANIM_TAG_MEGA_PARTICLES}, {gBattleAnimSpritePal_TrumpCard, ANIM_TAG_TRUMP_CARD}, {gBattleAnimSpritePal_TrumpCardParticles, ANIM_TAG_TRUMP_CARD_PARTICLES}, + {gBattleAnimSpritePal_Accupressure, ANIM_TAG_ACCUPRESSURE}, + {gBattleAnimSpritePal_WringOut, ANIM_TAG_WRING_OUT} }; const struct BattleAnimBackground gBattleAnimBackgroundTable[] = diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index c2655fd44..35b311e72 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -158,6 +158,8 @@ static void AnimMoveFeintSwipe(struct Sprite *); static void AnimMoveFeintZoom(struct Sprite *); static void AnimMoveTrumpCard(struct Sprite *); static void AnimMoveTrumpCardParticle(struct Sprite* sprite); +static void AnimMoveAccupressure(struct Sprite* sprite); +static void AnimMoveWringOut(struct Sprite* sprite); const union AnimCmd gUnknown_085920F0[] = { @@ -279,6 +281,47 @@ static const union AnimCmd * const sTrumpCardParticleAnims[] = sTrumpCardParticleFrame2, }; +static const union AffineAnimCmd sAccupressureTurn[] = +{ + AFFINEANIMCMD_FRAME(0, 0, 1, 20), + AFFINEANIMCMD_FRAME(0, 0, -1, 40), + AFFINEANIMCMD_END, +}; + +static const union AffineAnimCmd sAccupressureStill[] = +{ + AFFINEANIMCMD_FRAME(256, 256, 0, 0), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd * const sAccupressureAffineAnims[] = +{ + sAccupressureStill, + sAccupressureTurn +}; + +const struct SpriteTemplate gAccupressureSpriteTemplate = +{ + .tileTag = ANIM_TAG_ACCUPRESSURE, + .paletteTag = ANIM_TAG_ACCUPRESSURE, + .oam = &gUnknown_085249D4, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sAccupressureAffineAnims, + .callback = AnimMoveAccupressure, +}; + +const struct SpriteTemplate gWringOutHandSpriteTemplate = +{ + .tileTag = ANIM_TAG_WRING_OUT, + .paletteTag = ANIM_TAG_WRING_OUT, + .oam = &gUnknown_085249D4, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimMoveWringOut, +}; + const struct SpriteTemplate gTrumpCardParticleSpriteTempalte = { .tileTag = ANIM_TAG_TRUMP_CARD_PARTICLES, @@ -2969,6 +3012,80 @@ static void AnimMoveTrumpCardParticle(struct Sprite* sprite) sprite->callback = AnimMoveTrumpCardParticleAlive; } +static void AnimMoveAccupressureTransition(struct Sprite* sprite) +{ + switch(sprite->data[5]) + { + case 0: + if(AnimTranslateLinear(sprite)) + { + StartSpriteAffineAnim(sprite, 1); + sprite->data[5]++; + } + break; + case 1: + if(sprite->affineAnimEnded) + { + DestroyAnimSprite(sprite); + } + break; + } +} + +static void AnimMoveAccupressure(struct Sprite* sprite) +{ + InitSpritePosToAnimTarget(sprite, TRUE); + sprite->data[0] = gBattleAnimArgs[2]; + sprite->data[1] = sprite->pos1.x; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); + sprite->data[3] = sprite->pos1.y; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y); + sprite->data[5] = 0; + InitAnimLinearTranslation(sprite); + sprite->callback = AnimMoveAccupressureTransition; +} + +static void AnimMoveWringOutCircle(struct Sprite* sprite) +{ + sprite->pos2.x = Cos(sprite->data[3], sprite->data[2]); + sprite->pos2.y = Sin(sprite->data[3], sprite->data[2]); + if(sprite->data[1] > 0) + { + if(sprite->data[3] + sprite->data[0] >= 256) + { + AGBPrintf("Hit the crit section: step: %d, angle: %d", sprite->data[0], sprite->data[3]); + sprite->data[3] = (sprite->data[0] + sprite->data[3]) % 256; + sprite->data[1]--; + AGBPrintf("Crit New angle: %d", sprite->data[3]); + } + else + { + AGBPrintf("New angle: %d", sprite->data[3]); + sprite->data[3] += sprite->data[0]; + } + + } + else if(sprite->data[3] < 64) + { + //We need to go for an extra 90° + sprite->data[3] += sprite->data[0]; + } + else + { + DestroyAnimSprite(sprite); + } +} + +static void AnimMoveWringOut(struct Sprite* sprite) +{ + InitSpritePosToAnimTarget(sprite, TRUE); + sprite->data[0] = 256 / gBattleAnimArgs[2]; //step size + sprite->data[1] = gBattleAnimArgs[3]; //Number of circle spins + sprite->data[2] = gBattleAnimArgs[4]; //radius + sprite->data[3] = 64; //current angle 90° + sprite->callback = AnimMoveWringOutCircle; +} + // seed (sprouts a sapling from a seed.) // Used by Leech Seed. // arg 0: initial x pixel offset diff --git a/src/graphics.c b/src/graphics.c index c7783221a..6419ab66f 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -125,6 +125,12 @@ const u32 gBattleAnimSpritePal_TrumpCard[] = INCBIN_U32("graphics/battle_anims/s const u32 gBattleAnimSpriteGfx_TrumpCardParticles[] = INCBIN_U32("graphics/battle_anims/sprites/trump_card_particles.4bpp.lz"); const u32 gBattleAnimSpritePal_TrumpCardParticles[] = INCBIN_U32("graphics/battle_anims/sprites/trump_card_particles.gbapal.lz"); +const u32 gBattleAnimSpriteGfx_Accupressure[] = INCBIN_U32("graphics/battle_anims/sprites/accupressure.4bpp.lz"); +const u32 gBattleAnimSpritePal_Accupressure[] = INCBIN_U32("graphics/battle_anims/sprites/accupressure.gbapal.lz"); + +const u32 gBattleAnimSpriteGfx_WringOut[] = INCBIN_U32("graphics/battle_anims/sprites/wring_out.4bpp.lz"); +const u32 gBattleAnimSpritePal_WringOut[] = INCBIN_U32("graphics/battle_anims/sprites/wring_out.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"); From 8126662cfb6507288a18b58961c50bfddcb099e6 Mon Sep 17 00:00:00 2001 From: Karathan Date: Wed, 3 Jul 2019 14:10:29 +0200 Subject: [PATCH 5/7] update wring out with trace, remove AGBPrintf --- data/battle_anim_scripts.s | 17 ++++++++++++++++- src/battle_anim_effects_1.c | 7 ++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index b60538e0b..eca8d65f9 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -1237,7 +1237,22 @@ Move_HEAL_BLOCK: Move_WRING_OUT: loadspritegfx ANIM_TAG_WRING_OUT - createsprite gWringOutHandSpriteTemplate, ANIM_TARGET, 40, 0, 0, 48, 3, 32 + monbg ANIM_TARGET + setalpha 12, 8 + createsprite gWringOutHandSpriteTemplate, ANIM_TARGET, 40, 0, 0, 48, 3, 32, FALSE + delay 3 + createsprite gWringOutHandSpriteTemplate, ANIM_TARGET, 40, 0, 0, 48, 3, 32, TRUE + delay 3 + createsprite gWringOutHandSpriteTemplate, ANIM_TARGET, 40, 0, 0, 48, 3, 32, TRUE + delay 3 + createsprite gWringOutHandSpriteTemplate, ANIM_TARGET, 40, 0, 0, 48, 3, 32, TRUE + delay 3 + createsprite gWringOutHandSpriteTemplate, ANIM_TARGET, 40, 0, 0, 48, 3, 32, TRUE + delay 3 + createsprite gWringOutHandSpriteTemplate, ANIM_TARGET, 40, 0, 0, 48, 3, 32, TRUE + waitforvisualfinish + clearmonbg ANIM_TARGET + blendoff waitforvisualfinish end diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 35b311e72..537230d19 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -3053,14 +3053,11 @@ static void AnimMoveWringOutCircle(struct Sprite* sprite) { if(sprite->data[3] + sprite->data[0] >= 256) { - AGBPrintf("Hit the crit section: step: %d, angle: %d", sprite->data[0], sprite->data[3]); sprite->data[3] = (sprite->data[0] + sprite->data[3]) % 256; sprite->data[1]--; - AGBPrintf("Crit New angle: %d", sprite->data[3]); } else { - AGBPrintf("New angle: %d", sprite->data[3]); sprite->data[3] += sprite->data[0]; } @@ -3079,6 +3076,10 @@ static void AnimMoveWringOutCircle(struct Sprite* sprite) static void AnimMoveWringOut(struct Sprite* sprite) { InitSpritePosToAnimTarget(sprite, TRUE); + if(gBattleAnimArgs[5] == TRUE) + { + sprite->oam.objMode = ST_OAM_OBJ_BLEND; + } sprite->data[0] = 256 / gBattleAnimArgs[2]; //step size sprite->data[1] = gBattleAnimArgs[3]; //Number of circle spins sprite->data[2] = gBattleAnimArgs[4]; //radius From d9b54c3c1c161606bc427bdc570883fab39e66e1 Mon Sep 17 00:00:00 2001 From: Karathan Date: Sat, 6 Jul 2019 05:22:18 +0200 Subject: [PATCH 6/7] add power swap, guard swap, worry seed --- data/battle_anim_scripts.s | 89 ++++++++++++++ .../battle_anims/sprites/colored_orbs.png | Bin 0 -> 432 bytes graphics/battle_anims/sprites/small_cloud.png | Bin 0 -> 183 bytes graphics/battle_anims/sprites/worry_seed.png | Bin 0 -> 317 bytes include/constants/battle_anim.h | 3 + include/graphics.h | 6 + src/battle_anim.c | 8 +- src/battle_anim_effects_1.c | 110 ++++++++++++++++++ src/graphics.c | 9 ++ src/normal.c | 91 +++++++++++++++ 10 files changed, 315 insertions(+), 1 deletion(-) create mode 100644 graphics/battle_anims/sprites/colored_orbs.png create mode 100644 graphics/battle_anims/sprites/small_cloud.png create mode 100644 graphics/battle_anims/sprites/worry_seed.png diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index eca8d65f9..0d05554f2 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -1336,9 +1336,87 @@ Move_COPYCAT: end Move_POWER_SWAP: + loadspritegfx ANIM_TAG_COLORED_ORBS + playsewithpan SE_W104, 0 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 0, 0, 42, -32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 1, 0, 42, -32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 1, 0, 42, -32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 1, 0, 42, -32 + delay 2 + playsewithpan SE_W104, 0 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 0, 1, 42, 32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 1, 1, 42, 32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 1, 1, 42, 32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 1, 1, 42, 32 + + waitforvisualfinish + playsewithpan SE_W104, 0 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 0, 0, 42, -32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 1, 0, 42, -32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 1, 0, 42, -32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 1, 0, 42, -32 + delay 2 + playsewithpan SE_W104, 0 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 0, 1, 42, 32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 1, 1, 42, 32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 1, 1, 42, 32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 1, 1, 42, 32 + delay 2 + waitforvisualfinish end Move_GUARD_SWAP: + loadspritegfx ANIM_TAG_COLORED_ORBS + playsewithpan SE_W104, 0 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 2, 0, 42, -32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 3, 0, 42, -32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 3, 0, 42, -32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 3, 0, 42, -32 + delay 2 + playsewithpan SE_W104, 0 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 2, 1, 42, 32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 3, 1, 42, 32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 3, 1, 42, 32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 3, 1, 42, 32 + + waitforvisualfinish + playsewithpan SE_W104, 0 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 2, 0, 42, -32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 3, 0, 42, -32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 3, 0, 42, -32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 3, 0, 42, -32 + delay 2 + playsewithpan SE_W104, 0 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 2, 1, 42, 32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 3, 1, 42, 32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 3, 1, 42, 32 + delay 2 + createsprite gPowerSwapGuardSwapSpriteTemplate, ANIM_TARGET, 3, 0, 0, 3, 1, 42, 32 + delay 2 + waitforvisualfinish end Move_PUNISHMENT: @@ -1348,6 +1426,17 @@ Move_LAST_RESORT: end Move_WORRY_SEED: + loadspritegfx ANIM_TAG_WORRY_SEED + loadspritegfx ANIM_TAG_SMALL_CLOUD + playsewithpan SE_W077, SOUND_PAN_ATTACKER + createsprite gWorrySeedSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 32, -32 + waitforvisualfinish + playsewithpan SE_W028, SOUND_PAN_TARGET + createsprite gSmallCloudTemplate, ANIM_ATTACKER, 3, -2, -1, 0, -1, -1 + createsprite gSmallCloudTemplate, ANIM_ATTACKER, 3, 3, 1, 1, 2, -1 + createsprite gSmallCloudTemplate, ANIM_ATTACKER, 3, -2, 1, 2, 1, -2 + createsprite gSmallCloudTemplate, ANIM_ATTACKER, 3, 3, -2, 1, -1, -2 + waitforvisualfinish end Move_SUCKER_PUNCH: diff --git a/graphics/battle_anims/sprites/colored_orbs.png b/graphics/battle_anims/sprites/colored_orbs.png new file mode 100644 index 0000000000000000000000000000000000000000..3bd3a55dd31f62dcedb260f8d682edb4a4919a60 GIT binary patch literal 432 zcmeAS@N?(olHy`uVBq!ia0vp^0zjO=!3-po`I#mGDaPU;cPEB*=VV?2IR*hfA+A80 zL0C?mo7=_3B}Ybv!8|N2Esepqa*dJEK7Df&k0SgK8W9|G&+1M(?TE^88RCpc6pYBoewypZeyxw7aMexKed{Om*9R<%7J_C3o1I&UV(c{72|%ji;BmUJ5AytNxSc3w29H_e~g u3Ugi-*m;>C=dFf1&-c8@f!Obtx61$L72Q8cf$I$@v^`z@T-G@yGywo)S+{Ed literal 0 HcmV?d00001 diff --git a/graphics/battle_anims/sprites/small_cloud.png b/graphics/battle_anims/sprites/small_cloud.png new file mode 100644 index 0000000000000000000000000000000000000000..2733a71dca46be9d0253e118d5ec7cfe452990af GIT binary patch literal 183 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~{s5m4S0F7R zp-@oJaNxv+4<9~Qbhjx0g;-01{DK+&1A)v1HIPZJo-U3d5>s3IFLE&`a4;|b_W%Bz zOG&K(-3Q?r%A?s&C>EvF3uOnx|Gg_Y#+rzu1>lyVGu~amOZuS5w1$ Y_FVdQ&MBb@0LocDH2?qr literal 0 HcmV?d00001 diff --git a/graphics/battle_anims/sprites/worry_seed.png b/graphics/battle_anims/sprites/worry_seed.png new file mode 100644 index 0000000000000000000000000000000000000000..2f6d68b29453f51254dcb6eab1dc858f66d0e37d GIT binary patch literal 317 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=4IB%*ral=DPAu7MjjB zN`W34i9yD(A;v}VCUx0v9hI(2dqa+|&c403^zE72X|Ip+0QE4I1o;IsI6S+N2I3@n zySp%Su*!M>Ih+L^k;M!Q+`=Ht$S`Y;1W=H@#M9T6{V_WmqlU0>-cgVv+B{txLpZJ{ zCp0j>GqvVcb?muUo?kwV+rVJM-2ea6zRpx)V|)4g|9`#wc$SnofB%20aBXFDzJ6=> z^7OT@1QJ%Ph}pYn(ITe?#XYspdOqdata[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y); + + sprite->data[0] = gBattleAnimArgs[2]; + sprite->data[5] = gBattleAnimArgs[3]; + InitAnimArcTranslation(sprite); + sprite->callback = AnimMoveWorrySeedWait; +} + +static void AnimMoveSmallCloudAnimate(struct Sprite* sprite) +{ + sprite->pos2.x += sprite->data[0]; + sprite->pos2.y += sprite->data[1]; + + if(sprite->affineAnimEnded) + { + DestroyAnimSprite(sprite); + } + +} +#define ONE_IF_ZERO(x) ((x) > 0 ? (x) : 1) + +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: cloud type animation [0..2] +// arg 3: horizontal velocity +// arg 4: vertical velocity +// arg 5: duration +static void AnimMoveSmallCloud(struct Sprite* sprite) +{ + InitSpritePosToAnimTarget(sprite, TRUE); + sprite->data[0] = gBattleAnimArgs[3]; + sprite->data[1] = gBattleAnimArgs[4]; + sprite->callback = AnimMoveSmallCloudAnimate; + StartSpriteAffineAnim(sprite, gBattleAnimArgs[2]+1); +} + static void AnimPluckParticle(struct Sprite* sprite) { if(sprite->data[0] > 0) diff --git a/src/graphics.c b/src/graphics.c index 6419ab66f..7fd71cf73 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -166,6 +166,15 @@ const u32 gBattleAnimSpriteGfx_Lightning2[] = INCBIN_U32("graphics/battle_anims/ const u32 gBattleAnimSpriteGfx_Lightning[] = INCBIN_U32("graphics/battle_anims/sprites/lightning.4bpp.lz"); +const u32 gBattleAnimSpriteGfx_ColoredOrbs[] = INCBIN_U32("graphics/battle_anims/sprites/colored_orbs.4bpp.lz"); +const u32 gBattleAnimSpritePal_ColoredOrbs[] = INCBIN_U32("graphics/battle_anims/sprites/colored_orbs.gbapal.lz"); + +const u32 gBattleAnimSpriteGfx_WorrySeed[] = INCBIN_U32("graphics/battle_anims/sprites/worry_seed.4bpp.lz"); +const u32 gBattleAnimSpritePal_WorrySeed[] = INCBIN_U32("graphics/battle_anims/sprites/worry_seed.gbapal.lz"); + +const u32 gBattleAnimSpriteGfx_SmallCloud[] = INCBIN_U32("graphics/battle_anims/sprites/small_cloud.4bpp.lz"); +const u32 gBattleAnimSpritePal_SmallCloud[] = INCBIN_U32("graphics/battle_anims/sprites/small_cloud.gbapal.lz"); + const u32 gUnknownGfx_C06D98[] = INCBIN_U32("graphics/unknown/unknown_C06D98.4bpp.lz"); const u32 gUnknownPal_C06D98[] = INCBIN_U32("graphics/unknown/unknown_C06D98.gbapal.lz"); const u32 gUnknownPal_C06D98_2[] = INCBIN_U32("graphics/unknown/unknown_C06D98_2.gbapal.lz"); diff --git a/src/normal.c b/src/normal.c index 2b592e199..293d1931c 100644 --- a/src/normal.c +++ b/src/normal.c @@ -35,6 +35,7 @@ static void sub_81161F4(void); static void sub_81162F8(u8); static void sub_81163D0(struct Sprite *); static void sub_81165E4(struct Sprite *); +static void AnimMovePowerSwapGuardSwap(struct Sprite *); const union AnimCmd gUnknown_0859722C[] = { @@ -93,6 +94,63 @@ const struct SpriteTemplate gComplexPaletteBlendSpriteTemplate = .callback = sub_81158A4, }; +static const union AnimCmd sPowerSwapGuardSwapFrame0[] = +{ + ANIMCMD_FRAME(0, 0), + ANIMCMD_END +}; + +static const union AnimCmd sPowerSwapGuardSwapFrame1[] = +{ + ANIMCMD_FRAME(4, 0), + ANIMCMD_END +}; + +static const union AnimCmd sPowerSwapGuardSwapFrame2[] = +{ + ANIMCMD_FRAME(8, 0), + ANIMCMD_END +}; + +static const union AnimCmd sPowerSwapGuardSwapFrame3[] = +{ + ANIMCMD_FRAME(12, 0), + ANIMCMD_END +}; + +static const union AnimCmd sPowerSwapGuardSwapFrame4[] = +{ + ANIMCMD_FRAME(16, 0), + ANIMCMD_END +}; + +static const union AnimCmd sPowerSwapGuardSwapFrame5[] = +{ + ANIMCMD_FRAME(20, 0), + ANIMCMD_END +}; + +static const union AnimCmd * const sPowerSwapGuardSwapAnimTable[] = +{ + sPowerSwapGuardSwapFrame0, + sPowerSwapGuardSwapFrame1, + sPowerSwapGuardSwapFrame2, + sPowerSwapGuardSwapFrame3, + sPowerSwapGuardSwapFrame4, + sPowerSwapGuardSwapFrame5 +}; + +const struct SpriteTemplate gPowerSwapGuardSwapSpriteTemplate = +{ + .tileTag = ANIM_TAG_COLORED_ORBS, + .paletteTag = ANIM_TAG_COLORED_ORBS, + .oam = &gUnknown_0852490C, + .anims = sPowerSwapGuardSwapAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimMovePowerSwapGuardSwap +}; + const union AnimCmd gUnknown_085972A4[] = { ANIMCMD_FRAME(0, 3), @@ -253,6 +311,39 @@ const struct SpriteTemplate gUnknown_08597400 = .callback = sub_81163D0, }; +static void AnimMovePowerSwapGuardSwapWait(struct Sprite* sprite) +{ + if (TranslateAnimHorizontalArc(sprite)) + DestroyAnimSprite(sprite); +} + +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: orb type (0..5) - color and size +// arg 3: from user to target / target to user +// arg 4: wave period +// arg 5: wave amplitude +static void AnimMovePowerSwapGuardSwap(struct Sprite* sprite) +{ + StartSpriteAnim(sprite, gBattleAnimArgs[2]); + if(gBattleAnimArgs[3] == 0) + { + InitSpritePosToAnimAttacker(sprite, TRUE); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y); + } + else + { + InitSpritePosToAnimTarget(sprite, TRUE); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y); + } + sprite->data[0] = gBattleAnimArgs[4]; + sprite->data[5] = gBattleAnimArgs[5]; + InitAnimArcTranslation(sprite); + sprite->callback = AnimMovePowerSwapGuardSwapWait; +} + // Moves a spinning duck around the mon's head. // arg 0: initial x pixel offset // arg 1: initial y pixel offset From bcffc2655e0401bb129787d39f60137be1a9575c Mon Sep 17 00:00:00 2001 From: Karathan Date: Sat, 6 Jul 2019 05:25:56 +0200 Subject: [PATCH 7/7] fix style issues --- .../{feint-punch.png => feint_punch.png} | Bin src/battle_anim_effects_1.c | 42 +++++++++--------- src/graphics.c | 4 +- 3 files changed, 23 insertions(+), 23 deletions(-) rename graphics/battle_anims/sprites/{feint-punch.png => feint_punch.png} (100%) diff --git a/graphics/battle_anims/sprites/feint-punch.png b/graphics/battle_anims/sprites/feint_punch.png similarity index 100% rename from graphics/battle_anims/sprites/feint-punch.png rename to graphics/battle_anims/sprites/feint_punch.png diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 94ec21a80..e731fbf3f 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -2994,26 +2994,26 @@ 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); - } + 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; - } + case 1: + if(AnimTranslateLinear(sprite)) + { + sprite->callback = DestroyAnimSprite; + } break; } @@ -3126,14 +3126,14 @@ static void AnimMoveAccupressureTransition(struct Sprite* sprite) { switch(sprite->data[5]) { - case 0: + case 0: if(AnimTranslateLinear(sprite)) { StartSpriteAffineAnim(sprite, 1); sprite->data[5]++; } break; - case 1: + case 1: if(sprite->affineAnimEnded) { DestroyAnimSprite(sprite); diff --git a/src/graphics.c b/src/graphics.c index 7fd71cf73..7a31edea5 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -116,8 +116,8 @@ 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_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_TrumpCard[] = INCBIN_U32("graphics/battle_anims/sprites/trump_cards.4bpp.lz"); const u32 gBattleAnimSpritePal_TrumpCard[] = INCBIN_U32("graphics/battle_anims/sprites/trump_cards.gbapal.lz");