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 000000000..0da836ff3 Binary files /dev/null and b/graphics/battle_anims/sprites/accupressure.png differ diff --git a/graphics/battle_anims/sprites/wring_out.png b/graphics/battle_anims/sprites/wring_out.png new file mode 100644 index 000000000..b96ffdbd2 Binary files /dev/null and b/graphics/battle_anims/sprites/wring_out.png differ 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");