Generalize usage of castformPalette

This commit is contained in:
GriffinR 2022-05-18 22:11:51 -04:00
parent ef4d99c87e
commit 91baf08638

View File

@ -590,7 +590,7 @@ void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 battlerId)
if (species == SPECIES_CASTFORM)
{
paletteOffset = 0x100 + battlerId * 16;
LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette[CASTFORM_NORMAL]);
LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette);
LoadPalette(gBattleStruct->castformPalette[gBattleMonForms[battlerId]], paletteOffset, 0x20);
}
@ -653,7 +653,7 @@ void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 battlerId)
if (species == SPECIES_CASTFORM)
{
paletteOffset = 0x100 + battlerId * 16;
LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette[CASTFORM_NORMAL]);
LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette);
LoadPalette(gBattleStruct->castformPalette[gBattleMonForms[battlerId]], paletteOffset, 0x20);
}
@ -973,7 +973,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform)
if (targetSpecies == SPECIES_CASTFORM)
{
gSprites[gBattlerSpriteIds[battlerAtk]].anims = gMonFrontAnimsPtrTable[targetSpecies];
LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette[CASTFORM_NORMAL]);
LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette);
LoadPalette(gBattleStruct->castformPalette[gBattleMonForms[battlerDef]], paletteOffset, 32);
}