Fix shiny animation not respecting Illusion mon target and Imposter revealing opponent ability (#2985)

This commit is contained in:
Eduardo Quezada D'Ottone 2023-05-14 22:16:58 -04:00 committed by GitHub
commit 447739d005
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -9373,8 +9373,8 @@ BattleScript_FriskActivates::
end3
BattleScript_ImposterActivates::
transformdataexecution
call BattleScript_AbilityPopUp
transformdataexecution
playmoveanimation BS_ATTACKER, MOVE_TRANSFORM
waitanimation
printstring STRINGID_IMPOSTERTRANSFORM

View File

@ -2484,9 +2484,14 @@ void TryShinyAnimation(u8 battler, struct Pokemon *mon)
u32 otId, personality;
u32 shinyValue;
u8 taskCirc, taskDgnl;
struct Pokemon* illusionMon;
isShiny = FALSE;
gBattleSpritesDataPtr->healthBoxesData[battler].triedShinyMonAnim = TRUE;
illusionMon = GetIllusionMonPtr(battler);
if (illusionMon != NULL)
mon = illusionMon;
otId = GetMonData(mon, MON_DATA_OT_ID);
personality = GetMonData(mon, MON_DATA_PERSONALITY);

View File

@ -10395,12 +10395,19 @@ bool32 SetIllusionMon(struct Pokemon *mon, u32 battlerId)
{
struct Pokemon *party, *partnerMon;
s32 i, id;
u8 side, partyCount;
gBattleStruct->illusion[battlerId].set = 1;
if (GetMonAbility(mon) != ABILITY_ILLUSION)
return FALSE;
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)))
partnerMon = &party[gBattlerPartyIndexes[BATTLE_PARTNER(battlerId)]];