From 85ce72a4d07cbf1f4339d03e2e774938046e98fc Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Thu, 14 Oct 2021 10:47:39 -0400 Subject: [PATCH] add shell smash anim --- data/battle_anim_scripts.s | 25 +++++++++++++++++++++++++ include/battle_anim.h | 2 ++ src/battle_anim_new.c | 34 ++++++++++++++++++++++++++++++++++ src/battle_anim_rock.c | 9 ++++----- 4 files changed, 65 insertions(+), 5 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 4063885e09..794cc2c0cc 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -5374,6 +5374,31 @@ ScaldHitSplats: return Move_SHELL_SMASH: + loadspritegfx ANIM_TAG_SHELL_RIGHT + loadspritegfx ANIM_TAG_SHELL_LEFT + loadspritegfx ANIM_TAG_IMPACT + loadspritegfx ANIM_TAG_ROCKS + loadspritegfx ANIM_TAG_HANDS_AND_FEET + playsewithpan SE_M_SCRATCH, SOUND_PAN_ATTACKER + createsprite gShellSmashRightShellSpriteTemplate, ANIM_ATTACKER, 2, 0xffd7, 0x0, 0x2, 0x333, 0x0, 0xa + createsprite gShellSmashLeftShellSpriteTemplate, ANIM_ATTACKER, 2, 0x20, 0x0, 0x6, 0xfccd, 0x0, 0xa + delay 10 + createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x1, 0x1 + createsprite gFistFootSpriteTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x8, 0x1, 0x0 + playsewithpan SE_M_ICY_WIND, SOUND_PAN_TARGET + createvisualtask AnimTask_ShakeMon, 2, 1, 3, 0, 5, 1 + waitforvisualfinish + playsewithpan SE_M_BUBBLE, SOUND_PAN_TARGET + createsprite gShellSmashPurpleRocksSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x14, 0x18, 0xe, 0x2 + createsprite gShellSmashPurpleRocksSpriteTemplate, ANIM_ATTACKER, 2, 0x5, 0x0, 0xffec, 0x18, 0xe, 0x1 + createsprite gShellSmashPurpleRocksSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x5, 0x14, 0xffe8, 0xe, 0x2 + createsprite gShellSmashPurpleRocksSpriteTemplate, ANIM_ATTACKER, 2, 0xfffb, 0x0, 0xffec, 0xffe8, 0xe, 0x2 + createsprite gShellSmashPurpleRocksSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0xfffb, 0x1e, 0x12, 0x8, 0x2 + createsprite gShellSmashPurpleRocksSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x1e, 0xffee, 0x8, 0x2 + createsprite gShellSmashPurpleRocksSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0xffe2, 0x12, 0x8, 0x2 + createsprite gShellSmashPurpleRocksSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0xffe2, 0xffee, 0x8, 0x2 + createvisualtask AnimTask_ShakeMon, 2, 1, 0, 3, 7, 1 + waitforvisualfinish end Move_HEAL_PULSE: diff --git a/include/battle_anim.h b/include/battle_anim.h index 9bc51facb7..ff388c714a 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -442,6 +442,7 @@ extern const union AffineAnimCmd *const gAffineAnims_SpinningHandOrFoot[]; extern const union AnimCmd *const gAnims_RevengeBigScratch[]; // battle_anim_rock.c +extern const union AnimCmd *const gAnims_FlyingRock[]; extern const union AffineAnimCmd *const gAffineAnims_Whirlpool[]; extern const union AffineAnimCmd *const gAffineAnims_BasicRock[]; void AnimParticleInVortex(struct Sprite *sprite); @@ -449,6 +450,7 @@ void AnimFallingRock(struct Sprite *sprite); void AnimRaiseSprite(struct Sprite *sprite); void AnimFallingRock_Step(struct Sprite *sprite); void AnimFlyingSandCrescent(struct Sprite *sprite); +void AnimRockFragment(struct Sprite *); // battle_anim_dark.c void AnimClawSlash(struct Sprite *sprite); diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index 0c452c236f..55a617bab0 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -93,6 +93,40 @@ const struct SpriteTemplate gPowerTrickSpriteTemplate = //// GEN 5 +//shell smash +const struct SpriteTemplate gShellSmashLeftShellSpriteTemplate = +{ + .tileTag = ANIM_TAG_SHELL_RIGHT, + .paletteTag = ANIM_TAG_SHELL_RIGHT, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_Bite, + .callback = AnimBite +}; + +const struct SpriteTemplate gShellSmashRightShellSpriteTemplate = +{ + .tileTag = ANIM_TAG_SHELL_LEFT, + .paletteTag = ANIM_TAG_SHELL_LEFT, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_Bite, + .callback = AnimBite +}; + +const struct SpriteTemplate gShellSmashPurpleRocksSpriteTemplate = +{ + .tileTag = ANIM_TAG_ROCKS, + .paletteTag = ANIM_TAG_SHELL_RIGHT, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_FlyingRock, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimRockFragment +}; + //wide guard const struct SpriteTemplate gWideGuardBlueConversionTemplate = { diff --git a/src/battle_anim_rock.c b/src/battle_anim_rock.c index da2d9b6458..afbacc6337 100644 --- a/src/battle_anim_rock.c +++ b/src/battle_anim_rock.c @@ -9,7 +9,6 @@ #include "constants/rgb.h" #include "constants/songs.h" -static void AnimRockFragment(struct Sprite *); static void AnimTask_Rollout_Step(u8 taskId); static void AnimRolloutParticle(struct Sprite *); static void AnimRockTomb(struct Sprite *); @@ -43,7 +42,7 @@ static const union AnimCmd sAnim_FlyingRock_2[] = ANIMCMD_END, }; -static const union AnimCmd *const sAnims_FlyingRock[] = +const union AnimCmd *const gAnims_FlyingRock[] = { sAnim_FlyingRock_0, sAnim_FlyingRock_1, @@ -55,7 +54,7 @@ const struct SpriteTemplate gFallingRockSpriteTemplate = .tileTag = ANIM_TAG_ROCKS, .paletteTag = ANIM_TAG_ROCKS, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = sAnims_FlyingRock, + .anims = gAnims_FlyingRock, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimFallingRock, @@ -66,7 +65,7 @@ const struct SpriteTemplate gRockFragmentSpriteTemplate = .tileTag = ANIM_TAG_ROCKS, .paletteTag = ANIM_TAG_ROCKS, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = sAnims_FlyingRock, + .anims = gAnims_FlyingRock, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimRockFragment, @@ -430,7 +429,7 @@ void AnimFallingRock_Step(struct Sprite *sprite) } // Animates the rock particles that are shown on the impact for Rock Blast / Rock Smash -static void AnimRockFragment(struct Sprite *sprite) +void AnimRockFragment(struct Sprite *sprite) { StartSpriteAnim(sprite, gBattleAnimArgs[5]); AnimateSprite(sprite);