mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-03-08 08:27:52 +01:00
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.
This commit is contained in:
parent
07bdd2ffe6
commit
61add8823e
@ -2651,7 +2651,6 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
|||||||
case MOVE_EFFECT_KNOCK_OFF:
|
case MOVE_EFFECT_KNOCK_OFF:
|
||||||
case MOVE_EFFECT_SMACK_DOWN:
|
case MOVE_EFFECT_SMACK_DOWN:
|
||||||
case MOVE_EFFECT_REMOVE_STATUS:
|
case MOVE_EFFECT_REMOVE_STATUS:
|
||||||
case MOVE_EFFECT_STEAL_ITEM:
|
|
||||||
case MOVE_EFFECT_BURN_UP:
|
case MOVE_EFFECT_BURN_UP:
|
||||||
gBattleStruct->moveEffect2 = gBattleScripting.moveEffect;
|
gBattleStruct->moveEffect2 = gBattleScripting.moveEffect;
|
||||||
gBattlescriptCurrInstr++;
|
gBattlescriptCurrInstr++;
|
||||||
@ -3146,6 +3145,8 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
|||||||
gBattlescriptCurrInstr++;
|
gBattlescriptCurrInstr++;
|
||||||
break;
|
break;
|
||||||
case MOVE_EFFECT_STEAL_ITEM:
|
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))
|
if (!CanStealItem(gBattlerAttacker, gBattlerTarget, gBattleMons[gBattlerTarget].item))
|
||||||
{
|
{
|
||||||
@ -5046,32 +5047,6 @@ static void Cmd_moveend(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break; // MOVE_EFFECT_REMOVE_STATUS
|
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:
|
case MOVE_EFFECT_BURN_UP:
|
||||||
effect = TRUE;
|
effect = TRUE;
|
||||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user