Multibattles Illusion party boundaries fix (#7308)
This commit is contained in:
parent
c7b2c771e1
commit
d63f859db6
@ -297,7 +297,7 @@ bool32 TryClearIllusion(u32 battler, u32 caseID);
|
||||
u32 GetIllusionMonSpecies(u32 battler);
|
||||
struct Pokemon *GetIllusionMonPtr(u32 battler);
|
||||
void ClearIllusionMon(u32 battler);
|
||||
u32 GetIllusionMonPartyId(struct Pokemon *party, struct Pokemon *mon, struct Pokemon *partnerMon);
|
||||
u32 GetIllusionMonPartyId(struct Pokemon *party, struct Pokemon *mon, struct Pokemon *partnerMon, u32 battler);
|
||||
bool32 SetIllusionMon(struct Pokemon *mon, u32 battler);
|
||||
bool32 ShouldGetStatBadgeBoost(u16 flagId, u32 battler);
|
||||
u32 GetBattleMoveCategory(u32 move);
|
||||
|
||||
@ -3187,7 +3187,7 @@ static void IllusionNickHack(u32 battler, u32 partyId, u8 *dst)
|
||||
else
|
||||
partnerMon = mon;
|
||||
|
||||
id = GetIllusionMonPartyId(gEnemyParty, mon, partnerMon);
|
||||
id = GetIllusionMonPartyId(gEnemyParty, mon, partnerMon, battler);
|
||||
}
|
||||
|
||||
if (id != PARTY_SIZE)
|
||||
|
||||
@ -10373,11 +10373,29 @@ u32 GetIllusionMonSpecies(u32 battler)
|
||||
return SPECIES_NONE;
|
||||
}
|
||||
|
||||
u32 GetIllusionMonPartyId(struct Pokemon *party, struct Pokemon *mon, struct Pokemon *partnerMon)
|
||||
u32 GetIllusionMonPartyId(struct Pokemon *party, struct Pokemon *mon, struct Pokemon *partnerMon, u32 battler)
|
||||
{
|
||||
s32 id;
|
||||
s32 partyEnd=6;
|
||||
s32 partyStart=0;
|
||||
|
||||
// Adjust party search range for Multibattles and Player vs two-trainers
|
||||
if((GetBattlerSide(battler) == B_SIDE_PLAYER && (gBattleTypeFlags & BATTLE_TYPE_MULTI))
|
||||
|| (GetBattlerSide(battler) == B_SIDE_OPPONENT && (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS)))
|
||||
{
|
||||
if((GetBattlerPosition(battler) == B_POSITION_PLAYER_LEFT) || (GetBattlerPosition(battler) == B_POSITION_OPPONENT_LEFT))
|
||||
{
|
||||
partyEnd = 3;
|
||||
partyStart = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
partyEnd = 6;
|
||||
partyStart = 3;
|
||||
}
|
||||
}
|
||||
|
||||
// Find last alive non-egg pokemon.
|
||||
for (id = PARTY_SIZE - 1; id >= 0; id--)
|
||||
for (s32 id = partyEnd - 1; id >= partyStart; id--)
|
||||
{
|
||||
if (GetMonData(&party[id], MON_DATA_SANITY_HAS_SPECIES)
|
||||
&& GetMonData(&party[id], MON_DATA_HP)
|
||||
@ -10411,7 +10429,7 @@ bool32 SetIllusionMon(struct Pokemon *mon, u32 battler)
|
||||
else
|
||||
partnerMon = mon;
|
||||
|
||||
id = GetIllusionMonPartyId(party, mon, partnerMon);
|
||||
id = GetIllusionMonPartyId(party, mon, partnerMon, battler);
|
||||
if (id != PARTY_SIZE)
|
||||
{
|
||||
gBattleStruct->illusion[battler].state = ILLUSION_ON;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user