diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 98ac1bfda76d..c16a5c7859b3 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -934,6 +934,44 @@ gBattleAnimMove_ToxicSpikes:: end gBattleAnimMove_HeartSwap:: + loadspritegfx ANIM_TAG_RED_HEART + loadspritegfx ANIM_TAG_PINKVIO_ORB + loadspritegfx ANIM_TAG_SPARKLE_2 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 3, 0, 8, RGB(31, 24, 26) + createvisualtask AnimTask_HeartSwap, 3, ANIM_TARGET + createvisualtask AnimTask_BlendMonInAndOut, 5, ANIM_TARGET, RGB_WHITE, 12, 3, 1 + loopsewithpan SE_M_TAIL_WHIP, SOUND_PAN_ATTACKER, 10, 8 + delay 16 + createvisualtask AnimTask_HeartSwap, 3, ANIM_ATTACKER + createvisualtask AnimTask_BlendMonInAndOut, 5, ANIM_ATTACKER, RGB_WHITE, 12, 3, 1 + waitforvisualfinish + createsprite gGrantingStarsSpriteTemplate, ANIM_ATTACKER, 2, -15, 0, 0, 0, 32, 60 + createsprite gGrantingStarsSpriteTemplate, ANIM_TARGET, 2, -15, 0, 0, 0, 32, 60 + delay 8 + createsprite gGrantingStarsSpriteTemplate, ANIM_ATTACKER, 2, 12, -5, 0, 0, 32, 60 + createsprite gGrantingStarsSpriteTemplate, ANIM_TARGET, 2, 12, -5, 0, 0, 32, 60 + delay 4 + playsewithpan SE_SHINY, SOUND_PAN_ATTACKER + createvisualtask AnimTask_BlendMonInAndOut, 5, ANIM_ATTACKER, RGB(31, 25, 27), 12, 3, 1 + createvisualtask AnimTask_ScaleMonAndRestore, 5, -3, -3, 16, ANIM_ATTACKER, 0 + createvisualtask AnimTask_BlendMonInAndOut, 5, ANIM_TARGET, RGB(31, 25, 27), 12, 3, 1 + createvisualtask AnimTask_ScaleMonAndRestore, 5, -3, -3, 16, ANIM_TARGET, 0 + createsprite gRedHeartBurstSpriteTemplate, ANIM_TARGET, 3, 160, -32 + createsprite gRedHeartBurstSpriteTemplate, ANIM_TARGET, 3, -256, -40 + createsprite gRedHeartBurstSpriteTemplate, ANIM_TARGET, 3, 128, -16 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 3, 8, 0, RGB(31, 24, 26) + createsprite gRedHeartCharmSpriteTemplate, ANIM_ATTACKER, 3, 0, 20 + playsewithpan SE_M_MORNING_SUN, SOUND_PAN_ATTACKER + delay 15 + createsprite gRedHeartCharmSpriteTemplate, ANIM_ATTACKER, 3, -20, 20 + playsewithpan SE_M_CHARM, SOUND_PAN_ATTACKER + delay 15 + createsprite gRedHeartCharmSpriteTemplate, ANIM_ATTACKER, 3, 20, 20 + playsewithpan SE_M_CHARM, SOUND_PAN_ATTACKER + waitforvisualfinish + clearmonbg ANIM_ATTACKER + clearmonbg ANIM_TARGET + blendoff end gBattleAnimMove_AquaRing:: diff --git a/graphics/battle_anims/sprites/pinkvio_orb.png b/graphics/battle_anims/sprites/pinkvio_orb.png new file mode 100644 index 000000000000..d0d7c927549b Binary files /dev/null and b/graphics/battle_anims/sprites/pinkvio_orb.png differ diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 4601b452a2fa..00253642473d 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -416,6 +416,7 @@ #define ANIM_TAG_BEAM (ANIM_SPRITES_START + 402) #define ANIM_TAG_RED_EXPLOSION (ANIM_SPRITES_START + 403) #define ANIM_TAG_PURPLE_CHAIN (ANIM_SPRITES_START + 404) +#define ANIM_TAG_PINKVIO_ORB (ANIM_SPRITES_START + 405) // battlers #define ANIM_ATTACKER 0 diff --git a/include/graphics.h b/include/graphics.h index e11acf897805..06b5ab1b2d9f 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -2887,6 +2887,8 @@ extern const u32 gBattleAnimSpritePal_IvyCudgelGrass[]; extern const u32 gBattleAnimSpritePal_IvyCudgelFire[]; extern const u32 gBattleAnimSpritePal_IvyCudgelRock[]; extern const u32 gBattleAnimSpritePal_IvyCudgelWater[]; +extern const u32 gBattleAnimSpriteGfx_PinkVioletOrb[]; +extern const u32 gBattleAnimSpritePal_PinkVioletOrb[]; extern const u32 gBattleAnimBgImage_Dark[]; extern const u32 gBattleAnimBgImage_Ghost[]; diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index b33c0a8bb652..0a94cad2dc53 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -953,6 +953,18 @@ const struct SpriteTemplate gRedHeartRisingSpriteTemplate = .callback = AnimRedHeartRising, }; +// New struct that's just a copy of 'gMagentaHeartSpriteTemplate', without need to make new anim tags +const struct SpriteTemplate gRedHeartCharmSpriteTemplate = +{ + .tileTag = ANIM_TAG_RED_HEART, + .paletteTag = ANIM_TAG_RED_HEART, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimMagentaHeart, +}; + const union AffineAnimCmd gHiddenPowerOrbAffineAnimCmds[] = { AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0), diff --git a/src/battle_anim_psychic.c b/src/battle_anim_psychic.c index 1c998e9c56e9..a9c1f0cf6727 100644 --- a/src/battle_anim_psychic.c +++ b/src/battle_anim_psychic.c @@ -25,6 +25,7 @@ static void AnimTask_MeditateStretchAttacker_Step(u8); static void AnimTask_Teleport_Step(u8); static void AnimTask_ImprisonOrbs_Step(u8); static void AnimTask_SkillSwap_Step(u8); +static void AnimTask_HeartSwap_Step(u8); static void AnimTask_ExtrasensoryDistortion_Step(u8); static void AnimTask_TransparentCloneGrowAndShrink_Step(u8); static void AnimateZenHeadbutt(struct Sprite *sprite); @@ -359,6 +360,18 @@ const struct SpriteTemplate gSkillSwapOrbSpriteTemplate = .callback = AnimSkillSwapOrb, }; +// Pink version of the Skill Swap orbs +const struct SpriteTemplate gHeartSwapOrbSpriteTemplate = +{ + .tileTag = ANIM_TAG_PINKVIO_ORB, + .paletteTag = ANIM_TAG_PINKVIO_ORB, + .oam = &gOamData_AffineNormal_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sAffineAnims_SkillSwapOrb, + .callback = AnimSkillSwapOrb, +}; + static const union AffineAnimCmd sAffineAnim_LusterPurgeCircle[] = { AFFINEANIMCMD_FRAME(0x20, 0x20, 0, 0), @@ -1001,7 +1014,7 @@ void AnimTask_SkillSwap(u8 taskId) } else { - if (gBattleAnimArgs[0] == 1) + if (gBattleAnimArgs[0] == ANIM_TARGET) { task->data[10] = -10; task->data[11] = GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_LEFT) + 8; @@ -1023,6 +1036,55 @@ void AnimTask_SkillSwap(u8 taskId) task->func = AnimTask_SkillSwap_Step; } +// Copy of Skill Swap's function to get position of the user and target +// arg 0: move target +void AnimTask_HeartSwap(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + if (IsContest()) + { + if (gBattleAnimArgs[0] == ANIM_TARGET) + { + task->data[10] = -10; + task->data[11] = GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_RIGHT) - 8; + task->data[12] = GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_TOP) + 8; + task->data[13] = GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_RIGHT) - 8; + task->data[14] = GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_TOP) + 8; + } + else + { + task->data[10] = 10; + task->data[11] = GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_LEFT) + 8; + task->data[12] = GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_BOTTOM) - 8; + task->data[13] = GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_LEFT) + 8; + task->data[14] = GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_BOTTOM) - 8; + } + } + else + { + if (gBattleAnimArgs[0] == ANIM_TARGET) + { + task->data[10] = -10; + task->data[11] = GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_LEFT) + 8; + task->data[12] = GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_TOP) + 8; + task->data[13] = GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_LEFT) + 8; + task->data[14] = GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_TOP) + 8; + } + else + { + task->data[10] = 10; + task->data[11] = GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_RIGHT) - 8; + task->data[12] = GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_BOTTOM) - 8; + task->data[13] = GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_RIGHT) - 8; + task->data[14] = GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_BOTTOM) - 8; + } + } + + task->data[1] = 6; + task->func = AnimTask_HeartSwap_Step; +} + static void AnimTask_SkillSwap_Step(u8 taskId) { u8 spriteId; @@ -1057,6 +1119,42 @@ static void AnimTask_SkillSwap_Step(u8 taskId) } } +// Copy of Skill Swap's function to vault the series of orbs between the user and target +// CreateSprite modified so it uses the pink orbs instead of the blue/green ones +static void AnimTask_HeartSwap_Step(u8 taskId) +{ + u8 spriteId; + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + if (++task->data[1] > 6) + { + task->data[1] = 0; + spriteId = CreateSprite(&gHeartSwapOrbSpriteTemplate, task->data[11], task->data[12], 0); + if (spriteId != MAX_SPRITES) + { + gSprites[spriteId].data[0] = 16; + gSprites[spriteId].data[2] = task->data[13]; + gSprites[spriteId].data[4] = task->data[14]; + gSprites[spriteId].data[5] = task->data[10]; + + InitAnimArcTranslation(&gSprites[spriteId]); + StartSpriteAffineAnim(&gSprites[spriteId], task->data[2] & 3); + } + + if (++task->data[2] == 12) + task->data[0]++; + } + break; + case 1: + if (++task->data[1] > 17) + DestroyAnimVisualTask(taskId); + break; + } +} + static void AnimSkillSwapOrb(struct Sprite *sprite) { if (TranslateAnimHorizontalArc(sprite)) diff --git a/src/data/battle_anim.h b/src/data/battle_anim.h index 2ab982d2d72c..a09c8d72c8cc 100644 --- a/src/data/battle_anim.h +++ b/src/data/battle_anim.h @@ -1465,6 +1465,7 @@ const struct CompressedSpriteSheet gBattleAnimPicTable[] = {gBattleAnimSpriteGfx_RedExplosion, 0x0800, ANIM_TAG_RED_EXPLOSION}, {gBattleAnimSpriteGfx_Beam, 0x0800, ANIM_TAG_BEAM}, {gBattleAnimSpriteGfx_PurpleChain, 0x1000, ANIM_TAG_PURPLE_CHAIN}, + {gBattleAnimSpriteGfx_PinkVioletOrb, 0x0080, ANIM_TAG_PINKVIO_ORB}, }; const struct CompressedSpritePalette gBattleAnimPaletteTable[] = @@ -1931,6 +1932,7 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] = {gBattleAnimSpritePal_RedExplosion, ANIM_TAG_RED_EXPLOSION}, {gBattleAnimSpritePal_Beam, ANIM_TAG_BEAM}, {gBattleAnimSpritePal_PurpleChain, ANIM_TAG_PURPLE_CHAIN}, + {gBattleAnimSpritePal_PinkVioletOrb, ANIM_TAG_PINKVIO_ORB}, }; const struct BattleAnimBackground gBattleAnimBackgroundTable[] = diff --git a/src/graphics.c b/src/graphics.c index 231aec415824..5aafa8ae4591 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1263,6 +1263,9 @@ const u32 gBattleAnimSpriteGfx_XSign[] = INCBIN_U32("graphics/battle_anims/sprit const u32 gBattleAnimSpriteGfx_BluegreenOrb[] = INCBIN_U32("graphics/battle_anims/sprites/bluegreen_orb.4bpp.lz"); const u32 gBattleAnimSpritePal_BluegreenOrb[] = INCBIN_U32("graphics/battle_anims/sprites/bluegreen_orb.gbapal.lz"); +const u32 gBattleAnimSpriteGfx_PinkVioletOrb[] = INCBIN_U32("graphics/battle_anims/sprites/pinkvio_orb.4bpp.lz"); +const u32 gBattleAnimSpritePal_PinkVioletOrb[] = INCBIN_U32("graphics/battle_anims/sprites/pinkvio_orb.gbapal.lz"); + const u32 gBattleAnimSpriteGfx_PawPrint[] = INCBIN_U32("graphics/battle_anims/sprites/paw_print.4bpp.lz"); const u32 gBattleAnimSpritePal_PawPrint[] = INCBIN_U32("graphics/battle_anims/sprites/paw_print.gbapal.lz");