mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-19 01:44:20 +01:00
Fix shiny animation not respecting Illusion mon target and Imposter revealing opponent ability (#2985)
This commit is contained in:
commit
447739d005
@ -9373,8 +9373,8 @@ BattleScript_FriskActivates::
|
||||
end3
|
||||
|
||||
BattleScript_ImposterActivates::
|
||||
transformdataexecution
|
||||
call BattleScript_AbilityPopUp
|
||||
transformdataexecution
|
||||
playmoveanimation BS_ATTACKER, MOVE_TRANSFORM
|
||||
waitanimation
|
||||
printstring STRINGID_IMPOSTERTRANSFORM
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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)]];
|
||||
|
Loading…
x
Reference in New Issue
Block a user