fix sticky hold softlock (#4885)

This commit is contained in:
sneed 2024-06-29 19:54:58 +03:00 committed by GitHub
parent 26ef19d6c0
commit 75be596933
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 2 deletions

View file

@ -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

View file

@ -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;

View file

@ -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!");
}
}