mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-02-09 23:03:01 +01:00
add pickpocket
This commit is contained in:
parent
0912577ea1
commit
520f00f4ae
@ -7688,3 +7688,10 @@ BattleScript_PrintPlayerForfeitedLinkBattle::
|
|||||||
atk57
|
atk57
|
||||||
waitmessage 0x40
|
waitmessage 0x40
|
||||||
end2
|
end2
|
||||||
|
|
||||||
|
BattleScript_Pickpocket::
|
||||||
|
call BattleScript_AbilityPopUp
|
||||||
|
swapattackerwithtarget
|
||||||
|
seteffectsecondary
|
||||||
|
swapattackerwithtarget
|
||||||
|
return
|
||||||
|
@ -349,5 +349,6 @@ extern const u8 BattleScript_EmergencyExitNoPopUp[];
|
|||||||
extern const u8 BattleScript_EmergencyExitWild[];
|
extern const u8 BattleScript_EmergencyExitWild[];
|
||||||
extern const u8 BattleScript_EmergencyExitWildNoPopUp[];
|
extern const u8 BattleScript_EmergencyExitWildNoPopUp[];
|
||||||
extern const u8 BattleScript_CheekPouchActivates[];
|
extern const u8 BattleScript_CheekPouchActivates[];
|
||||||
|
extern const u8 BattleScript_Pickpocket[];
|
||||||
|
|
||||||
#endif // GUARD_BATTLE_SCRIPTS_H
|
#endif // GUARD_BATTLE_SCRIPTS_H
|
||||||
|
@ -2931,7 +2931,8 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
side = GetBattlerSide(gBattlerAttacker);
|
side = GetBattlerSide(gBattlerAttacker);
|
||||||
if (GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT
|
if (gLastUsedAbility != ABILITY_PICKPOCKET //we need to swap attacker and target so this check otherwise fails
|
||||||
|
&& GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT
|
||||||
&& !(gBattleTypeFlags &
|
&& !(gBattleTypeFlags &
|
||||||
(BATTLE_TYPE_EREADER_TRAINER
|
(BATTLE_TYPE_EREADER_TRAINER
|
||||||
| BATTLE_TYPE_FRONTIER
|
| BATTLE_TYPE_FRONTIER
|
||||||
|
@ -4518,6 +4518,24 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
|||||||
effect++;
|
effect++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ABILITY_PICKPOCKET:
|
||||||
|
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||||
|
&& IsBattlerAlive(gBattlerAttacker)
|
||||||
|
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
|
||||||
|
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT)
|
||||||
|
&& TARGET_TURN_DAMAGED
|
||||||
|
&& IsBattlerAlive(gBattlerTarget)
|
||||||
|
&& gBattleMons[gBattlerAttacker].item != ITEM_NONE
|
||||||
|
&& gBattleMons[gBattlerTarget].item == ITEM_NONE
|
||||||
|
&& GetBattlerAbility(gBattlerAttacker) != ABILITY_STICKY_HOLD)
|
||||||
|
{
|
||||||
|
gBattleScripting.moveEffect = MOVE_EFFECT_STEAL_ITEM;
|
||||||
|
BattleScriptPushCursor();
|
||||||
|
gBattlescriptCurrInstr = BattleScript_Pickpocket;
|
||||||
|
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
|
||||||
|
effect++;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ABILITYEFFECT_MOVE_END_ATTACKER: // Same as above, but for attacker
|
case ABILITYEFFECT_MOVE_END_ATTACKER: // Same as above, but for attacker
|
||||||
|
Loading…
x
Reference in New Issue
Block a user