From 81e59ace253866e56d7f362f74401494068c4ee0 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Fri, 30 Jun 2023 03:58:07 -0400 Subject: [PATCH] Cleaned up remaining Castform hack stuff (#3063) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Removed gCastformFrontSpriteCoords * Removed sCastformElevations and IsCastformForm * Removed sCastformBackSpriteYCoords and castformPalette in BattleStruct * Scrubbed unused BS commands * Removed B_ANIM_CASTFORM_CHANGE and BattleForm constants * Removed redundant function in Pokémon Debug menu * Removed handling in animation scripts * Removed gBattleMonForms * Reduced MAX_MON_PIC_FRAMES to 2 * Removed Castform/Cherrim makefile stuff * Fixed weather form change tests not checking species. * Fixed Castform palettes after Lunos' PR --- asm/macros/battle_script.inc | 4 +- data/battle_anim_scripts.s | 29 ++--- graphics/pokemon/castform/back.png | Bin 0 -> 374 bytes graphics/pokemon/castform/front.png | Bin 0 -> 386 bytes .../pokemon/castform/{normal => }/normal.pal | 2 +- .../pokemon/castform/normal/anim_front.png | Bin 413 -> 0 bytes graphics/pokemon/castform/normal/back.png | Bin 401 -> 0 bytes graphics/pokemon/castform/normal/front.png | Bin 413 -> 0 bytes .../pokemon/castform/rainy/anim_front.png | Bin 533 -> 0 bytes graphics/pokemon/castform/rainy/back.png | Bin 488 -> 468 bytes graphics/pokemon/castform/rainy/front.png | Bin 533 -> 506 bytes graphics/pokemon/castform/rainy/normal.pal | 2 +- graphics/pokemon/castform/rainy/shiny.pal | 2 +- .../pokemon/castform/{normal => }/shiny.pal | 2 +- .../pokemon/castform/snowy/anim_front.png | Bin 690 -> 0 bytes graphics/pokemon/castform/snowy/back.png | Bin 622 -> 596 bytes graphics/pokemon/castform/snowy/front.png | Bin 690 -> 665 bytes graphics/pokemon/castform/snowy/normal.pal | 2 +- graphics/pokemon/castform/snowy/shiny.pal | 2 +- .../pokemon/castform/sunny/anim_front.png | Bin 632 -> 0 bytes graphics/pokemon/castform/sunny/back.png | Bin 575 -> 553 bytes graphics/pokemon/castform/sunny/front.png | Bin 632 -> 607 bytes graphics/pokemon/castform/sunny/normal.pal | 2 +- graphics/pokemon/castform/sunny/shiny.pal | 2 +- graphics_file_rules.mk | 56 ---------- include/battle.h | 2 - include/battle_gfx_sfx_util.h | 2 +- include/constants/battle.h | 10 -- include/constants/battle_anim.h | 75 +++++++------ include/constants/pokemon.h | 3 +- include/pokemon.h | 1 - src/battle_anim_effects_3.c | 11 +- src/battle_anim_mons.c | 56 +--------- src/battle_controller_link_opponent.c | 4 +- src/battle_controller_link_partner.c | 4 +- src/battle_controller_opponent.c | 4 +- src/battle_controller_player.c | 2 +- src/battle_controller_player_partner.c | 4 +- src/battle_controller_recorded_opponent.c | 4 +- src/battle_controller_recorded_player.c | 4 +- src/battle_controller_wally.c | 2 +- src/battle_controllers.c | 1 - src/battle_gfx_sfx_util.c | 74 +++---------- src/battle_intro.c | 2 +- src/battle_main.c | 10 +- src/battle_script_commands.c | 26 ++--- src/contest.c | 5 - src/data.c | 14 --- src/data/graphics/pokemon.h | 16 +-- src/pokemon.c | 10 +- src/pokemon_animation.c | 3 + src/pokemon_debug.c | 50 +-------- src/reshow_battle_screen.c | 8 +- test/ability_flower_gift.c | 6 ++ test/ability_forecast.c | 102 +++++++++++++++++- 55 files changed, 225 insertions(+), 395 deletions(-) create mode 100644 graphics/pokemon/castform/back.png create mode 100644 graphics/pokemon/castform/front.png rename graphics/pokemon/castform/{normal => }/normal.pal (93%) delete mode 100644 graphics/pokemon/castform/normal/anim_front.png delete mode 100644 graphics/pokemon/castform/normal/back.png delete mode 100644 graphics/pokemon/castform/normal/front.png delete mode 100644 graphics/pokemon/castform/rainy/anim_front.png rename graphics/pokemon/castform/{normal => }/shiny.pal (93%) delete mode 100644 graphics/pokemon/castform/snowy/anim_front.png delete mode 100644 graphics/pokemon/castform/sunny/anim_front.png diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 014a8bb7f..47dc8092a 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1186,11 +1186,11 @@ .byte 0xe5 .endm - .macro doweatherformchangeanimation + .macro unused3 .byte 0xe6 .endm - .macro tryweatherformdatachange + .macro unused4 .byte 0xe7 .endm diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index c32c6d203..7c995ef72 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -910,7 +910,6 @@ gBattleAnims_StatusConditions:: .align 2 gBattleAnims_General:: - .4byte General_WeatherFormChange @ B_ANIM_CASTFORM_CHANGE .4byte General_StatsChange @ B_ANIM_STATS_CHANGE .4byte General_SubstituteFade @ B_ANIM_SUBSTITUTE_FADE .4byte General_SubstituteAppear @ B_ANIM_SUBSTITUTE_APPEAR @@ -24282,7 +24281,7 @@ Move_TRANSFORM: monbg ANIM_ATTACKER playsewithpan SE_M_TELEPORT, SOUND_PAN_ATTACKER waitplaysewithpan SE_M_MINIMIZE, SOUND_PAN_ATTACKER, 48 - createvisualtask AnimTask_TransformMon, 2, 0, 0, 1 + createvisualtask AnimTask_TransformMon, 2, 0, 1 waitforvisualfinish clearmonbg ANIM_ATTACKER end @@ -26364,22 +26363,6 @@ Status_Nightmare: Status_Powder: end -General_WeatherFormChange: - createvisualtask AnimTask_IsMonInvisible, 2 - jumpreteq TRUE, WeatherFormChangeSkipAnim - goto WeatherFormChangeContinue -WeatherFormChangeContinue: - monbg ANIM_ATTACKER - playsewithpan SE_M_TELEPORT, SOUND_PAN_ATTACKER - waitplaysewithpan SE_M_MINIMIZE, SOUND_PAN_ATTACKER, 48 - createvisualtask AnimTask_TransformMon, 2, 1, 0, 0 - waitforvisualfinish - clearmonbg ANIM_ATTACKER - end -WeatherFormChangeSkipAnim: - createvisualtask AnimTask_CastformGfxDataChange, 2, 1 - end - General_StatsChange: createvisualtask AnimTask_StatsChange, 5 waitforvisualfinish @@ -26798,14 +26781,14 @@ General_WishHeal: General_IllusionOff: monbg ANIM_TARGET - createvisualtask AnimTask_TransformMon, 2, 0, 1, 0 + createvisualtask AnimTask_TransformMon, 2, 1, 0 waitforvisualfinish clearmonbg ANIM_TARGET end General_FormChange: monbg ANIM_ATTACKER - createvisualtask AnimTask_TransformMon, 2, 0, 1, 0 + createvisualtask AnimTask_TransformMon, 2, 1, 0 waitforvisualfinish clearmonbg ANIM_ATTACKER end @@ -26834,7 +26817,7 @@ General_MegaEvolution: delay 20 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA waitforvisualfinish - createvisualtask AnimTask_TransformMon, 2, 0, 1, 0 + createvisualtask AnimTask_TransformMon, 2, 1, 0 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA createvisualtask AnimTask_HorizontalShake, 5, 1, 5, 14 waitforvisualfinish @@ -26980,7 +26963,7 @@ General_PrimalReversion_Alpha: delay 20 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA waitforvisualfinish - createvisualtask AnimTask_TransformMon, 2, 0, 1, 0 + createvisualtask AnimTask_TransformMon, 2, 1, 0 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA createvisualtask AnimTask_HorizontalShake, 5, 1, 5, 14 waitforvisualfinish @@ -27007,7 +26990,7 @@ General_PrimalReversion_Omega: delay 20 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA waitforvisualfinish - createvisualtask AnimTask_TransformMon, 2, 0, 1, 0 + createvisualtask AnimTask_TransformMon, 2, 1, 0 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA createvisualtask AnimTask_HorizontalShake, 5, 1, 5, 14 waitforvisualfinish diff --git a/graphics/pokemon/castform/back.png b/graphics/pokemon/castform/back.png new file mode 100644 index 0000000000000000000000000000000000000000..4a0a4f59d77b349699f26075df371f761c6b6629 GIT binary patch literal 374 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!3<7*YTxVQZaP;VusGy*;d-p!O zckkP`cR-o{|NjG-Kn4U%nKH#I$O|YaAt4dlnYa%qDo_&S7YtH|3=RZzI|JpOdb&7< zM6|xWdXcYLfrmBVvePl=>Hq%U?+bh0bZJRzs{Z4B89whg7aZEQb`1#p@$Sf2H@|qE zF^5CX%0PxCCYBSmd<054IXpTJmQ6Y#!N!uA?z>3v;Tr9Q%#!crnU4P|S5SD4?@4QI9v%m^KYi; z%F3>dUqlkPq}XOi7~fqf7503-rj$cUVUc*i)2D}?YHdt0*eLJ#(sgF1_ou+6jM+>E zpJQ&%i&O|>-Si{lKoyLsQy`KAiT-hEWQx}E38 z++Q(`zW;7tn4Mjqz31fdgTAgcQOS}seuZyv3zA6ES=Qzdoj#*j^Mj?t>$VEF>zc>* sPcAnTobvw8p<5l_#q5DzSoxgwn>rUS|IL@LfqrN3boFyt=akR{09wtd3IG5A diff --git a/graphics/pokemon/castform/normal/back.png b/graphics/pokemon/castform/normal/back.png deleted file mode 100644 index 99a2bfef7a69cb5a0ad725960cac16db0c0a33e5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 401 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!j01c^T!Hk_qf?@Sg3j*U`|RGm zZ{OYlMgIT)4`c!va4==c6t5sJptyvDghS`sqd*D9k|4ie28U-i(tsS!0*}aI1_nK4 z5N51cYF`EvWH0gbb!C6f#?Gk2#xm)JK2Ye1r;B4q#NoGBFLE7L;9QoSkE1!`)y z71hrhC_X9E;j~en^VMmJDz41<&1(x_qdO11qAQ+`*AISmF2nNg!SJ)W#3?%_*y}; dzJg~D!}Qs_+xzyMkO%sg!PC{xWt~$(696}@o?8F_ diff --git a/graphics/pokemon/castform/normal/front.png b/graphics/pokemon/castform/normal/front.png deleted file mode 100644 index d6a73c2c409882f61cb893c32013dc58b9d5a918..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 413 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!j01c^T!Hk_qf?@Sg3j*U`|RGm zZ{OYlMgIT)4`c!va4==c6t5sJptyvDghS`sqd*D9k|4ie28U-i(tsS!0*}aI1_nK4 z5N51cYF`EvWH0gbb!C6f#?Gk2UOe^2PN2{SPZ!6Kh{JEE?iOM)C;0`wKk?0Y?OC=={mF1`%~aj#%v~o z&oQ^>MJj}`Zu*gNAokb_?t(L+u5G^~YC;n@d#A4H{yu}P-MsJUd{c#E?>;JD-Olr4 z?ys0e-+#9+%+4;*-gEN!L0{LJsAS0*zrr`T1xY07ENgR!PM=Y%`N2}+bz6nobOV diff --git a/graphics/pokemon/castform/rainy/anim_front.png b/graphics/pokemon/castform/rainy/anim_front.png deleted file mode 100644 index 0c2e4e174940c8b4b4602ada3bbf046ed65fd0ac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 533 zcmV+w0_y#VP)_UREm%3t^>e;g0?Pr@Iz|A;{GWBdTu_Jaj9{E(nrf6KcCSNjG9=jck5_ZpJY z@gs>TxdqD4^T#sJZo{N}HOM0Q1gY{(e1_={uLhT3S&UoGg-4KtUn;)TWpo&%0RB&a zegUhYu*_zNUV(u{ql*~5g4Otf7s0yv1yLb2tj2oBsrpMeQgkXwl!pme800Q&L8P#k;;s7Daw($MmRpMbpr zHK3jW)YnI;lxia-s6*xYzc&W3j3WncFtqVafhYKzH;#M( XgLx&~|NWN_00000NkvXXu0mjfs7CEQ diff --git a/graphics/pokemon/castform/rainy/back.png b/graphics/pokemon/castform/rainy/back.png index 2763b51d9562624150fe0fa7228662fd44ecf665..bd7ac7d7ce21002dff974c8c7433de2d0dd1bc32 100644 GIT binary patch delta 415 zcmV;Q0bu^<1JnbMBo{DHOjJbx0070slsQ3KVspK7i`A60&5=GHf5)}nM*si-5Oh*b zQvm<}|NsC0|NsC0|NsC0|G-d-LjV8)LrFwIR9J=W*4=W0AP@!M%t9k9KY9PRtt=oI zMHiUqMaOg3rstcJq>8WClP6D}{PRdD5pkmLy;n-%FoM*l3=*J9#)w)_BLe7JfT0P6 z@P0s8C+GqU2w{QNe-i>|$|iJw4tt>glT7_-p#Cnq1UR%i1w54dgwjV!{^`T+$E$Iz zO3G$1Cm`JpsQp7BgFhh-DD_ORC(wX2eyb;eGl2%A{yxZ?fUQ0W_Y>L!m=nSup%kZp z0LBCY#Hk?O41m6@u;3^N0`A^J93YN@5Mp^VCL|!GY7^jkeSv+JWg1xi2xtp%e>qG8 zbgZ@j)_)>gOkiEm)4+wmyraZtixYu;S8NFUyDH=(VOPhFlOaDKVKzF?1?TeFtaUt@ z@<9t9#scSzF-52Y>nnEz)s3-mLV&e45SRT}5BVkl=-2jJ_yuC@9?prIP7VM7002ov JPDHLkV1fY!zQ+In delta 436 zcmV;l0ZabW1Ly;gBpNeNOjJbx0070slsQ3KVspK7i`A60%>V!ZkvkrLb%EMr00001 zbW%=J06^y0W&i*H32;bRa{vG?BLDy{BLR4&KXw2B00(qQO+^Ri1_uEw3JoNr1ONa5 zJ4r-AR9M69meG=fAPhx2flh^h@c&<12_Rb02AJK4j`yv$=gch%@$tBG=gyrUkCYM- z2YBb4QVP2zNIa!e0ji{bPq8(q9s}sD0lF#_g>%qVK^H-XAvDl>zyO-E8k*N(FKA!M z#19Kp@6Ch*-Dp5n4Ycz}$)7x%kGpX}C1rI0dpEm)FX)p(4t|ALpx{}-u0RD+`4vwF z&n=MneUMiH&v-KUfdb45;YTP%RUm*-fdryz5HE&+ZdPb;Gzb!ZeEScvfH)e25YvlM zAqi48GzsQb!9LS8ESUaDaBcwg_W~NLX9Cuf2p1Jt8+ur9VPKvp@!bOJJnKk0G4M}S z$RlBgW5Z;CGF39&G#BPM&t|RTWXgjUyyxJ?m}1xlmT$f(2sg$;MFG~@pt$5C9`dOG epv(5t@CN&hAz;uCnHLiP0000 diff --git a/graphics/pokemon/castform/rainy/front.png b/graphics/pokemon/castform/rainy/front.png index 0ee52a35ae888654fa8ea46504fc663e457dff31..acfcca96bf72d700021ff894571d8ff7f1f2c4a5 100644 GIT binary patch delta 454 zcmV;%0XhDa1o{JzBo{DHOjJc$09VDulsQ3KVspK7i`A60&5=GHf0pA*$^ZZW5Oh*b zQvm<}|NsC0|NsC0|NsC0|G-d-LjV8)X-PyuR9J=WluNdRFbD-b#`Y6I_P^T>m-uPl z8$g_TM;TZJNr+wd=8ZoYc|gxdn_;KtrGJFC@(13^Z`*_VS^3TCw+Mi5?Hf4CH#TtL zn*`tZ1N@&r`~rrdu*_yiQGtO)gGEYF!DM{Fi(s1Kf&>VL$@r*% z0Zo=F@baet*_P0ffa}#M3wg$3a>pd-NRl1zGU0RC584Gn4}8Us{|V; zx8o29oqRDA2k!#%2s%A9x$-2Zz%vX#0vM$3L0k>MAaw5lgXA4&ZI#X=QDvvAA_)tB%}W+-4wyXH-$XG-@FOr3s(#x+BnmMV!ZkvkrL5>nWI00001 zbW%=J06^y0W&i*H32;bRa{vG?BLDy{BLR4&KXw2B00(qQO+^Ri1_uEw3wk4zk^le! zXh}ptR9M69mCKTZAPhw*vC9V}-v9sFCJEY~;y9HPK1_kHnN|g5+lG5=b zi7B}S%Fpx1GS6_ ztD&&WW{6&afkmT>7`=kk_<|R~y7~oCAvLVVdj+h}YN-Nv=0FX9y1n6^0!&b7t0E2v z%n--m_(rw97M$E=EXn&>~jjmiE>7N0a+1f zh$`P_D7@6bbPx9m^hvg3G%0kSfeBTRTZtZ^bf-fA`tik39DE9>M-b%F(DHHL*GH+8?iJ`fAoY&3luExVxia-s6*xYzc&W3j3WncFtqVafhYKzH;#M( XgLx&~|NWN_00000NkvXXu0mjfKyKM$ diff --git a/graphics/pokemon/castform/rainy/normal.pal b/graphics/pokemon/castform/rainy/normal.pal index 914cdac62..f844fdf1f 100644 --- a/graphics/pokemon/castform/rainy/normal.pal +++ b/graphics/pokemon/castform/rainy/normal.pal @@ -1,12 +1,12 @@ JASC-PAL 0100 16 +248 160 176 197 197 148 57 65 90 98 115 189 115 139 213 148 180 205 -0 0 0 205 238 246 180 197 222 139 205 222 diff --git a/graphics/pokemon/castform/rainy/shiny.pal b/graphics/pokemon/castform/rainy/shiny.pal index 914cdac62..f844fdf1f 100644 --- a/graphics/pokemon/castform/rainy/shiny.pal +++ b/graphics/pokemon/castform/rainy/shiny.pal @@ -1,12 +1,12 @@ JASC-PAL 0100 16 +248 160 176 197 197 148 57 65 90 98 115 189 115 139 213 148 180 205 -0 0 0 205 238 246 180 197 222 139 205 222 diff --git a/graphics/pokemon/castform/normal/shiny.pal b/graphics/pokemon/castform/shiny.pal similarity index 93% rename from graphics/pokemon/castform/normal/shiny.pal rename to graphics/pokemon/castform/shiny.pal index 2fa401dd6..4fc9b290d 100644 --- a/graphics/pokemon/castform/normal/shiny.pal +++ b/graphics/pokemon/castform/shiny.pal @@ -1,6 +1,7 @@ JASC-PAL 0100 16 +248 160 176 197 197 148 98 90 90 205 164 189 @@ -12,7 +13,6 @@ JASC-PAL 0 0 0 0 0 0 0 0 0 -0 0 0 148 148 148 74 82 74 255 255 255 diff --git a/graphics/pokemon/castform/snowy/anim_front.png b/graphics/pokemon/castform/snowy/anim_front.png deleted file mode 100644 index 0bcfddc337de1c9ee07a41942f33cc3d517b186b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 690 zcmV;j0!{siP)(Qbn<3`LQd1aW}*|G#$jbqJxIh-qIYt@oh{F84s<#AX;ix)7iA zf_Z6_(jCTbhKtF>ob)PcuV!`Du#RJd@^IK6{(1^r`su9b^l6{GP21+ZD+<{GW^etb zC4eAK2cW)wA?Y7ogxy;RM60Q6Bl7r?s0Uzwlo1-c`JK!m!m(};-X8>AUFiaz7Oxfe z08aRwp;4R85F?x^M@#}+p+U5XfL&tSkq-BIFyb4U>Mp24GNOJyClSgXyW!7YXJv## zOMtEa=vPAO@1iD;d79ie?SmXlq62dAO)eXbISMdBp0?ir5=|rL?b`_I-8LtT3XpJF zPkD3Wq#zrNsvJ$D~er*fqUn{+7j~E z5XS0P0AJ6;yBeV&k0+rz3yOsF0oonx0JioO=L1r? z>UY95Kws2vO{o%SU5bC9>%wd&nUdd%8B11C+S^j;c^8WyXkzZyCd7h?Br4s?R`B{r z6#!8UQv9kQJbj&Y2Wl2YgV`?l*#W_+V$irwKm-;*DvLy{C(fXeEcm z0hIuQEh69ZD?w^2^tMz260T{AfXF+fl)(MZZStjm!PyYr^8W#V65jK_4;bW4|408s YKahAX%#@W=#{d8T07*qoM6N<$f>7!)e*gdg diff --git a/graphics/pokemon/castform/snowy/back.png b/graphics/pokemon/castform/snowy/back.png index 11281385a5bba260693760f922cdfc14001e7486..6b8946b351b75a2b5d823e572f8e62e266d79d8f 100644 GIT binary patch delta 544 zcmV+*0^j}a1k?nOBo{DHOjJd50CUB~lqpgpF5Oh*b zQvm<}|NsC0|NsC0|NsC0|G-d-LjV8)!%0LzR9J=WmfLQ`APht+6D7uBwg3OO161cC4yn))LGK=r$H97}?WJ+r-eBW~#0f1mm;wME?`Fn~5qhQ?Fy zdw}?dqRnW26A4Rz7n#j;4Da8`&gQ5R$aDl_J^)ZyED45n>^m*TAP~stI`-EcfWsl+ zc+ou7+5eY-gBF7rrXD8*ibFmuBHqX$Sto#)t%D0PUFf-wn#e-RJq-XH!fBFpzfHNP zodo0zAD2KDesba|B|r)AQ3>qlq}Bi&;3>rw0&yzxHP!FIw*b#f&}v|RiR~*QwgA)J z6El?>1X0N48rt1Ky6R6~1OY+WP1mdXnk=qdr0FWNg^}F(dt*?7D}F4yu+Rj1eprv; itpKE75u5)1nvZoBpNeNOjJd50CUB~lqpgV!ZkvkrLckliE00001 zbW%=J06^y0W&i*H32;bRa{vG?BLDy{BLR4&KXw2B00(qQO+^Ri1_uEw4hl(N9RL6U z!AV3xR9M69meG#HAP7Y#*rY|ur2qf5tD+WLtewg3KK0I9<2|Av%LW4q#RgV`0N=43ndu(9g z(O&>kZ|w}oJkU#j9xaiF-1p43D1ca?|OBAb#o8Y&NsB zzjPEb4-oA#roc)8u7zO5ApY96kBF24%(Ex;RB8}Ju`h!j)o=o2fBr`h5melC9M#9p z!gY}5QRXWnyUYKLP6%B6SWn@hY3$|Wehr%e(0)w-^%)u#zz^DAHFN)G)#v~K002ov JPDHLkV1mFh2dn@9 diff --git a/graphics/pokemon/castform/snowy/front.png b/graphics/pokemon/castform/snowy/front.png index e921cd1a6af798669be43c50e9e25185b3f8e329..54f338d1f76a161e46bed3c9f827568882b4e10a 100644 GIT binary patch delta 614 zcmV-s0-61?1(^kqBo{DHOjJbx0070slqpgZHfAOHXW5Oh*b zQvm<}|NsC0|NsC0|NsC0|G-d-LjV8*2uVaiR9J=WmeFp*APhw-XG*|H#{d8A>}wz- zoxo{dCaw3OqHgXf*nsnReAH1q=>_xJD1b)_t>Oq^gx?tw)#VHTg>a@EvC#yS&>-4E!0zxLi0x3W zg?B?!-33)BhSwj@MTFR5H~jo{79;FR0k;0tFN84OMFk+@e|a|FTn6kcq5(MjW|Iyl z_5zf^^Zpya=T`#n-%1egz8hf@fY&c|;N6U~fOIg4*jq-eBQNHc2?$_W?g8Zd^8^zJ zi}@80lLLYKm?zU>GJsa$xmjH8(ic$2hA>sX0Aha~*3}3X@^lhz=Y&h5SBwmh?w|*- zwQo3IxMVs2f9q@b#2K!B`C{nMKM}b7^Ls%F$3XsU)OeV<# zUZ|+}m0%s-*%|O^60ZP%V|t|0)02*9BZK(?l>mb#MDbQ<1fd{OvbK~1&dz8Eh^#}V z9B|vK$Ws4;vmw0Y{{sLayyt%(@OY(oAN@o90LV!ZkvkrLw|-Pt00001 zbW%=J06^y0W&i*H32;bRa{vG?BLDy{BLR4&KXw2B00(qQO+^Ri1_uEw4}DHhivR!u z1xZ9fR9M69meFp5FbqYJnFMiw`TxIm_H_uMorq~)Caw3O3NH6R;>2bcKDrQ}^n!V5 zl+qo>Zib7=#GLdhYOiL0b=I(sV}$Z>*dP9S3S9c>tmyP= zAWjFMzJ4L;A6!mxV1JYm8oT+O%ptIVq9%`dn%p<-gB(nv19I_AE*p+H3NS*Rw%-5}O(W;++X(92HYbb1r? z>UY95Kws2vO{o%SU5bC9>%wd&nUdd%8B11C+S^j;c^8WyXkzZyCd7h?Br4s?R`B{r z6#!8UQv9kQJbj&Y2Wl2YgV`?l*#W_+V#Rz^4g60^*HnkiDmijc6r@ z#Q~K7gDoQ8^D9AWEA+Nh0uruiih#&Fq?Ew@&u#Lhf5F)h-tzwefD+#GzYiGXP5(## ZL_d&tF3gmbQ^x=R002ovPDHLkV1gyMADI9E diff --git a/graphics/pokemon/castform/snowy/normal.pal b/graphics/pokemon/castform/snowy/normal.pal index d1c64ac75..e05641ab1 100644 --- a/graphics/pokemon/castform/snowy/normal.pal +++ b/graphics/pokemon/castform/snowy/normal.pal @@ -1,12 +1,12 @@ JASC-PAL 0100 16 +248 160 176 197 197 148 41 82 57 123 82 189 139 115 213 148 180 205 -0 0 0 197 180 255 156 156 197 139 205 172 diff --git a/graphics/pokemon/castform/snowy/shiny.pal b/graphics/pokemon/castform/snowy/shiny.pal index d1c64ac75..e05641ab1 100644 --- a/graphics/pokemon/castform/snowy/shiny.pal +++ b/graphics/pokemon/castform/snowy/shiny.pal @@ -1,12 +1,12 @@ JASC-PAL 0100 16 +248 160 176 197 197 148 41 82 57 123 82 189 139 115 213 148 180 205 -0 0 0 197 180 255 156 156 197 139 205 172 diff --git a/graphics/pokemon/castform/sunny/anim_front.png b/graphics/pokemon/castform/sunny/anim_front.png deleted file mode 100644 index b866e48c1e4beeef475b89f9e47e33658e3e8df1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 632 zcmV-;0*C#HP)-Ohs`42Df{QK%`s|EvA_1L{2ZEbi2IS!R|!4^S#@n%=y*3rc>% zvjpHVpIe?9AlLef0CE?U2L=Ryz5)|SHDR!NyPy;pET>lw$}Si!Csv<$aa<-aR!+2E z7l6`&gXL`N)wkjR_*Kr({`CriZ3dpo84}3v@;O+>1QS>f)vUJ?9vf1k6KH(Jk47DP zIXN_XE znWGO!;&KTOJ)5ak{!%d0AYWC%o#t)ZXjmW+TQ*ItL_<8eqQ}3ZxWFgTqJqsof`)D9 zx5J<-3a)|A0(%J@$JIdl$c-PuZ4rC*{9_D18<@t2cLVi_^Ap?(@tAz`W;}nPcq+#E Sg{tEK0000n;isezp0000GbW%=J0RR90|NsC0|NsC0 z|NsC0z)*`r0004)Nkl9O$K!~Mxa}9fJwh+w9spA8N`E6z^!EXrJwSizgoJ?AmS#D5 z0SE#g0Dzu-M2n69O~qb+cL6Q=SO4NrbbkQ^Q2`8z+JOFMIdugD7y))iK$4@(1i`4@ zk<$ZU=DiGjW>D>j2_OQ*i=bwamH==53J5-+%oNsh!I z3`HZ8UI2@5|I;>}fJ()fPSvjSS18hdGM>n`J$m%$(f?3JePWL&fV+SGcpQ-txBUXR zN9Y0E13-#h3I3e>4*;BdfYb>I0jnj=a`Orh1Rel@&OV~0jsQ*7uHRii%lxZa#ox!18M%tbzCjKzb|N_2+<`_ z0OtP&;KrT;GzH+S!%qNHLZ1aQ3$Or)696J6ga(){b{)uf

LYlYlE9@u ABme*a diff --git a/graphics/pokemon/castform/sunny/front.png b/graphics/pokemon/castform/sunny/front.png index 3d97e3112fc0324e1c3bd0297e280cc05b5bb822..fe37e1867def6db9af4ac45ccdf6ac1ec79ce4e6 100644 GIT binary patch delta 543 zcmV+)0^t4l1m6UZBmppyB`begT2lZ2{}>n;;(EEX0000GbW%=J0RR90|NsC0|NsC0 z|NsC0z)*`r0005bNklco3`L!2M@+&{q%?z)?Za&FF$06!7oTIhe-;6KD_BB)1YC8uTKEE<|7rdMkf0esz5H%NZeCJO6L69>TRKb`gY{2~<$npnNH2nBxNN{bC?% z^kU{cL8z|6?x(zrNg*J-|xC-2jcdf_*N^a2M z4c7_8P81$S1Wem3<|g3BOvr%EFn{yyj0)V*K%MvbqPz7#}dkguYkM$^9UBL)*NM4DYvYY8iqFQ#a* z?}Ccre2)lr`v@BL&hLjoRuo(Vodx=0IF5^<^pTw(!gUe7diF7fpA9s$__Lw3i4WWX h-=W9kn>XY613DAqDc%YEzV-kB002ovPDHLkV1mQ-1^@s6 delta 568 zcmV-80>}N|1o#AyBmpy#B`bdb003HAQvd(|7#J9Oz(fH60004WQchC-Ohs` z42Df{QK%`s|EvA_1L{2ZEbi2IS!R|!4^S#@n%=y*3rc>%vjpHVpId*P8X(vDivV&L zlm`X`fW86~NHt-wdb^+$7%Zn(56UhWEhko=cyU}NFjh{qUl)MVf`jF3>(#g70QgnT z(Ejxbf^7z#${7;K@A5fV#sm{s57n%<5*`~;q7!I*#g9fEdpS8YdgJGhXP&W@lQ~>K z<>$HaYRD|n{tonzI*flmrR}V3>TM6{zRlO*QAr4_0GGwNrC+GP8}wG-{L=8HT_%L$ z?fk#Ndk7aY>>>y?6PSR+U_6lIr>mhqCxS;xH*^KIGnLiA!M_V?DCp5~m6vasqYp>oatRMTo2gd* zQZUmXUsb`K=55<(SRfEvHchQWLp-^n$G@Yvz$ek7g3UjIhHdA!!=Nh)u7S@2dkGxJ z)j<2mjUU2o5qm84{9_D18<@t2cLVi_^Ap?(@tAz`W;}nPcq+#Eg{tEK0000$@ - -$(CHERRIMGFXDIR)/back.4bpp: $(CHERRIMGFXDIR)/normal/back.4bpp \ - $(CHERRIMGFXDIR)/sunshine/back.4bpp - @cat $^ >$@ - -$(CHERRIMGFXDIR)/anim_front.4bpp: $(CHERRIMGFXDIR)/normal/anim_front.4bpp \ - $(CHERRIMGFXDIR)/sunshine/anim_front.4bpp - @cat $^ >$@ - -$(CHERRIMGFXDIR)/normal.gbapal: $(CHERRIMGFXDIR)/normal/normal.gbapal \ - $(CHERRIMGFXDIR)/sunshine/normal.gbapal - @cat $^ >$@ - -$(CHERRIMGFXDIR)/shiny.gbapal: $(CHERRIMGFXDIR)/normal/shiny.gbapal \ - $(CHERRIMGFXDIR)/sunshine/shiny.gbapal - @cat $^ >$@ - -### Castform ### - -$(CASTFORMGFXDIR)/front.4bpp: $(CASTFORMGFXDIR)/normal/front.4bpp \ - $(CASTFORMGFXDIR)/sunny/front.4bpp \ - $(CASTFORMGFXDIR)/rainy/front.4bpp \ - $(CASTFORMGFXDIR)/snowy/front.4bpp - @cat $^ >$@ - -$(CASTFORMGFXDIR)/back.4bpp: $(CASTFORMGFXDIR)/normal/back.4bpp \ - $(CASTFORMGFXDIR)/sunny/back.4bpp \ - $(CASTFORMGFXDIR)/rainy/back.4bpp \ - $(CASTFORMGFXDIR)/snowy/back.4bpp - @cat $^ >$@ - -$(CASTFORMGFXDIR)/anim_front.4bpp: $(CASTFORMGFXDIR)/normal/anim_front.4bpp \ - $(CASTFORMGFXDIR)/sunny/anim_front.4bpp \ - $(CASTFORMGFXDIR)/rainy/anim_front.4bpp \ - $(CASTFORMGFXDIR)/snowy/anim_front.4bpp - @cat $^ >$@ - -$(CASTFORMGFXDIR)/normal.gbapal: $(CASTFORMGFXDIR)/normal/normal.gbapal \ - $(CASTFORMGFXDIR)/sunny/normal.gbapal \ - $(CASTFORMGFXDIR)/rainy/normal.gbapal \ - $(CASTFORMGFXDIR)/snowy/normal.gbapal - @cat $^ >$@ - -$(CASTFORMGFXDIR)/shiny.gbapal: $(CASTFORMGFXDIR)/normal/shiny.gbapal \ - $(CASTFORMGFXDIR)/sunny/shiny.gbapal \ - $(CASTFORMGFXDIR)/rainy/shiny.gbapal \ - $(CASTFORMGFXDIR)/snowy/shiny.gbapal - @cat $^ >$@ - ### Tilesets ### $(TILESETGFXDIR)/secondary/petalburg/tiles.4bpp: %.4bpp: %.png diff --git a/include/battle.h b/include/battle.h index 9cf4f100a..ca099379f 100644 --- a/include/battle.h +++ b/include/battle.h @@ -585,7 +585,6 @@ struct BattleStruct u8 turnSideTracker; u8 givenExpMons; // Bits for enemy party's pokemon that gave exp to player's party. u16 lastTakenMoveFrom[MAX_BATTLERS_COUNT][MAX_BATTLERS_COUNT]; // a 2-D array [target][attacker] - u16 castformPalette[NUM_CASTFORM_FORMS][16]; union { struct LinkBattlerHeader linkBattlerHeader; u32 battleVideo[2]; @@ -988,7 +987,6 @@ extern struct BattleHealthboxInfo *gBattleControllerOpponentHealthboxData; extern struct BattleHealthboxInfo *gBattleControllerOpponentFlankHealthboxData; extern u16 gBattleMovePower; extern u16 gMoveToLearn; -extern u8 gBattleMonForms[MAX_BATTLERS_COUNT]; extern u32 gFieldStatuses; extern struct FieldTimer gFieldTimers; extern u8 gBattlerAbility; diff --git a/include/battle_gfx_sfx_util.h b/include/battle_gfx_sfx_util.h index 9a0b79c31..0b1bd52fb 100644 --- a/include/battle_gfx_sfx_util.h +++ b/include/battle_gfx_sfx_util.h @@ -23,7 +23,7 @@ bool8 BattleInitAllSprites(u8 *state1, u8 *battlerId); void ClearSpritesHealthboxAnimData(void); void CopyAllBattleSpritesInvisibilities(void); void CopyBattleSpriteInvisibility(u8 battlerId); -void HandleSpeciesGfxDataChange(u8 attacker, u8 target, bool8 castform, bool32 megaEvo, bool8 trackEnemyPersonality); +void HandleSpeciesGfxDataChange(u8 attacker, u8 target, bool32 megaEvo, bool8 trackEnemyPersonality); void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite); void LoadBattleMonGfxAndAnimate(u8 battlerId, bool8 loadMonSprite, u8 spriteId); void TrySetBehindSubstituteSpriteBit(u8 battlerId, u16 move); diff --git a/include/constants/battle.h b/include/constants/battle.h index cbc362861..c32af976c 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -423,16 +423,6 @@ #define B_WAIT_TIME_SHORT (B_WAIT_TIME_MULTIPLIER * 2) #define B_WAIT_TIME_SHORTEST (B_WAIT_TIME_MULTIPLIER) -#define CHERRIM_OVERCAST 0 -#define CHERRIM_SUNSHINE 1 - -#define CASTFORM_NORMAL 0 -#define CASTFORM_FIRE 1 -#define CASTFORM_WATER 2 -#define CASTFORM_ICE 3 -#define NUM_CASTFORM_FORMS 4 -#define CASTFORM_SUBSTITUTE (1 << 7) - #define FLEE_ITEM 1 #define FLEE_ABILITY 2 diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 60e044130..01d4b6809 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -510,44 +510,43 @@ #define BG_CHLOROBLAST 80 // table ids for general animations (gBattleAnims_General) -#define B_ANIM_CASTFORM_CHANGE 0 -#define B_ANIM_STATS_CHANGE 1 -#define B_ANIM_SUBSTITUTE_FADE 2 -#define B_ANIM_SUBSTITUTE_APPEAR 3 -#define B_ANIM_POKEBLOCK_THROW 4 -#define B_ANIM_ITEM_KNOCKOFF 5 -#define B_ANIM_TURN_TRAP 6 -#define B_ANIM_HELD_ITEM_EFFECT 7 -#define B_ANIM_SMOKEBALL_ESCAPE 8 -#define B_ANIM_HANGED_ON 9 -#define B_ANIM_RAIN_CONTINUES 10 -#define B_ANIM_SUN_CONTINUES 11 -#define B_ANIM_SANDSTORM_CONTINUES 12 -#define B_ANIM_HAIL_CONTINUES 13 -#define B_ANIM_LEECH_SEED_DRAIN 14 -#define B_ANIM_MON_HIT 15 -#define B_ANIM_ITEM_STEAL 16 -#define B_ANIM_SNATCH_MOVE 17 -#define B_ANIM_FUTURE_SIGHT_HIT 18 -#define B_ANIM_DOOM_DESIRE_HIT 19 -#define B_ANIM_FOCUS_PUNCH_SETUP 20 -#define B_ANIM_INGRAIN_HEAL 21 -#define B_ANIM_WISH_HEAL 22 -#define B_ANIM_MEGA_EVOLUTION 23 -#define B_ANIM_ILLUSION_OFF 24 -#define B_ANIM_FORM_CHANGE 25 -#define B_ANIM_SLIDE_OFFSCREEN 26 // for Emergency Exit -#define B_ANIM_RESTORE_BG 27 // for Terrain Endings -#define B_ANIM_TOTEM_FLARE 28 // Totem boosts aura flare -#define B_ANIM_GULP_MISSILE 29 -#define B_ANIM_STRONG_WINDS 30 -#define B_ANIM_PRIMAL_REVERSION 31 -#define B_ANIM_AQUA_RING_HEAL 32 -#define B_ANIM_BEAK_BLAST_SETUP 33 -#define B_ANIM_SHELL_TRAP_SETUP 34 -#define B_ANIM_ZMOVE_ACTIVATE 35 // Using Z Moves -#define B_ANIM_AFFECTION_HANGED_ON 36 -#define B_ANIM_SNOW_CONTINUES 37 +#define B_ANIM_STATS_CHANGE 0 +#define B_ANIM_SUBSTITUTE_FADE 1 +#define B_ANIM_SUBSTITUTE_APPEAR 2 +#define B_ANIM_POKEBLOCK_THROW 3 +#define B_ANIM_ITEM_KNOCKOFF 4 +#define B_ANIM_TURN_TRAP 5 +#define B_ANIM_HELD_ITEM_EFFECT 6 +#define B_ANIM_SMOKEBALL_ESCAPE 7 +#define B_ANIM_HANGED_ON 8 +#define B_ANIM_RAIN_CONTINUES 9 +#define B_ANIM_SUN_CONTINUES 10 +#define B_ANIM_SANDSTORM_CONTINUES 11 +#define B_ANIM_HAIL_CONTINUES 12 +#define B_ANIM_LEECH_SEED_DRAIN 13 +#define B_ANIM_MON_HIT 14 +#define B_ANIM_ITEM_STEAL 15 +#define B_ANIM_SNATCH_MOVE 16 +#define B_ANIM_FUTURE_SIGHT_HIT 17 +#define B_ANIM_DOOM_DESIRE_HIT 18 +#define B_ANIM_FOCUS_PUNCH_SETUP 19 +#define B_ANIM_INGRAIN_HEAL 20 +#define B_ANIM_WISH_HEAL 21 +#define B_ANIM_MEGA_EVOLUTION 22 +#define B_ANIM_ILLUSION_OFF 23 +#define B_ANIM_FORM_CHANGE 24 +#define B_ANIM_SLIDE_OFFSCREEN 25 // for Emergency Exit +#define B_ANIM_RESTORE_BG 26 // for Terrain Endings +#define B_ANIM_TOTEM_FLARE 27 // Totem boosts aura flare +#define B_ANIM_GULP_MISSILE 28 +#define B_ANIM_STRONG_WINDS 29 +#define B_ANIM_PRIMAL_REVERSION 30 +#define B_ANIM_AQUA_RING_HEAL 31 +#define B_ANIM_BEAK_BLAST_SETUP 32 +#define B_ANIM_SHELL_TRAP_SETUP 33 +#define B_ANIM_ZMOVE_ACTIVATE 34 // Using Z Moves +#define B_ANIM_AFFECTION_HANGED_ON 35 +#define B_ANIM_SNOW_CONTINUES 36 // special animations table (gBattleAnims_Special) #define B_ANIM_LVL_UP 0 diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 510d48271..f8bb4ec8d 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -333,11 +333,10 @@ // Most pokemon have 2 frames (a default and an alternate for their animation). // There are 4 exceptions: -// - Castform has 4 frames, 1 for each form // - Deoxys has 2 frames, 1 for each form // - Spinda has 1 frame, presumably to avoid the work of animating its spots // - Unown has 1 frame, presumably to avoid the work of animating all 28 of its forms -#define MAX_MON_PIC_FRAMES 4 +#define MAX_MON_PIC_FRAMES 2 #define BATTLE_ALIVE_EXCEPT_ACTIVE 0 #define BATTLE_ALIVE_ATK_SIDE 1 diff --git a/include/pokemon.h b/include/pokemon.h index 2c32054c5..8368714f8 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -527,7 +527,6 @@ u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves); u8 GetNumberOfRelearnableMoves(struct Pokemon *mon); u16 SpeciesToPokedexNum(u16 species); bool32 IsSpeciesInHoennDex(u16 species); -void ClearBattleMonForms(void); u16 GetBattleBGM(void); void PlayBattleBGM(void); void PlayMapChosenOrBattleBGM(u16 songId); diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 9f110b958..3d89c3614 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -2349,7 +2349,6 @@ void AnimTask_TransformMon(u8 taskId) gTasks[taskId].data[10] = gBattleAnimArgs[0]; gTasks[taskId].data[11] = gBattleAnimArgs[1]; - gTasks[taskId].data[12] = gBattleAnimArgs[2]; gTasks[taskId].data[0]++; break; case 1: @@ -2364,7 +2363,7 @@ void AnimTask_TransformMon(u8 taskId) } break; case 2: - HandleSpeciesGfxDataChange(gBattleAnimAttacker, gBattleAnimTarget, gTasks[taskId].data[10], gTasks[taskId].data[11], gTasks[taskId].data[12]); + HandleSpeciesGfxDataChange(gBattleAnimAttacker, gBattleAnimTarget, gTasks[taskId].data[10], gTasks[taskId].data[11]); GetBgDataForTransform(&animBg, gBattleAnimAttacker); if (IsContest()) @@ -2372,7 +2371,7 @@ void AnimTask_TransformMon(u8 taskId) else position = GetBattlerPosition(gBattleAnimAttacker); - src = gMonSpritesGfxPtr->sprites.ptr[position] + (gBattleMonForms[gBattleAnimAttacker] << 11); + src = gMonSpritesGfxPtr->sprites.ptr[position]; dest = animBg.bgTiles; CpuCopy32(src, dest, MON_PIC_SIZE); LoadBgTiles(1, animBg.bgTiles, 0x800, animBg.tilesOffset); @@ -2449,12 +2448,6 @@ void AnimTask_IsMonInvisible(u8 taskId) DestroyAnimVisualTask(taskId); } -void AnimTask_CastformGfxDataChange(u8 taskId) -{ - HandleSpeciesGfxDataChange(gBattleAnimAttacker, gBattleAnimTarget, TRUE, FALSE, FALSE); - DestroyAnimVisualTask(taskId); -} - void AnimTask_MorningSunLightBeam(u8 taskId) { struct BattleAnimBgData animBg; diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c index ca338791c..f2016dd5e 100644 --- a/src/battle_anim_mons.c +++ b/src/battle_anim_mons.c @@ -52,32 +52,6 @@ const struct UCoords8 sBattlerCoords[][MAX_BATTLERS_COUNT] = }, }; -// One entry for each of the four Castform forms. -const struct MonCoords gCastformFrontSpriteCoords[NUM_CASTFORM_FORMS] = -{ - [CASTFORM_NORMAL] = { .size = MON_COORDS_SIZE(32, 32), .y_offset = 17 }, - [CASTFORM_FIRE] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 9 }, - [CASTFORM_WATER] = { .size = MON_COORDS_SIZE(32, 48), .y_offset = 9 }, - [CASTFORM_ICE] = { .size = MON_COORDS_SIZE(64, 48), .y_offset = 8 }, -}; - -const u8 sCastformElevations[NUM_CASTFORM_FORMS] = -{ - [CASTFORM_NORMAL] = 13, - [CASTFORM_FIRE] = 14, - [CASTFORM_WATER] = 13, - [CASTFORM_ICE] = 13, -}; - -// Y position of the backsprite for each of the four Castform forms. -static const u8 sCastformBackSpriteYCoords[NUM_CASTFORM_FORMS] = -{ - [CASTFORM_NORMAL] = 0, - [CASTFORM_FIRE] = 0, - [CASTFORM_WATER] = 0, - [CASTFORM_ICE] = 0, -}; - // Placeholders for pokemon sprites to be created for a move animation effect (e.g. Role Play / Snatch) #define TAG_MOVE_EFFECT_MON_1 55125 #define TAG_MOVE_EFFECT_MON_2 55126 @@ -197,10 +171,6 @@ u8 GetBattlerYDelta(u8 battlerId, u16 species) coordSpecies = GetUnownSpeciesId(personality); ret = gMonBackPicCoords[coordSpecies].y_offset; } - else if (species == SPECIES_CASTFORM) - { - ret = sCastformBackSpriteYCoords[gBattleMonForms[battlerId]]; - } else if (species > NUM_SPECIES) { ret = gMonBackPicCoords[0].y_offset; @@ -223,10 +193,6 @@ u8 GetBattlerYDelta(u8 battlerId, u16 species) coordSpecies = GetUnownSpeciesId(personality); ret = gMonFrontPicCoords[coordSpecies].y_offset; } - else if (species == SPECIES_CASTFORM) - { - ret = gCastformFrontSpriteCoords[gBattleMonForms[battlerId]].y_offset; - } else if (species > NUM_SPECIES) { ret = gMonFrontPicCoords[0].y_offset; @@ -246,9 +212,7 @@ u8 GetBattlerElevation(u8 battlerId, u16 species) { if (!IsContest()) { - if (species == SPECIES_CASTFORM) - ret = sCastformElevations[gBattleMonForms[battlerId]]; - else if (species > NUM_SPECIES) + if (species > NUM_SPECIES) ret = gEnemyMonElevation[0]; else ret = gEnemyMonElevation[species]; @@ -1963,10 +1927,7 @@ static u16 GetBattlerYDeltaFromSpriteId(u8 spriteId) else species = spriteInfo[battlerId].transformSpecies; - if (species == SPECIES_CASTFORM) - return sCastformBackSpriteYCoords[gBattleMonForms[battlerId]]; - else - return gMonBackPicCoords[species].y_offset; + return gMonBackPicCoords[species].y_offset; } else { @@ -1976,10 +1937,7 @@ static u16 GetBattlerYDeltaFromSpriteId(u8 spriteId) else species = spriteInfo[battlerId].transformSpecies; - if (species == SPECIES_CASTFORM) - return sCastformElevations[gBattleMonForms[battlerId]]; - else - return gMonFrontPicCoords[species].y_offset; + return gMonFrontPicCoords[species].y_offset; } } } @@ -2201,10 +2159,6 @@ s16 GetBattlerSpriteCoordAttr(u8 battlerId, u8 attr) species = GetUnownSpeciesId(personality); coords = &gMonBackPicCoords[species]; } - else if (species == SPECIES_CASTFORM) - { - coords = &gCastformFrontSpriteCoords[gBattleMonForms[battlerId]]; - } else if (species <= SPECIES_EGG) { coords = &gMonBackPicCoords[species]; @@ -2263,10 +2217,6 @@ s16 GetBattlerSpriteCoordAttr(u8 battlerId, u8 attr) species = GetUnownSpeciesId(personality); coords = &gMonFrontPicCoords[species]; } - else if (species == SPECIES_CASTFORM) - { - coords = &gCastformFrontSpriteCoords[gBattleMonForms[battlerId]]; - } else if (species > NUM_SPECIES) { coords = &gMonFrontPicCoords[0]; diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index b4936da5c..69e2f6bde 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -1129,7 +1129,7 @@ static void LinkOpponentHandleLoadMonSprite(void) gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; - StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); + StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0); SetBattlerShadowSpriteCallback(gActiveBattler, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES)); @@ -1169,7 +1169,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId; - StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], gBattleMonForms[battlerId]); + StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], 0); gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index d07a92e93..8684ba70e 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -1025,7 +1025,7 @@ static void LinkPartnerHandleLoadMonSprite(void) gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; - StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); + StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0); gBattlerControllerFuncs[gActiveBattler] = WaitForMonAnimAfterLoad; } @@ -1061,7 +1061,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId; - StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], gBattleMonForms[battlerId]); + StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], 0); gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index c3e4a9037..f316f19ea 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1160,7 +1160,7 @@ static void OpponentHandleLoadMonSprite(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = species; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; - StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); + StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0); SetBattlerShadowSpriteCallback(gActiveBattler, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES)); @@ -1201,7 +1201,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId; - StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], gBattleMonForms[battlerId]); + StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], 0); gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index c88dbff78..6d2e03fd8 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -2436,7 +2436,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId; - StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], gBattleMonForms[battlerId]); + StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], 0); gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index b94d5347a..3a4beeca9 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -1213,7 +1213,7 @@ static void PlayerPartnerHandleLoadMonSprite(void) gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; - StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); + StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0); gBattlerControllerFuncs[gActiveBattler] = WaitForMonAnimAfterLoad; } @@ -1249,7 +1249,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId; - StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], gBattleMonForms[battlerId]); + StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], 0); gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index d1c60343a..283388fcf 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -1118,7 +1118,7 @@ static void RecordedOpponentHandleLoadMonSprite(void) gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; - StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); + StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0); SetBattlerShadowSpriteCallback(gActiveBattler, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES)); @@ -1155,7 +1155,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId; - StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], gBattleMonForms[battlerId]); + StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], 0); gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index 46f3de4f1..86cb49198 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -1101,7 +1101,7 @@ static void RecordedPlayerHandleLoadMonSprite(void) gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; - StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); + StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0); gBattlerControllerFuncs[gActiveBattler] = WaitForMonAnimAfterLoad; } @@ -1137,7 +1137,7 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId; - StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], gBattleMonForms[battlerId]); + StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], 0); gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index fa1fa00fb..00a825dba 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -1474,7 +1474,7 @@ static void StartSendOutAnim(u8 battlerId) gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId; - StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], gBattleMonForms[battlerId]); + StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], 0); gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; gSprites[gBattleControllerData[battlerId]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); diff --git a/src/battle_controllers.c b/src/battle_controllers.c index d5d3e479e..d7ca18c6a 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -57,7 +57,6 @@ void SetUpBattleVarsAndBirchZigzagoon(void) HandleLinkBattleSetup(); gBattleControllerExecFlags = 0; ClearBattleAnimationVars(); - ClearBattleMonForms(); BattleAI_SetupItems(); BattleAI_SetupFlags(); diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 5f168d88b..383ce16e6 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -434,12 +434,6 @@ bool8 TryHandleLaunchBattleTableAnimation(u8 activeBattler, u8 atkBattler, u8 de { u8 taskId; - if (tableId == B_ANIM_CASTFORM_CHANGE && (argument & CASTFORM_SUBSTITUTE)) - { - // If Castform is behind substitute, set the new form but skip the animation - gBattleMonForms[activeBattler] = (argument & ~CASTFORM_SUBSTITUTE); - return TRUE; - } if (gBattleSpritesDataPtr->battlerData[activeBattler].behindSubstitute && !ShouldAnimBeDoneRegardlessOfSubstitute(tableId)) { @@ -607,13 +601,6 @@ static void BattleLoadMonSpriteGfx(struct Pokemon *mon, u32 battlerId, bool32 op LoadPalette(gDecompressionBuffer, paletteOffset, PLTT_SIZE_4BPP); LoadPalette(gDecompressionBuffer, BG_PLTT_ID(8) + BG_PLTT_ID(battlerId), PLTT_SIZE_4BPP); - if (species == SPECIES_CASTFORM || species == SPECIES_CHERRIM) - { - paletteOffset = OBJ_PLTT_ID(battlerId); - LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette); - LoadPalette(gBattleStruct->castformPalette[gBattleMonForms[battlerId]], paletteOffset, PLTT_SIZE_4BPP); - } - // transform's pink color if (gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies != SPECIES_NONE) { @@ -860,7 +847,7 @@ void CopyBattleSpriteInvisibility(u8 battlerId) gBattleSpritesDataPtr->battlerData[battlerId].invisible = gSprites[gBattlerSpriteIds[battlerId]].invisible; } -void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform, bool32 megaEvo, bool8 trackEnemyPersonality) +void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool32 megaEvo, bool8 trackEnemyPersonality) { u32 personalityValue, otId, position, paletteOffset, targetSpecies; const void *lzPaletteData, *src; @@ -930,54 +917,26 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform, bo gTransformedPersonalities[battlerAtk]); } } + src = gMonSpritesGfxPtr->sprites.ptr[position]; + dst = (void *)(OBJ_VRAM0 + gSprites[gBattlerSpriteIds[battlerAtk]].oam.tileNum * 32); + DmaCopy32(3, src, dst, MON_PIC_SIZE); + paletteOffset = OBJ_PLTT_ID(battlerAtk); + lzPaletteData = GetMonSpritePalFromSpeciesAndPersonality(targetSpecies, otId, personalityValue); + LZDecompressWram(lzPaletteData, gDecompressionBuffer); + LoadPalette(gDecompressionBuffer, paletteOffset, PLTT_SIZE_4BPP); - if (castform) + if (!megaEvo) { - StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerAtk]], gBattleSpritesDataPtr->animationData->animArg); - paletteOffset = OBJ_PLTT_ID(battlerAtk); - lzPaletteData = GetMonSpritePalFromSpeciesAndPersonality(targetSpecies, otId, personalityValue); - LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette); - LoadPalette(gBattleStruct->castformPalette[gBattleSpritesDataPtr->animationData->animArg], paletteOffset, PLTT_SIZE_4BPP); - gBattleMonForms[battlerAtk] = gBattleSpritesDataPtr->animationData->animArg; - if (gBattleSpritesDataPtr->battlerData[battlerAtk].transformSpecies != SPECIES_NONE) - { - BlendPalette(paletteOffset, 16, 6, RGB_WHITE); - CpuCopy32(&gPlttBufferFaded[paletteOffset], &gPlttBufferUnfaded[paletteOffset], PLTT_SIZEOF(16)); - } - gSprites[gBattlerSpriteIds[battlerAtk]].y = GetBattlerSpriteDefault_Y(battlerAtk); - } - else - { - src = gMonSpritesGfxPtr->sprites.ptr[position]; - dst = (void *)(OBJ_VRAM0 + gSprites[gBattlerSpriteIds[battlerAtk]].oam.tileNum * 32); - DmaCopy32(3, src, dst, MON_PIC_SIZE); - paletteOffset = OBJ_PLTT_ID(battlerAtk); - lzPaletteData = GetMonSpritePalFromSpeciesAndPersonality(targetSpecies, otId, personalityValue); - LZDecompressWram(lzPaletteData, gDecompressionBuffer); - LoadPalette(gDecompressionBuffer, paletteOffset, PLTT_SIZE_4BPP); - - if (targetSpecies == SPECIES_CASTFORM || targetSpecies == SPECIES_CHERRIM) - { - gSprites[gBattlerSpriteIds[battlerAtk]].anims = gMonFrontAnimsPtrTable[targetSpecies]; - LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette); - LoadPalette(gBattleStruct->castformPalette[gBattleMonForms[battlerDef]], paletteOffset, PLTT_SIZE_4BPP); - } - - if (!megaEvo) - { - BlendPalette(paletteOffset, 16, 6, RGB_WHITE); - CpuCopy32(&gPlttBufferFaded[paletteOffset], &gPlttBufferUnfaded[paletteOffset], PLTT_SIZEOF(16)); - } - - if (!IsContest() && !megaEvo) + BlendPalette(paletteOffset, 16, 6, RGB_WHITE); + CpuCopy32(&gPlttBufferFaded[paletteOffset], &gPlttBufferUnfaded[paletteOffset], PLTT_SIZEOF(16)); + if (!IsContest()) { gBattleSpritesDataPtr->battlerData[battlerAtk].transformSpecies = targetSpecies; - gBattleMonForms[battlerAtk] = gBattleMonForms[battlerDef]; } - - gSprites[gBattlerSpriteIds[battlerAtk]].y = GetBattlerSpriteDefault_Y(battlerAtk); - StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerAtk]], gBattleMonForms[battlerAtk]); } + + gSprites[gBattlerSpriteIds[battlerAtk]].y = GetBattlerSpriteDefault_Y(battlerAtk); + StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerAtk]], 0); } void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite) @@ -1021,7 +980,7 @@ void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite) void LoadBattleMonGfxAndAnimate(u8 battlerId, bool8 loadMonSprite, u8 spriteId) { BattleLoadSubstituteOrMonSpriteGfx(battlerId, loadMonSprite); - StartSpriteAnim(&gSprites[spriteId], gBattleMonForms[battlerId]); + StartSpriteAnim(&gSprites[spriteId], 0); if (!loadMonSprite) gSprites[spriteId].y = GetSubstituteSpriteDefault_Y(battlerId); @@ -1232,7 +1191,6 @@ void FillAroundBattleWindows(void) void ClearTemporarySpeciesSpriteData(u8 battlerId, bool8 dontClearSubstitute) { gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies = SPECIES_NONE; - gBattleMonForms[battlerId] = 0; if (!dontClearSubstitute) ClearBehindSubstituteBit(battlerId); } diff --git a/src/battle_intro.c b/src/battle_intro.c index 78982ca4c..4ed12d636 100644 --- a/src/battle_intro.c +++ b/src/battle_intro.c @@ -589,7 +589,7 @@ void DrawBattlerOnBg(int bgId, u8 x, u8 y, u8 battlerPosition, u8 paletteId, u8 int i, j; u8 battler = GetBattlerAtPosition(battlerPosition); int offset = tilesOffset; - CpuCopy16(gMonSpritesGfxPtr->sprites.ptr[battlerPosition] + BG_SCREEN_SIZE * gBattleMonForms[battler], tiles, BG_SCREEN_SIZE); + CpuCopy16(gMonSpritesGfxPtr->sprites.ptr[battlerPosition], tiles, BG_SCREEN_SIZE); LoadBgTiles(bgId, tiles, 0x1000, tilesOffset); for (i = y; i < y + 8; i++) { diff --git a/src/battle_main.c b/src/battle_main.c index 7904ffdf8..186ae225a 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -234,7 +234,6 @@ EWRAM_DATA struct BattleHealthboxInfo *gBattleControllerOpponentHealthboxData = EWRAM_DATA struct BattleHealthboxInfo *gBattleControllerOpponentFlankHealthboxData = NULL; // Never read EWRAM_DATA u16 gBattleMovePower = 0; EWRAM_DATA u16 gMoveToLearn = 0; -EWRAM_DATA u8 gBattleMonForms[MAX_BATTLERS_COUNT] = {0}; EWRAM_DATA u32 gFieldStatuses = 0; EWRAM_DATA struct FieldTimer gFieldTimers = {0}; EWRAM_DATA u8 gBattlerAbility = 0; @@ -2784,7 +2783,6 @@ static void SpriteCB_Flicker(struct Sprite *sprite) #undef sDelay extern const struct MonCoords gMonFrontPicCoords[]; -extern const struct MonCoords gCastformFrontSpriteCoords[]; void SpriteCB_FaintOpponentMon(struct Sprite *sprite) { @@ -2805,10 +2803,6 @@ void SpriteCB_FaintOpponentMon(struct Sprite *sprite) species = GetUnownSpeciesId(personality); yOffset = gMonFrontPicCoords[species].y_offset; } - else if (species == SPECIES_CASTFORM) - { - yOffset = gCastformFrontSpriteCoords[gBattleMonForms[battler]].y_offset; - } else if (species > NUM_SPECIES) { yOffset = gMonFrontPicCoords[SPECIES_NONE].y_offset; @@ -2838,12 +2832,12 @@ static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite) } else // Erase bottom part of the sprite to create a smooth illusion of mon falling down. { - u8 *dst = gMonSpritesGfxPtr->sprites.byte[GetBattlerPosition(sprite->sBattler)] + (gBattleMonForms[sprite->sBattler] << 11) + (sprite->data[3] << 8); + u8 *dst = gMonSpritesGfxPtr->sprites.byte[GetBattlerPosition(sprite->sBattler)] + (sprite->data[3] << 8); for (i = 0; i < 0x100; i++) *(dst++) = 0; - StartSpriteAnim(sprite, gBattleMonForms[sprite->sBattler]); + StartSpriteAnim(sprite, 0); } } } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index c4ea866df..0faeef28d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -585,8 +585,8 @@ static void Cmd_switchoutabilities(void); static void Cmd_jumpifhasnohp(void); static void Cmd_getsecretpowereffect(void); static void Cmd_pickup(void); -static void Cmd_doweatherformchangeanimation(void); -static void Cmd_tryweatherformdatachange(void); +static void Cmd_unused3(void); +static void Cmd_unused4(void); static void Cmd_settypebasedhalvers(void); static void Cmd_jumpifsubstituteblocks(void); static void Cmd_tryrecycleitem(void); @@ -844,8 +844,8 @@ void (* const gBattleScriptingCommandsTable[])(void) = Cmd_jumpifhasnohp, //0xE3 Cmd_getsecretpowereffect, //0xE4 Cmd_pickup, //0xE5 - Cmd_doweatherformchangeanimation, //0xE6 - Cmd_tryweatherformdatachange, //0xE7 + Cmd_unused3, //0xE6 + Cmd_unused4, //0xE7 Cmd_settypebasedhalvers, //0xE8 Cmd_jumpifsubstituteblocks, //0xE9 Cmd_tryrecycleitem, //0xEA @@ -15139,26 +15139,12 @@ static void Cmd_pickup(void) gBattlescriptCurrInstr = cmd->nextInstr; } -static void Cmd_doweatherformchangeanimation(void) +static void Cmd_unused3(void) { - CMD_ARGS(); - - gActiveBattler = gBattleScripting.battler; - - if (gBattleMons[gActiveBattler].status2 & STATUS2_SUBSTITUTE) - *(&gBattleStruct->formToChangeInto) |= CASTFORM_SUBSTITUTE; - - BtlController_EmitBattleAnimation(BUFFER_A, B_ANIM_CASTFORM_CHANGE, gBattleStruct->formToChangeInto); - MarkBattlerForControllerExec(gActiveBattler); - - gBattlescriptCurrInstr = cmd->nextInstr; } -static void Cmd_tryweatherformdatachange(void) +static void Cmd_unused4(void) { - CMD_ARGS(); - - // removed in favor of new form system } // Water and Mud Sport diff --git a/src/contest.c b/src/contest.c index 55207eb3e..97797dbf7 100644 --- a/src/contest.c +++ b/src/contest.c @@ -1189,7 +1189,6 @@ void CB2_StartContest(void) FreeAllSpritePalettes(); gReservedSpritePaletteCount = 4; eContestDebugMode = CONTEST_DEBUG_MODE_OFF; - ClearBattleMonForms(); InitContestResources(); gMain.state++; break; @@ -1778,8 +1777,6 @@ static void Task_DoAppeals(u8 taskId) } return; case APPEALSTATE_SLIDE_MON_IN: - for (i = 0; i < CONTESTANT_COUNT; i++) - gBattleMonForms[i] = 0; memset(gContestResources->moveAnim, 0, sizeof(*gContestResources->moveAnim)); SetMoveAnimAttackerData(eContest.currentContestant); spriteId = CreateContestantSprite( @@ -5312,8 +5309,6 @@ static void SetMoveSpecificAnimData(u8 contestant) memset(&gContestResources->moveAnim->species, 0, 20); ClearBattleAnimationVars(); - for (i = 0; i < CONTESTANT_COUNT; i++) - gBattleMonForms[i] = 0; switch (move) { case MOVE_CURSE: diff --git a/src/data.c b/src/data.c index 1ced9ce81..859209a93 100644 --- a/src/data.c +++ b/src/data.c @@ -279,24 +279,10 @@ static const union AnimCmd sAnim_MonPic_1[] = ANIMCMD_END, }; -static const union AnimCmd sAnim_MonPic_2[] = -{ - ANIMCMD_FRAME(2, 0), - ANIMCMD_END, -}; - -static const union AnimCmd sAnim_MonPic_3[] = -{ - ANIMCMD_FRAME(3, 0), - ANIMCMD_END, -}; - const union AnimCmd *const gAnims_MonPic[MAX_MON_PIC_FRAMES] = { sAnim_MonPic_0, sAnim_MonPic_1, - sAnim_MonPic_2, - sAnim_MonPic_3, }; #define SPECIES_SPRITE(species, sprite) [SPECIES_##species] = {sprite, MON_PIC_SIZE, SPECIES_##species} diff --git a/src/data/graphics/pokemon.h b/src/data/graphics/pokemon.h index ae93b05bc..c6d0d3bb5 100644 --- a/src/data/graphics/pokemon.h +++ b/src/data/graphics/pokemon.h @@ -378,7 +378,7 @@ const u32 gMonFrontPic_Anorith[] = INCBIN_U32("graphics/pokemon/anorith/anim_fro const u32 gMonFrontPic_Armaldo[] = INCBIN_U32("graphics/pokemon/armaldo/anim_front.4bpp.lz"); const u32 gMonFrontPic_Feebas[] = INCBIN_U32("graphics/pokemon/feebas/anim_front.4bpp.lz"); const u32 gMonFrontPic_Milotic[] = INCBIN_U32("graphics/pokemon/milotic/anim_front.4bpp.lz"); -const u32 gMonFrontPic_Castform[] = INCBIN_U32("graphics/pokemon/castform/anim_front.4bpp.lz"); +const u32 gMonFrontPic_Castform[] = INCBIN_U32("graphics/pokemon/castform/front.4bpp.lz"); const u32 gMonFrontPic_Kecleon[] = INCBIN_U32("graphics/pokemon/kecleon/anim_front.4bpp.lz"); const u32 gMonFrontPic_Shuppet[] = INCBIN_U32("graphics/pokemon/shuppet/anim_front.4bpp.lz"); const u32 gMonFrontPic_Banette[] = INCBIN_U32("graphics/pokemon/banette/anim_front.4bpp.lz"); @@ -456,7 +456,7 @@ const u32 gMonFrontPic_Pachirisu[] = INCBIN_U32("graphics/pokemon/pachirisu/anim const u32 gMonFrontPic_Buizel[] = INCBIN_U32("graphics/pokemon/buizel/anim_front.4bpp.lz"); const u32 gMonFrontPic_Floatzel[] = INCBIN_U32("graphics/pokemon/floatzel/anim_front.4bpp.lz"); const u32 gMonFrontPic_Cherubi[] = INCBIN_U32("graphics/pokemon/cherubi/anim_front.4bpp.lz"); -const u32 gMonFrontPic_Cherrim[] = INCBIN_U32("graphics/pokemon/cherrim/anim_front.4bpp.lz"); +const u32 gMonFrontPic_Cherrim[] = INCBIN_U32("graphics/pokemon/cherrim/normal/anim_front.4bpp.lz"); const u32 gMonFrontPic_Shellos[] = INCBIN_U32("graphics/pokemon/shellos/anim_front.4bpp.lz"); const u32 gMonFrontPic_Gastrodon[] = INCBIN_U32("graphics/pokemon/gastrodon/anim_front.4bpp.lz"); const u32 gMonFrontPic_Ambipom[] = INCBIN_U32("graphics/pokemon/ambipom/anim_front.4bpp.lz"); @@ -1117,9 +1117,9 @@ const u32 gMonFrontPic_UnownY[] = INCBIN_U32("graphics/pokemon/unown/y/anim_fron const u32 gMonFrontPic_UnownZ[] = INCBIN_U32("graphics/pokemon/unown/z/anim_front.4bpp.lz"); const u32 gMonFrontPic_UnownExclamationMark[] = INCBIN_U32("graphics/pokemon/unown/exclamation_mark/anim_front.4bpp.lz"); const u32 gMonFrontPic_UnownQuestionMark[] = INCBIN_U32("graphics/pokemon/unown/question_mark/anim_front.4bpp.lz"); -const u32 gMonFrontPic_CastformSunny[] = INCBIN_U32("graphics/pokemon/castform/sunny/anim_front.4bpp.lz"); -const u32 gMonFrontPic_CastformRainy[] = INCBIN_U32("graphics/pokemon/castform/rainy/anim_front.4bpp.lz"); -const u32 gMonFrontPic_CastformSnowy[] = INCBIN_U32("graphics/pokemon/castform/snowy/anim_front.4bpp.lz"); +const u32 gMonFrontPic_CastformSunny[] = INCBIN_U32("graphics/pokemon/castform/sunny/front.4bpp.lz"); +const u32 gMonFrontPic_CastformRainy[] = INCBIN_U32("graphics/pokemon/castform/rainy/front.4bpp.lz"); +const u32 gMonFrontPic_CastformSnowy[] = INCBIN_U32("graphics/pokemon/castform/snowy/front.4bpp.lz"); const u32 gMonFrontPic_DeoxysAttack[] = INCBIN_U32("graphics/pokemon/deoxys/attack/anim_front.4bpp.lz"); const u32 gMonFrontPic_DeoxysDefense[] = INCBIN_U32("graphics/pokemon/deoxys/defense/anim_front.4bpp.lz"); const u32 gMonFrontPic_DeoxysSpeed[] = INCBIN_U32("graphics/pokemon/deoxys/speed/anim_front.4bpp.lz"); @@ -1695,7 +1695,7 @@ const u32 gMonBackPic_Pachirisu[] = INCBIN_U32("graphics/pokemon/pachirisu/back. const u32 gMonBackPic_Buizel[] = INCBIN_U32("graphics/pokemon/buizel/back.4bpp.lz"); const u32 gMonBackPic_Floatzel[] = INCBIN_U32("graphics/pokemon/floatzel/back.4bpp.lz"); const u32 gMonBackPic_Cherubi[] = INCBIN_U32("graphics/pokemon/cherubi/back.4bpp.lz"); -const u32 gMonBackPic_Cherrim[] = INCBIN_U32("graphics/pokemon/cherrim/back.4bpp.lz"); +const u32 gMonBackPic_Cherrim[] = INCBIN_U32("graphics/pokemon/cherrim/normal/back.4bpp.lz"); const u32 gMonBackPic_Shellos[] = INCBIN_U32("graphics/pokemon/shellos/back.4bpp.lz"); const u32 gMonBackPic_Gastrodon[] = INCBIN_U32("graphics/pokemon/gastrodon/back.4bpp.lz"); const u32 gMonBackPic_Ambipom[] = INCBIN_U32("graphics/pokemon/ambipom/back.4bpp.lz"); @@ -2903,7 +2903,7 @@ const u32 gMonPalette_Pachirisu[] = INCBIN_U32("graphics/pokemon/pachirisu/norma const u32 gMonPalette_Buizel[] = INCBIN_U32("graphics/pokemon/buizel/normal.gbapal.lz"); const u32 gMonPalette_Floatzel[] = INCBIN_U32("graphics/pokemon/floatzel/normal.gbapal.lz"); const u32 gMonPalette_Cherubi[] = INCBIN_U32("graphics/pokemon/cherubi/normal.gbapal.lz"); -const u32 gMonPalette_Cherrim[] = INCBIN_U32("graphics/pokemon/cherrim/normal.gbapal.lz"); +const u32 gMonPalette_Cherrim[] = INCBIN_U32("graphics/pokemon/cherrim/normal/normal.gbapal.lz"); const u32 gMonPalette_Shellos[] = INCBIN_U32("graphics/pokemon/shellos/normal.gbapal.lz"); const u32 gMonPalette_Gastrodon[] = INCBIN_U32("graphics/pokemon/gastrodon/normal.gbapal.lz"); const u32 gMonPalette_Ambipom[] = INCBIN_U32("graphics/pokemon/ambipom/normal.gbapal.lz"); @@ -4136,7 +4136,7 @@ const u32 gMonShinyPalette_Pachirisu[] = INCBIN_U32("graphics/pokemon/pachirisu/ const u32 gMonShinyPalette_Buizel[] = INCBIN_U32("graphics/pokemon/buizel/shiny.gbapal.lz"); const u32 gMonShinyPalette_Floatzel[] = INCBIN_U32("graphics/pokemon/floatzel/shiny.gbapal.lz"); const u32 gMonShinyPalette_Cherubi[] = INCBIN_U32("graphics/pokemon/cherubi/shiny.gbapal.lz"); -const u32 gMonShinyPalette_Cherrim[] = INCBIN_U32("graphics/pokemon/cherrim/shiny.gbapal.lz"); +const u32 gMonShinyPalette_Cherrim[] = INCBIN_U32("graphics/pokemon/cherrim/normal/shiny.gbapal.lz"); const u32 gMonShinyPalette_Shellos[] = INCBIN_U32("graphics/pokemon/shellos/shiny.gbapal.lz"); const u32 gMonShinyPalette_Gastrodon[] = INCBIN_U32("graphics/pokemon/gastrodon/shiny.gbapal.lz"); const u32 gMonShinyPalette_Ambipom[] = INCBIN_U32("graphics/pokemon/ambipom/shiny.gbapal.lz"); diff --git a/src/pokemon.c b/src/pokemon.c index 5cbdffb66..58252f5fe 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -2314,6 +2314,9 @@ const u8 sMonFrontAnimIdsTable[NUM_SPECIES - 1] = [SPECIES_FEEBAS - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW, [SPECIES_MILOTIC - 1] = ANIM_CIRCULAR_STRETCH_TWICE, [SPECIES_CASTFORM - 1] = ANIM_H_SLIDE_WOBBLE, + [SPECIES_CASTFORM_SUNNY - 1] = ANIM_H_SLIDE_WOBBLE, + [SPECIES_CASTFORM_RAINY - 1] = ANIM_H_SLIDE_WOBBLE, + [SPECIES_CASTFORM_SNOWY - 1] = ANIM_H_SLIDE_WOBBLE, [SPECIES_KECLEON - 1] = ANIM_FLICKER_INCREASING, [SPECIES_SHUPPET - 1] = ANIM_V_SLIDE_WOBBLE, [SPECIES_BANETTE - 1] = ANIM_CIRCULAR_STRETCH_TWICE, @@ -7508,13 +7511,6 @@ bool32 IsSpeciesInHoennDex(u16 species) return TRUE; } -void ClearBattleMonForms(void) -{ - int i; - for (i = 0; i < MAX_BATTLERS_COUNT; i++) - gBattleMonForms[i] = 0; -} - u16 GetBattleBGM(void) { if (gBattleTypeFlags & BATTLE_TYPE_KYOGRE_GROUDON) diff --git a/src/pokemon_animation.c b/src/pokemon_animation.c index e0847233e..c9f6a0489 100644 --- a/src/pokemon_animation.c +++ b/src/pokemon_animation.c @@ -575,6 +575,9 @@ static const u8 sSpeciesToBackAnimSet[NUM_SPECIES] = [SPECIES_LAIRON] = BACK_ANIM_V_SHAKE, [SPECIES_AGGRON] = BACK_ANIM_V_SHAKE_LOW, [SPECIES_CASTFORM] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_CASTFORM_SUNNY] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_CASTFORM_RAINY] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_CASTFORM_SNOWY] = BACK_ANIM_CONVEX_DOUBLE_ARC, [SPECIES_VOLBEAT] = BACK_ANIM_CONVEX_DOUBLE_ARC, [SPECIES_ILLUMISE] = BACK_ANIM_CONVEX_DOUBLE_ARC, [SPECIES_LILEEP] = BACK_ANIM_H_STRETCH, diff --git a/src/pokemon_debug.c b/src/pokemon_debug.c index 2e9f04506..44ee5b9e6 100644 --- a/src/pokemon_debug.c +++ b/src/pokemon_debug.c @@ -45,8 +45,6 @@ extern const struct CompressedSpriteSheet gSpriteSheet_EnemyShadow; extern const struct SpriteTemplate gSpriteTemplate_EnemyShadow; extern const struct SpritePalette sSpritePalettes_HealthBoxHealthBar[2]; extern const struct UCoords8 sBattlerCoords[][MAX_BATTLERS_COUNT] ; -extern const struct MonCoords gCastformFrontSpriteCoords[NUM_CASTFORM_FORMS]; -extern const u8 sCastformElevations[NUM_CASTFORM_FORMS]; extern const u8 sMonFrontAnimIdsTable[NUM_SPECIES - 1]; static const u16 sBgColor[] = {RGB_WHITE}; @@ -732,53 +730,11 @@ static void BattleLoadOpponentMonSpriteGfxCustom(u16 species, bool8 isFemale, bo LoadPalette(gDecompressionBuffer, 0x80 + battlerId * 16, 0x20); } -static bool8 IsCastformForm(species) -{ - if (species == SPECIES_CASTFORM_SUNNY || species == SPECIES_CASTFORM_RAINY || species == SPECIES_CASTFORM_SNOWY) - return TRUE; - - return FALSE; -} - -static u8 GetCastformYCustom(species) -{ - u8 ret; - switch (species) - { - case SPECIES_CASTFORM: - ret = gCastformFrontSpriteCoords[CASTFORM_NORMAL].y_offset; - break; - case SPECIES_CASTFORM_SUNNY: - ret = gCastformFrontSpriteCoords[CASTFORM_FIRE].y_offset; - break; - case SPECIES_CASTFORM_RAINY: - ret = gCastformFrontSpriteCoords[CASTFORM_WATER].y_offset; - break; - case SPECIES_CASTFORM_SNOWY: - ret = gCastformFrontSpriteCoords[CASTFORM_ICE].y_offset; - break; - } - return ret; -} - -static u8 GetElevationValue(u16 species) -{ - u8 val; - if (species == SPECIES_CASTFORM) - val = sCastformElevations[0]; - else if (IsCastformForm(species)) - val = sCastformElevations[species - SPECIES_CASTFORM_SUNNY + 1]; - else - val = gEnemyMonElevation[species]; - - return val; -} - static void SetConstSpriteValues(struct PokemonDebugMenu *data) { u16 species = data->currentmonId; data->constSpriteValues.frontPicCoords = gMonFrontPicCoords[species].y_offset; - data->constSpriteValues.frontElevation = GetElevationValue(species); + data->constSpriteValues.frontElevation = gEnemyMonElevation[species]; data->constSpriteValues.backPicCoords = gMonBackPicCoords[species].y_offset; } @@ -798,7 +754,7 @@ static u8 GetBattlerSpriteFinal_YCustom(u16 species, s8 offset_picCoords, s8 off offset = gMonFrontPicCoords[species].y_offset + offset_picCoords; //Elevation - offset -= GetElevationValue(species) + offset_elevation; + offset -= gEnemyMonElevation[species] + offset_elevation; //Main position y = offset + sBattlerCoords[0][1].y; @@ -830,7 +786,7 @@ static void LoadAndCreateEnemyShadowSpriteCustom(struct PokemonDebugMenu *data, { u8 x, y; bool8 invisible = FALSE; - if (gEnemyMonElevation[species] == 0 && !IsCastformForm(species)) + if (gEnemyMonElevation[species] == 0) invisible = TRUE; LoadCompressedSpriteSheet(&gSpriteSheet_EnemyShadow); LoadSpritePalette(&sSpritePalettes_HealthBoxHealthBar[0]); diff --git a/src/reshow_battle_screen.c b/src/reshow_battle_screen.c index b24db3f87..51f9b9d8a 100644 --- a/src/reshow_battle_screen.c +++ b/src/reshow_battle_screen.c @@ -230,9 +230,7 @@ static void CreateBattlerSprite(u8 battler) gSprites[gBattlerSpriteIds[battler]].data[0] = battler; gSprites[gBattlerSpriteIds[battler]].data[2] = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battler]], MON_DATA_SPECIES); - StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], gBattleMonForms[battler]); - if (gBattleSpritesDataPtr->battlerData[battler].transformSpecies == SPECIES_CASTFORM) - gSprites[gBattlerSpriteIds[battler]].anims = gMonFrontAnimsPtrTable[SPECIES_CASTFORM]; + StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], 0); } else if (gBattleTypeFlags & BATTLE_TYPE_SAFARI && battler == B_POSITION_PLAYER_LEFT) { @@ -268,9 +266,7 @@ static void CreateBattlerSprite(u8 battler) gSprites[gBattlerSpriteIds[battler]].data[0] = battler; gSprites[gBattlerSpriteIds[battler]].data[2] = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battler]], MON_DATA_SPECIES); - StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], gBattleMonForms[battler]); - if (gBattleSpritesDataPtr->battlerData[battler].transformSpecies == SPECIES_CASTFORM) - gSprites[gBattlerSpriteIds[battler]].anims = gMonFrontAnimsPtrTable[SPECIES_CASTFORM]; + StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], 0); } gSprites[gBattlerSpriteIds[battler]].invisible = gBattleSpritesDataPtr->battlerData[battler].invisible; diff --git a/test/ability_flower_gift.c b/test/ability_flower_gift.c index 560706af4..58d4bf2e1 100644 --- a/test/ability_flower_gift.c +++ b/test/ability_flower_gift.c @@ -12,6 +12,8 @@ SINGLE_BATTLE_TEST("Flower Gift transforms Cherrim in harsh sunlight") ABILITY_POPUP(player, ABILITY_FLOWER_GIFT); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); MESSAGE("Cherrim transformed!"); + } THEN { + EXPECT_EQ(player->species, SPECIES_CHERRIM_SUNSHINE); } } @@ -32,6 +34,8 @@ SINGLE_BATTLE_TEST("Flower Gift transforms Cherrim back to normal when weather c ABILITY_POPUP(player, ABILITY_FLOWER_GIFT); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); MESSAGE("Cherrim transformed!"); + } THEN { + EXPECT_EQ(player->species, SPECIES_CHERRIM); } } @@ -52,6 +56,8 @@ SINGLE_BATTLE_TEST("Flower Gift transforms Cherrim back to normal when its abili // back to normal ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); MESSAGE("Cherrim transformed!"); + } THEN { + EXPECT_EQ(player->species, SPECIES_CHERRIM); } } diff --git a/test/ability_forecast.c b/test/ability_forecast.c index 696c0383a..d2d36c1ab 100644 --- a/test/ability_forecast.c +++ b/test/ability_forecast.c @@ -17,6 +17,20 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform in weather from an opponent's m ABILITY_POPUP(player, ABILITY_FORECAST); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); MESSAGE("Castform transformed!"); + } THEN { + switch (move) + { + case MOVE_SUNNY_DAY: + EXPECT_EQ(player->species, SPECIES_CASTFORM_SUNNY); + break; + case MOVE_RAIN_DANCE: + EXPECT_EQ(player->species, SPECIES_CASTFORM_RAINY); + break; + case MOVE_HAIL: + case MOVE_SNOWSCAPE: + EXPECT_EQ(player->species, SPECIES_CASTFORM_SNOWY); + break; + } } } @@ -36,6 +50,20 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform in weather from its own move") ABILITY_POPUP(player, ABILITY_FORECAST); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); MESSAGE("Castform transformed!"); + } THEN { + switch (move) + { + case MOVE_SUNNY_DAY: + EXPECT_EQ(player->species, SPECIES_CASTFORM_SUNNY); + break; + case MOVE_RAIN_DANCE: + EXPECT_EQ(player->species, SPECIES_CASTFORM_RAINY); + break; + case MOVE_HAIL: + case MOVE_SNOWSCAPE: + EXPECT_EQ(player->species, SPECIES_CASTFORM_SNOWY); + break; + } } } @@ -57,6 +85,20 @@ DOUBLE_BATTLE_TEST("Forecast transforms Castform in weather from a partner's mov ABILITY_POPUP(playerLeft, ABILITY_FORECAST); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, playerLeft); MESSAGE("Castform transformed!"); + } THEN { + switch (move) + { + case MOVE_SUNNY_DAY: + EXPECT_EQ(playerLeft->species, SPECIES_CASTFORM_SUNNY); + break; + case MOVE_RAIN_DANCE: + EXPECT_EQ(playerLeft->species, SPECIES_CASTFORM_RAINY); + break; + case MOVE_HAIL: + case MOVE_SNOWSCAPE: + EXPECT_EQ(playerLeft->species, SPECIES_CASTFORM_SNOWY); + break; + } } } @@ -87,6 +129,29 @@ DOUBLE_BATTLE_TEST("Forecast transforms all Castforms present in weather") ABILITY_POPUP(opponentRight, ABILITY_FORECAST); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, opponentRight); MESSAGE("Foe Castform transformed!"); + } THEN { + switch (move) + { + case MOVE_SUNNY_DAY: + EXPECT_EQ(playerLeft->species, SPECIES_CASTFORM_SUNNY); + EXPECT_EQ(playerRight->species, SPECIES_CASTFORM_SUNNY); + EXPECT_EQ(opponentLeft->species, SPECIES_CASTFORM_SUNNY); + EXPECT_EQ(opponentRight->species, SPECIES_CASTFORM_SUNNY); + break; + case MOVE_RAIN_DANCE: + EXPECT_EQ(playerLeft->species, SPECIES_CASTFORM_RAINY); + EXPECT_EQ(playerRight->species, SPECIES_CASTFORM_RAINY); + EXPECT_EQ(opponentLeft->species, SPECIES_CASTFORM_RAINY); + EXPECT_EQ(opponentRight->species, SPECIES_CASTFORM_RAINY); + break; + case MOVE_HAIL: + case MOVE_SNOWSCAPE: + EXPECT_EQ(playerLeft->species, SPECIES_CASTFORM_SNOWY); + EXPECT_EQ(playerRight->species, SPECIES_CASTFORM_SNOWY); + EXPECT_EQ(opponentLeft->species, SPECIES_CASTFORM_SNOWY); + EXPECT_EQ(opponentRight->species, SPECIES_CASTFORM_SNOWY); + break; + } } } @@ -106,6 +171,19 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform in weather from an ability") ABILITY_POPUP(player, ABILITY_FORECAST); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); MESSAGE("Castform transformed!"); + } THEN { + switch (ability) + { + case ABILITY_DROUGHT: + EXPECT_EQ(player->species, SPECIES_CASTFORM_SUNNY); + break; + case ABILITY_DRIZZLE: + EXPECT_EQ(player->species, SPECIES_CASTFORM_RAINY); + break; + case ABILITY_SNOW_WARNING: + EXPECT_EQ(player->species, SPECIES_CASTFORM_SNOWY); + break; + } } } @@ -125,6 +203,16 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform in primal weather") ABILITY_POPUP(player, ABILITY_FORECAST); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); MESSAGE("Castform transformed!"); + } THEN { + switch (ability) + { + case ABILITY_DESOLATE_LAND: + EXPECT_EQ(player->species, SPECIES_CASTFORM_SUNNY); + break; + case ABILITY_PRIMORDIAL_SEA: + EXPECT_EQ(player->species, SPECIES_CASTFORM_RAINY); + break; + } } } @@ -149,6 +237,8 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal when weather exp ABILITY_POPUP(player, ABILITY_FORECAST); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); MESSAGE("Castform transformed!"); + } THEN { + EXPECT_EQ(player->species, SPECIES_CASTFORM); } } @@ -169,11 +259,14 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal when Sandstorm i ABILITY_POPUP(player, ABILITY_FORECAST); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); MESSAGE("Castform transformed!"); + } THEN { + EXPECT_EQ(player->species, SPECIES_CASTFORM); } } SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal under Air Lock") { + KNOWN_FAILING; GIVEN { PLAYER(SPECIES_CASTFORM) { Ability(ABILITY_FORECAST); } OPPONENT(SPECIES_WOBBUFFET); @@ -181,7 +274,6 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal under Air Lock") } WHEN { TURN { MOVE(player, MOVE_RAIN_DANCE); } TURN { SWITCH(opponent, 1); } - TURN { MOVE(opponent, MOVE_CELEBRATE, megaEvolve: TRUE); } } SCENE { // transforms ABILITY_POPUP(player, ABILITY_FORECAST); @@ -192,6 +284,8 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal under Air Lock") ABILITY_POPUP(player, ABILITY_FORECAST); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); MESSAGE("Castform transformed!"); + } THEN { + EXPECT_EQ(player->species, SPECIES_CASTFORM); } } @@ -211,6 +305,8 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform on switch-in") ABILITY_POPUP(player, ABILITY_FORECAST); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); MESSAGE("Castform transformed!"); + } THEN { + EXPECT_EQ(player->species, SPECIES_CASTFORM_RAINY); } } @@ -231,6 +327,8 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform when weather changes") ABILITY_POPUP(player, ABILITY_FORECAST); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); MESSAGE("Castform transformed!"); + } THEN { + EXPECT_EQ(player->species, SPECIES_CASTFORM_SUNNY); } } @@ -251,5 +349,7 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal when its ability // back to normal ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); MESSAGE("Castform transformed!"); + } THEN { + EXPECT_EQ(player->species, SPECIES_CASTFORM); } }