mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 19:47:35 +01:00
Make transform not break
This commit is contained in:
parent
767008427f
commit
4eb7b7048e
@ -23,7 +23,7 @@ bool8 BattleInitAllSprites(u8 *state1, u8 *battlerId);
|
|||||||
void ClearSpritesHealthboxAnimData(void);
|
void ClearSpritesHealthboxAnimData(void);
|
||||||
void CopyAllBattleSpritesInvisibilities(void);
|
void CopyAllBattleSpritesInvisibilities(void);
|
||||||
void CopyBattleSpriteInvisibility(u8 battlerId);
|
void CopyBattleSpriteInvisibility(u8 battlerId);
|
||||||
void HandleSpeciesGfxDataChange(u8 attacker, u8 target, bool8 notTransform, bool32 megaEvo);
|
void HandleSpeciesGfxDataChange(u8 attacker, u8 target, bool8 notTransform, bool32 megaEvo, bool8 trackEnemyPersonality);
|
||||||
void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite);
|
void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite);
|
||||||
void LoadBattleMonGfxAndAnimate(u8 battlerId, bool8 loadMonSprite, u8 spriteId);
|
void LoadBattleMonGfxAndAnimate(u8 battlerId, bool8 loadMonSprite, u8 spriteId);
|
||||||
void TrySetBehindSubstituteSpriteBit(u8 battlerId, u16 move);
|
void TrySetBehindSubstituteSpriteBit(u8 battlerId, u16 move);
|
||||||
|
@ -2364,7 +2364,7 @@ void AnimTask_TransformMon(u8 taskId)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
HandleSpeciesGfxDataChange(gBattleAnimAttacker, gBattleAnimTarget, gTasks[taskId].data[10], gBattleAnimArgs[1]);
|
HandleSpeciesGfxDataChange(gBattleAnimAttacker, gBattleAnimTarget, gTasks[taskId].data[10], gBattleAnimArgs[1], TRUE);
|
||||||
GetBgDataForTransform(&animBg, gBattleAnimAttacker);
|
GetBgDataForTransform(&animBg, gBattleAnimAttacker);
|
||||||
|
|
||||||
if (IsContest())
|
if (IsContest())
|
||||||
@ -2451,7 +2451,7 @@ void AnimTask_IsMonInvisible(u8 taskId)
|
|||||||
|
|
||||||
void AnimTask_CastformGfxDataChange(u8 taskId)
|
void AnimTask_CastformGfxDataChange(u8 taskId)
|
||||||
{
|
{
|
||||||
HandleSpeciesGfxDataChange(gBattleAnimAttacker, gBattleAnimTarget, TRUE, FALSE);
|
HandleSpeciesGfxDataChange(gBattleAnimAttacker, gBattleAnimTarget, TRUE, FALSE, FALSE);
|
||||||
DestroyAnimVisualTask(taskId);
|
DestroyAnimVisualTask(taskId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -849,9 +849,9 @@ void CopyBattleSpriteInvisibility(u8 battlerId)
|
|||||||
gBattleSpritesDataPtr->battlerData[battlerId].invisible = gSprites[gBattlerSpriteIds[battlerId]].invisible;
|
gBattleSpritesDataPtr->battlerData[battlerId].invisible = gSprites[gBattlerSpriteIds[battlerId]].invisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform, bool32 megaEvo)
|
void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform, bool32 megaEvo, bool8 trackEnemyPersonality)
|
||||||
{
|
{
|
||||||
u32 personalityValue, otId, position, paletteOffset, targetSpecies;
|
u32 personalityValue, otId, position, paletteOffset, targetSpecies, personalityValueEnemyParty;
|
||||||
const void *lzPaletteData, *src;
|
const void *lzPaletteData, *src;
|
||||||
void *dst;
|
void *dst;
|
||||||
|
|
||||||
@ -888,6 +888,8 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform, bo
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (trackEnemyPersonality)
|
||||||
|
personalityValueEnemyParty = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_PERSONALITY);
|
||||||
personalityValue = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_PERSONALITY);
|
personalityValue = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_PERSONALITY);
|
||||||
otId = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_OT_ID);
|
otId = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_OT_ID);
|
||||||
|
|
||||||
@ -919,7 +921,10 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform, bo
|
|||||||
dst = (void *)(OBJ_VRAM0 + gSprites[gBattlerSpriteIds[battlerAtk]].oam.tileNum * 32);
|
dst = (void *)(OBJ_VRAM0 + gSprites[gBattlerSpriteIds[battlerAtk]].oam.tileNum * 32);
|
||||||
DmaCopy32(3, src, dst, MON_PIC_SIZE);
|
DmaCopy32(3, src, dst, MON_PIC_SIZE);
|
||||||
paletteOffset = OBJ_PLTT_ID(battlerAtk);
|
paletteOffset = OBJ_PLTT_ID(battlerAtk);
|
||||||
lzPaletteData = GetMonSpritePalFromSpeciesAndPersonality(targetSpecies, otId, personalityValue);
|
if (trackEnemyPersonality)
|
||||||
|
lzPaletteData = GetMonSpritePalFromSpeciesAndPersonality(targetSpecies, otId, personalityValueEnemyParty);
|
||||||
|
else
|
||||||
|
lzPaletteData = GetMonSpritePalFromSpeciesAndPersonality(targetSpecies, otId, personalityValue);
|
||||||
LZDecompressWram(lzPaletteData, gDecompressionBuffer);
|
LZDecompressWram(lzPaletteData, gDecompressionBuffer);
|
||||||
LoadPalette(gDecompressionBuffer, paletteOffset, PLTT_SIZE_4BPP);
|
LoadPalette(gDecompressionBuffer, paletteOffset, PLTT_SIZE_4BPP);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user