From 900c15c20cab42986e7b1b3a5858ee768cef8a44 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 3 May 2019 17:27:49 +0200 Subject: [PATCH] Mega evo animation --- data/battle_anim_scripts.s | 65 +++++++++++------- .../battle_anims/sprites/mega_particles.png | Bin 0 -> 510 bytes graphics/battle_anims/sprites/mega_stone.png | Bin 0 -> 1051 bytes graphics/battle_anims/sprites/mega_symbol.png | Bin 0 -> 487 bytes include/battle_anim.h | 9 +++ include/constants/battle_anim.h | 3 + include/graphics.h | 6 ++ src/battle_anim.c | 6 ++ src/battle_anim_effects_3.c | 33 +++++++++ src/battle_interface.c | 10 +-- src/ghost.c | 3 +- src/graphics.c | 9 +++ 12 files changed, 113 insertions(+), 31 deletions(-) create mode 100644 graphics/battle_anims/sprites/mega_particles.png create mode 100644 graphics/battle_anims/sprites/mega_stone.png create mode 100644 graphics/battle_anims/sprites/mega_symbol.png diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 1ef54a202b..4744292486 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -13137,32 +13137,49 @@ General_WishHeal: end General_MegaEvolution: - loadspritegfx ANIM_TAG_ORBS - loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT - loadspritegfx ANIM_TAG_METEOR - loadspritegfx ANIM_TAG_FLAT_ROCK - monbg ANIM_ATK_PARTNER - setalpha 12, 8 - createvisualtask sub_8115A04, 2, 2, 1, 4, 0, 11, RGB(31, 31, 11) - playsewithpan SE_W025, -64 - call SolarBeamSetUp1 - waitforvisualfinish - createsprite gUnknown_08595FEC, ANIM_TARGET, 2, 0 - playsewithpan SE_W025, -64 - delay 15 - createsprite gBattleAnimSpriteTemplate_85972D8, ANIM_ATTACKER, 2, 4, 1, 180, 1 - createvisualtask sub_8159244, 5, 234, 0 - delay 20 - createvisualtask sub_815B7D0, 2, 0, 1 - delay 4 - createvisualtask sub_8117494, 50 - waitforvisualfinish - createvisualtask sub_8117494, 2 - playsewithpan SE_W043, -64 - blendoff - clearmonbg ANIM_ATTACKER + loadspritegfx ANIM_TAG_MEGA_STONE + loadspritegfx ANIM_TAG_MEGA_PARTICLES + loadspritegfx ANIM_TAG_MEGA_SYMBOL + monbg ANIM_ATTACKER + setalpha 12, 8 + loopsewithpan SE_W025, SOUND_PAN_ATTACKER, 13, 3 + createvisualtask sub_8115A04, 2, 2, 0, 6, 0, 11, RGB(31, 31, 11) + call MegaEvolutionParticles + call MegaEvolutionParticles + call MegaEvolutionParticles + waitforvisualfinish + playsewithpan SE_W076, SOUND_PAN_ATTACKER + createsprite gMegaStoneSpriteTemplate, ANIM_ATTACKER, 41, 0, 0, 0, 0 + delay 20 + createvisualtask sub_8116664, 5, 5, 2, 0, 16, RGB_WHITEALPHA + waitforvisualfinish + createvisualtask sub_815B7D0, 2, 0, 1 + createvisualtask sub_8116664, 5, 5, 2, 16, 0, RGB_WHITEALPHA + createvisualtask sub_81152DC, 5, 1, 5, 14 + waitforvisualfinish + createsprite gMegaSymbolSpriteTemplate ANIM_ATTACKER, 2 + waitforvisualfinish + clearmonbg ANIM_ATK_PARTNER + blendoff end +MegaEvolutionParticles: + createsprite gMegaParticlesSpriteTemplate, ANIM_ATTACKER, 2, 40, -10, 13 + delay 3 + createsprite gMegaParticlesSpriteTemplate, ANIM_ATTACKER, 2, -35, -10, 13 + delay 3 + createsprite gMegaParticlesSpriteTemplate, ANIM_ATTACKER, 2, 15, -40, 13 + delay 3 + createsprite gMegaParticlesSpriteTemplate, ANIM_ATTACKER, 2, -10, -32, 13 + delay 3 + createsprite gMegaParticlesSpriteTemplate, ANIM_ATTACKER, 2, 25, -20, 13 + delay 3 + createsprite gMegaParticlesSpriteTemplate, ANIM_ATTACKER, 2, -40, -20, 13 + delay 3 + createsprite gMegaParticlesSpriteTemplate, ANIM_ATTACKER, 2, 5, -40, 13 + delay 3 + return + General_TerrainMisty: end diff --git a/graphics/battle_anims/sprites/mega_particles.png b/graphics/battle_anims/sprites/mega_particles.png new file mode 100644 index 0000000000000000000000000000000000000000..6fdf09d96e0d606f5253e5ed18da3c272120e6ce GIT binary patch literal 510 zcmeAS@N?(olHy`uVBq!ia0vp^0zhoQ!VDx|6+TY^QY`6?zK#qG8~eHcB(ehe3dtTp zz6=aiY77hwEes65fIi1;V5)EKCOG0EHAg;|it=M#{_S>O>_%)r2R1cVu< zYV%101=&kHeO=k_v+;>Y%TBb>0$R^-!qdeuMB;MkSzAA6Ljjftm4S70^!7P!X%c?J zx+ueSZqwV#8y5LIH!JaLcR5@*^ZAE0>`j^9Cfg`8ALfgA)2R6Tu2V|CBd6-7XF6I< zXE=;s`@AUD;Xm-|NOoDo&iNZcoH&Dx!^FC;kotR)G0UiF^6U!J>Hw}q4M{;9{;^}p4Yc+{(W|*rs(G7+07lj71mug zd;WDF7kn9csjh*UuAxbYp@o%^xs{P6 VL_^=Zwnsn>44$rjF6*2UngE>NybAyT literal 0 HcmV?d00001 diff --git a/graphics/battle_anims/sprites/mega_stone.png b/graphics/battle_anims/sprites/mega_stone.png new file mode 100644 index 0000000000000000000000000000000000000000..e3350bbb54366daa5cb6f180682af2146f989ca8 GIT binary patch literal 1051 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0J3?w7mbKU|emUKs7M+SzC{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5l#mGU32{waZttU|b7j?< zFPHB8`S#`i|Nq;jOzX)j`SpsM52%JQ$=lt9^+*28<3J8)fk$L90|Va?5N4dJ%_j{M zWH0gbb!ETL#wQ|ea=CAl7Xt&+Yfl%)5Rc=fQ_q&oHV|liYi@8%Judypq^%R3uDdGT zH2=ZKWSKPAWNY01&&r$`GP*ozcJJ;?WXs$f+2?dDuee%-Rm1mj&1?-52DjegZ(5)->BMs(uv&Xo-ysltiE}?M*TARd+LiL7nRidf8@C#DXZBu@wBX6oiJ5XQKJqkJa!=UR@c2Oq+r4vh6d4T@O6Hn`u)JEaz_OutshAo^ zz$U8e+_9XSpUwy| z>+u?wH{jOxzj30Ltn$>Y@+>4EoR$F2llgEFT@!_8{_^8NyKfM*|#r|WnS2U z`S)L*i&46;reS}s+2!c74e^ZjMS@opzyAomVftZ)?IZD!hegtJroXH@>srG3qonjH zr^Ct2Q&PoK*&g#eI30XK$eBsam%F1j-blbns4h_<#yxA|^|L%JTc&ZeEI8cWf56N| zp_huE-s{T58x@ZnT&C!5p&pC z1x2h{R37|&<#JGE&hHO;e4lilsk|>*B3Bp4`PoQ^Ka}y-i-freYJ6|^s{9b@Z(+8m z6BcJ;{2n`pvv+n~aEUO_QmvAUQh^kMk%6Iw zu7Rblp;?HbrIo1(5NR72Ss57YJ?H!$MMG|WN@iLmNQ0@aftjwMNr<6^m65rXsS!j& To6c=Upaup{S3j3^P6NSwWJ?9znhg z3{`3j3=J&|48MRv4KElNN(~qoUL`OvSj}Ky5HFasE6@fgAs65i;tHe-G$Ot%YI*Z2 zXHL+RjvWv7T+7+<;KQA5SN{M1uVupa0H}g7$=lt9^W)8>Z-5-m0*}aI1_r((Aj~*b zn@<`j$X?><>&kwgjZcKz@TFSF6rj*XPZ!4!jq|A!H}W+(2)H~yaf@3bc zjeA?Vw|4G~65`o9cm7+`L-#h_-E-zl>i34!pd-nATuY);1FX&_CG@RIWS#JKt8?kI zsUf^)EE_CcY>U=SJfoQOW<}G)ssD<)ymo(lwK&$=EKX?G=1Q?T&WVqWD&)8;ZVR?D zWX#o77j%4nCxrizsMPIydsGrOrS8dlye2@JPxsOV=Ix4p7s6$G>|Px?$+dzdqxawc zFU;*%B`W*0^`8PAuUg_7QIe8al4_M)lnSI6j0_AdbPX(Z4b4IfEv-yVfJocG$jZQA z?>Xo9C>nC}Q!>*kK^jbT4a{^6O+pMUtPBmUOe`T9?$pjy25MmNboFyt=akR{0L(qC Ao&W#< literal 0 HcmV?d00001 diff --git a/include/battle_anim.h b/include/battle_anim.h index 3c216e8fff..75eb7b3a9f 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -224,7 +224,10 @@ void sub_8117854(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5, // battle_anim_effects_1.c void sub_810310C(u8 battler, struct Sprite* sprite); void AnimMoveTwisterParticle(struct Sprite* sprite); +void AnimPowerAbsorptionOrb(struct Sprite* sprite); extern const union AnimCmd *const gUnknown_08592388[]; +extern const union AnimCmd *const gUnknown_085921C8[]; +extern const union AffineAnimCmd *const gUnknown_085921DC[]; void sub_8100898(struct Sprite *); // water.c @@ -238,6 +241,12 @@ void sub_810E044(struct Sprite *sprite); //poison.c extern const union AffineAnimCmd *const gUnknown_085961A0[]; +// ghost.c +void sub_8112B78(struct Sprite *sprite); + +// psychic.c +extern const union AffineAnimCmd *const gUnknown_08596894[]; + // smokescreen.c u8 sub_807521C(s16 x, s16 y, u8 a3); diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 1678f6f7bd..add0fbbae6 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -300,6 +300,9 @@ #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) // battlers #define ANIM_ATTACKER 0 diff --git a/include/graphics.h b/include/graphics.h index c9100a3563..6bb016480b 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4949,5 +4949,11 @@ extern const u32 gBattleAnimSpritePal_PurpleJab[]; extern const u32 gBattleAnimSpritePal_ToxicSpikes[]; extern const u32 gBattleAnimSpriteGfx_EnergyBall[]; extern const u32 gBattleAnimSpritePal_EnergyBall[]; +extern const u32 gBattleAnimSpriteGfx_MegaStone[]; +extern const u32 gBattleAnimSpritePal_MegaStone[]; +extern const u32 gBattleAnimSpriteGfx_MegaParticles[]; +extern const u32 gBattleAnimSpritePal_MegaParticles[]; +extern const u32 gBattleAnimSpriteGfx_MegaSymbol[]; +extern const u32 gBattleAnimSpritePal_MegaSymbol[]; #endif //GUARD_GRAPHICS_H diff --git a/src/battle_anim.c b/src/battle_anim.c index 5a36120e2e..7442a04cfc 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -1418,6 +1418,9 @@ 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_MegaStone, 0x800, ANIM_TAG_MEGA_STONE}, + {gBattleAnimSpriteGfx_MegaSymbol, 0x0200, ANIM_TAG_MEGA_SYMBOL}, + {gBattleAnimSpriteGfx_MegaParticles, 0x0180, ANIM_TAG_MEGA_PARTICLES}, }; const struct CompressedSpritePalette gBattleAnimPaletteTable[] = @@ -1715,6 +1718,9 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] = {gBattleAnimSpritePal_PurpleJab, ANIM_TAG_PURPLE_JAB}, {gBattleAnimSpritePal_ToxicSpikes, ANIM_TAG_TOXIC_SPIKES}, {gBattleAnimSpritePal_EnergyBall, ANIM_TAG_ENERGY_BALL}, + {gBattleAnimSpritePal_MegaStone, ANIM_TAG_MEGA_STONE}, + {gBattleAnimSpritePal_MegaSymbol, ANIM_TAG_MEGA_SYMBOL}, + {gBattleAnimSpritePal_MegaParticles, ANIM_TAG_MEGA_PARTICLES}, }; const struct BattleAnimBackground gBattleAnimBackgroundTable[] = diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 040438fdf1..116aa6ae71 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -1190,6 +1190,39 @@ const union AffineAnimCmd gSlackOffSquishAffineAnimCmds[] = AFFINEANIMCMD_END, }; +const struct SpriteTemplate gMegaStoneSpriteTemplate = +{ + .tileTag = ANIM_TAG_MEGA_STONE, + .paletteTag = ANIM_TAG_MEGA_STONE, + .oam = &gUnknown_08524AFC, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_08596894, + .callback = sub_80A77C8, +}; + +const struct SpriteTemplate gMegaParticlesSpriteTemplate = +{ + .tileTag = ANIM_TAG_MEGA_PARTICLES, + .paletteTag = ANIM_TAG_MEGA_PARTICLES, + .oam = &gUnknown_08524A8C, + .anims = gUnknown_085921C8, + .images = NULL, + .affineAnims = gUnknown_085921DC, + .callback = AnimPowerAbsorptionOrb, +}; + +const struct SpriteTemplate gMegaSymbolSpriteTemplate = +{ + .tileTag = ANIM_TAG_MEGA_SYMBOL, + .paletteTag = ANIM_TAG_MEGA_SYMBOL, + .oam = &gUnknown_08524A34, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8112B78, +}; + void sub_815A0D4(struct Sprite *sprite) { sprite->pos1.x += gBattleAnimArgs[0]; diff --git a/src/battle_interface.c b/src/battle_interface.c index 6b59e2cc20..38d2702117 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -1339,16 +1339,16 @@ void DestroyMegaTriggerSprite(void) static const s8 sIndicatorPosSingles[][2] = { - [B_POSITION_PLAYER_LEFT] = {42, -7}, - [B_POSITION_OPPONENT_LEFT] = {10, 10}, + [B_POSITION_PLAYER_LEFT] = {53, -8}, + [B_POSITION_OPPONENT_LEFT] = {53, -8}, }; static const s8 sIndicatorPosDoubles[][2] = { [B_POSITION_PLAYER_LEFT] = {53, -8}, - [B_POSITION_OPPONENT_LEFT] = {10, 10}, - [B_POSITION_PLAYER_RIGHT] = {10, 10}, - [B_POSITION_OPPONENT_RIGHT] = {10, 10}, + [B_POSITION_OPPONENT_LEFT] = {53, -8}, + [B_POSITION_PLAYER_RIGHT] = {53, -8}, + [B_POSITION_OPPONENT_RIGHT] = {53, -8}, }; void CreateMegaIndicatorSprite(u32 battlerId, u32 which) diff --git a/src/ghost.c b/src/ghost.c index 26fb9affeb..16e9722db2 100644 --- a/src/ghost.c +++ b/src/ghost.c @@ -35,7 +35,6 @@ static void sub_81129F0(struct Sprite *); static void sub_8112A4C(struct Sprite *); static void sub_8112ACC(struct Sprite *); static void sub_8112B44(struct Sprite *); -static void sub_8112B78(struct Sprite *); static void sub_8112C4C(struct Sprite *); static void sub_8112D10(u8 taskId); static void sub_8112E9C(struct Sprite *); @@ -1153,7 +1152,7 @@ static void sub_8112B44(struct Sprite *sprite) DestroyAnimSprite(sprite); } -static void sub_8112B78(struct Sprite *sprite) +void sub_8112B78(struct Sprite *sprite) { u16 coeffB; u16 coeffA; diff --git a/src/graphics.c b/src/graphics.c index 550bdabdbd..4e26c48c3f 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -32,6 +32,15 @@ const u32 gBattleAnimSpritePal_ToxicSpikes[] = INCBIN_U32("graphics/battle_anims const u32 gBattleAnimSpriteGfx_EnergyBall[] = INCBIN_U32("graphics/battle_anims/sprites/energy_ball.4bpp.lz"); const u32 gBattleAnimSpritePal_EnergyBall[] = INCBIN_U32("graphics/battle_anims/sprites/energy_ball.gbapal.lz"); +const u32 gBattleAnimSpriteGfx_MegaStone[] = INCBIN_U32("graphics/battle_anims/sprites/mega_stone.4bpp.lz"); +const u32 gBattleAnimSpritePal_MegaStone[] = INCBIN_U32("graphics/battle_anims/sprites/mega_stone.gbapal.lz"); + +const u32 gBattleAnimSpriteGfx_MegaParticles[] = INCBIN_U32("graphics/battle_anims/sprites/mega_particles.4bpp.lz"); +const u32 gBattleAnimSpritePal_MegaParticles[] = INCBIN_U32("graphics/battle_anims/sprites/mega_particles.gbapal.lz"); + +const u32 gBattleAnimSpriteGfx_MegaSymbol[] = INCBIN_U32("graphics/battle_anims/sprites/mega_symbol.4bpp.lz"); +const u32 gBattleAnimSpritePal_MegaSymbol[] = INCBIN_U32("graphics/battle_anims/sprites/mega_symbol.gbapal.lz"); + // Battle anims const u32 gBattleAnimSpriteGfx_Bubble[] = INCBIN_U32("graphics/battle_anims/sprites/bubble.4bpp.lz"); const u32 gBattleAnimSpriteGfx_Bone[] = INCBIN_U32("graphics/battle_anims/sprites/bone.4bpp.lz");