Skip to content

Commit

Permalink
fix sticky hold softlock (#4885)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sneed69 authored Jun 29, 2024
1 parent 26ef19d commit 75be596
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
18 changes: 18 additions & 0 deletions test/battle/ability/sticky_hold.c
Original file line number Diff line number Diff line change
@@ -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!");
}
}

0 comments on commit 75be596

Please sign in to comment.