mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-03-06 23:48:02 +01:00
Ignore Illusion if the pokemon is the last slot in the party.
This commit is contained in:
parent
f985eefaa1
commit
64c2eb39c0
@ -10398,12 +10398,19 @@ bool32 SetIllusionMon(struct Pokemon *mon, u32 battlerId)
|
|||||||
{
|
{
|
||||||
struct Pokemon *party, *partnerMon;
|
struct Pokemon *party, *partnerMon;
|
||||||
s32 i, id;
|
s32 i, id;
|
||||||
|
u8 side, partyCount;
|
||||||
|
|
||||||
gBattleStruct->illusion[battlerId].set = 1;
|
gBattleStruct->illusion[battlerId].set = 1;
|
||||||
if (GetMonAbility(mon) != ABILITY_ILLUSION)
|
if (GetMonAbility(mon) != ABILITY_ILLUSION)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
party = GetBattlerParty(battlerId);
|
party = GetBattlerParty(battlerId);
|
||||||
|
side = GetBattlerSide(battlerId);
|
||||||
|
partyCount = side == B_SIDE_PLAYER ? gPlayerPartyCount : gEnemyPartyCount;
|
||||||
|
|
||||||
|
// If this pokemon is last in the party, ignore Illusion.
|
||||||
|
if (&party[partyCount - 1] == mon)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
if (IsBattlerAlive(BATTLE_PARTNER(battlerId)))
|
if (IsBattlerAlive(BATTLE_PARTNER(battlerId)))
|
||||||
partnerMon = &party[gBattlerPartyIndexes[BATTLE_PARTNER(battlerId)]];
|
partnerMon = &party[gBattlerPartyIndexes[BATTLE_PARTNER(battlerId)]];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user