block item use under embargo
This commit is contained in:
parent
e6a2d2226f
commit
eadd09bebd
@ -796,6 +796,9 @@ static bool8 ShouldUseItem(void)
|
|||||||
if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_RIGHT)
|
if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_RIGHT)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
if (gStatuses3[gActiveBattler] & STATUS3_EMBARGO)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||||
party = gPlayerParty;
|
party = gPlayerParty;
|
||||||
else
|
else
|
||||||
|
|||||||
@ -4313,7 +4313,13 @@ static bool8 IsItemFlute(u16 item)
|
|||||||
static bool8 ExecuteTableBasedItemEffect_(u8 partyMonIndex, u16 item, u8 monMoveIndex)
|
static bool8 ExecuteTableBasedItemEffect_(u8 partyMonIndex, u16 item, u8 monMoveIndex)
|
||||||
{
|
{
|
||||||
if (gMain.inBattle)
|
if (gMain.inBattle)
|
||||||
return ExecuteTableBasedItemEffect(&gPlayerParty[partyMonIndex], item, GetPartyIdFromBattleSlot(partyMonIndex), monMoveIndex);
|
{
|
||||||
|
if ((partyMonIndex == 0 && gStatuses3[B_POSITION_PLAYER_LEFT] & STATUS3_EMBARGO)
|
||||||
|
|| (partyMonIndex == 1 && gStatuses3[B_POSITION_PLAYER_RIGHT] & STATUS3_EMBARGO))
|
||||||
|
return TRUE; // cannot use on this mon
|
||||||
|
else
|
||||||
|
return ExecuteTableBasedItemEffect(&gPlayerParty[partyMonIndex], item, GetPartyIdFromBattleSlot(partyMonIndex), monMoveIndex);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return ExecuteTableBasedItemEffect(&gPlayerParty[partyMonIndex], item, partyMonIndex, monMoveIndex);
|
return ExecuteTableBasedItemEffect(&gPlayerParty[partyMonIndex], item, partyMonIndex, monMoveIndex);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user