From 75be596933100a3e5c607f5189a4f5575549fe8d Mon Sep 17 00:00:00 2001 From: sneed <56992013+Sneed69@users.noreply.github.com> Date: Sat, 29 Jun 2024 19:54:58 +0300 Subject: [PATCH 1/3] fix sticky hold softlock (#4885) --- data/battle_scripts_1.s | 2 +- src/battle_script_commands.c | 2 +- test/battle/ability/sticky_hold.c | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 test/battle/ability/sticky_hold.c diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 1bbb75946015..8bceedfa47ad 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -8573,7 +8573,7 @@ BattleScript_SynchronizeActivates:: return BattleScript_NoItemSteal:: - pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUpTarget printstring STRINGID_PKMNSXMADEYINEFFECTIVE waitmessage B_WAIT_TIME_LONG return diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 83c910f6b0c3..eaa69de10db4 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3454,7 +3454,7 @@ void SetMoveEffect(bool32 primary, bool32 certain) } else if (GetBattlerAbility(gBattlerTarget) == ABILITY_STICKY_HOLD) { - BattleScriptPushCursor(); + BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_NoItemSteal; gLastUsedAbility = gBattleMons[gBattlerTarget].ability; diff --git a/test/battle/ability/sticky_hold.c b/test/battle/ability/sticky_hold.c new file mode 100644 index 000000000000..2c7cc095350c --- /dev/null +++ b/test/battle/ability/sticky_hold.c @@ -0,0 +1,18 @@ +#include "global.h" +#include "test/battle.h" + +SINGLE_BATTLE_TEST("Sticky Hold prevents item theft") +{ + GIVEN { + ASSUME(MoveHasAdditionalEffect(MOVE_THIEF, MOVE_EFFECT_STEAL_ITEM)); + PLAYER(SPECIES_URSALUNA) { Item(ITEM_NONE); } + OPPONENT(SPECIES_GASTRODON) { Ability(ABILITY_STICKY_HOLD); Item(ITEM_LIFE_ORB); } + } WHEN { + TURN { MOVE(player, MOVE_THIEF); } + } SCENE { + MESSAGE("Ursaluna used Thief!"); + ABILITY_POPUP(opponent, ABILITY_STICKY_HOLD); + MESSAGE("Foe Gastrodon's Sticky Hold made Thief ineffective!"); + } +} + From 3ec371de054deec0f4c0824316ca3509a5a71c18 Mon Sep 17 00:00:00 2001 From: Cafei <46283144+cafei-uh@users.noreply.github.com> Date: Sat, 29 Jun 2024 22:46:00 +0400 Subject: [PATCH 2/3] Fixes (#4887) --- graphics/pokemon/bounsweet/front.png | Bin 451 -> 388 bytes graphics/pokemon/bounsweet/normal.pal | 2 +- graphics/pokemon/bounsweet/shiny.pal | 4 ++-- graphics/pokemon/bruxish/back.png | Bin 708 -> 620 bytes graphics/pokemon/bruxish/front.png | Bin 666 -> 571 bytes graphics/pokemon/bruxish/shiny.pal | 4 ++-- graphics/pokemon/charjabug/anim_front.png | Bin 837 -> 816 bytes graphics/pokemon/charjabug/shiny.pal | 4 ++-- graphics/pokemon/lurantis/back.png | Bin 898 -> 820 bytes 9 files changed, 7 insertions(+), 7 deletions(-) diff --git a/graphics/pokemon/bounsweet/front.png b/graphics/pokemon/bounsweet/front.png index a31220dcf963253deca2ed8a627cb9aafbd96f90..9e09d6d728ff656d01aa26ca68d6539ebc8190e0 100644 GIT binary patch delta 327 zcmV-N0l5Cd1B3&R7#0Wv0001;w}I>c0004VQb$4nuFf3kkv=ki`1tq$005i=5^?|l z0Rl-xK~z|U?Ugx#!ypVr5oqyDfcqaeAYh!Ou^?53Us=U_5?~wWc6N5YKLD`C`w#$E z1R<;$R1lU%s0zPgaJVXP=qCjL?F>~g3JV@|^;iY12o^;nf;I;4L(gRccD!SD16BeC zRTg45;0bvoIxE9}iGc6zsf35|x^dc}B3jZ?wK<&k9Pt0AU=#|gd|Vr-pLeK35;r-9oaAu`7%xvQafMdr1;$<2(vv$OL* Za|hZT3)>qZz!d-h002ovPDHLkV1hAngqZ*U delta 390 zcmV;10eSv}1H%K57$yV*00013M{Ml?0004VQb$4nuFf3k00004XF*Lt006O%3;baP zkuEZS00000003T8tkM7g010qNS#tmY4#NNd4#NS*Z>VGd00A6HL_t(Y$L*6bP6IIz zMQ0^TX(({Q33jQ)mLasaeE@A<+f<CM8Ir+iA9LYwR_)gy!YWgYQWX*nYD{iZs3mnH~V`v0AT(ZWBiDy`CzUQ=l%_J k@xR7ro)#bs8l(x}2m0M%Qv#UqaR2}S07*qoM6N<$f?@Wi1ONa4 diff --git a/graphics/pokemon/bounsweet/normal.pal b/graphics/pokemon/bounsweet/normal.pal index 6ba3b9fb34c9..029ef53c85f8 100644 --- a/graphics/pokemon/bounsweet/normal.pal +++ b/graphics/pokemon/bounsweet/normal.pal @@ -15,5 +15,5 @@ JASC-PAL 248 136 136 88 104 96 184 192 192 -0 0 0 +248 248 248 0 0 0 diff --git a/graphics/pokemon/bounsweet/shiny.pal b/graphics/pokemon/bounsweet/shiny.pal index 14fc1f5ab3cc..704d72a19af9 100644 --- a/graphics/pokemon/bounsweet/shiny.pal +++ b/graphics/pokemon/bounsweet/shiny.pal @@ -14,6 +14,6 @@ JASC-PAL 248 224 40 248 136 136 88 104 96 -184 192 192 -0 0 0 +200 192 128 +247 240 184 0 0 0 diff --git a/graphics/pokemon/bruxish/back.png b/graphics/pokemon/bruxish/back.png index 32aeed0b52920041c7d460e0d7a51e7cda87cbac..7969fb7197e2c4d42d8caa3804124d5a7a27d9de 100644 GIT binary patch delta 576 zcmV-G0>Ayl1?&Wn7#0Wv0001;w}I>c0004VQb$4nuFf3kkv=1T`1tt9z_7@mQ0UNz z`1tsckdVlzIK=1EHvj+u>PbXFR9J=WmfMcQAPhtcF<>mB{QuvsFF;7rm2!F6l`;=) zm3B@BW0QV9uU`EJIng8k#Cm`L@lSrbOK{+x5x_qNJS02@tc2SD*9dp_K?r`DV!Yi7 zAc&Y!yzE4gg>d121^_dQ1QBA4*9n*@D?-hIUoHcb5P9`Ymk6MD4}<*D;MmZ>u%O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>e*yC9C2#RxH@@`X`@h&|tn8={x5S-X4FiRgQm1K?(B{u9wVfBWW;Du3zy29e_E zz6Nj`KrBufz{m2@h}e(f4*=&P9s}ra0$9evDS*5Ie*>_+kfQ{EUgL=00e%Yb0vJc0 z_zH;tX}%aB@*G=<0I^m8ygWH9=mtm+(Z6N`z^?$&8-SC5ZJXzr%>NCbpAxBEaBkbS zUpkQHISW|z)-VHlf6em=fR~mWK(spB1p(-SW(q4%044n$Ez3fogMDXR&_-VUC{F8; z+ynsD0RZoJ0M_tE3dLz%hau-*2c{kN-OIZML$S|i{lS{F1F+)bocxZ*E>)K}c`Kf_ zcO7mSE;)*!m`zOQi(Juh1vqy%sf31Ju9=H$2P%yZrrlzK* zrl$W(G4|J||7+|I7d6@ch|fn1*NajF?&U9x(k@P?yI&P9D-9ux^3uS zm*-^JnFD~;o;*I#rJppWh zq<@9TYiyMl8R$4)0K~aXK-NP88lAC=8#cvGpez7qYc>%KwiU?3j&UUZTYA@{hde+C zA$og6=S9Z`t9D*yQV3|>23O%E901O)bD-wLCx8MC;WeUcI*v35$ n&;y(Ki8nUUl6zBAQ-yv2tU4j6S=-x<00000NkvXXu0mjfX)A4Y diff --git a/graphics/pokemon/charjabug/shiny.pal b/graphics/pokemon/charjabug/shiny.pal index 58974fb24f00..a5ffc233bc3e 100644 --- a/graphics/pokemon/charjabug/shiny.pal +++ b/graphics/pokemon/charjabug/shiny.pal @@ -15,5 +15,5 @@ JASC-PAL 248 160 72 112 72 24 176 112 48 -0 0 0 -0 0 0 +8 64 88 +176 168 176 diff --git a/graphics/pokemon/lurantis/back.png b/graphics/pokemon/lurantis/back.png index a080a77f099511c4d5bb9b31787a80276e082415..d133d63f7a81ff5a1d586b192ace7046f659b8af 100644 GIT binary patch delta 750 zcmVc0004VQb$4nuFf3kkv=|u0%SVYt(=eZzu3lbTKG1GuVOB|Iv){` zIWp($!mINU0l6DyCk~k{mTGJW0p7`;Cw)Lmx8bOs@Kiz=!a>2h-bYUVnj?6?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From: Frank DeBlasio <35279583+fdeblasio@users.noreply.github.com> Date: Sat, 29 Jun 2024 16:12:26 -0400 Subject: [PATCH 3/3] Allowed rematches to occur if I_VS_SEEKER_CHARGING isn't enabled (#4866) --- include/vs_seeker.h | 1 + src/battle_setup.c | 19 ++++++++++--------- src/vs_seeker.c | 8 ++++++++ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/include/vs_seeker.h b/include/vs_seeker.h index 723e73bf372d..d6795432b071 100644 --- a/include/vs_seeker.h +++ b/include/vs_seeker.h @@ -8,6 +8,7 @@ bool8 UpdateVsSeekerStepCounter(void); void MapResetTrainerRematches(u16 mapGroup, u16 mapNum); void ClearRematchMovementByTrainerId(void); u16 GetRematchTrainerIdVSSeeker(u16 trainerId); +bool32 IsVsSeekerEnabled(void); #define VSSEEKER_RECHARGE_STEPS 100 diff --git a/src/battle_setup.c b/src/battle_setup.c index 92fc2bea250c..2fe016ec8728 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -1916,15 +1916,16 @@ static bool32 HasAtLeastFiveBadges(void) void IncrementRematchStepCounter(void) { #if FREE_MATCH_CALL == FALSE - if (HasAtLeastFiveBadges() - && (I_VS_SEEKER_CHARGING != 0) - && (!CheckBagHasItem(ITEM_VS_SEEKER, 1))) - { - if (gSaveBlock1Ptr->trainerRematchStepCounter >= STEP_COUNTER_MAX) - gSaveBlock1Ptr->trainerRematchStepCounter = STEP_COUNTER_MAX; - else - gSaveBlock1Ptr->trainerRematchStepCounter++; - } + if (!HasAtLeastFiveBadges()) + return; + + if (IsVsSeekerEnabled()) + return; + + if (gSaveBlock1Ptr->trainerRematchStepCounter >= STEP_COUNTER_MAX) + gSaveBlock1Ptr->trainerRematchStepCounter = STEP_COUNTER_MAX; + else + gSaveBlock1Ptr->trainerRematchStepCounter++; #endif //FREE_MATCH_CALL } diff --git a/src/vs_seeker.c b/src/vs_seeker.c index 63b6c6f9d533..30dcb74ce0c4 100644 --- a/src/vs_seeker.c +++ b/src/vs_seeker.c @@ -577,6 +577,14 @@ u16 GetRematchTrainerIdVSSeeker(u16 trainerId) return gRematchTable[tableId].trainerIds[rematchTrainerIdx]; } +bool32 IsVsSeekerEnabled(void) +{ + if (I_VS_SEEKER_CHARGING == 0) + return FALSE; + + return (CheckBagHasItem(ITEM_VS_SEEKER, 1)); +} + static bool8 ObjectEventIdIsSane(u8 objectEventId) { struct ObjectEvent *objectEvent = &gObjectEvents[objectEventId];