From 61add8823eb38eb54c06a26e01383b92d85a9eec Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Wed, 13 Oct 2021 18:25:04 +1300 Subject: [PATCH] Fix Thief Thief doesn't work as a move end effect - the item steal animation only works if it runs before the target faints. This restores its original code and adds a simple check to handle its interaction with Parental Bond. --- src/battle_script_commands.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 20fb438d82..1c9af78972 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2651,7 +2651,6 @@ void SetMoveEffect(bool32 primary, u32 certain) case MOVE_EFFECT_KNOCK_OFF: case MOVE_EFFECT_SMACK_DOWN: case MOVE_EFFECT_REMOVE_STATUS: - case MOVE_EFFECT_STEAL_ITEM: case MOVE_EFFECT_BURN_UP: gBattleStruct->moveEffect2 = gBattleScripting.moveEffect; gBattlescriptCurrInstr++; @@ -3146,6 +3145,8 @@ void SetMoveEffect(bool32 primary, u32 certain) gBattlescriptCurrInstr++; break; case MOVE_EFFECT_STEAL_ITEM: + // Only steal items on the final strike of Parental Bond + if (!(gSpecialStatuses[gBattlerAttacker].parentalBondOn == 2 && gBattleMons[gBattlerTarget].hp != 0)) { if (!CanStealItem(gBattlerAttacker, gBattlerTarget, gBattleMons[gBattlerTarget].item)) { @@ -5046,32 +5047,6 @@ static void Cmd_moveend(void) } } break; // MOVE_EFFECT_REMOVE_STATUS - case MOVE_EFFECT_STEAL_ITEM: - if (!CanStealItem(gBattlerAttacker, gBattlerTarget, gBattleMons[gBattlerTarget].item) - || gBattleMons[gBattlerAttacker].item != ITEM_NONE - || gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY - || gBattleMons[gBattlerTarget].item == ITEM_NONE) - { - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_MoveEnd; // Can't steal item, just do damage - } - else if (gBattleMons[gBattlerTarget].item - && gBattleMons[gBattlerTarget].ability == ABILITY_STICKY_HOLD) // Can steal item, but ability prevents it - { - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_NoItemSteal; - - gLastUsedAbility = gBattleMons[gBattlerTarget].ability; - RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); - } - else - { - StealTargetItem(gBattlerAttacker, gBattlerTarget); // Attacker steals target item - gBattleStruct->changedItems[gBattlerAttacker] = gLastUsedItem; // Stolen item to be assigned later - BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = BattleScript_ItemSteal; - } - break; // MOVE_EFFECT_STEAL_ITEM case MOVE_EFFECT_BURN_UP: effect = TRUE; BattleScriptPush(gBattlescriptCurrInstr + 1);