fix sticky hold softlock (#4885)
This commit is contained in:
parent
26ef19d6c0
commit
75be596933
3 changed files with 20 additions and 2 deletions
|
@ -8573,7 +8573,7 @@ BattleScript_SynchronizeActivates::
|
||||||
return
|
return
|
||||||
|
|
||||||
BattleScript_NoItemSteal::
|
BattleScript_NoItemSteal::
|
||||||
pause B_WAIT_TIME_SHORT
|
call BattleScript_AbilityPopUpTarget
|
||||||
printstring STRINGID_PKMNSXMADEYINEFFECTIVE
|
printstring STRINGID_PKMNSXMADEYINEFFECTIVE
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
return
|
return
|
||||||
|
|
|
@ -3454,7 +3454,7 @@ void SetMoveEffect(bool32 primary, bool32 certain)
|
||||||
}
|
}
|
||||||
else if (GetBattlerAbility(gBattlerTarget) == ABILITY_STICKY_HOLD)
|
else if (GetBattlerAbility(gBattlerTarget) == ABILITY_STICKY_HOLD)
|
||||||
{
|
{
|
||||||
BattleScriptPushCursor();
|
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||||
gBattlescriptCurrInstr = BattleScript_NoItemSteal;
|
gBattlescriptCurrInstr = BattleScript_NoItemSteal;
|
||||||
|
|
||||||
gLastUsedAbility = gBattleMons[gBattlerTarget].ability;
|
gLastUsedAbility = gBattleMons[gBattlerTarget].ability;
|
||||||
|
|
18
test/battle/ability/sticky_hold.c
Normal file
18
test/battle/ability/sticky_hold.c
Normal 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!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue