From 2f7116531bd0be2d9cbddc95d177ba75210c6226 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Wed, 20 Nov 2024 11:12:49 +0100 Subject: [PATCH 01/15] Wrong assumtion in dauntless_shield.c (#5692) --- test/battle/ability/dauntless_shield.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/battle/ability/dauntless_shield.c b/test/battle/ability/dauntless_shield.c index ff7cc723ac..0e6adedfd2 100644 --- a/test/battle/ability/dauntless_shield.c +++ b/test/battle/ability/dauntless_shield.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(B_PROTEAN_LIBERO == GEN_9); + ASSUME(B_DAUNTLESS_SHIELD == GEN_9); } SINGLE_BATTLE_TEST("Dauntless Shield raises Defense by one stage") From 596b8b20f4e0e922ccfa361f6a29e2f3e263a4af Mon Sep 17 00:00:00 2001 From: PhallenTree <168426989+PhallenTree@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:35:05 +0000 Subject: [PATCH 02/15] Fixes Neutralizing Gas crashes + adds missing interaction, Regenerator small fix (#5694) --- data/battle_scripts_1.s | 7 +-- src/battle_script_commands.c | 11 +++- test/battle/ability/intimidate.c | 90 +++++++++++++++++++++++++++++++- 3 files changed, 103 insertions(+), 5 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 027c344b2d..a17c54c7e3 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -2401,7 +2401,6 @@ BattleScript_EffectHealingWish:: storehealingwish BS_ATTACKER .if B_HEALING_WISH_SWITCH <= GEN_4 openpartyscreen BS_ATTACKER, BattleScript_EffectHealingWishEnd - switchoutabilities BS_ATTACKER waitstate switchhandleorder BS_ATTACKER, 2 returnatktoball @@ -5764,7 +5763,6 @@ BattleScript_PrintFullBox:: BattleScript_ActionSwitch:: hpthresholds2 BS_ATTACKER - saveattacker printstring STRINGID_RETURNMON jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_PursuitSwitchDmgSetMultihit setmultihit 1 @@ -5782,7 +5780,6 @@ BattleScript_DoSwitchOut:: switchoutabilities BS_ATTACKER updatedynamax waitstate - restoreattacker returnatktoball waitstate drawpartystatussummary BS_ATTACKER @@ -9602,7 +9599,9 @@ BattleScript_EjectButtonActivates:: removeitem BS_SCRIPTING makeinvisible BS_SCRIPTING openpartyscreen BS_SCRIPTING, BattleScript_EjectButtonEnd + copybyte sSAVED_BATTLER, sBATTLER switchoutabilities BS_SCRIPTING + copybyte sBATTLER, sSAVED_BATTLER waitstate switchhandleorder BS_SCRIPTING 0x2 returntoball BS_SCRIPTING, FALSE @@ -9699,6 +9698,7 @@ BattleScript_PastelVeilEnd: end3 BattleScript_NeutralizingGasExits:: + saveattacker savetarget pause B_WAIT_TIME_SHORT printstring STRINGID_NEUTRALIZINGGASOVER @@ -9708,6 +9708,7 @@ BattleScript_NeutralizingGasExitsLoop: switchinabilities BS_TARGET addbyte gBattlerTarget, 1 jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_NeutralizingGasExitsLoop + restoreattacker restoretarget return diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index c373778b68..b1dbcc6106 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3976,6 +3976,15 @@ static void Cmd_tryfaintmon(void) } else { + if (gBattleMons[battler].ability == ABILITY_NEUTRALIZING_GAS + && !(gAbsentBattlerFlags & (1u << battler)) + && !IsBattlerAlive(battler)) + { + gBattleMons[battler].ability = ABILITY_NONE; + BattleScriptPush(gBattlescriptCurrInstr); + gBattlescriptCurrInstr = BattleScript_NeutralizingGasExits; + return; + } if (cmd->battler == BS_ATTACKER) { destinyBondBattler = gBattlerTarget; @@ -14763,7 +14772,7 @@ static void Cmd_switchoutabilities(void) MarkBattlerForControllerExec(battler); break; case ABILITY_REGENERATOR: - gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 3; + gBattleMoveDamage = GetNonDynamaxMaxHP(battler) / 3; gBattleMoveDamage += gBattleMons[battler].hp; if (gBattleMoveDamage > gBattleMons[battler].maxHP) gBattleMoveDamage = gBattleMons[battler].maxHP; diff --git a/test/battle/ability/intimidate.c b/test/battle/ability/intimidate.c index d2d7bc4af7..a7776dabff 100644 --- a/test/battle/ability/intimidate.c +++ b/test/battle/ability/intimidate.c @@ -246,7 +246,7 @@ DOUBLE_BATTLE_TEST("Intimidate is not going to trigger if a mon switches out thr } } -SINGLE_BATTLE_TEST("Intimidate activates when it's no longer effected by Neutralizing Gas") +SINGLE_BATTLE_TEST("Intimidate activates when it's no longer effected by Neutralizing Gas - switching out") { GIVEN { PLAYER(SPECIES_WEEZING) { Ability(ABILITY_NEUTRALIZING_GAS); } @@ -263,3 +263,91 @@ SINGLE_BATTLE_TEST("Intimidate activates when it's no longer effected by Neutral SEND_IN_MESSAGE("Wobbuffet"); } } + +SINGLE_BATTLE_TEST("Intimidate activates when it's no longer affected by Neutralizing Gas - switching moves") +{ + u32 move; + PARAMETRIZE { move = MOVE_U_TURN; } + PARAMETRIZE { move = MOVE_HEALING_WISH; } + PARAMETRIZE { move = MOVE_BATON_PASS; } + GIVEN { + ASSUME(gMovesInfo[MOVE_U_TURN].effect == EFFECT_HIT_ESCAPE); + ASSUME(gMovesInfo[MOVE_HEALING_WISH].effect == EFFECT_HEALING_WISH); + ASSUME(gMovesInfo[MOVE_BATON_PASS].effect == EFFECT_BATON_PASS); + PLAYER(SPECIES_WEEZING) { Ability(ABILITY_NEUTRALIZING_GAS); } + PLAYER(SPECIES_WOBBUFFET) { HP(1); } + OPPONENT(SPECIES_ARBOK) { Ability(ABILITY_INTIMIDATE); } + } WHEN { + TURN { MOVE(player, move); SEND_OUT(player, 1); } + } SCENE { + ABILITY_POPUP(player, ABILITY_NEUTRALIZING_GAS); + MESSAGE("Neutralizing Gas filled the area!"); + ANIMATION(ANIM_TYPE_MOVE, move, player); + MESSAGE("The effects of Neutralizing Gas wore off!"); + ABILITY_POPUP(opponent, ABILITY_INTIMIDATE); + SEND_IN_MESSAGE("Wobbuffet"); + } THEN { + if (move == MOVE_HEALING_WISH) + EXPECT_EQ(player->hp, player->maxHP); + } +} + +SINGLE_BATTLE_TEST("Intimidate activates when it's no longer affected by Neutralizing Gas - opponent caused switches") +{ + u32 move, item; + PARAMETRIZE { move = MOVE_TACKLE; item = ITEM_EJECT_BUTTON; } + PARAMETRIZE { move = MOVE_GROWL; item = ITEM_EJECT_PACK; } + PARAMETRIZE { move = MOVE_ROAR; item = ITEM_NONE; } + PARAMETRIZE { move = MOVE_DRAGON_TAIL; item = ITEM_NONE; } + GIVEN { + ASSUME(gItemsInfo[ITEM_EJECT_BUTTON].holdEffect == HOLD_EFFECT_EJECT_BUTTON); + ASSUME(gItemsInfo[ITEM_EJECT_PACK].holdEffect == HOLD_EFFECT_EJECT_PACK); + ASSUME(gMovesInfo[MOVE_GROWL].effect == EFFECT_ATTACK_DOWN); + ASSUME(gMovesInfo[MOVE_ROAR].effect == EFFECT_ROAR); + ASSUME(gMovesInfo[MOVE_DRAGON_TAIL].effect == EFFECT_HIT_SWITCH_TARGET); + PLAYER(SPECIES_WEEZING) { Ability(ABILITY_NEUTRALIZING_GAS); Item(item); } + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_ARBOK) { Ability(ABILITY_INTIMIDATE); } + } WHEN { + if (item != ITEM_NONE) { + TURN { MOVE(opponent, move); SEND_OUT(player, 1); } + } else { + TURN { MOVE(opponent, move); } + } + } SCENE { + ABILITY_POPUP(player, ABILITY_NEUTRALIZING_GAS); + MESSAGE("Neutralizing Gas filled the area!"); + ANIMATION(ANIM_TYPE_MOVE, move, opponent); + if (item != ITEM_NONE) + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("The effects of Neutralizing Gas wore off!"); + ABILITY_POPUP(opponent, ABILITY_INTIMIDATE); + if (item != ITEM_NONE) { + SEND_IN_MESSAGE("Wobbuffet"); + } else { + MESSAGE("Wobbuffet was dragged out!"); + } + } +} + +SINGLE_BATTLE_TEST("Intimidate activates when it's no longer affected by Neutralizing Gas - fainted") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_FELL_STINGER].effect == EFFECT_FELL_STINGER); + PLAYER(SPECIES_WEEZING) { Ability(ABILITY_NEUTRALIZING_GAS); HP(1); } + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_ARBOK) { Ability(ABILITY_INTIMIDATE); } + } WHEN { + TURN { MOVE(opponent, MOVE_FELL_STINGER); SEND_OUT(player, 1); } + } SCENE { + ABILITY_POPUP(player, ABILITY_NEUTRALIZING_GAS); + MESSAGE("Neutralizing Gas filled the area!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FELL_STINGER, opponent); + MESSAGE("The effects of Neutralizing Gas wore off!"); + ABILITY_POPUP(opponent, ABILITY_INTIMIDATE); + MESSAGE("Weezing fainted!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + SEND_IN_MESSAGE("Wobbuffet"); + } +} + From ea3cec339ce9d8d7c165f7b1f56118e07595be9f Mon Sep 17 00:00:00 2001 From: hedara90 <90hedara@gmail.com> Date: Sat, 23 Nov 2024 18:06:34 +0100 Subject: [PATCH 03/15] Follower fixes, Melmetal, Patrat, Woobat (#5685) Co-authored-by: Hedara --- graphics/pokemon/melmetal/overworld.png | Bin 2053 -> 1337 bytes .../pokemon/melmetal/overworld_normal.pal | 4 ++-- graphics/pokemon/melmetal/overworld_shiny.pal | 2 +- graphics/pokemon/patrat/overworld.png | Bin 691 -> 618 bytes graphics/pokemon/woobat/overworld.png | Bin 565 -> 563 bytes 5 files changed, 3 insertions(+), 3 deletions(-) diff --git a/graphics/pokemon/melmetal/overworld.png b/graphics/pokemon/melmetal/overworld.png index 4be020a5c6a803fd1e3412ef591fd026585126da..e8097644ad166decd45c160a6cd6556db3d8780e 100644 GIT binary patch delta 1265 zcmVvHod5OW=z zKm+Udf7>Hzv5oO1`R4pBGp#8SyAqeRI}CsAul=>PCAI&VuUkmhj*?@t}tlu&2@z3$SrIH@yHBHm&f$oX^D?*78@e(5s z#RfhT1~B?9qs6WC_&vJGd!$gtgau9kkE4StLiPmM+1FIYV(|BRc!K;Lqs0w`J${ew z^fAR#Q>l?2b`7{18ewFu=#t|2T4Fc0o=iri%M@D6W zi5VDwVgimX2JRX6_~-a)h82apq6UHZ({=_f30OZ|r(C9=6vB)aLi(9X#%5V`eUbem zgY!VR#5pPhmuTD^z}N(NQ4Ip|XJ_DwU;&W~_Zt}!a^Tkw)~fUdP8b*te|Cd625#an z`lghtJRZF?9SmF$OvlQY01eU6kYF&JG?nVCjtxD-bQq1e*0{&_J8+7&uL1~^JTnRG z^B6%O6(ae*6wh4RLk0?SeVC4u_U zjBkjC;;TMc2pmNRj}XXj8Kz14Amc5{WVCn)8nqP;yZE-kTf?1*2s@9~zvC7{5n=2I zTFFcYDKP;ak{x{11P57Z7)F2d;Ze1GVEqoWaYfQ5^ycJexZ_W(+O*gy*=A-{4g~IQSW#d_$b+r@>ON zYGAZ?2g|6+gpx7F5V!`jbaQOina71;b&Af|AT=#MJ7LXY9)51)w|JG0ea@0Go){n_ zLca^O;r)KE1~APRe;N6;hw~hdI}m3I6vM};zos(7nhJjt$J@#{w5<|aARgme@om`Q zlF#Tt`m@9>3Ks@8@u`z*B>evVI)T-sI`E6>4p`$@JdjwOr|a`(tNyKyRQ&zBDC}DG zC%DH=o2jb6&YUR@5;q5{LmnUzumF{?Z2=B37CiVK9}MV(e>lUs4Uh)n0RmaR=I(y# zCeJKpAOyy5&krW!^w41D7arWbA?~-?BRYJ#{!j^Z-#v6#4A@dW!>W6A5|(mmi-ER` zSPX=r&m)`|&}KdD!41&e?u5C+YO(b8StN8PZK--}Mc2?@MCud`SBBo^xhW$k z4^en^5JH#3f6>8r2lmy z5EWkxbPC;H-GCbZU_kogQQzi}l+w>$3~-HgK#IPvj|Ql*9-wIYMsnFnjPS#~j)M0}M)Y3{@nvhW)+8UjWvf(hffwIKjB00000NkvXXu0mjfbeL5} literal 2053 zcmeHH`BM@I7^Q_pP`pBoNKsogGF@*(^B}~tB(dB`$@`$(!mD)GlRU6U)Xcnf3vbP1 z^U9jQ6)MZsOxi3h1+6t*HO+%qgtdQTr#JI`@0T~y8Jsjc9)a0Du6WV<%nZa=C2r-qh5aMQ(U|`|q{6j=8xR z$&u*b;NU=S)SQtd8I zxpP9MW@~0?u}?bTb1a|gQPFD9x$2O;+c~lM=`7BNCO^qSac2B?E`IziP2U`QWM9}< zef!$Y?;pm*9N|*EZ4jbpI?7B5fgYCV%%bGl(*bQ?NI{<+IH>vRdCq>p4K*{XxJE7U zFoHYZdkxiVFWQxved%5JFryRAbfamR8V|X^T70?5c)Ln8p>8}Q|#DZWP6%a zQJ<6$<4J`^CWjkjJdk$0h97IA^+( z8#VWSp|F=m(q}&o6Exn5nd0|qzC$h(@Dt{*#jF5`U)EVYs-cq3+%PD~xyC~&xk6Jl3WQ`mK9X@HBGulyy%4FxUz!)mSK3nEw}AzXE8vlQ(AI2)T; za)NCS()tCHm}HFbUx%8V)#VIUq{Mup{ko9Cfv4s2?pfU;iZw4lMTu{=)*-I`{ADpR6)ZoG|%o z%!!$`Tx;r=e`f(HVR}?G3m-k7e2@?Udan_ynU}o*cZn5%FKSp445L;MyBV4h-3s*G zNKLiINE8?Cgb%$i*`I!31*IdYjLvB1i87T z1)PZSQjk(-)Y1>Axw=W7l{pEAO#K~)1IJ6c8&~*wY{_5(%yNc}H|%54WM#CdWeh`* t-nNWi_xqRUbV973c0Q}+Idc&BN!1MyPwAMwy7je=Jza@}Hhl2q{{V+zb*TUV diff --git a/graphics/pokemon/melmetal/overworld_normal.pal b/graphics/pokemon/melmetal/overworld_normal.pal index 28e4593192..d9b329362b 100644 --- a/graphics/pokemon/melmetal/overworld_normal.pal +++ b/graphics/pokemon/melmetal/overworld_normal.pal @@ -1,7 +1,7 @@ JASC-PAL 0100 16 -255 255 255 +120 255 255 254 235 185 220 220 218 235 192 100 @@ -16,4 +16,4 @@ JASC-PAL 64 64 64 45 43 43 8 8 8 -0 0 0 +255 255 255 diff --git a/graphics/pokemon/melmetal/overworld_shiny.pal b/graphics/pokemon/melmetal/overworld_shiny.pal index 6d1c75c9bb..4f5321a062 100644 --- a/graphics/pokemon/melmetal/overworld_shiny.pal +++ b/graphics/pokemon/melmetal/overworld_shiny.pal @@ -16,4 +16,4 @@ JASC-PAL 64 64 64 45 43 43 8 8 8 -0 0 0 +255 255 255 diff --git a/graphics/pokemon/patrat/overworld.png b/graphics/pokemon/patrat/overworld.png index ea2df04dc1ae62d0fbbdd1068f564c15fa2084f4..8b6a34f19870bd4736d739af3c9e5acab7e74267 100644 GIT binary patch delta 605 zcmV-j0;2u11?mKl7=H)@0001UMu)cm0004VQb$4nuFf3k0000mP)t-sn9!g}Fephd zC;$Keqi-=UE-&UyDE7}z%EF<_!lAX8Ztm{)wU}-I0000000000Gq-fz0005#NklB7q|u|&VQC=#*7&=X3Ur|<0X;O z$LpgU;N$gC9T^M4jjC>2TMj{ReH&;2u zN9Q-huP|`S(B7titHJC!46sNLb$&$KK*)E4PjT$IIolIpoByO4%q;*h;YtM4aZX zQ373IByg?34wFK}A+|GUg{+ay((D?JINe~iKPw!bRbg?cwaEPHzrY9^8B(l(tzECJ zA*_~xh=V>QhEK6BFpC7pV%1(ne}0zSV=F_RKP8k%$$u_^kc0XImumtx=S`(H&8?mi zFa!sd1NovzG;fojm5fdmahaVB(zjV70Vjtw^WHGGI>mt(JHx~Vslc1vXt@>d-0s9` zuA%#P!A;-}FJP`gzh=2nQnK%XgFBs8m-aHyH$k5x)i{@-h=$nqFU^7u zcO4m6iB>y}cppDZfVn%KZp8!i%7y|#Ri00000NkvXXu0mjfw_z5i delta 679 zcmV;Y0$Ba(1hWN@7=Hu<0002CwraKj0004VQb$4nuFf3k00004XF*Lt006O%3;baP z0000dP)t-sn9!hDNJtP65C8xGh@DcSB~OEw6gEiw3$KvJ@7WG`s2f%mi2pgRQU4R&xT*vt_? zW{{$vErA?SZvrqHs%8cYK-hN#?hboy7!0@r=V}JC$!LlNY7Fqw|252IN5y6|onV9B z`&rH4VXhh(>{ZR6?5OzFayp4Ei{9R+uV2ji#D9Rj&gUoj_rPh%%fQ+${l!2G zz9VqD%I98ie6PvZdH(x~xN1cE-R-v@ogmOY|9brev9Y#x%Zx$H(|nmIzS=HYuNLJ? zi!Q4H*)!+*v1(>*!D2SXAZF1(3(3Qlolb;eY1Pr{oZa2sv=0NHuGd9iu7xo|t0rbq zA*?{<;eR}f6Uovr;OOk<=NnYqTBlbZi-W*kuv}93Cqhbr&Sbo{*dSUICXpP?Na8%t zkl;~#agpJd>t_qXlJIzuX%XsOlovAbA6k*q9V*c7I7RZB=C#K8=u!x>qeS>6;ESrg z1`$-8RP={=TJZ;75F2WNk7%pW1dqsf`&5rR$sqn|@VeuJ_5ZKI*e@Qqn(HW?Wpn@l N002ovPDHLkV1n^cL`DDr diff --git a/graphics/pokemon/woobat/overworld.png b/graphics/pokemon/woobat/overworld.png index 1d14a5c43d798ca82fd85c3103b4e524903b5407..18bff8d5c3b0302fea9b089865903cdc11e1ecf1 100644 GIT binary patch delta 476 zcmV<20VDpk1hWK?VSl|zL_t(oh3!_+a)clZ1On0e{~z3hC{ReiK6K_f!+H;Ti)(fR zsB;?|8yg!Np94?FKZf^#4w#Gpn6Yl1z@PFyhQPl`jgS)R3?e)U&?5lVVTHFUu=yAI zTz`h?zyqd~R2KRFCjoC5t-PUc^KbNhc%T~~`xp>a18fYTCV!Bx`$4csXu`kICwqJ_ zuRh?huQ|wi2}=TWKDG)QUYlSO{*}Hzj^L$!%|Mx8+B&BHND(D~$R;VTpW~=?Ek9U5 zzNggJ@uJ`IgT8a;7aUYOM#DgLudf2|G5TMWpSDj`M5yR!%^AUxf! zlyCx^R640#dVd2XKN?^-pt|A#5<|ZX`7Uhuegi`mQ=la>%317MvWz7!b%VSa}!> zKojx67yU^C?i^4rPbL`6K3YyR&S(K#kq%Jw^DPbEOI57+m3}n<#^*v#P9`Yt3YG#G z9~*Z;g;xzs_?7+*^F`~bedAMNg-*O*-|4`$`#>U3R$KV^toDLVo S3Pb1s0000}4#t-PYI^KbO6E07J4eRPPT0XBwE6Msm*`$e!wXu`kICwqJ_ zFJ7S7mmDO$fKLMSeQXsryfk1F{*}Hx4rg=yl7VNyr2CluBSp*scs5CS{a#0{Yx%(f z@;Og^9iR1Ee$Y22o^Vj@=oJIiy?hsd_1?OJW1ufX`jlD2ht2}#Omj#+=iONZ7RWrE zE|d@fB9%@mmw()VoF6Sv98g{UIM0(~=x;+l3md+lfW)Wl5>VPKtgjHafyni9qs0c? z1D0AT8!-0rkqV6d8uYn9Xm}6|FrP8;`Zv@Et*Q2vSBVvR*}wjNdl_xMGr4@1`v81HjT;*q8yg>kA53iy UQ&T@M2LJ#707*qoM6N<$f=&F>=>Px# From 2baea35414f2846f1fe745aa93fb9b6f69da0d98 Mon Sep 17 00:00:00 2001 From: hedara90 <90hedara@gmail.com> Date: Sun, 24 Nov 2024 14:38:56 +0100 Subject: [PATCH 04/15] Fixed Farfetch'd overworld sprite (#5711) Co-authored-by: Hedara --- graphics/pokemon/farfetchd/overworld.png | Bin 686 -> 813 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/graphics/pokemon/farfetchd/overworld.png b/graphics/pokemon/farfetchd/overworld.png index 46aec0976444a8250ad6fa9446a09e6ac95d35b7..63d29215b72960dd3c0d269481a07ab5f333a17f 100644 GIT binary patch delta 737 zcmV<70v`RY1+4}yiBL{Q4GJ0x0000DNk~Le000310000W2m=5B0Lph()&Kwi0drDE zLIAGL9O;owT7LqMNkl#RFdU6HYq^r2`ndGOH+ z-HX6GzFbzUSg~ToiWMtXtk6g)y~W=z@J~a#%QjK(gkTKy&q5YwRPjJpj@bVLW5p58cpL3nC5wO7@;erjGaS6-MIp?Ch0FQ`be(FO@ ze1eyWKOsLBC=-J*C(6GR7ya)YGuk$a__!gC0LT2vkpU&bbAHq>NZ^E7S^9&cLzZaFw`RInK7Y7p5K*dClnd~G!mUH$?IyJ*{|G4G zZVb7$o!AD=nsg1IkPm^633p#t6QA5S$TVsOiGcUri0elp+S(ndKlnWXJ_Is%YScM- zU$tcIKe%gveyZY3R+w^j9l9JKa{@Xe z;^?Vr;QUfqeX~5KlND( zpWs{I&*g~ejWag>uZP)Av26Ie{jpd=HZBo!29rcHw}1P1j-x2uSv#TUE#qM z35aEr<}g>6kN6ZQ$0Xeihwna@8Jq#TYT&^YgIH_bcx_8yf5fN2jHMQ|Cg9`bh5^K( z4|ye@D+aNaT8a1A+JJyhfvm5JLT$?68@GlOaLfm1s+hjGW)KldA?9TCFW@2&vTT$T zQ4OHWhrnY()XzQSlj{aWBWECyabNH`$Obp8*fMBGElT-=s|NU27AG1*Zr*30wc*g* z;{$741h!5{f4zZm44hp3mP~+iwB@3jhEBNkvXXu0mjfNeB?l From 632ef149e0773fd9b5385db244cd820c32bc465e Mon Sep 17 00:00:00 2001 From: cawtds <38510667+cawtds@users.noreply.github.com> Date: Sun, 24 Nov 2024 20:42:14 +0100 Subject: [PATCH 05/15] Handle showdowns apostrophe the same way as ASCII apostrophe (#5712) --- tools/trainerproc/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/trainerproc/main.c b/tools/trainerproc/main.c index b410e810b0..8b939a955f 100644 --- a/tools/trainerproc/main.c +++ b/tools/trainerproc/main.c @@ -1545,6 +1545,7 @@ static void fprint_species(FILE *f, const char *prefix, struct String s) static const unsigned char *male = (unsigned char *)u8"♂"; static const unsigned char *female = (unsigned char *)u8"♀"; static const unsigned char *e_diacritic = (unsigned char *)u8"é"; + static const unsigned char *right_single_quotation_mark = (unsigned char *)u8"’"; for (int i = 0; i < s.string_n; i++) { unsigned char c = s.string[i]; @@ -1562,7 +1563,7 @@ static void fprint_species(FILE *f, const char *prefix, struct String s) underscore = false; fputc(c - 'a' + 'A', f); } - else if (c == '\'' || c == '%') + else if (c == '\'' || c == '%' || is_utf8_character(s, &i, right_single_quotation_mark)) { // Do nothing. } From d924b361e64a1a171c18abc1bb9b48591c55c434 Mon Sep 17 00:00:00 2001 From: hedara90 <90hedara@gmail.com> Date: Sun, 24 Nov 2024 23:04:43 +0100 Subject: [PATCH 06/15] Added Minimize interaction to Supercell Slam (#5713) Co-authored-by: Hedara --- src/data/moves_info.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/data/moves_info.h b/src/data/moves_info.h index 4eee90a802..3a6837dd2b 100644 --- a/src/data/moves_info.h +++ b/src/data/moves_info.h @@ -20605,6 +20605,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .priority = 0, .category = DAMAGE_CATEGORY_PHYSICAL, .makesContact = TRUE, + .minimizeDoubleDamage = TRUE, .battleAnimScript = Move_SUPERCELL_SLAM, }, From b1231269393e9135f87d515e69622666630e3165 Mon Sep 17 00:00:00 2001 From: Pawkkie <61265402+Pawkkie@users.noreply.github.com> Date: Wed, 27 Nov 2024 13:59:39 -0500 Subject: [PATCH 07/15] Update README.md to link to INSTALL.md (#5720) --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index facd5f5626..5330e40981 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,16 @@ pokeemerald-expansion is a decomp hack base project based off pret's [pokeemerald](https://github.com/pret/pokeemerald) decompilation project. It's recommended that any new projects that plan on using it, to clone this repository instead of pret's vanilla repository, as we regurlarly incorporate pret's documentation changes. This is ***NOT*** a standalone romhack, and as such, most features will be unavailable and/or unbalanced if played as is. +## Using pokeemerald-expansion + If you use pokeemerald-expansion in your hack, please add RHH (Rom Hacking Hideout) to your credits list. Optionally, you can list the version used, so it can help players know what features to expect. You can phrase it as the following: ``` Based off RHH's pokeemerald-expansion 1.9.3 https://github.com/rh-hideout/pokeemerald-expansion/ ``` +Please follow the instructions in `INSTALL.md` to get pokeemerald-expansion set up on your machine. + ## What features are included? - ***IMPORTANT*❗❗ Read through these to learn what features you can toggle**: - [Battle configurations](https://github.com/rh-hideout/pokeemerald-expansion/blob/master/include/config/battle.h) From 6b170d70f1fb87728d9916b67ddf173a5409a4c8 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Wed, 27 Nov 2024 20:05:11 +0100 Subject: [PATCH 08/15] Fixes Red Card / Eject Pack interaction (#5724) --- include/constants/battle_script_commands.h | 2 +- test/battle/form_change/primal_reversion.c | 16 ++++++++++++++++ test/battle/hold_effect/red_card.c | 22 ++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index a8daf8841b..5f3feefa31 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -300,9 +300,9 @@ enum MoveEndEffects MOVEEND_RECOIL, MOVEEND_ITEM_EFFECTS_ATTACKER, MOVEEND_MAGICIAN, // Occurs after final multi-hit strike, and after other items/abilities would activate + MOVEEND_RED_CARD, // Red Card triggers before Eject Pack MOVEEND_EJECT_ITEMS, MOVEEND_WHITE_HERB, - MOVEEND_RED_CARD, MOVEEND_LIFEORB_SHELLBELL, // Includes shell bell, throat spray, etc MOVEEND_CHANGED_ITEMS, MOVEEND_PICKPOCKET, diff --git a/test/battle/form_change/primal_reversion.c b/test/battle/form_change/primal_reversion.c index df19a1d0d6..4b9e019b5b 100644 --- a/test/battle/form_change/primal_reversion.c +++ b/test/battle/form_change/primal_reversion.c @@ -332,3 +332,19 @@ DOUBLE_BATTLE_TEST("Primal reversion and other switch-in effects trigger for all EXPECT_EQ(opponentRight->statStages[STAT_SPEED], DEFAULT_STAT_STAGE - 1); } } + +SINGLE_BATTLE_TEST("111") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_TACKLE].power != 0); + PLAYER(SPECIES_GROUDON) { HP(1); Item(ITEM_RED_ORB); } + PLAYER(SPECIES_WOBBUFFET) + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); SEND_OUT(player, 1); } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, player); + MESSAGE("Groudon's Primal Reversion! It reverted to its primal form!"); + MESSAGE("Groudon fainted!"); + } +} diff --git a/test/battle/hold_effect/red_card.c b/test/battle/hold_effect/red_card.c index 3209549de1..7cdbba2412 100644 --- a/test/battle/hold_effect/red_card.c +++ b/test/battle/hold_effect/red_card.c @@ -467,4 +467,26 @@ SINGLE_BATTLE_TEST("Red Card prevents Emergency Exit activation when triggered") } } +SINGLE_BATTLE_TEST("Red Card activates before Eject Pack") +{ + GIVEN { + ASSUME(MoveHasAdditionalEffectSelf(MOVE_OVERHEAT, MOVE_EFFECT_SP_ATK_MINUS_2) == TRUE); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_EJECT_PACK); } + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); } + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(player, MOVE_OVERHEAT); MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_OVERHEAT, player); + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Wobbuffet is switched out with the Eject Button!"); + } + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent); + MESSAGE("Foe Wobbuffet held up its Red Card against Wobbuffet!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + } +} + // SINGLE_BATTLE_TEST("Red Card activates but fails if the attacker has Dynamaxed") From 846427ac432942fb743850f06fcb9569bf26df5a Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Wed, 27 Nov 2024 20:08:38 +0100 Subject: [PATCH 09/15] Fixes gems triggering on confusion damage (#5723) --- src/battle_script_commands.c | 1 + test/battle/status2/confusion.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index b1dbcc6106..2ca3cd52f8 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2119,6 +2119,7 @@ END: } if (gSpecialStatuses[gBattlerAttacker].gemBoost && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && !(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && gBattleMons[gBattlerAttacker].item && gMovesInfo[gCurrentMove].effect != EFFECT_PLEDGE && gCurrentMove != MOVE_STRUGGLE) diff --git a/test/battle/status2/confusion.c b/test/battle/status2/confusion.c index 3c86e5d555..03a17bcfeb 100644 --- a/test/battle/status2/confusion.c +++ b/test/battle/status2/confusion.c @@ -26,3 +26,21 @@ SINGLE_BATTLE_TEST("Confusion adds a 50/33% chance to hit self with 40 power") EXPECT_EQ(damage[0], damage[1]); } } + +SINGLE_BATTLE_TEST("Confusion self hit does not consume Gems") +{ + PASSES_RANDOMLY(B_CONFUSION_SELF_DMG_CHANCE >= GEN_7 ? 33 : 50, 100, RNG_CONFUSION); + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_NORMAL_GEM); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_CONFUSE_RAY); MOVE(player, MOVE_TACKLE); } + } SCENE { + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Normal Gem strengthened Wobbuffet's power!"); + } + MESSAGE("It hurt itself in its confusion!"); + } +} From 174177a4d57d102bc181c02b2422d1b88a55b1dd Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Thu, 28 Nov 2024 11:17:48 +0100 Subject: [PATCH 10/15] Fixes minor move desc errors (#5728) --- src/data/moves_info.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/moves_info.h b/src/data/moves_info.h index 3a6837dd2b..df12555c5b 100644 --- a/src/data/moves_info.h +++ b/src/data/moves_info.h @@ -12220,7 +12220,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = { .name = COMPOUND_STRING("Coil"), .description = COMPOUND_STRING( - "Coils up to raise Attack\n" + "Coils up to raise Attack,\n" "Defense and Accuracy."), .effect = EFFECT_COIL, .power = 0, @@ -17336,7 +17336,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .name = COMPOUND_STRING("Octolock"), .description = COMPOUND_STRING( "Traps the foe to lower Def\n" - "and Sp. Def fall each turn."), + "and Sp. Def each turn."), .effect = EFFECT_OCTOLOCK, .power = 0, .type = TYPE_FIGHTING, From 88cdd8bdfb901d22149ba027e17eadebb92b2839 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Thu, 28 Nov 2024 11:22:32 +0100 Subject: [PATCH 11/15] Fixes Kee Maranga and Enigma Berry (#5727) --- include/battle.h | 2 +- src/battle_util.c | 4 ++-- test/battle/hold_effect/enigma_berry.c | 16 ++++++++++++++++ test/battle/hold_effect/kee_berry.c | 16 ++++++++++++++++ test/battle/hold_effect/maranga_berry.c | 16 ++++++++++++++++ 5 files changed, 51 insertions(+), 3 deletions(-) diff --git a/include/battle.h b/include/battle.h index fda1639fa5..20afe876ca 100644 --- a/include/battle.h +++ b/include/battle.h @@ -831,7 +831,7 @@ STATIC_ASSERT(sizeof(((struct BattleStruct *)0)->palaceFlags) * 8 >= MAX_BATTLER #define BATTLER_MAX_HP(battlerId)(gBattleMons[battlerId].hp == gBattleMons[battlerId].maxHP) #define TARGET_TURN_DAMAGED ((gSpecialStatuses[gBattlerTarget].physicalDmg != 0 || gSpecialStatuses[gBattlerTarget].specialDmg != 0) || (gBattleStruct->enduredDamage & gBitTable[gBattlerTarget])) -#define BATTLER_TURN_DAMAGED(battlerId) ((gSpecialStatuses[battlerId].physicalDmg != 0 || gSpecialStatuses[battlerId].specialDmg != 0) || (gBattleStruct->enduredDamage & gBitTable[battler])) +#define BATTLER_TURN_DAMAGED(battlerId) ((gSpecialStatuses[battlerId].physicalDmg != 0 || gSpecialStatuses[battlerId].specialDmg != 0) || (gBattleStruct->enduredDamage & gBitTable[battlerId])) #define IS_BATTLER_OF_TYPE(battlerId, type)((GetBattlerType(battlerId, 0, FALSE) == type || GetBattlerType(battlerId, 1, FALSE) == type || (GetBattlerType(battlerId, 2, FALSE) != TYPE_MYSTERY && GetBattlerType(battlerId, 2, FALSE) == type))) #define IS_BATTLER_OF_BASE_TYPE(battlerId, type)((GetBattlerType(battlerId, 0, TRUE) == type || GetBattlerType(battlerId, 1, TRUE) == type || (GetBattlerType(battlerId, 2, TRUE) != TYPE_MYSTERY && GetBattlerType(battlerId, 2, TRUE) == type))) diff --git a/src/battle_util.c b/src/battle_util.c index de0d3e7cc6..dc98c278e3 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -6831,7 +6831,7 @@ static u8 TrySetEnigmaBerry(u32 battler) { if (IsBattlerAlive(battler) && !DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove) - && ((TARGET_TURN_DAMAGED && gMoveResultFlags & MOVE_RESULT_SUPER_EFFECTIVE) || gBattleScripting.overrideBerryRequirements) + && ((BATTLER_TURN_DAMAGED(battler) && gMoveResultFlags & MOVE_RESULT_SUPER_EFFECTIVE) || gBattleScripting.overrideBerryRequirements) && !(gBattleScripting.overrideBerryRequirements && gBattleMons[battler].hp == gBattleMons[battler].maxHP) && (B_HEAL_BLOCKING < GEN_5 || !(gStatuses3[battler] & STATUS3_HEAL_BLOCK))) { @@ -6855,7 +6855,7 @@ static u8 DamagedStatBoostBerryEffect(u32 battler, u8 statId, u8 category) || (!DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove) && GetBattleMoveCategory(gCurrentMove) == category && battler != gBattlerAttacker - && TARGET_TURN_DAMAGED)) + && BATTLER_TURN_DAMAGED(battler))) ) { BufferStatChange(battler, statId, STRINGID_STATROSE); diff --git a/test/battle/hold_effect/enigma_berry.c b/test/battle/hold_effect/enigma_berry.c index c678b178d3..16a598b272 100644 --- a/test/battle/hold_effect/enigma_berry.c +++ b/test/battle/hold_effect/enigma_berry.c @@ -58,3 +58,19 @@ SINGLE_BATTLE_TEST("Enigma Berry does nothing if Heal Block applies") } } } + +DOUBLE_BATTLE_TEST("Enigma Berry doesn't trigger if partner was hit") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT) { Item(ITEM_ENIGMA_BERRY); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_TACKLE, target: opponentLeft); } + } SCENE { + NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponentRight); + } THEN { + EXPECT(opponentRight->item == ITEM_ENIGMA_BERRY); + } +} diff --git a/test/battle/hold_effect/kee_berry.c b/test/battle/hold_effect/kee_berry.c index ace35a824c..35a4e6fcd5 100644 --- a/test/battle/hold_effect/kee_berry.c +++ b/test/battle/hold_effect/kee_berry.c @@ -73,3 +73,19 @@ SINGLE_BATTLE_TEST("Kee Berry doesn't trigger if the item hold user used a physi EXPECT_EQ(player->statStages[STAT_DEF], DEFAULT_STAT_STAGE); } } + +DOUBLE_BATTLE_TEST("Kee Berry doesn't trigger if partner was hit") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT) { Item(ITEM_KEE_BERRY); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_TACKLE, target: opponentLeft); } + } SCENE { + NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponentRight); + } THEN { + EXPECT(opponentRight->item == ITEM_KEE_BERRY); + } +} diff --git a/test/battle/hold_effect/maranga_berry.c b/test/battle/hold_effect/maranga_berry.c index a7b90bd9b3..036b2a51c0 100644 --- a/test/battle/hold_effect/maranga_berry.c +++ b/test/battle/hold_effect/maranga_berry.c @@ -73,3 +73,19 @@ SINGLE_BATTLE_TEST("Maranga Berry doesn't trigger if the item hold user used a s EXPECT_EQ(player->statStages[STAT_SPDEF], DEFAULT_STAT_STAGE); } } + +DOUBLE_BATTLE_TEST("Maranga Berry doesn't trigger if partner was hit") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT) { Item(ITEM_MARANGA_BERRY); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_TACKLE, target: opponentLeft); } + } SCENE { + NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponentRight); + } THEN { + EXPECT(opponentRight->item == ITEM_MARANGA_BERRY); + } +} From 0cd0e0b00567c87f649ba9111f0092d6bb5fd9ea Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Thu, 28 Nov 2024 11:24:38 +0100 Subject: [PATCH 12/15] Fixes Blunder Policy (#5722) --- src/battle_script_commands.c | 9 +++- test/battle/hold_effect/blunder_policy.c | 67 ++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 test/battle/hold_effect/blunder_policy.c diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 2ca3cd52f8..7a9409d4d4 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1767,8 +1767,6 @@ static void AccuracyCheck(bool32 recalcDragonDarts, const u8 *nextInstr, const u if (!RandomPercentage(RNG_ACCURACY, accuracy)) { gMoveResultFlags |= MOVE_RESULT_MISSED; - if (holdEffectAtk == HOLD_EFFECT_BLUNDER_POLICY) - gBattleStruct->blunderPolicy = TRUE; // Only activates from missing through acc/evasion checks if (gMovesInfo[gCurrentMove].effect == EFFECT_DRAGON_DARTS && !recalcDragonDarts // So we don't jump back and forth between targets @@ -2532,6 +2530,13 @@ static void Cmd_resultmessage(void) return; } + if (gMoveResultFlags & MOVE_RESULT_MISSED && !(gMoveResultFlags & (MOVE_RESULT_DOESNT_AFFECT_FOE | MOVE_RESULT_FAILED))) + { + if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_BLUNDER_POLICY + && !IsBattlerProtected(gBattlerAttacker, gBattlerTarget, gCurrentMove)) + gBattleStruct->blunderPolicy = TRUE; // Only activates from missing through acc/evasion checks + } + if (gMoveResultFlags & MOVE_RESULT_MISSED && (!(gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE) || gBattleCommunication[MISS_TYPE] > B_MSG_AVOIDED_ATK)) { if (gBattleCommunication[MISS_TYPE] > B_MSG_AVOIDED_ATK) // Wonder Guard or Levitate - show the ability pop-up diff --git a/test/battle/hold_effect/blunder_policy.c b/test/battle/hold_effect/blunder_policy.c new file mode 100644 index 0000000000..552ad2f6fb --- /dev/null +++ b/test/battle/hold_effect/blunder_policy.c @@ -0,0 +1,67 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(gItemsInfo[ITEM_BLUNDER_POLICY].holdEffect == HOLD_EFFECT_BLUNDER_POLICY); +} + +SINGLE_BATTLE_TEST("Blunder Policy raises the users speed by 2 stages if the user misses") +{ + PASSES_RANDOMLY(3, 10, RNG_ACCURACY); + GIVEN { + ASSUME(gMovesInfo[MOVE_FOCUS_BLAST].accuracy == 70); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_BLUNDER_POLICY); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_FOCUS_BLAST); } + } SCENE { + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_FOCUS_BLAST, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + } THEN { + EXPECT(player->item == ITEM_NONE); + EXPECT_EQ(player->statStages[STAT_SPEED], DEFAULT_STAT_STAGE + 2); + } +} + + +SINGLE_BATTLE_TEST("Blunder Policy will never trigger if the move fails due to an immunity") +{ + PASSES_RANDOMLY(10, 10, RNG_ACCURACY); + GIVEN { + ASSUME(gMovesInfo[MOVE_FOCUS_BLAST].accuracy == 70); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_BLUNDER_POLICY); } + OPPONENT(SPECIES_GASTLY); + } WHEN { + TURN { MOVE(player, MOVE_FOCUS_BLAST); } + } SCENE { + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FOCUS_BLAST, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + } + } THEN { + EXPECT(player->item == ITEM_BLUNDER_POLICY); + EXPECT_EQ(player->statStages[STAT_SPEED], DEFAULT_STAT_STAGE); + } +} + +SINGLE_BATTLE_TEST("Blunder Policy will never trigger if the move fails due to Protect") +{ + PASSES_RANDOMLY(10, 10, RNG_ACCURACY); + GIVEN { + ASSUME(gMovesInfo[MOVE_FOCUS_BLAST].accuracy == 70); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_BLUNDER_POLICY); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_PROTECT); MOVE(player, MOVE_FOCUS_BLAST); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_PROTECT, opponent); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FOCUS_BLAST, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + } + } THEN { + EXPECT(player->item == ITEM_BLUNDER_POLICY); + EXPECT_EQ(player->statStages[STAT_SPEED], DEFAULT_STAT_STAGE); + } +} From c4fe97011e5269e83d91cd710c22501f1e86bc3c Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Thu, 28 Nov 2024 22:51:34 +0100 Subject: [PATCH 13/15] Fix Floral Healing anim (#5733) --- data/battle_anim_scripts.s | 4 ++-- test/battle/form_change/primal_reversion.c | 16 ---------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 68f804e8ed..55abebbbf0 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -10103,7 +10103,6 @@ Move_FLORAL_HEALING:: loadspritegfx ANIM_TAG_ORBS @circles loadspritegfx ANIM_TAG_PINK_PETAL @pink particles monbg ANIM_ATTACKER - monbg ANIM_TARGET playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER call CIRCLES_LEAVES call CIRCLES_LEAVES @@ -10111,6 +10110,7 @@ Move_FLORAL_HEALING:: panse SE_M_COMET_PUNCH, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 0x2, 0x0 playsewithpan SE_M_TWISTER, 0x0 createsprite gSweetScentPetalSpriteTemplate, ANIM_ATTACKER, 2, 0x46, 0x1, 0x40 + clearmonbg ANIM_ATTACKER delay 0x2 createsprite gFloralHealingWindLeavesTemplate, ANIM_ATTACKER, 2, 0x3c, 0x0, 0x40 delay 0x2 @@ -10133,6 +10133,7 @@ Move_FLORAL_HEALING:: createsprite gSweetScentPetalSpriteTemplate, ANIM_ATTACKER, 2, 0x55, 0x0, 0x78 delay 0x2 loopsewithpan SE_M_POISON_POWDER, SOUND_PAN_TARGET, 0x12, 0xa + monbg ANIM_TARGET call FloralHealingSpores call FloralHealingSpores call FloralHealingSpores @@ -10143,7 +10144,6 @@ Move_FLORAL_HEALING:: createsprite gGrantingStarsSpriteTemplate, ANIM_ATTACKER, 16, 0xc, 0xfffb, 0x1, 0x0, 0x20, 0x3c, 0x1 waitforvisualfinish clearmonbg ANIM_TARGET - clearmonbg ANIM_ATTACKER end FloralHealingSpores: createsprite gFloralHealingFlowerTemplate, ANIM_ATTACKER, 2, 0x0, 0xffec, 0x55, 0x50, 0x0 diff --git a/test/battle/form_change/primal_reversion.c b/test/battle/form_change/primal_reversion.c index 4b9e019b5b..df19a1d0d6 100644 --- a/test/battle/form_change/primal_reversion.c +++ b/test/battle/form_change/primal_reversion.c @@ -332,19 +332,3 @@ DOUBLE_BATTLE_TEST("Primal reversion and other switch-in effects trigger for all EXPECT_EQ(opponentRight->statStages[STAT_SPEED], DEFAULT_STAT_STAGE - 1); } } - -SINGLE_BATTLE_TEST("111") -{ - GIVEN { - ASSUME(gMovesInfo[MOVE_TACKLE].power != 0); - PLAYER(SPECIES_GROUDON) { HP(1); Item(ITEM_RED_ORB); } - PLAYER(SPECIES_WOBBUFFET) - OPPONENT(SPECIES_WOBBUFFET); - } WHEN { - TURN { MOVE(opponent, MOVE_TACKLE); SEND_OUT(player, 1); } - } SCENE { - ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, player); - MESSAGE("Groudon's Primal Reversion! It reverted to its primal form!"); - MESSAGE("Groudon fainted!"); - } -} From 0f4b59898419b4ae2167ab7a14fb7c2e92daded3 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Thu, 28 Nov 2024 23:21:42 +0100 Subject: [PATCH 14/15] Fixes Aegislash not reverting back (#5734) --- include/constants/form_change_types.h | 4 ++++ src/battle_script_commands.c | 5 ++--- src/battle_util.c | 4 ++++ src/data/pokemon/form_change_tables.h | 8 +++++--- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/include/constants/form_change_types.h b/include/constants/form_change_types.h index 74bc16cf2f..79a8a4cee7 100644 --- a/include/constants/form_change_types.h +++ b/include/constants/form_change_types.h @@ -134,4 +134,8 @@ // param1: amount of days #define FORM_CHANGE_DAYS_PASSED 23 +// Form change for Aegislash +#define FORM_CHANGE_BATTLE_ATTACK 24 +#define FORM_CHANGE_BATTLE_KINGS_SHIELD 25 + #endif // GUARD_CONSTANTS_FORM_CHANGE_TYPES_H diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 7a9409d4d4..f8619880d0 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1127,7 +1127,6 @@ static bool32 NoTargetPresent(u8 battler, u32 move) return FALSE; } -// TODO: Convert this to a proper FORM_CHANGE type. static bool32 TryAegiFormChange(void) { // Only Aegislash with Stance Change can transform, transformed mons cannot. @@ -1142,12 +1141,12 @@ static bool32 TryAegiFormChange(void) case SPECIES_AEGISLASH_SHIELD: // Shield -> Blade if (IS_MOVE_STATUS(gCurrentMove)) return FALSE; - gBattleMons[gBattlerAttacker].species = SPECIES_AEGISLASH_BLADE; + TryBattleFormChange(gBattlerAttacker, FORM_CHANGE_BATTLE_ATTACK); break; case SPECIES_AEGISLASH_BLADE: // Blade -> Shield if (gCurrentMove != MOVE_KINGS_SHIELD) return FALSE; - gBattleMons[gBattlerAttacker].species = SPECIES_AEGISLASH_SHIELD; + TryBattleFormChange(gBattlerAttacker, FORM_CHANGE_BATTLE_KINGS_SHIELD); break; } diff --git a/src/battle_util.c b/src/battle_util.c index dc98c278e3..7e0970bcab 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -10848,6 +10848,10 @@ u16 GetBattleFormChangeTargetSpecies(u32 battler, u16 method) if (GetBattlerTeraType(battler) == formChanges[i].param1) targetSpecies = formChanges[i].targetSpecies; break; + case FORM_CHANGE_BATTLE_ATTACK: + case FORM_CHANGE_BATTLE_KINGS_SHIELD: + targetSpecies = formChanges[i].targetSpecies; + break; } } } diff --git a/src/data/pokemon/form_change_tables.h b/src/data/pokemon/form_change_tables.h index 52f888a55b..153dde2546 100644 --- a/src/data/pokemon/form_change_tables.h +++ b/src/data/pokemon/form_change_tables.h @@ -789,9 +789,11 @@ static const struct FormChange sFurfrouFormChangeTable[] = { #if P_FAMILY_HONEDGE static const struct FormChange sAegislashFormChangeTable[] = { - {FORM_CHANGE_BATTLE_SWITCH, SPECIES_AEGISLASH_SHIELD}, - {FORM_CHANGE_FAINT, SPECIES_AEGISLASH_SHIELD}, - {FORM_CHANGE_END_BATTLE, SPECIES_AEGISLASH_SHIELD}, + {FORM_CHANGE_BATTLE_ATTACK, SPECIES_AEGISLASH_BLADE}, + {FORM_CHANGE_BATTLE_KINGS_SHIELD, SPECIES_AEGISLASH_SHIELD}, + {FORM_CHANGE_BATTLE_SWITCH, SPECIES_AEGISLASH_SHIELD}, + {FORM_CHANGE_FAINT, SPECIES_AEGISLASH_SHIELD}, + {FORM_CHANGE_END_BATTLE, SPECIES_AEGISLASH_SHIELD}, {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_HONEDGE From 320c015565854c982da8a368db3d3f84ec475710 Mon Sep 17 00:00:00 2001 From: Hedara Date: Fri, 29 Nov 2024 11:58:40 +0100 Subject: [PATCH 15/15] Fixed test messages --- test/battle/ability/intimidate.c | 12 ++++++------ test/battle/hold_effect/red_card.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/battle/ability/intimidate.c b/test/battle/ability/intimidate.c index f3b1f05c0c..e0f97d5bda 100644 --- a/test/battle/ability/intimidate.c +++ b/test/battle/ability/intimidate.c @@ -281,9 +281,9 @@ SINGLE_BATTLE_TEST("Intimidate activates when it's no longer affected by Neutral TURN { MOVE(player, move); SEND_OUT(player, 1); } } SCENE { ABILITY_POPUP(player, ABILITY_NEUTRALIZING_GAS); - MESSAGE("Neutralizing Gas filled the area!"); + MESSAGE("Neutralizing gas filled the area!"); ANIMATION(ANIM_TYPE_MOVE, move, player); - MESSAGE("The effects of Neutralizing Gas wore off!"); + MESSAGE("The effects of the neutralizing gas wore off!"); ABILITY_POPUP(opponent, ABILITY_INTIMIDATE); SEND_IN_MESSAGE("Wobbuffet"); } THEN { @@ -316,11 +316,11 @@ SINGLE_BATTLE_TEST("Intimidate activates when it's no longer affected by Neutral } } SCENE { ABILITY_POPUP(player, ABILITY_NEUTRALIZING_GAS); - MESSAGE("Neutralizing Gas filled the area!"); + MESSAGE("Neutralizing gas filled the area!"); ANIMATION(ANIM_TYPE_MOVE, move, opponent); if (item != ITEM_NONE) ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); - MESSAGE("The effects of Neutralizing Gas wore off!"); + MESSAGE("The effects of the neutralizing gas wore off!"); ABILITY_POPUP(opponent, ABILITY_INTIMIDATE); if (item != ITEM_NONE) { SEND_IN_MESSAGE("Wobbuffet"); @@ -341,9 +341,9 @@ SINGLE_BATTLE_TEST("Intimidate activates when it's no longer affected by Neutral TURN { MOVE(opponent, MOVE_FELL_STINGER); SEND_OUT(player, 1); } } SCENE { ABILITY_POPUP(player, ABILITY_NEUTRALIZING_GAS); - MESSAGE("Neutralizing Gas filled the area!"); + MESSAGE("Neutralizing gas filled the area!"); ANIMATION(ANIM_TYPE_MOVE, MOVE_FELL_STINGER, opponent); - MESSAGE("The effects of Neutralizing Gas wore off!"); + MESSAGE("The effects of the neutralizing gas wore off!"); ABILITY_POPUP(opponent, ABILITY_INTIMIDATE); MESSAGE("Weezing fainted!"); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); diff --git a/test/battle/hold_effect/red_card.c b/test/battle/hold_effect/red_card.c index c2a7238934..aa312797b2 100644 --- a/test/battle/hold_effect/red_card.c +++ b/test/battle/hold_effect/red_card.c @@ -486,7 +486,7 @@ SINGLE_BATTLE_TEST("Red Card activates before Eject Pack") MESSAGE("Wobbuffet is switched out with the Eject Button!"); } ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent); - MESSAGE("Foe Wobbuffet held up its Red Card against Wobbuffet!"); + MESSAGE("The opposing Wobbuffet held up its Red Card against Wobbuffet!"); ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); } }