Fixes cries in move animations ignoring Illusion (#4564)

* Fixes cries in move animations not taking into account the ability Illusion

* Fixes cry for Link Battles
This commit is contained in:
PhallenTree 2024-05-14 12:34:36 +01:00 committed by GitHub
parent dd6e91eaf7
commit 5cc7330f33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -167,10 +167,7 @@ void SoundTask_PlayCryHighPitch(u8 taskId)
return;
}
if (GetBattlerSide(battlerId) != B_SIDE_PLAYER)
species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES);
else
species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES);
species = (GetIllusionMonSpecies(battlerId) != SPECIES_NONE) ? GetIllusionMonSpecies(battlerId) : gAnimBattlerSpecies[battlerId];
}
if (species != SPECIES_NONE)
@ -215,10 +212,7 @@ void SoundTask_PlayDoubleCry(u8 taskId)
return;
}
if (GetBattlerSide(battlerId) != B_SIDE_PLAYER)
species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES);
else
species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES);
species = (GetIllusionMonSpecies(battlerId) != SPECIES_NONE) ? GetIllusionMonSpecies(battlerId) : gAnimBattlerSpecies[battlerId];
}
gTasks[taskId].data[0] = gBattleAnimArgs[1];
@ -285,7 +279,8 @@ void SoundTask_WaitForCry(u8 taskId)
void SoundTask_PlayNormalCry(u8 taskId)
{
PlayCry_ByMode(gBattleMons[gBattleAnimAttacker].species, BattleAnimAdjustPanning(SOUND_PAN_ATTACKER), CRY_MODE_NORMAL);
u16 species = (GetIllusionMonSpecies(gBattleAnimAttacker) != SPECIES_NONE) ? GetIllusionMonSpecies(gBattleAnimAttacker) : gAnimBattlerSpecies[gBattleAnimAttacker];
PlayCry_ByMode(species, BattleAnimAdjustPanning(SOUND_PAN_ATTACKER), CRY_MODE_NORMAL);
gTasks[taskId].func = SoundTask_WaitForCry;
}
@ -305,7 +300,7 @@ void SoundTask_PlayCryWithEcho(u8 taskId)
if (IsContest())
species = gContestResources->moveAnim->species;
else
species = gAnimBattlerSpecies[gBattleAnimAttacker];
species = (GetIllusionMonSpecies(gBattleAnimAttacker) != SPECIES_NONE) ? GetIllusionMonSpecies(gBattleAnimAttacker) : gAnimBattlerSpecies[gBattleAnimAttacker];
gTasks[taskId].tSpecies = species;
gTasks[taskId].tPan = pan;