diff --git a/asm/macros/battle_anim_script.inc b/asm/macros/battle_anim_script.inc index 742cdb2f26..ecfea5c197 100644 --- a/asm/macros/battle_anim_script.inc +++ b/asm/macros/battle_anim_script.inc @@ -315,6 +315,19 @@ .Lsprite_\@_2: .endm +.macro createdragondartsprite anim_battler:req, subpriority_offset:req, argv:vararg + .byte 0x33 + .if \anim_battler == ANIM_TARGET + .byte ANIMSPRITE_IS_TARGET | (\subpriority_offset & 0x7F) + .else + .byte (\subpriority_offset & 0x7F) + .endif + .byte (.Lsprite_\@_2 - .Lsprite_\@_1) / 2 +.Lsprite_\@_1: + .2byte \argv +.Lsprite_\@_2: + .endm + @ useful macros .macro jumpreteq value:req, ptr:req jumpargeq ARG_RET_ID, \value, \ptr diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 13982a59f9..2bef0a0858 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -13865,10 +13865,12 @@ Move_MAGIC_POWDER:: end Move_DRAGON_DARTS:: + loadspritegfx ANIM_TAG_DREEPY_SHINY loadspritegfx ANIM_TAG_DREEPY + loadspritegfx ANIM_TAG_AIR_WAVE loadspritegfx ANIM_TAG_EXPLOSION playsewithpan SE_FALL, SOUND_PAN_ATTACKER - createsprite gDreepyMissileTemplate, ANIM_TARGET, 2, 0x0, 0x0, 0x19 + createdragondartsprite ANIM_TARGET, 2, 0x0, 0x0, 0x19 delay 0x19 playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 16, 1 diff --git a/graphics/battle_anims/sprites/dreepy_missile.pal b/graphics/battle_anims/sprites/dreepy_missile.pal new file mode 100644 index 0000000000..906cfa8a24 --- /dev/null +++ b/graphics/battle_anims/sprites/dreepy_missile.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +153 217 234 +254 87 103 +77 119 117 +62 67 67 +170 237 211 +138 189 179 +121 163 146 +77 119 117 +251 234 137 +195 97 109 +78 52 54 +222 214 198 +173 146 118 +151 135 135 +122 105 94 +0 4 1 diff --git a/graphics/battle_anims/sprites/dreepy_missile.png b/graphics/battle_anims/sprites/dreepy_missile.png index 73fe2d2f21..49333681cf 100644 Binary files a/graphics/battle_anims/sprites/dreepy_missile.png and b/graphics/battle_anims/sprites/dreepy_missile.png differ diff --git a/graphics/battle_anims/sprites/dreepy_missile_shiny.pal b/graphics/battle_anims/sprites/dreepy_missile_shiny.pal new file mode 100644 index 0000000000..718b2d2400 --- /dev/null +++ b/graphics/battle_anims/sprites/dreepy_missile_shiny.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +153 217 234 +222 223 109 +77 119 117 +62 67 67 +170 237 211 +138 189 179 +77 171 225 +53 110 226 +251 234 137 +195 97 109 +78 52 54 +222 214 198 +173 146 118 +151 135 135 +122 105 94 +0 4 1 diff --git a/include/battle_anim.h b/include/battle_anim.h index fafde10c5b..c17de9180c 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -537,6 +537,9 @@ extern const union AnimCmd *const gAnims_WillOWispOrb[]; extern const union AnimCmd *const gAnims_FirePlume[]; // battle_anim_dragon.c +extern const union AnimCmd *const gAnims_DreepyMissilePlayer[]; +extern const union AnimCmd *const gAnims_DreepyMissileOpponent[]; +extern const union AnimCmd *const gAnims_DreepyMissileOpponentNotDrag[]; extern const union AnimCmd *const gAnims_DragonBreathFire[]; extern const union AnimCmd *const gAnims_DragonRageFirePlume[]; extern const union AffineAnimCmd *const gAffineAnims_DragonRageFire[]; diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index bde2458508..613f39098f 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -407,6 +407,7 @@ #define ANIM_TAG_SYRUP_SPLAT_YELLOW (ANIM_SPRITES_START + 393) #define ANIM_TAG_TERA_CRYSTAL (ANIM_SPRITES_START + 394) #define ANIM_TAG_TERA_SHATTER (ANIM_SPRITES_START + 395) +#define ANIM_TAG_DREEPY_SHINY (ANIM_SPRITES_START + 396) // battlers #define ANIM_ATTACKER 0 diff --git a/include/graphics.h b/include/graphics.h index a563cb064a..488f9f5616 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -2752,6 +2752,8 @@ extern const u32 gBattleAnimSpriteGfx_DragonPulseRing[]; extern const u32 gBattleAnimSpritePal_DragonPulseRing[]; extern const u32 gBattleAnimSpriteGfx_DreepyMissile[]; extern const u32 gBattleAnimSpritePal_DreepyMissile[]; +extern const u32 gBattleAnimSpriteGfx_DreepyMissileShiny[]; +extern const u32 gBattleAnimSpritePal_DreepyMissileShiny[]; extern const u32 gBattleAnimSpriteGfx_Drill[]; extern const u32 gBattleAnimSpritePal_Drill[]; extern const u32 gBattleAnimSpriteGfx_NewEmbers[]; diff --git a/src/battle_anim.c b/src/battle_anim.c index deb56db036..d944aac562 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -85,6 +85,7 @@ static void Cmd_stopsound(void); static void Cmd_createvisualtaskontargets(void); static void Cmd_createspriteontargets(void); static void Cmd_createspriteontargets_onpos(void); +static void Cmd_createdragondartsprite(void); static void RunAnimScriptCommand(void); static void Task_UpdateMonBg(u8 taskId); static void FlipBattlerBgTiles(void); @@ -176,6 +177,7 @@ static void (* const sScriptCmdTable[])(void) = Cmd_createvisualtaskontargets, // 0x30 Cmd_createspriteontargets, // 0x31 Cmd_createspriteontargets_onpos, // 0x32 + Cmd_createdragondartsprite, // 0x33 }; void ClearBattleAnimationVars(void) @@ -2133,3 +2135,62 @@ static void Cmd_stopsound(void) m4aMPlayStop(&gMPlayInfo_SE2); sBattleAnimScriptPtr++; } + +static void Cmd_createdragondartsprite(void) +{ + s32 i; + struct SpriteTemplate template; + u8 argVar; + u8 argsCount; + s16 subpriority; + struct Pokemon *party = GetBattlerParty(gBattleAnimAttacker); + + sBattleAnimScriptPtr++; + + argVar = sBattleAnimScriptPtr[0]; + sBattleAnimScriptPtr++; + argsCount = sBattleAnimScriptPtr[0]; + sBattleAnimScriptPtr++; + + for (i = 0; i < argsCount; i++) + { + gBattleAnimArgs[i] = T1_READ_16(sBattleAnimScriptPtr); + sBattleAnimScriptPtr += 2; + } + + subpriority = GetSubpriorityForMoveAnim(argVar); + + if (GetMonData(&party[gBattlerPartyIndexes[gBattleAnimAttacker]], MON_DATA_SPECIES) == SPECIES_DRAGAPULT) + { + template.tileTag = ANIM_TAG_DREEPY; + if (IsMonShiny(&party[gBattlerPartyIndexes[gBattleAnimAttacker]]) == TRUE) + template.paletteTag = ANIM_TAG_DREEPY_SHINY; + else + template.paletteTag = ANIM_TAG_DREEPY; + template.oam = &gOamData_AffineOff_ObjNormal_32x32; + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) + template.anims = gAnims_DreepyMissileOpponent; + else + template.anims = gAnims_DreepyMissilePlayer; + } + else + { + template.tileTag = ANIM_TAG_AIR_WAVE; + template.paletteTag = ANIM_TAG_DREEPY; + template.oam = &gOamData_AffineOff_ObjNormal_32x16; + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) + template.anims = gAnims_DreepyMissileOpponentNotDrag; + else + template.anims = gAnims_DreepyMissilePlayer; + } + + template.images = NULL; + template.affineAnims = gDummySpriteAffineAnimTable; + template.callback = AnimShadowBall; + + if (CreateSpriteAndAnimate(&template, + GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2), + GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET), + subpriority) != MAX_SPRITES) // Don't increment the task count if the sprite couldn't be created(i.e. there are too many created sprites atm). + gAnimVisualTaskCount++; +} diff --git a/src/battle_anim_dragon.c b/src/battle_anim_dragon.c index 1398d899b3..4191c42585 100644 --- a/src/battle_anim_dragon.c +++ b/src/battle_anim_dragon.c @@ -42,6 +42,39 @@ const struct SpriteTemplate gOutrageFlameSpriteTemplate = .callback = AnimOutrageFlame, }; +static const union AnimCmd sAnim_DreepyMissileOpponent_0[] = +{ + ANIMCMD_FRAME(0, 0, .hFlip = TRUE), + ANIMCMD_END, +}; + +const union AnimCmd *const gAnims_DreepyMissileOpponent[] = +{ + sAnim_DreepyMissileOpponent_0, +}; + +static const union AnimCmd sAnim_DreepyMissilePlayer_0[] = +{ + ANIMCMD_FRAME(0, 0), + ANIMCMD_END, +}; + +const union AnimCmd *const gAnims_DreepyMissilePlayer[] = +{ + sAnim_DreepyMissilePlayer_0, +}; + +static const union AnimCmd sAnim_DreepyMissileNotDrag_0[] = +{ + ANIMCMD_FRAME(0, 0, .hFlip = TRUE, .vFlip = TRUE), + ANIMCMD_END, +}; + +const union AnimCmd *const gAnims_DreepyMissileOpponentNotDrag[] = +{ + sAnim_DreepyMissileNotDrag_0, +}; + static const union AnimCmd sAnim_DragonBreathFire_0[] = { ANIMCMD_FRAME(16, 3), diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index fed928e747..98af6c22ba 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -3712,12 +3712,42 @@ const struct SpriteTemplate gMagicPowderBluePowderTemplate = }; //dreepy missile -const struct SpriteTemplate gDreepyMissileTemplate = +const struct SpriteTemplate gDreepyMissilePlayerTemplate = { .tileTag = ANIM_TAG_DREEPY, .paletteTag = ANIM_TAG_DREEPY, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = gDummySpriteAnimTable, + .anims = gAnims_DreepyMissilePlayer, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimShadowBall +}; +const struct SpriteTemplate gDreepyMissileOpponentTemplate = +{ + .tileTag = ANIM_TAG_DREEPY, + .paletteTag = ANIM_TAG_DREEPY, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_DreepyMissileOpponent, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimShadowBall +}; +const struct SpriteTemplate gDreepyMissilePlayerShinyTemplate = +{ + .tileTag = ANIM_TAG_DREEPY, + .paletteTag = ANIM_TAG_DREEPY_SHINY, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_DreepyMissilePlayer, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimShadowBall +}; +const struct SpriteTemplate gDreepyMissileOpponentShinyTemplate = +{ + .tileTag = ANIM_TAG_DREEPY, + .paletteTag = ANIM_TAG_DREEPY_SHINY, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_DreepyMissileOpponent, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimShadowBall diff --git a/src/data/battle_anim.h b/src/data/battle_anim.h index 6b29a7c9ef..485519cdc5 100644 --- a/src/data/battle_anim.h +++ b/src/data/battle_anim.h @@ -1456,6 +1456,7 @@ const struct CompressedSpriteSheet gBattleAnimPicTable[] = {gBattleAnimSpriteGfx_SyrupSplat, 0x400, ANIM_TAG_SYRUP_SPLAT_YELLOW}, {gBattleAnimSpriteGfx_TeraCrystal, 0x800, ANIM_TAG_TERA_CRYSTAL}, {gBattleAnimSpriteGfx_TeraShatter, 0x0180, ANIM_TAG_TERA_SHATTER}, + {gBattleAnimSpriteGfx_DreepyMissile, 0x200, ANIM_TAG_DREEPY_SHINY}, }; const struct CompressedSpritePalette gBattleAnimPaletteTable[] = @@ -1913,6 +1914,7 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] = {gBattleAnimSpritePal_SyrupYellow, ANIM_TAG_SYRUP_SPLAT_YELLOW}, {gBattleAnimSpritePal_TeraCrystal, ANIM_TAG_TERA_CRYSTAL}, {gBattleAnimSpritePal_TeraShatter, ANIM_TAG_TERA_SHATTER}, + {gBattleAnimSpritePal_DreepyMissileShiny, ANIM_TAG_DREEPY_SHINY}, }; const struct BattleAnimBackground gBattleAnimBackgroundTable[] = diff --git a/src/graphics.c b/src/graphics.c index 0d25ef7805..72e9925599 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -126,6 +126,8 @@ const u32 gBattleAnimSpritePal_DragonPulseRing[] = INCBIN_U32("graphics/battle_a const u32 gBattleAnimSpriteGfx_DreepyMissile[] = INCBIN_U32("graphics/battle_anims/sprites/dreepy_missile.4bpp.lz"); const u32 gBattleAnimSpritePal_DreepyMissile[] = INCBIN_U32("graphics/battle_anims/sprites/dreepy_missile.gbapal.lz"); +const u32 gBattleAnimSpriteGfx_DreepyMissileShiny[] = INCBIN_U32("graphics/battle_anims/sprites/dreepy_missile.4bpp.lz"); +const u32 gBattleAnimSpritePal_DreepyMissileShiny[] = INCBIN_U32("graphics/battle_anims/sprites/dreepy_missile_shiny.gbapal.lz"); const u32 gBattleAnimSpriteGfx_Drill[] = INCBIN_U32("graphics/battle_anims/sprites/drill.4bpp.lz"); const u32 gBattleAnimSpritePal_Drill[] = INCBIN_U32("graphics/battle_anims/sprites/drill.gbapal.lz");