mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-27 13:53:52 +01:00
Remove special handling for Deoxys.
This commit is contained in:
parent
a1e3700d10
commit
6a0939cd4e
@ -148,7 +148,7 @@ void PrepareAffineAnimInTaskData(struct Task *task, u8 spriteId, const union Aff
|
|||||||
bool8 RunAffineAnimFromTaskData(struct Task *task);
|
bool8 RunAffineAnimFromTaskData(struct Task *task);
|
||||||
void AnimThrowProjectile(struct Sprite *sprite);
|
void AnimThrowProjectile(struct Sprite *sprite);
|
||||||
void sub_80A6BFC(struct BattleAnimBgData *unk, u8 unused);
|
void sub_80A6BFC(struct BattleAnimBgData *unk, u8 unused);
|
||||||
u8 sub_80A8394(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, u32 a10);
|
u8 sub_80A8394(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId);
|
||||||
void sub_80A749C(struct Sprite *sprite);
|
void sub_80A749C(struct Sprite *sprite);
|
||||||
void TradeMenuBouncePartySprites(struct Sprite *sprite);
|
void TradeMenuBouncePartySprites(struct Sprite *sprite);
|
||||||
void DestroyAnimVisualTaskAndDisableBlend(u8 taskId);
|
void DestroyAnimVisualTaskAndDisableBlend(u8 taskId);
|
||||||
|
@ -17,16 +17,10 @@ void LoadCompressedSpritePaletteOverrideBuffer(const struct CompressedSpritePale
|
|||||||
bool8 LoadCompressedSpritePaletteUsingHeap(const struct CompressedSpritePalette *src);
|
bool8 LoadCompressedSpritePaletteUsingHeap(const struct CompressedSpritePalette *src);
|
||||||
|
|
||||||
void DecompressPicFromTable(const struct CompressedSpriteSheet *src, void* buffer, s32 species);
|
void DecompressPicFromTable(const struct CompressedSpriteSheet *src, void* buffer, s32 species);
|
||||||
void DecompressPicFromTable_2(const struct CompressedSpriteSheet *src, void* buffer, s32 species);
|
|
||||||
void DecompressPicFromTable_DontHandleDeoxys(const struct CompressedSpriteSheet *src, void* buffer, s32 species);
|
|
||||||
|
|
||||||
void HandleLoadSpecialPokePic(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality);
|
void HandleLoadSpecialPokePic(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality);
|
||||||
void HandleLoadSpecialPokePic_2(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality);
|
|
||||||
void HandleLoadSpecialPokePic_DontHandleDeoxys(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality);
|
|
||||||
|
|
||||||
void LoadSpecialPokePic(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality, bool8 isFrontPic);
|
void LoadSpecialPokePic(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality, bool8 isFrontPic);
|
||||||
void LoadSpecialPokePic_2(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality, bool8 isFrontPic);
|
|
||||||
void LoadSpecialPokePic_DontHandleDeoxys(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality, bool8 isFrontPic);
|
|
||||||
|
|
||||||
u32 GetDecompressedDataSize(const u32 *ptr);
|
u32 GetDecompressedDataSize(const u32 *ptr);
|
||||||
|
|
||||||
|
@ -282,7 +282,6 @@ void CreateMonWithEVSpreadNatureOTID(struct Pokemon *mon, u16 species, u8 level,
|
|||||||
void sub_80686FC(struct Pokemon *mon, struct BattleTowerPokemon *dest);
|
void sub_80686FC(struct Pokemon *mon, struct BattleTowerPokemon *dest);
|
||||||
void CreateObedientMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId);
|
void CreateObedientMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId);
|
||||||
bool8 sub_80688F8(u8 caseId, u8 battlerId);
|
bool8 sub_80688F8(u8 caseId, u8 battlerId);
|
||||||
void SetDeoxysStats(void);
|
|
||||||
u16 GetUnionRoomTrainerPic(void);
|
u16 GetUnionRoomTrainerPic(void);
|
||||||
u16 GetUnionRoomTrainerClass(void);
|
u16 GetUnionRoomTrainerClass(void);
|
||||||
void CreateObedientEnemyMon(void);
|
void CreateObedientEnemyMon(void);
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
extern const u8 gMonIconPaletteIndices[];
|
extern const u8 gMonIconPaletteIndices[];
|
||||||
extern const u8 gMonIconPaletteIndicesFemale[];
|
extern const u8 gMonIconPaletteIndicesFemale[];
|
||||||
|
|
||||||
const u8 *GetMonIconTiles(u16 species, bool32, u32 personality);
|
const u8 *GetMonIconTiles(u16 species, u32 personality);
|
||||||
void sub_80D304C(u16 offset);
|
void sub_80D304C(u16 offset);
|
||||||
u8 GetValidMonIconPalIndex(u16 species);
|
u8 GetValidMonIconPalIndex(u16 species);
|
||||||
const u8 *GetMonIconPtr(u16 speciesId, u32 personality, u32 frameNo);
|
const u8 *GetMonIconPtr(u16 speciesId, u32 personality);
|
||||||
const u16 *GetValidMonIconPalettePtr(u16 speciesId);
|
const u16 *GetValidMonIconPalettePtr(u16 speciesId);
|
||||||
u16 GetIconSpecies(u16 species, u32 personality);
|
u16 GetIconSpecies(u16 species, u32 personality);
|
||||||
u16 GetUnownLetterByPersonality(u32 personality);
|
u16 GetUnownLetterByPersonality(u32 personality);
|
||||||
@ -15,10 +15,10 @@ u16 sub_80D2E84(u16 speciesId);
|
|||||||
void LoadMonIconPalettes(void);
|
void LoadMonIconPalettes(void);
|
||||||
void LoadMonIconPalette(u16 species);
|
void LoadMonIconPalette(u16 species);
|
||||||
void FreeMonIconPalettes(void);
|
void FreeMonIconPalettes(void);
|
||||||
u8 sub_80D2D78(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, bool32 extra);
|
u8 sub_80D2D78(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority);
|
||||||
void FreeMonIconPalette(u16 species);
|
void FreeMonIconPalette(u16 species);
|
||||||
void FreeAndDestroyMonIconSprite(struct Sprite *sprite);
|
void FreeAndDestroyMonIconSprite(struct Sprite *sprite);
|
||||||
u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u32 personality, bool32 extra);
|
u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u32 personality);
|
||||||
u8 UpdateMonIconFrame(struct Sprite *sprite);
|
u8 UpdateMonIconFrame(struct Sprite *sprite);
|
||||||
void LoadMonIconPalette(u16 species);
|
void LoadMonIconPalette(u16 species);
|
||||||
void sub_80D328C(struct Sprite *sprite);
|
void sub_80D328C(struct Sprite *sprite);
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
bool16 ResetAllPicSprites(void);
|
bool16 ResetAllPicSprites(void);
|
||||||
u16 CreatePicSprite2(u16 species, u32 otId, u32 personality, u8 flags, s16 x, s16 y, u8 paletteSlot, u16 paletteTag);
|
u16 CreatePicSprite2(u16 species, u32 otId, u32 personality, u8 flags, s16 x, s16 y, u8 paletteSlot, u16 paletteTag);
|
||||||
u16 CreateMonPicSprite_HandleDeoxys(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag);
|
u16 CreateMonPicSprite(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag);
|
||||||
u16 FreeAndDestroyMonPicSprite(u16 spriteId);
|
u16 FreeAndDestroyMonPicSprite(u16 spriteId);
|
||||||
u16 CreateTrainerPicSprite(u16 species, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag);
|
u16 CreateTrainerPicSprite(u16 species, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag);
|
||||||
u16 FreeAndDestroyTrainerPicSprite(u16 spriteId);
|
u16 FreeAndDestroyTrainerPicSprite(u16 spriteId);
|
||||||
|
@ -3248,7 +3248,7 @@ void AnimTask_RolePlaySilhouette(u8 taskId)
|
|||||||
|
|
||||||
coord1 = GetBattlerSpriteCoord(gBattleAnimAttacker, 0);
|
coord1 = GetBattlerSpriteCoord(gBattleAnimAttacker, 0);
|
||||||
coord2 = GetBattlerSpriteCoord(gBattleAnimAttacker, 1);
|
coord2 = GetBattlerSpriteCoord(gBattleAnimAttacker, 1);
|
||||||
spriteId = sub_80A8394(species, isBackPic, 0, coord1 + xOffset, coord2, 5, personality, otId, gBattleAnimTarget, 1);
|
spriteId = sub_80A8394(species, isBackPic, 0, coord1 + xOffset, coord2, 5, personality, otId, gBattleAnimTarget);
|
||||||
|
|
||||||
gSprites[spriteId].oam.priority = priority;
|
gSprites[spriteId].oam.priority = priority;
|
||||||
gSprites[spriteId].oam.objMode = ST_OAM_OBJ_BLEND;
|
gSprites[spriteId].oam.objMode = ST_OAM_OBJ_BLEND;
|
||||||
@ -5067,7 +5067,7 @@ void AnimTask_SnatchOpposingMonMove(u8 taskId)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
spriteId2 = sub_80A8394(species, isBackPic, 0, x, GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y), subpriority, personality, otId, gBattleAnimAttacker, 0);
|
spriteId2 = sub_80A8394(species, isBackPic, 0, x, GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y), subpriority, personality, otId, gBattleAnimAttacker);
|
||||||
if (gBattleSpritesDataPtr->battlerData[gBattleAnimAttacker].transformSpecies != SPECIES_NONE)
|
if (gBattleSpritesDataPtr->battlerData[gBattleAnimAttacker].transformSpecies != SPECIES_NONE)
|
||||||
BlendPalette((gSprites[spriteId2].oam.paletteNum * 16) | 0x100, 16, 6, RGB_WHITE);
|
BlendPalette((gSprites[spriteId2].oam.paletteNum * 16) | 0x100, 16, 6, RGB_WHITE);
|
||||||
|
|
||||||
|
@ -2013,7 +2013,7 @@ u8 GetBattlerSpriteBGPriorityRank(u8 battlerId)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 sub_80A8394(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, u32 a10)
|
u8 sub_80A8394(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId)
|
||||||
{
|
{
|
||||||
u8 spriteId;
|
u8 spriteId;
|
||||||
u16 sheet = LoadSpriteSheet(&sUnknown_08525FC0[a3]);
|
u16 sheet = LoadSpriteSheet(&sUnknown_08525FC0[a3]);
|
||||||
@ -2024,34 +2024,20 @@ u8 sub_80A8394(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority
|
|||||||
if (!isBackpic)
|
if (!isBackpic)
|
||||||
{
|
{
|
||||||
LoadCompressedPalette(GetMonSpritePalFromSpeciesAndPersonality(species, trainerId, personality), (palette * 0x10) + 0x100, 0x20);
|
LoadCompressedPalette(GetMonSpritePalFromSpeciesAndPersonality(species, trainerId, personality), (palette * 0x10) + 0x100, 0x20);
|
||||||
if (a10 == 1 || sub_80688F8(5, battlerId) == 1 || gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies != 0)
|
LoadSpecialPokePic(&gMonFrontPicTable[species],
|
||||||
LoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species],
|
gMonSpritesGfxPtr->buffer,
|
||||||
gMonSpritesGfxPtr->buffer,
|
species,
|
||||||
species,
|
personality,
|
||||||
personality,
|
TRUE);
|
||||||
TRUE);
|
|
||||||
else
|
|
||||||
LoadSpecialPokePic_2(&gMonFrontPicTable[species],
|
|
||||||
gMonSpritesGfxPtr->buffer,
|
|
||||||
species,
|
|
||||||
personality,
|
|
||||||
TRUE);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LoadCompressedPalette(GetMonSpritePalFromSpeciesAndPersonality(species, trainerId, personality), (palette * 0x10) + 0x100, 0x20);
|
LoadCompressedPalette(GetMonSpritePalFromSpeciesAndPersonality(species, trainerId, personality), (palette * 0x10) + 0x100, 0x20);
|
||||||
if (a10 == 1 || sub_80688F8(5, battlerId) == 1 || gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies != 0)
|
LoadSpecialPokePic(&gMonBackPicTable[species],
|
||||||
LoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[species],
|
gMonSpritesGfxPtr->buffer,
|
||||||
gMonSpritesGfxPtr->buffer,
|
species,
|
||||||
species,
|
personality,
|
||||||
personality,
|
FALSE);
|
||||||
FALSE);
|
|
||||||
else
|
|
||||||
LoadSpecialPokePic_2(&gMonBackPicTable[species],
|
|
||||||
gMonSpritesGfxPtr->buffer,
|
|
||||||
species,
|
|
||||||
personality,
|
|
||||||
FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RequestDma3Copy(gMonSpritesGfxPtr->buffer, (void *)(OBJ_VRAM0 + (sheet * 0x20)), 0x800, 1);
|
RequestDma3Copy(gMonSpritesGfxPtr->buffer, (void *)(OBJ_VRAM0 + (sheet * 0x20)), 0x800, 1);
|
||||||
|
@ -4270,7 +4270,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
|
|||||||
SpriteCb_MonIcon,
|
SpriteCb_MonIcon,
|
||||||
x | sInfoTrainerMonX[i],
|
x | sInfoTrainerMonX[i],
|
||||||
y + sInfoTrainerMonY[i],
|
y + sInfoTrainerMonY[i],
|
||||||
0, 0, TRUE);
|
0, 0);
|
||||||
gSprites[sInfoCard->spriteIds[2 + i + arrId]].oam.priority = 0;
|
gSprites[sInfoCard->spriteIds[2 + i + arrId]].oam.priority = 0;
|
||||||
}
|
}
|
||||||
else if (trainerId == TRAINER_FRONTIER_BRAIN)
|
else if (trainerId == TRAINER_FRONTIER_BRAIN)
|
||||||
@ -4279,7 +4279,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
|
|||||||
SpriteCb_MonIcon,
|
SpriteCb_MonIcon,
|
||||||
x | sInfoTrainerMonX[i],
|
x | sInfoTrainerMonX[i],
|
||||||
y + sInfoTrainerMonY[i],
|
y + sInfoTrainerMonY[i],
|
||||||
0, 0, TRUE);
|
0, 0);
|
||||||
gSprites[sInfoCard->spriteIds[2 + i + arrId]].oam.priority = 0;
|
gSprites[sInfoCard->spriteIds[2 + i + arrId]].oam.priority = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -4288,7 +4288,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
|
|||||||
SpriteCb_MonIcon,
|
SpriteCb_MonIcon,
|
||||||
x | sInfoTrainerMonX[i],
|
x | sInfoTrainerMonX[i],
|
||||||
y + sInfoTrainerMonY[i],
|
y + sInfoTrainerMonY[i],
|
||||||
0, 0, TRUE);
|
0, 0);
|
||||||
gSprites[sInfoCard->spriteIds[2 + i + arrId]].oam.priority = 0;
|
gSprites[sInfoCard->spriteIds[2 + i + arrId]].oam.priority = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4759,7 +4759,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
|||||||
SpriteCb_MonIcon,
|
SpriteCb_MonIcon,
|
||||||
x | sLeftTrainerMonX[i],
|
x | sLeftTrainerMonX[i],
|
||||||
y + sLeftTrainerMonY[i],
|
y + sLeftTrainerMonY[i],
|
||||||
0, 0, TRUE);
|
0, 0);
|
||||||
gSprites[sInfoCard->spriteIds[2 + i + arrId]].oam.priority = 0;
|
gSprites[sInfoCard->spriteIds[2 + i + arrId]].oam.priority = 0;
|
||||||
}
|
}
|
||||||
else if (trainerIds[0] == TRAINER_FRONTIER_BRAIN)
|
else if (trainerIds[0] == TRAINER_FRONTIER_BRAIN)
|
||||||
@ -4768,7 +4768,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
|||||||
SpriteCb_MonIcon,
|
SpriteCb_MonIcon,
|
||||||
x | sLeftTrainerMonX[i],
|
x | sLeftTrainerMonX[i],
|
||||||
y + sLeftTrainerMonY[i],
|
y + sLeftTrainerMonY[i],
|
||||||
0, 0, TRUE);
|
0, 0);
|
||||||
gSprites[sInfoCard->spriteIds[2 + i + arrId]].oam.priority = 0;
|
gSprites[sInfoCard->spriteIds[2 + i + arrId]].oam.priority = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -4777,7 +4777,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
|||||||
SpriteCb_MonIcon,
|
SpriteCb_MonIcon,
|
||||||
x | sLeftTrainerMonX[i],
|
x | sLeftTrainerMonX[i],
|
||||||
y + sLeftTrainerMonY[i],
|
y + sLeftTrainerMonY[i],
|
||||||
0, 0, TRUE);
|
0, 0);
|
||||||
gSprites[sInfoCard->spriteIds[2 + i + arrId]].oam.priority = 0;
|
gSprites[sInfoCard->spriteIds[2 + i + arrId]].oam.priority = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4799,7 +4799,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
|||||||
SpriteCb_MonIcon,
|
SpriteCb_MonIcon,
|
||||||
x | sRightTrainerMonX[i],
|
x | sRightTrainerMonX[i],
|
||||||
y + sRightTrainerMonY[i],
|
y + sRightTrainerMonY[i],
|
||||||
0, 0, TRUE);
|
0, 0);
|
||||||
gSprites[sInfoCard->spriteIds[5 + i + arrId]].oam.priority = 0;
|
gSprites[sInfoCard->spriteIds[5 + i + arrId]].oam.priority = 0;
|
||||||
}
|
}
|
||||||
else if (trainerIds[1] == TRAINER_FRONTIER_BRAIN)
|
else if (trainerIds[1] == TRAINER_FRONTIER_BRAIN)
|
||||||
@ -4808,7 +4808,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
|||||||
SpriteCb_MonIcon,
|
SpriteCb_MonIcon,
|
||||||
x | sRightTrainerMonX[i],
|
x | sRightTrainerMonX[i],
|
||||||
y + sRightTrainerMonY[i],
|
y + sRightTrainerMonY[i],
|
||||||
0, 0, TRUE);
|
0, 0);
|
||||||
gSprites[sInfoCard->spriteIds[5 + i + arrId]].oam.priority = 0;
|
gSprites[sInfoCard->spriteIds[5 + i + arrId]].oam.priority = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -4817,7 +4817,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
|||||||
SpriteCb_MonIcon,
|
SpriteCb_MonIcon,
|
||||||
x | sRightTrainerMonX[i],
|
x | sRightTrainerMonX[i],
|
||||||
y + sRightTrainerMonY[i],
|
y + sRightTrainerMonY[i],
|
||||||
0, 0, TRUE);
|
0, 0);
|
||||||
gSprites[sInfoCard->spriteIds[5 + i + arrId]].oam.priority = 0;
|
gSprites[sInfoCard->spriteIds[5 + i + arrId]].oam.priority = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1952,7 +1952,7 @@ static void Summary_ShowMonSprite(void)
|
|||||||
u32 personality = GetMonData(mon, MON_DATA_PERSONALITY, NULL);
|
u32 personality = GetMonData(mon, MON_DATA_PERSONALITY, NULL);
|
||||||
u32 otId = GetMonData(mon, MON_DATA_OT_ID, NULL);
|
u32 otId = GetMonData(mon, MON_DATA_OT_ID, NULL);
|
||||||
|
|
||||||
sFactorySelectScreen->unk294[1].field0 = CreateMonPicSprite_HandleDeoxys(species, otId, personality, TRUE, 88, 32, 15, 0xFFFF);
|
sFactorySelectScreen->unk294[1].field0 = CreateMonPicSprite(species, otId, personality, TRUE, 88, 32, 15, 0xFFFF);
|
||||||
gSprites[sFactorySelectScreen->unk294[1].field0].centerToCornerVecX = 0;
|
gSprites[sFactorySelectScreen->unk294[1].field0].centerToCornerVecX = 0;
|
||||||
gSprites[sFactorySelectScreen->unk294[1].field0].centerToCornerVecY = 0;
|
gSprites[sFactorySelectScreen->unk294[1].field0].centerToCornerVecY = 0;
|
||||||
|
|
||||||
@ -1978,7 +1978,7 @@ static void Select_ShowSummaryMonSprite(void)
|
|||||||
personality = GetMonData(mon, MON_DATA_PERSONALITY, NULL);
|
personality = GetMonData(mon, MON_DATA_PERSONALITY, NULL);
|
||||||
otId = GetMonData(mon, MON_DATA_OT_ID, NULL);
|
otId = GetMonData(mon, MON_DATA_OT_ID, NULL);
|
||||||
|
|
||||||
sFactorySelectScreen->unk294[1].field0 = CreateMonPicSprite_HandleDeoxys(species, otId, personality, TRUE, 88, 32, 15, 0xFFFF);
|
sFactorySelectScreen->unk294[1].field0 = CreateMonPicSprite(species, otId, personality, TRUE, 88, 32, 15, 0xFFFF);
|
||||||
gSprites[sFactorySelectScreen->unk294[1].field0].centerToCornerVecX = 0;
|
gSprites[sFactorySelectScreen->unk294[1].field0].centerToCornerVecX = 0;
|
||||||
gSprites[sFactorySelectScreen->unk294[1].field0].centerToCornerVecY = 0;
|
gSprites[sFactorySelectScreen->unk294[1].field0].centerToCornerVecY = 0;
|
||||||
|
|
||||||
@ -2000,7 +2000,7 @@ static void Select_ShowChosenMonsSprites(void)
|
|||||||
u32 personality = GetMonData(mon, MON_DATA_PERSONALITY, NULL);
|
u32 personality = GetMonData(mon, MON_DATA_PERSONALITY, NULL);
|
||||||
u32 otId = GetMonData(mon, MON_DATA_OT_ID, NULL);
|
u32 otId = GetMonData(mon, MON_DATA_OT_ID, NULL);
|
||||||
|
|
||||||
sFactorySelectScreen->unk294[i].field0 = CreateMonPicSprite_HandleDeoxys(species, otId, personality, TRUE, (i * 72) + 16, 32, i + 13, 0xFFFF);
|
sFactorySelectScreen->unk294[i].field0 = CreateMonPicSprite(species, otId, personality, TRUE, (i * 72) + 16, 32, i + 13, 0xFFFF);
|
||||||
gSprites[sFactorySelectScreen->unk294[i].field0].centerToCornerVecX = 0;
|
gSprites[sFactorySelectScreen->unk294[i].field0].centerToCornerVecX = 0;
|
||||||
gSprites[sFactorySelectScreen->unk294[i].field0].centerToCornerVecY = 0;
|
gSprites[sFactorySelectScreen->unk294[i].field0].centerToCornerVecY = 0;
|
||||||
break;
|
break;
|
||||||
@ -3905,7 +3905,7 @@ static void Swap_ShowSummaryMonSprite(void)
|
|||||||
personality = GetMonData(mon, MON_DATA_PERSONALITY, NULL);
|
personality = GetMonData(mon, MON_DATA_PERSONALITY, NULL);
|
||||||
otId = GetMonData(mon, MON_DATA_OT_ID, NULL);
|
otId = GetMonData(mon, MON_DATA_OT_ID, NULL);
|
||||||
|
|
||||||
sFactorySwapScreen->unk2C.field0 = CreateMonPicSprite_HandleDeoxys(species, personality, otId, TRUE, 88, 32, 15, 0xFFFF); // BUG: otId and personality should be switched.
|
sFactorySwapScreen->unk2C.field0 = CreateMonPicSprite(species, personality, otId, TRUE, 88, 32, 15, 0xFFFF); // BUG: otId and personality should be switched.
|
||||||
gSprites[sFactorySwapScreen->unk2C.field0].centerToCornerVecX = 0;
|
gSprites[sFactorySwapScreen->unk2C.field0].centerToCornerVecX = 0;
|
||||||
gSprites[sFactorySwapScreen->unk2C.field0].centerToCornerVecY = 0;
|
gSprites[sFactorySwapScreen->unk2C.field0].centerToCornerVecY = 0;
|
||||||
|
|
||||||
@ -4115,7 +4115,7 @@ static void Swap_ShowMonSprite(void)
|
|||||||
personality = GetMonData(mon, MON_DATA_PERSONALITY, NULL);
|
personality = GetMonData(mon, MON_DATA_PERSONALITY, NULL);
|
||||||
otId = GetMonData(mon, MON_DATA_OT_ID, NULL);
|
otId = GetMonData(mon, MON_DATA_OT_ID, NULL);
|
||||||
|
|
||||||
sFactorySwapScreen->unk2C.field0 = CreateMonPicSprite_HandleDeoxys(species, otId, personality, TRUE, 88, 32, 15, 0xFFFF);
|
sFactorySwapScreen->unk2C.field0 = CreateMonPicSprite(species, otId, personality, TRUE, 88, 32, 15, 0xFFFF);
|
||||||
gSprites[sFactorySwapScreen->unk2C.field0].centerToCornerVecX = 0;
|
gSprites[sFactorySwapScreen->unk2C.field0].centerToCornerVecX = 0;
|
||||||
gSprites[sFactorySwapScreen->unk2C.field0].centerToCornerVecY = 0;
|
gSprites[sFactorySwapScreen->unk2C.field0].centerToCornerVecY = 0;
|
||||||
|
|
||||||
|
@ -566,9 +566,9 @@ void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 battlerId)
|
|||||||
|
|
||||||
otId = GetMonData(mon, MON_DATA_OT_ID);
|
otId = GetMonData(mon, MON_DATA_OT_ID);
|
||||||
position = GetBattlerPosition(battlerId);
|
position = GetBattlerPosition(battlerId);
|
||||||
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species],
|
HandleLoadSpecialPokePic(&gMonFrontPicTable[species],
|
||||||
gMonSpritesGfxPtr->sprites[position],
|
gMonSpritesGfxPtr->sprites[position],
|
||||||
species, currentPersonality);
|
species, currentPersonality);
|
||||||
|
|
||||||
paletteOffset = 0x100 + battlerId * 16;
|
paletteOffset = 0x100 + battlerId * 16;
|
||||||
|
|
||||||
@ -620,18 +620,9 @@ void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 battlerId)
|
|||||||
otId = GetMonData(mon, MON_DATA_OT_ID);
|
otId = GetMonData(mon, MON_DATA_OT_ID);
|
||||||
position = GetBattlerPosition(battlerId);
|
position = GetBattlerPosition(battlerId);
|
||||||
|
|
||||||
if (sub_80688F8(1, battlerId) == 1 || gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies != SPECIES_NONE)
|
HandleLoadSpecialPokePic(&gMonBackPicTable[species],
|
||||||
{
|
gMonSpritesGfxPtr->sprites[position],
|
||||||
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[species],
|
species, currentPersonality);
|
||||||
gMonSpritesGfxPtr->sprites[position],
|
|
||||||
species, currentPersonality);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
HandleLoadSpecialPokePic(&gMonBackPicTable[species],
|
|
||||||
gMonSpritesGfxPtr->sprites[position],
|
|
||||||
species, currentPersonality);
|
|
||||||
}
|
|
||||||
|
|
||||||
paletteOffset = 0x100 + battlerId * 16;
|
paletteOffset = 0x100 + battlerId * 16;
|
||||||
|
|
||||||
@ -670,18 +661,18 @@ void nullsub_24(u16 species)
|
|||||||
void DecompressTrainerFrontPic(u16 frontPicId, u8 battlerId)
|
void DecompressTrainerFrontPic(u16 frontPicId, u8 battlerId)
|
||||||
{
|
{
|
||||||
u8 position = GetBattlerPosition(battlerId);
|
u8 position = GetBattlerPosition(battlerId);
|
||||||
DecompressPicFromTable_2(&gTrainerFrontPicTable[frontPicId],
|
DecompressPicFromTable(&gTrainerFrontPicTable[frontPicId],
|
||||||
gMonSpritesGfxPtr->sprites[position],
|
gMonSpritesGfxPtr->sprites[position],
|
||||||
SPECIES_NONE);
|
SPECIES_NONE);
|
||||||
LoadCompressedSpritePalette(&gTrainerFrontPicPaletteTable[frontPicId]);
|
LoadCompressedSpritePalette(&gTrainerFrontPicPaletteTable[frontPicId]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DecompressTrainerBackPic(u16 backPicId, u8 battlerId)
|
void DecompressTrainerBackPic(u16 backPicId, u8 battlerId)
|
||||||
{
|
{
|
||||||
u8 position = GetBattlerPosition(battlerId);
|
u8 position = GetBattlerPosition(battlerId);
|
||||||
DecompressPicFromTable_2(&gTrainerBackPicTable[backPicId],
|
DecompressPicFromTable(&gTrainerBackPicTable[backPicId],
|
||||||
gMonSpritesGfxPtr->sprites[position],
|
gMonSpritesGfxPtr->sprites[position],
|
||||||
SPECIES_NONE);
|
SPECIES_NONE);
|
||||||
LoadCompressedPalette(gTrainerBackPicPaletteTable[backPicId].data,
|
LoadCompressedPalette(gTrainerBackPicPaletteTable[backPicId].data,
|
||||||
0x100 + 16 * battlerId, 0x20);
|
0x100 + 16 * battlerId, 0x20);
|
||||||
}
|
}
|
||||||
@ -919,10 +910,10 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 notTransform
|
|||||||
personalityValue = gContestResources->moveAnim->personality;
|
personalityValue = gContestResources->moveAnim->personality;
|
||||||
otId = gContestResources->moveAnim->otId;
|
otId = gContestResources->moveAnim->otId;
|
||||||
|
|
||||||
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[targetSpecies],
|
HandleLoadSpecialPokePic(&gMonBackPicTable[targetSpecies],
|
||||||
gMonSpritesGfxPtr->sprites[0],
|
gMonSpritesGfxPtr->sprites[0],
|
||||||
targetSpecies,
|
targetSpecies,
|
||||||
gContestResources->moveAnim->targetPersonality);
|
gContestResources->moveAnim->targetPersonality);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -938,20 +929,20 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 notTransform
|
|||||||
personalityValue = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_PERSONALITY);
|
personalityValue = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_PERSONALITY);
|
||||||
otId = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_OT_ID);
|
otId = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_OT_ID);
|
||||||
|
|
||||||
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[targetSpecies],
|
HandleLoadSpecialPokePic(&gMonBackPicTable[targetSpecies],
|
||||||
gMonSpritesGfxPtr->sprites[position],
|
gMonSpritesGfxPtr->sprites[position],
|
||||||
targetSpecies,
|
targetSpecies,
|
||||||
gTransformedPersonalities[battlerAtk]);
|
gTransformedPersonalities[battlerAtk]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
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);
|
||||||
|
|
||||||
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[targetSpecies],
|
HandleLoadSpecialPokePic(&gMonFrontPicTable[targetSpecies],
|
||||||
gMonSpritesGfxPtr->sprites[position],
|
gMonSpritesGfxPtr->sprites[position],
|
||||||
targetSpecies,
|
targetSpecies,
|
||||||
gTransformedPersonalities[battlerAtk]);
|
gTransformedPersonalities[battlerAtk]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1013,7 +1013,6 @@ static void CB2_HandleStartBattle(void)
|
|||||||
gTasks[taskId].data[4] = gBlockRecvBuffer[enemyMultiplayerId][1];
|
gTasks[taskId].data[4] = gBlockRecvBuffer[enemyMultiplayerId][1];
|
||||||
sub_8185F90(gBlockRecvBuffer[playerMultiplayerId][1]);
|
sub_8185F90(gBlockRecvBuffer[playerMultiplayerId][1]);
|
||||||
sub_8185F90(gBlockRecvBuffer[enemyMultiplayerId][1]);
|
sub_8185F90(gBlockRecvBuffer[enemyMultiplayerId][1]);
|
||||||
SetDeoxysStats();
|
|
||||||
gBattleCommunication[MULTIUSE_STATE]++;
|
gBattleCommunication[MULTIUSE_STATE]++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1592,7 +1591,6 @@ static void CB2_HandleStartMultiBattle(void)
|
|||||||
ResetBlockReceivedFlags();
|
ResetBlockReceivedFlags();
|
||||||
sub_8036EB8(4, playerMultiplayerId);
|
sub_8036EB8(4, playerMultiplayerId);
|
||||||
SetAllPlayersBerryData();
|
SetAllPlayersBerryData();
|
||||||
SetDeoxysStats();
|
|
||||||
var = CreateTask(InitLinkBattleVsScreen, 0);
|
var = CreateTask(InitLinkBattleVsScreen, 0);
|
||||||
gTasks[var].data[1] = 0x10E;
|
gTasks[var].data[1] = 0x10E;
|
||||||
gTasks[var].data[2] = 0x5A;
|
gTasks[var].data[2] = 0x5A;
|
||||||
|
@ -6104,7 +6104,7 @@ static void PutMonIconOnLvlUpBox(void)
|
|||||||
u16 species = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPECIES);
|
u16 species = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPECIES);
|
||||||
u32 personality = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_PERSONALITY);
|
u32 personality = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_PERSONALITY);
|
||||||
|
|
||||||
const u8* iconPtr = GetMonIconPtr(species, personality, 1);
|
const u8* iconPtr = GetMonIconPtr(species, personality);
|
||||||
iconSheet.data = iconPtr;
|
iconSheet.data = iconPtr;
|
||||||
iconSheet.size = 0x200;
|
iconSheet.size = 0x200;
|
||||||
iconSheet.tag = MON_ICON_LVLUP_BOX_TAG;
|
iconSheet.tag = MON_ICON_LVLUP_BOX_TAG;
|
||||||
|
@ -3117,10 +3117,7 @@ static u8 CreateContestantSprite(u16 species, u32 otId, u32 personality, u32 ind
|
|||||||
u8 spriteId;
|
u8 spriteId;
|
||||||
species = SanitizeSpecies(species);
|
species = SanitizeSpecies(species);
|
||||||
|
|
||||||
if (index == gContestPlayerMonIndex)
|
HandleLoadSpecialPokePic(&gMonBackPicTable[species], gMonSpritesGfxPtr->sprites[0], species, personality);
|
||||||
HandleLoadSpecialPokePic_2(&gMonBackPicTable[species], gMonSpritesGfxPtr->sprites[0], species, personality);
|
|
||||||
else
|
|
||||||
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[species], gMonSpritesGfxPtr->sprites[0], species, personality);
|
|
||||||
|
|
||||||
LoadCompressedPalette(GetMonSpritePalFromSpeciesAndPersonality(species, otId, personality), 0x120, 0x20);
|
LoadCompressedPalette(GetMonSpritePalFromSpeciesAndPersonality(species, otId, personality), 0x120, 0x20);
|
||||||
SetMultiuseSpriteTemplateToPokemon(species, 0);
|
SetMultiuseSpriteTemplateToPokemon(species, 0);
|
||||||
|
@ -366,7 +366,7 @@ static void InitContestMonPixels(u16 species, u8 whichSprite)
|
|||||||
LZDecompressVram(pal, gContestPaintingMonPalette);
|
LZDecompressVram(pal, gContestPaintingMonPalette);
|
||||||
if (whichSprite == 0)
|
if (whichSprite == 0)
|
||||||
{
|
{
|
||||||
HandleLoadSpecialPokePic_DontHandleDeoxys(
|
HandleLoadSpecialPokePic(
|
||||||
&gMonFrontPicTable[species],
|
&gMonFrontPicTable[species],
|
||||||
gMonSpritesGfxPtr->sprites[1],
|
gMonSpritesGfxPtr->sprites[1],
|
||||||
species,
|
species,
|
||||||
@ -375,7 +375,7 @@ static void InitContestMonPixels(u16 species, u8 whichSprite)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
HandleLoadSpecialPokePic_DontHandleDeoxys(
|
HandleLoadSpecialPokePic(
|
||||||
&gMonBackPicTable[species],
|
&gMonBackPicTable[species],
|
||||||
gMonSpritesGfxPtr->sprites[0],
|
gMonSpritesGfxPtr->sprites[0],
|
||||||
species,
|
species,
|
||||||
|
@ -876,22 +876,11 @@ static void Task_ShowWinnerMonBanner(u8 taskId)
|
|||||||
species = gContestMons[i].species;
|
species = gContestMons[i].species;
|
||||||
personality = gContestMons[i].personality;
|
personality = gContestMons[i].personality;
|
||||||
otId = gContestMons[i].otId;
|
otId = gContestMons[i].otId;
|
||||||
if (i == gContestPlayerMonIndex)
|
HandleLoadSpecialPokePic(
|
||||||
{
|
&gMonFrontPicTable[species],
|
||||||
HandleLoadSpecialPokePic_2(
|
gMonSpritesGfxPtr->sprites[1],
|
||||||
&gMonFrontPicTable[species],
|
species,
|
||||||
gMonSpritesGfxPtr->sprites[1],
|
personality);
|
||||||
species,
|
|
||||||
personality);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
HandleLoadSpecialPokePic_DontHandleDeoxys(
|
|
||||||
&gMonFrontPicTable[species],
|
|
||||||
gMonSpritesGfxPtr->sprites[1],
|
|
||||||
species,
|
|
||||||
personality);
|
|
||||||
}
|
|
||||||
|
|
||||||
pokePal = GetMonSpritePalStructFromOtIdPersonality(species, otId, personality);
|
pokePal = GetMonSpritePalStructFromOtIdPersonality(species, otId, personality);
|
||||||
LoadCompressedSpritePalette(pokePal);
|
LoadCompressedSpritePalette(pokePal);
|
||||||
@ -1090,14 +1079,9 @@ static void Task_FlashStarsAndHearts(u8 taskId)
|
|||||||
static void LoadContestMonIcon(u16 species, u8 monIndex, u8 srcOffset, u8 useDmaNow, u32 personality)
|
static void LoadContestMonIcon(u16 species, u8 monIndex, u8 srcOffset, u8 useDmaNow, u32 personality)
|
||||||
{
|
{
|
||||||
const u8 *iconPtr;
|
const u8 *iconPtr;
|
||||||
u16 var0, var1, frameNum;
|
u16 var0, var1;
|
||||||
|
|
||||||
if (monIndex == gContestPlayerMonIndex)
|
iconPtr = GetMonIconPtr(species, personality);
|
||||||
frameNum = 1;
|
|
||||||
else
|
|
||||||
frameNum = 0;
|
|
||||||
|
|
||||||
iconPtr = GetMonIconPtr(species, personality, frameNum);
|
|
||||||
iconPtr += srcOffset * 0x200 + 0x80;
|
iconPtr += srcOffset * 0x200 + 0x80;
|
||||||
if (useDmaNow)
|
if (useDmaNow)
|
||||||
{
|
{
|
||||||
@ -2551,10 +2535,7 @@ void ShowContestEntryMonPic(void)
|
|||||||
taskId = CreateTask(Task_ShowContestEntryMonPic, 0x50);
|
taskId = CreateTask(Task_ShowContestEntryMonPic, 0x50);
|
||||||
gTasks[taskId].data[0] = 0;
|
gTasks[taskId].data[0] = 0;
|
||||||
gTasks[taskId].data[1] = species;
|
gTasks[taskId].data[1] = species;
|
||||||
if (gSpecialVar_0x8006 == gContestPlayerMonIndex)
|
HandleLoadSpecialPokePic(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[1], species, personality);
|
||||||
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[1], species, personality);
|
|
||||||
else
|
|
||||||
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[1], species, personality);
|
|
||||||
|
|
||||||
palette = GetMonSpritePalStructFromOtIdPersonality(species, otId, personality);
|
palette = GetMonSpritePalStructFromOtIdPersonality(species, otId, personality);
|
||||||
LoadCompressedSpritePalette(palette);
|
LoadCompressedSpritePalette(palette);
|
||||||
|
@ -1168,20 +1168,6 @@ static const struct SpriteTemplate sSpriteTemplate_StatusIcons =
|
|||||||
.callback = SpriteCallbackDummy,
|
.callback = SpriteCallbackDummy,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Mask for the partners party in a multi battle. TRUE if in the partners party, FALSE otherwise
|
|
||||||
// The 7th slot is Cancel, and the 8th slot is unreachable
|
|
||||||
// Used only to determine whether or not to show the Deoxys form icon sprite
|
|
||||||
static const bool8 sMultiBattlePartnersPartyMask[PARTY_SIZE + 2] =
|
|
||||||
{
|
|
||||||
FALSE,
|
|
||||||
TRUE,
|
|
||||||
FALSE,
|
|
||||||
FALSE,
|
|
||||||
TRUE,
|
|
||||||
TRUE,
|
|
||||||
FALSE
|
|
||||||
};
|
|
||||||
|
|
||||||
static const u8 *const sUnused_StatStrings[] =
|
static const u8 *const sUnused_StatStrings[] =
|
||||||
{
|
{
|
||||||
gText_HP4,
|
gText_HP4,
|
||||||
|
106
src/decompress.c
106
src/decompress.c
@ -7,8 +7,6 @@
|
|||||||
|
|
||||||
EWRAM_DATA ALIGNED(4) u8 gDecompressionBuffer[0x4000] = {0};
|
EWRAM_DATA ALIGNED(4) u8 gDecompressionBuffer[0x4000] = {0};
|
||||||
|
|
||||||
static void DuplicateDeoxysTiles(void *pointer, s32 species);
|
|
||||||
|
|
||||||
void LZDecompressWram(const u32 *src, void *dest)
|
void LZDecompressWram(const u32 *src, void *dest)
|
||||||
{
|
{
|
||||||
LZ77UnCompWram(src, dest);
|
LZ77UnCompWram(src, dest);
|
||||||
@ -67,7 +65,6 @@ void DecompressPicFromTable(const struct CompressedSpriteSheet *src, void* buffe
|
|||||||
LZ77UnCompWram(gMonFrontPicTable[0].data, buffer);
|
LZ77UnCompWram(gMonFrontPicTable[0].data, buffer);
|
||||||
else
|
else
|
||||||
LZ77UnCompWram(src->data, buffer);
|
LZ77UnCompWram(src->data, buffer);
|
||||||
DuplicateDeoxysTiles(buffer, species);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleLoadSpecialPokePic(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality)
|
void HandleLoadSpecialPokePic(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality)
|
||||||
@ -79,7 +76,7 @@ void HandleLoadSpecialPokePic(const struct CompressedSpriteSheet *src, void *des
|
|||||||
else
|
else
|
||||||
isFrontPic = FALSE; // backPic
|
isFrontPic = FALSE; // backPic
|
||||||
|
|
||||||
LoadSpecialPokePic_2(src, dest, species, personality, isFrontPic);
|
LoadSpecialPokePic(src, dest, species, personality, isFrontPic);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadSpecialPokePic(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality, bool8 isFrontPic)
|
void LoadSpecialPokePic(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality, bool8 isFrontPic)
|
||||||
@ -105,7 +102,6 @@ void LoadSpecialPokePic(const struct CompressedSpriteSheet *src, void *dest, s32
|
|||||||
else
|
else
|
||||||
LZ77UnCompWram(src->data, dest);
|
LZ77UnCompWram(src->data, dest);
|
||||||
|
|
||||||
DuplicateDeoxysTiles(dest, species);
|
|
||||||
DrawSpindaSpots(species, personality, dest, isFrontPic);
|
DrawSpindaSpots(species, personality, dest, isFrontPic);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,103 +291,3 @@ bool8 LoadCompressedSpritePaletteUsingHeap(const struct CompressedSpritePalette
|
|||||||
Free(buffer);
|
Free(buffer);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DecompressPicFromTable_2(const struct CompressedSpriteSheet *src, void* buffer, s32 species) // a copy of DecompressPicFromTable
|
|
||||||
{
|
|
||||||
if (species > NUM_SPECIES)
|
|
||||||
LZ77UnCompWram(gMonFrontPicTable[0].data, buffer);
|
|
||||||
else
|
|
||||||
LZ77UnCompWram(src->data, buffer);
|
|
||||||
DuplicateDeoxysTiles(buffer, species);
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoadSpecialPokePic_2(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality, bool8 isFrontPic) // a copy of LoadSpecialPokePic
|
|
||||||
{
|
|
||||||
if (species == SPECIES_UNOWN)
|
|
||||||
{
|
|
||||||
u32 id = GetUnownSpeciesId(personality);
|
|
||||||
|
|
||||||
if (!isFrontPic)
|
|
||||||
LZ77UnCompWram(gMonBackPicTable[id].data, dest);
|
|
||||||
else
|
|
||||||
LZ77UnCompWram(gMonFrontPicTable[id].data, dest);
|
|
||||||
}
|
|
||||||
else if (species > NUM_SPECIES) // is species unknown? draw the ? icon
|
|
||||||
LZ77UnCompWram(gMonFrontPicTable[0].data, dest);
|
|
||||||
else if (SpeciesHasGenderDifference[species] && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE)
|
|
||||||
{
|
|
||||||
if (isFrontPic)
|
|
||||||
LZ77UnCompWram(gMonFrontPicTableFemale[species].data, dest);
|
|
||||||
else
|
|
||||||
LZ77UnCompWram(gMonBackPicTableFemale[species].data, dest);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
LZ77UnCompWram(src->data, dest);
|
|
||||||
|
|
||||||
DuplicateDeoxysTiles(dest, species);
|
|
||||||
DrawSpindaSpots(species, personality, dest, isFrontPic);
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleLoadSpecialPokePic_2(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality) // a copy of HandleLoadSpecialPokePic
|
|
||||||
{
|
|
||||||
bool8 isFrontPic;
|
|
||||||
|
|
||||||
if (src == &gMonFrontPicTable[species])
|
|
||||||
isFrontPic = TRUE; // frontPic
|
|
||||||
else
|
|
||||||
isFrontPic = FALSE; // backPic
|
|
||||||
|
|
||||||
LoadSpecialPokePic_2(src, dest, species, personality, isFrontPic);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DecompressPicFromTable_DontHandleDeoxys(const struct CompressedSpriteSheet *src, void* buffer, s32 species)
|
|
||||||
{
|
|
||||||
if (species > NUM_SPECIES)
|
|
||||||
LZ77UnCompWram(gMonFrontPicTable[0].data, buffer);
|
|
||||||
else
|
|
||||||
LZ77UnCompWram(src->data, buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleLoadSpecialPokePic_DontHandleDeoxys(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality)
|
|
||||||
{
|
|
||||||
bool8 isFrontPic;
|
|
||||||
|
|
||||||
if (src == &gMonFrontPicTable[species])
|
|
||||||
isFrontPic = TRUE; // frontPic
|
|
||||||
else
|
|
||||||
isFrontPic = FALSE; // backPic
|
|
||||||
|
|
||||||
LoadSpecialPokePic_DontHandleDeoxys(src, dest, species, personality, isFrontPic);
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoadSpecialPokePic_DontHandleDeoxys(const struct CompressedSpriteSheet *src, void *dest, s32 species, u32 personality, bool8 isFrontPic)
|
|
||||||
{
|
|
||||||
if (species == SPECIES_UNOWN)
|
|
||||||
{
|
|
||||||
u32 id = GetUnownSpeciesId(personality);
|
|
||||||
|
|
||||||
if (!isFrontPic)
|
|
||||||
LZ77UnCompWram(gMonBackPicTable[id].data, dest);
|
|
||||||
else
|
|
||||||
LZ77UnCompWram(gMonFrontPicTable[id].data, dest);
|
|
||||||
}
|
|
||||||
else if (species > NUM_SPECIES) // is species unknown? draw the ? icon
|
|
||||||
LZ77UnCompWram(gMonFrontPicTable[0].data, dest);
|
|
||||||
else if (SpeciesHasGenderDifference[species] && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE)
|
|
||||||
{
|
|
||||||
if (isFrontPic)
|
|
||||||
LZ77UnCompWram(gMonFrontPicTableFemale[species].data, dest);
|
|
||||||
else
|
|
||||||
LZ77UnCompWram(gMonBackPicTableFemale[species].data, dest);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
LZ77UnCompWram(src->data, dest);
|
|
||||||
|
|
||||||
DrawSpindaSpots(species, personality, dest, isFrontPic);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void DuplicateDeoxysTiles(void *pointer, s32 species)
|
|
||||||
{
|
|
||||||
if (species == SPECIES_DEOXYS)
|
|
||||||
CpuCopy32(pointer + 0x800, pointer, 0x800);
|
|
||||||
}
|
|
||||||
|
@ -433,9 +433,9 @@ static u8 EggHatchCreateMonSprite(u8 a0, u8 switchID, u8 pokeID, u16* speciesLoc
|
|||||||
{
|
{
|
||||||
u16 species = GetMonData(mon, MON_DATA_SPECIES);
|
u16 species = GetMonData(mon, MON_DATA_SPECIES);
|
||||||
u32 pid = GetMonData(mon, MON_DATA_PERSONALITY);
|
u32 pid = GetMonData(mon, MON_DATA_PERSONALITY);
|
||||||
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species],
|
HandleLoadSpecialPokePic(&gMonFrontPicTable[species],
|
||||||
gMonSpritesGfxPtr->sprites[(a0 * 2) + 1],
|
gMonSpritesGfxPtr->sprites[(a0 * 2) + 1],
|
||||||
species, pid);
|
species, pid);
|
||||||
LoadCompressedSpritePalette(GetMonSpritePalStruct(mon));
|
LoadCompressedSpritePalette(GetMonSpritePalStruct(mon));
|
||||||
*speciesLoc = species;
|
*speciesLoc = species;
|
||||||
}
|
}
|
||||||
|
@ -254,9 +254,9 @@ void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo,
|
|||||||
currSpecies = GetMonData(mon, MON_DATA_SPECIES);
|
currSpecies = GetMonData(mon, MON_DATA_SPECIES);
|
||||||
trainerId = GetMonData(mon, MON_DATA_OT_ID);
|
trainerId = GetMonData(mon, MON_DATA_OT_ID);
|
||||||
personality = GetMonData(mon, MON_DATA_PERSONALITY);
|
personality = GetMonData(mon, MON_DATA_PERSONALITY);
|
||||||
DecompressPicFromTable_2(&gMonFrontPicTable[currSpecies],
|
DecompressPicFromTable(&gMonFrontPicTable[currSpecies],
|
||||||
gMonSpritesGfxPtr->sprites[1],
|
gMonSpritesGfxPtr->sprites[1],
|
||||||
currSpecies);
|
currSpecies);
|
||||||
pokePal = GetMonSpritePalStructFromOtIdPersonality(currSpecies, trainerId, personality);
|
pokePal = GetMonSpritePalStructFromOtIdPersonality(currSpecies, trainerId, personality);
|
||||||
LoadCompressedPalette(pokePal->data, 0x110, 0x20);
|
LoadCompressedPalette(pokePal->data, 0x110, 0x20);
|
||||||
|
|
||||||
@ -269,9 +269,9 @@ void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo,
|
|||||||
gSprites[ID].invisible = TRUE;
|
gSprites[ID].invisible = TRUE;
|
||||||
|
|
||||||
// postEvo sprite
|
// postEvo sprite
|
||||||
DecompressPicFromTable_2(&gMonFrontPicTable[speciesToEvolve],
|
DecompressPicFromTable(&gMonFrontPicTable[speciesToEvolve],
|
||||||
gMonSpritesGfxPtr->sprites[3],
|
gMonSpritesGfxPtr->sprites[3],
|
||||||
speciesToEvolve);
|
speciesToEvolve);
|
||||||
pokePal = GetMonSpritePalStructFromOtIdPersonality(speciesToEvolve, trainerId, personality);
|
pokePal = GetMonSpritePalStructFromOtIdPersonality(speciesToEvolve, trainerId, personality);
|
||||||
LoadCompressedPalette(pokePal->data, 0x120, 0x20);
|
LoadCompressedPalette(pokePal->data, 0x120, 0x20);
|
||||||
|
|
||||||
@ -346,9 +346,9 @@ static void CB2_EvolutionSceneLoadGraphics(void)
|
|||||||
FreeAllSpritePalettes();
|
FreeAllSpritePalettes();
|
||||||
gReservedSpritePaletteCount = 4;
|
gReservedSpritePaletteCount = 4;
|
||||||
|
|
||||||
DecompressPicFromTable_2(&gMonFrontPicTable[postEvoSpecies],
|
DecompressPicFromTable(&gMonFrontPicTable[postEvoSpecies],
|
||||||
gMonSpritesGfxPtr->sprites[3],
|
gMonSpritesGfxPtr->sprites[3],
|
||||||
postEvoSpecies);
|
postEvoSpecies);
|
||||||
pokePal = GetMonSpritePalStructFromOtIdPersonality(postEvoSpecies, trainerId, personality);
|
pokePal = GetMonSpritePalStructFromOtIdPersonality(postEvoSpecies, trainerId, personality);
|
||||||
|
|
||||||
LoadCompressedPalette(pokePal->data, 0x120, 0x20);
|
LoadCompressedPalette(pokePal->data, 0x120, 0x20);
|
||||||
@ -418,9 +418,9 @@ static void CB2_TradeEvolutionSceneLoadGraphics(void)
|
|||||||
const struct CompressedSpritePalette* pokePal;
|
const struct CompressedSpritePalette* pokePal;
|
||||||
u32 trainerId = GetMonData(Mon, MON_DATA_OT_ID);
|
u32 trainerId = GetMonData(Mon, MON_DATA_OT_ID);
|
||||||
u32 personality = GetMonData(Mon, MON_DATA_PERSONALITY);
|
u32 personality = GetMonData(Mon, MON_DATA_PERSONALITY);
|
||||||
DecompressPicFromTable_2(&gMonFrontPicTable[postEvoSpecies],
|
DecompressPicFromTable(&gMonFrontPicTable[postEvoSpecies],
|
||||||
gMonSpritesGfxPtr->sprites[3],
|
gMonSpritesGfxPtr->sprites[3],
|
||||||
postEvoSpecies);
|
postEvoSpecies);
|
||||||
pokePal = GetMonSpritePalStructFromOtIdPersonality(postEvoSpecies, trainerId, personality);
|
pokePal = GetMonSpritePalStructFromOtIdPersonality(postEvoSpecies, trainerId, personality);
|
||||||
LoadCompressedPalette(pokePal->data, 0x120, 0x20);
|
LoadCompressedPalette(pokePal->data, 0x120, 0x20);
|
||||||
gMain.state++;
|
gMain.state++;
|
||||||
@ -482,9 +482,9 @@ void TradeEvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, u8 preEvoSpri
|
|||||||
sEvoStructPtr = AllocZeroed(sizeof(struct EvoInfo));
|
sEvoStructPtr = AllocZeroed(sizeof(struct EvoInfo));
|
||||||
sEvoStructPtr->preEvoSpriteID = preEvoSpriteID;
|
sEvoStructPtr->preEvoSpriteID = preEvoSpriteID;
|
||||||
|
|
||||||
DecompressPicFromTable_2(&gMonFrontPicTable[speciesToEvolve],
|
DecompressPicFromTable(&gMonFrontPicTable[speciesToEvolve],
|
||||||
gMonSpritesGfxPtr->sprites[1],
|
gMonSpritesGfxPtr->sprites[1],
|
||||||
speciesToEvolve);
|
speciesToEvolve);
|
||||||
|
|
||||||
pokePal = GetMonSpritePalStructFromOtIdPersonality(speciesToEvolve, trainerId, personality);
|
pokePal = GetMonSpritePalStructFromOtIdPersonality(speciesToEvolve, trainerId, personality);
|
||||||
LoadCompressedPalette(pokePal->data, 0x120, 0x20);
|
LoadCompressedPalette(pokePal->data, 0x120, 0x20);
|
||||||
|
@ -902,7 +902,7 @@ u8 AddNewGameBirchObject(s16 x, s16 y, u8 subpriority)
|
|||||||
|
|
||||||
u8 CreateMonSprite_PicBox(u16 species, s16 x, s16 y, u8 subpriority)
|
u8 CreateMonSprite_PicBox(u16 species, s16 x, s16 y, u8 subpriority)
|
||||||
{
|
{
|
||||||
s32 spriteId = CreateMonPicSprite_HandleDeoxys(species, 0, 0x8000, 1, x, y, 0, gMonPaletteTable[species].tag);
|
s32 spriteId = CreateMonPicSprite(species, 0, 0x8000, 1, x, y, 0, gMonPaletteTable[species].tag);
|
||||||
PreservePaletteInWeather(IndexOfSpritePaletteTag(gMonPaletteTable[species].tag) + 0x10);
|
PreservePaletteInWeather(IndexOfSpritePaletteTag(gMonPaletteTable[species].tag) + 0x10);
|
||||||
if (spriteId == 0xFFFF)
|
if (spriteId == 0xFFFF)
|
||||||
return MAX_SPRITES;
|
return MAX_SPRITES;
|
||||||
@ -913,7 +913,7 @@ u8 CreateMonSprite_PicBox(u16 species, s16 x, s16 y, u8 subpriority)
|
|||||||
u8 CreateMonSprite_FieldMove(u16 species, u32 otId, u32 personality, s16 x, s16 y, u8 subpriority)
|
u8 CreateMonSprite_FieldMove(u16 species, u32 otId, u32 personality, s16 x, s16 y, u8 subpriority)
|
||||||
{
|
{
|
||||||
const struct CompressedSpritePalette *spritePalette = GetMonSpritePalStructFromOtIdPersonality(species, otId, personality);
|
const struct CompressedSpritePalette *spritePalette = GetMonSpritePalStructFromOtIdPersonality(species, otId, personality);
|
||||||
u16 spriteId = CreateMonPicSprite_HandleDeoxys(species, otId, personality, 1, x, y, 0, spritePalette->tag);
|
u16 spriteId = CreateMonPicSprite(species, otId, personality, 1, x, y, 0, spritePalette->tag);
|
||||||
PreservePaletteInWeather(IndexOfSpritePaletteTag(spritePalette->tag) + 0x10);
|
PreservePaletteInWeather(IndexOfSpritePaletteTag(spritePalette->tag) + 0x10);
|
||||||
if (spriteId == 0xFFFF)
|
if (spriteId == 0xFFFF)
|
||||||
return MAX_SPRITES;
|
return MAX_SPRITES;
|
||||||
|
@ -931,7 +931,7 @@ static void Task_HofPC_DrawSpritesPrintText(u8 taskId)
|
|||||||
if (currMon->species == SPECIES_EGG)
|
if (currMon->species == SPECIES_EGG)
|
||||||
posY += 10;
|
posY += 10;
|
||||||
|
|
||||||
spriteId = CreateMonPicSprite_HandleDeoxys(currMon->species, currMon->tid, currMon->personality, 1, posX, posY, i, 0xFFFF);
|
spriteId = CreateMonPicSprite(currMon->species, currMon->tid, currMon->personality, 1, posX, posY, i, 0xFFFF);
|
||||||
gSprites[spriteId].oam.priority = 1;
|
gSprites[spriteId].oam.priority = 1;
|
||||||
gTasks[taskId].tMonSpriteId(i) = spriteId;
|
gTasks[taskId].tMonSpriteId(i) = spriteId;
|
||||||
}
|
}
|
||||||
|
@ -404,11 +404,11 @@ static bool8 MailReadBuildGraphics(void)
|
|||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
LoadMonIconPalette(icon);
|
LoadMonIconPalette(icon);
|
||||||
sMailRead->monIconSprite = sub_80D2D78(icon, SpriteCallbackDummy, 0x60, 0x80, 0, 0);
|
sMailRead->monIconSprite = sub_80D2D78(icon, SpriteCallbackDummy, 0x60, 0x80, 0);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
LoadMonIconPalette(icon);
|
LoadMonIconPalette(icon);
|
||||||
sMailRead->monIconSprite = sub_80D2D78(icon, SpriteCallbackDummy, 0x28, 0x80, 0, 0);
|
sMailRead->monIconSprite = sub_80D2D78(icon, SpriteCallbackDummy, 0x28, 0x80, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -2095,7 +2095,7 @@ void sub_819A25C(u8 palOffset, u16 speciesId)
|
|||||||
|
|
||||||
void sub_819A27C(u8 windowId, u16 speciesId, u32 personality, u16 x, u16 y)
|
void sub_819A27C(u8 windowId, u16 speciesId, u32 personality, u16 x, u16 y)
|
||||||
{
|
{
|
||||||
BlitBitmapToWindow(windowId, GetMonIconPtr(speciesId, personality, 1), x, y, 32, 32);
|
BlitBitmapToWindow(windowId, GetMonIconPtr(speciesId, personality), x, y, 32, 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ListMenuLoadStdPalAt(u8 palOffset, u8 palId)
|
void ListMenuLoadStdPalAt(u8 palOffset, u8 palId)
|
||||||
|
@ -420,7 +420,7 @@ void sub_801C4C0(void)
|
|||||||
sWonderCardData->unk_017C = 0xFF;
|
sWonderCardData->unk_017C = 0xFF;
|
||||||
if (sWonderCardData->unk_014C.unk_06 != SPECIES_NONE)
|
if (sWonderCardData->unk_014C.unk_06 != SPECIES_NONE)
|
||||||
{
|
{
|
||||||
sWonderCardData->unk_017C = sub_80D2D78(sub_80D2E84(sWonderCardData->unk_014C.unk_06), SpriteCallbackDummy, 0xDC, 0x14, 0, FALSE);
|
sWonderCardData->unk_017C = sub_80D2D78(sub_80D2E84(sWonderCardData->unk_014C.unk_06), SpriteCallbackDummy, 0xDC, 0x14, 0);
|
||||||
gSprites[sWonderCardData->unk_017C].oam.priority = 2;
|
gSprites[sWonderCardData->unk_017C].oam.priority = 2;
|
||||||
}
|
}
|
||||||
if (sWonderCardData->unk_0000.unk_09 != 0 && sWonderCardData->unk_0000.unk_08_0 == 1)
|
if (sWonderCardData->unk_0000.unk_09 != 0 && sWonderCardData->unk_0000.unk_08_0 == 1)
|
||||||
@ -434,7 +434,7 @@ void sub_801C4C0(void)
|
|||||||
sWonderCardData->unk_017D[r7][0] = CreateSprite(&gUnknown_082F1D48, 0xd8 - 32 * r7, 0x90, 8);
|
sWonderCardData->unk_017D[r7][0] = CreateSprite(&gUnknown_082F1D48, 0xd8 - 32 * r7, 0x90, 8);
|
||||||
if (sWonderCardData->unk_014C.unk_08[0][r7] != 0)
|
if (sWonderCardData->unk_014C.unk_08[0][r7] != 0)
|
||||||
{
|
{
|
||||||
sWonderCardData->unk_017D[r7][1] = sub_80D2D78(sub_80D2E84(sWonderCardData->unk_014C.unk_08[0][r7]), SpriteCallbackDummy, 0xd8 - 32 * r7, 0x88, 0, 0);
|
sWonderCardData->unk_017D[r7][1] = sub_80D2D78(sub_80D2E84(sWonderCardData->unk_014C.unk_08[0][r7]), SpriteCallbackDummy, 0xd8 - 32 * r7, 0x88, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1420,7 +1420,7 @@ static void NamingScreen_CreateMonIcon(void)
|
|||||||
u8 spriteId;
|
u8 spriteId;
|
||||||
|
|
||||||
LoadMonIconPalettes();
|
LoadMonIconPalettes();
|
||||||
spriteId = CreateMonIcon(sNamingScreen->monSpecies, SpriteCallbackDummy, 56, 40, 0, sNamingScreen->monPersonality, 1);
|
spriteId = CreateMonIcon(sNamingScreen->monSpecies, SpriteCallbackDummy, 56, 40, 0, sNamingScreen->monPersonality);
|
||||||
gSprites[spriteId].oam.priority = 3;
|
gSprites[spriteId].oam.priority = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ static void DisplayPartyPokemonGender(u8, u16, u8*, struct PartyMenuBox *);
|
|||||||
static void DisplayPartyPokemonHP(u16, struct PartyMenuBox *);
|
static void DisplayPartyPokemonHP(u16, struct PartyMenuBox *);
|
||||||
static void DisplayPartyPokemonMaxHP(u16, struct PartyMenuBox *);
|
static void DisplayPartyPokemonMaxHP(u16, struct PartyMenuBox *);
|
||||||
static void DisplayPartyPokemonHPBar(u16, u16, struct PartyMenuBox *);
|
static void DisplayPartyPokemonHPBar(u16, u16, struct PartyMenuBox *);
|
||||||
static void CreatePartyMonIconSpriteParameterized(u16, u32, struct PartyMenuBox *, u8, u32);
|
static void CreatePartyMonIconSpriteParameterized(u16, u32, struct PartyMenuBox *, u8);
|
||||||
static void CreatePartyMonHeldItemSpriteParameterized(u16, u16, struct PartyMenuBox *);
|
static void CreatePartyMonHeldItemSpriteParameterized(u16, u16, struct PartyMenuBox *);
|
||||||
static void CreatePartyMonPokeballSpriteParameterized(u16, struct PartyMenuBox *);
|
static void CreatePartyMonPokeballSpriteParameterized(u16, struct PartyMenuBox *);
|
||||||
static void CreatePartyMonStatusSpriteParameterized(u16, u8, struct PartyMenuBox *);
|
static void CreatePartyMonStatusSpriteParameterized(u16, u8, struct PartyMenuBox *);
|
||||||
@ -990,7 +990,7 @@ static void CreatePartyMonSprites(u8 slot)
|
|||||||
|
|
||||||
if (gMultiPartnerParty[actualSlot].species != SPECIES_NONE)
|
if (gMultiPartnerParty[actualSlot].species != SPECIES_NONE)
|
||||||
{
|
{
|
||||||
CreatePartyMonIconSpriteParameterized(gMultiPartnerParty[actualSlot].species, gMultiPartnerParty[actualSlot].personality, &sPartyMenuBoxes[slot], 0, FALSE);
|
CreatePartyMonIconSpriteParameterized(gMultiPartnerParty[actualSlot].species, gMultiPartnerParty[actualSlot].personality, &sPartyMenuBoxes[slot], 0);
|
||||||
CreatePartyMonHeldItemSpriteParameterized(gMultiPartnerParty[actualSlot].species, gMultiPartnerParty[actualSlot].heldItem, &sPartyMenuBoxes[slot]);
|
CreatePartyMonHeldItemSpriteParameterized(gMultiPartnerParty[actualSlot].species, gMultiPartnerParty[actualSlot].heldItem, &sPartyMenuBoxes[slot]);
|
||||||
CreatePartyMonPokeballSpriteParameterized(gMultiPartnerParty[actualSlot].species, &sPartyMenuBoxes[slot]);
|
CreatePartyMonPokeballSpriteParameterized(gMultiPartnerParty[actualSlot].species, &sPartyMenuBoxes[slot]);
|
||||||
if (gMultiPartnerParty[actualSlot].hp == 0)
|
if (gMultiPartnerParty[actualSlot].hp == 0)
|
||||||
@ -3854,23 +3854,18 @@ static bool8 SetUpFieldMove_Dive(void)
|
|||||||
|
|
||||||
static void CreatePartyMonIconSprite(struct Pokemon *mon, struct PartyMenuBox *menuBox, u32 slot)
|
static void CreatePartyMonIconSprite(struct Pokemon *mon, struct PartyMenuBox *menuBox, u32 slot)
|
||||||
{
|
{
|
||||||
bool32 handleDeoxys = TRUE;
|
|
||||||
u16 species2;
|
u16 species2;
|
||||||
|
|
||||||
// If in a multi battle, show partners Deoxys icon as Normal forme
|
|
||||||
if (IsMultiBattle() == TRUE && gMain.inBattle)
|
|
||||||
handleDeoxys = (sMultiBattlePartnersPartyMask[slot] ^ handleDeoxys) ? TRUE : FALSE;
|
|
||||||
|
|
||||||
species2 = GetMonData(mon, MON_DATA_SPECIES2);
|
species2 = GetMonData(mon, MON_DATA_SPECIES2);
|
||||||
CreatePartyMonIconSpriteParameterized(species2, GetMonData(mon, MON_DATA_PERSONALITY), menuBox, 1, handleDeoxys);
|
CreatePartyMonIconSpriteParameterized(species2, GetMonData(mon, MON_DATA_PERSONALITY), menuBox, 1);
|
||||||
UpdatePartyMonHPBar(menuBox->monSpriteId, mon);
|
UpdatePartyMonHPBar(menuBox->monSpriteId, mon);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CreatePartyMonIconSpriteParameterized(u16 species, u32 pid, struct PartyMenuBox *menuBox, u8 priority, bool32 handleDeoxys)
|
static void CreatePartyMonIconSpriteParameterized(u16 species, u32 pid, struct PartyMenuBox *menuBox, u8 priority)
|
||||||
{
|
{
|
||||||
if (species != SPECIES_NONE)
|
if (species != SPECIES_NONE)
|
||||||
{
|
{
|
||||||
menuBox->monSpriteId = CreateMonIcon(species, SpriteCB_MonIcon, menuBox->spriteCoords[0], menuBox->spriteCoords[1], 4, pid, handleDeoxys);
|
menuBox->monSpriteId = CreateMonIcon(species, SpriteCB_MonIcon, menuBox->spriteCoords[0], menuBox->spriteCoords[1], 4, pid);
|
||||||
gSprites[menuBox->monSpriteId].oam.priority = priority;
|
gSprites[menuBox->monSpriteId].oam.priority = priority;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -646,7 +646,7 @@ static bool8 LoadMonAndSceneGfx(struct Pokemon *mon)
|
|||||||
case 0:
|
case 0:
|
||||||
species = GetMonData(mon, MON_DATA_SPECIES2);
|
species = GetMonData(mon, MON_DATA_SPECIES2);
|
||||||
personality = GetMonData(mon, MON_DATA_PERSONALITY);
|
personality = GetMonData(mon, MON_DATA_PERSONALITY);
|
||||||
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[1], species, personality);
|
HandleLoadSpecialPokePic(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[1], species, personality);
|
||||||
sPokeblockFeed->loadGfxState++;
|
sPokeblockFeed->loadGfxState++;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -4607,7 +4607,7 @@ static u32 GetPokedexMonPersonality(u16 species)
|
|||||||
u16 CreateMonSpriteFromNationalDexNumber(u16 nationalNum, s16 x, s16 y, u16 paletteSlot)
|
u16 CreateMonSpriteFromNationalDexNumber(u16 nationalNum, s16 x, s16 y, u16 paletteSlot)
|
||||||
{
|
{
|
||||||
nationalNum = NationalPokedexNumToSpecies(nationalNum);
|
nationalNum = NationalPokedexNumToSpecies(nationalNum);
|
||||||
return CreateMonPicSprite_HandleDeoxys(nationalNum, SHINY_ODDS, GetPokedexMonPersonality(nationalNum), TRUE, x, y, paletteSlot, 0xFFFF);
|
return CreateMonPicSprite(nationalNum, SHINY_ODDS, GetPokedexMonPersonality(nationalNum), TRUE, x, y, paletteSlot, 0xFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
static u16 CreateSizeScreenTrainerPic(u16 species, s16 x, s16 y, s8 paletteSlot)
|
static u16 CreateSizeScreenTrainerPic(u16 species, s16 x, s16 y, s8 paletteSlot)
|
||||||
|
@ -2692,16 +2692,6 @@ const u8 gStatStageRatios[MAX_STAT_STAGE + 1][2] =
|
|||||||
{40, 10}, // +6, MAX_STAT_STAGE
|
{40, 10}, // +6, MAX_STAT_STAGE
|
||||||
};
|
};
|
||||||
|
|
||||||
static const u16 sDeoxysBaseStats[] =
|
|
||||||
{
|
|
||||||
[STAT_HP] = 50,
|
|
||||||
[STAT_ATK] = 95,
|
|
||||||
[STAT_DEF] = 90,
|
|
||||||
[STAT_SPEED] = 180,
|
|
||||||
[STAT_SPATK] = 95,
|
|
||||||
[STAT_SPDEF] = 90,
|
|
||||||
};
|
|
||||||
|
|
||||||
const u16 gLinkPlayerFacilityClasses[NUM_MALE_LINK_FACILITY_CLASSES + NUM_FEMALE_LINK_FACILITY_CLASSES] =
|
const u16 gLinkPlayerFacilityClasses[NUM_MALE_LINK_FACILITY_CLASSES + NUM_FEMALE_LINK_FACILITY_CLASSES] =
|
||||||
{
|
{
|
||||||
// Male classes
|
// Male classes
|
||||||
@ -3487,51 +3477,6 @@ bool8 sub_80688F8(u8 caseId, u8 battlerId)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u16 GetDeoxysStat(struct Pokemon *mon, s32 statId)
|
|
||||||
{
|
|
||||||
s32 ivVal, evVal;
|
|
||||||
u16 statValue = 0;
|
|
||||||
u8 nature;
|
|
||||||
|
|
||||||
if (gBattleTypeFlags & BATTLE_TYPE_20 || GetMonData(mon, MON_DATA_SPECIES, NULL) != SPECIES_DEOXYS)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
ivVal = GetMonData(mon, MON_DATA_HP_IV + statId, NULL);
|
|
||||||
evVal = GetMonData(mon, MON_DATA_HP_EV + statId, NULL);
|
|
||||||
statValue = ((sDeoxysBaseStats[statId] * 2 + ivVal + evVal / 4) * mon->level) / 100 + 5;
|
|
||||||
nature = GetNature(mon);
|
|
||||||
statValue = ModifyStatByNature(nature, statValue, (u8)statId);
|
|
||||||
return statValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetDeoxysStats(void)
|
|
||||||
{
|
|
||||||
s32 i, value;
|
|
||||||
|
|
||||||
for (i = 0; i < PARTY_SIZE; i++)
|
|
||||||
{
|
|
||||||
struct Pokemon *mon = &gPlayerParty[i];
|
|
||||||
|
|
||||||
if (GetMonData(mon, MON_DATA_SPECIES, NULL) != SPECIES_DEOXYS)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
value = GetMonData(mon, MON_DATA_ATK, NULL);
|
|
||||||
SetMonData(mon, MON_DATA_ATK, &value);
|
|
||||||
|
|
||||||
value = GetMonData(mon, MON_DATA_DEF, NULL);
|
|
||||||
SetMonData(mon, MON_DATA_DEF, &value);
|
|
||||||
|
|
||||||
value = GetMonData(mon, MON_DATA_SPEED, NULL);
|
|
||||||
SetMonData(mon, MON_DATA_SPEED, &value);
|
|
||||||
|
|
||||||
value = GetMonData(mon, MON_DATA_SPATK, NULL);
|
|
||||||
SetMonData(mon, MON_DATA_SPATK, &value);
|
|
||||||
|
|
||||||
value = GetMonData(mon, MON_DATA_SPDEF, NULL);
|
|
||||||
SetMonData(mon, MON_DATA_SPDEF, &value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
u16 GetUnionRoomTrainerPic(void)
|
u16 GetUnionRoomTrainerPic(void)
|
||||||
{
|
{
|
||||||
u8 linkId;
|
u8 linkId;
|
||||||
@ -4422,29 +4367,19 @@ u32 GetMonData(struct Pokemon *mon, s32 field, u8* data)
|
|||||||
ret = mon->maxHP;
|
ret = mon->maxHP;
|
||||||
break;
|
break;
|
||||||
case MON_DATA_ATK:
|
case MON_DATA_ATK:
|
||||||
ret = GetDeoxysStat(mon, STAT_ATK);
|
ret = mon->attack;
|
||||||
if (!ret)
|
|
||||||
ret = mon->attack;
|
|
||||||
break;
|
break;
|
||||||
case MON_DATA_DEF:
|
case MON_DATA_DEF:
|
||||||
ret = GetDeoxysStat(mon, STAT_DEF);
|
ret = mon->defense;
|
||||||
if (!ret)
|
|
||||||
ret = mon->defense;
|
|
||||||
break;
|
break;
|
||||||
case MON_DATA_SPEED:
|
case MON_DATA_SPEED:
|
||||||
ret = GetDeoxysStat(mon, STAT_SPEED);
|
ret = mon->speed;
|
||||||
if (!ret)
|
|
||||||
ret = mon->speed;
|
|
||||||
break;
|
break;
|
||||||
case MON_DATA_SPATK:
|
case MON_DATA_SPATK:
|
||||||
ret = GetDeoxysStat(mon, STAT_SPATK);
|
ret = mon->spAttack;
|
||||||
if (!ret)
|
|
||||||
ret = mon->spAttack;
|
|
||||||
break;
|
break;
|
||||||
case MON_DATA_SPDEF:
|
case MON_DATA_SPDEF:
|
||||||
ret = GetDeoxysStat(mon, STAT_SPDEF);
|
ret = mon->spDefense;
|
||||||
if (!ret)
|
|
||||||
ret = mon->spDefense;
|
|
||||||
break;
|
break;
|
||||||
case MON_DATA_ATK2:
|
case MON_DATA_ATK2:
|
||||||
ret = mon->attack;
|
ret = mon->attack;
|
||||||
@ -7726,7 +7661,6 @@ const u8 *GetTrainerNameFromId(u16 trainerId)
|
|||||||
bool8 HasTwoFramesAnimation(u16 species)
|
bool8 HasTwoFramesAnimation(u16 species)
|
||||||
{
|
{
|
||||||
return (species != SPECIES_CASTFORM
|
return (species != SPECIES_CASTFORM
|
||||||
&& species != SPECIES_DEOXYS
|
|
||||||
&& species != SPECIES_SPINDA
|
&& species != SPECIES_SPINDA
|
||||||
&& species != SPECIES_UNOWN
|
&& species != SPECIES_UNOWN
|
||||||
&& species != SPECIES_CHERRIM);
|
&& species != SPECIES_CHERRIM);
|
||||||
|
@ -2534,13 +2534,13 @@ const u16 sSpriteImageSizes[3][4] =
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u32 personality, bool32 handleDeoxys)
|
u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u32 personality)
|
||||||
{
|
{
|
||||||
u8 spriteId;
|
u8 spriteId;
|
||||||
struct MonIconSpriteTemplate iconTemplate =
|
struct MonIconSpriteTemplate iconTemplate =
|
||||||
{
|
{
|
||||||
.oam = &sMonIconOamData,
|
.oam = &sMonIconOamData,
|
||||||
.image = GetMonIconPtr(species, personality, handleDeoxys),
|
.image = GetMonIconPtr(species, personality),
|
||||||
.anims = sMonIconAnims,
|
.anims = sMonIconAnims,
|
||||||
.affineAnims = sMonIconAffineAnims,
|
.affineAnims = sMonIconAffineAnims,
|
||||||
.callback = callback,
|
.callback = callback,
|
||||||
@ -2559,7 +2559,7 @@ u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u
|
|||||||
return spriteId;
|
return spriteId;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 sub_80D2D78(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, bool32 extra)
|
u8 sub_80D2D78(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority)
|
||||||
{
|
{
|
||||||
u8 spriteId;
|
u8 spriteId;
|
||||||
struct MonIconSpriteTemplate iconTemplate =
|
struct MonIconSpriteTemplate iconTemplate =
|
||||||
@ -2572,7 +2572,7 @@ u8 sub_80D2D78(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8
|
|||||||
.paletteTag = POKE_ICON_BASE_PAL_TAG + gMonIconPaletteIndices[species],
|
.paletteTag = POKE_ICON_BASE_PAL_TAG + gMonIconPaletteIndices[species],
|
||||||
};
|
};
|
||||||
|
|
||||||
iconTemplate.image = GetMonIconTiles(species, extra, 0);
|
iconTemplate.image = GetMonIconTiles(species, 0);
|
||||||
spriteId = CreateMonIconSprite(&iconTemplate, x, y, subpriority);
|
spriteId = CreateMonIconSprite(&iconTemplate, x, y, subpriority);
|
||||||
|
|
||||||
UpdateMonIconFrame(&gSprites[spriteId]);
|
UpdateMonIconFrame(&gSprites[spriteId]);
|
||||||
@ -2625,9 +2625,9 @@ u16 sub_80D2E84(u16 species)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const u8 *GetMonIconPtr(u16 species, u32 personality, bool32 handleDeoxys)
|
const u8 *GetMonIconPtr(u16 species, u32 personality)
|
||||||
{
|
{
|
||||||
return GetMonIconTiles(GetIconSpecies(species, personality), handleDeoxys, personality);
|
return GetMonIconTiles(GetIconSpecies(species, personality), personality);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FreeAndDestroyMonIconSprite(struct Sprite *sprite)
|
void FreeAndDestroyMonIconSprite(struct Sprite *sprite)
|
||||||
@ -2689,14 +2689,10 @@ void SpriteCB_MonIcon(struct Sprite *sprite)
|
|||||||
UpdateMonIconFrame(sprite);
|
UpdateMonIconFrame(sprite);
|
||||||
}
|
}
|
||||||
|
|
||||||
const u8* GetMonIconTiles(u16 species, bool32 handleDeoxys, u32 personality)
|
const u8* GetMonIconTiles(u16 species, u32 personality)
|
||||||
{
|
{
|
||||||
const u8* iconSprite = gMonIconTable[species];
|
const u8* iconSprite = gMonIconTable[species];
|
||||||
if (species == SPECIES_DEOXYS && handleDeoxys == TRUE)
|
if (SpeciesHasGenderDifference[species] && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE)
|
||||||
{
|
|
||||||
iconSprite = (const u8*)(0x400 + (u32)iconSprite); // use the specific Deoxys form icon (Speed in this case)
|
|
||||||
}
|
|
||||||
else if (SpeciesHasGenderDifference[species] && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE)
|
|
||||||
{
|
{
|
||||||
iconSprite = gMonIconTableFemale[species];
|
iconSprite = gMonIconTableFemale[species];
|
||||||
}
|
}
|
||||||
|
@ -5169,7 +5169,7 @@ static u16 sub_80CC124(u16 species, u32 personality)
|
|||||||
sPSSData->field_B58[i] = species;
|
sPSSData->field_B58[i] = species;
|
||||||
sPSSData->field_B08[i]++;
|
sPSSData->field_B08[i]++;
|
||||||
var = 16 * i;
|
var = 16 * i;
|
||||||
CpuCopy32(GetMonIconTiles(species, TRUE, personality), (void*)(OBJ_VRAM0) + var * 32, 0x200);
|
CpuCopy32(GetMonIconTiles(species, personality), (void*)(OBJ_VRAM0) + var * 32, 0x200);
|
||||||
|
|
||||||
return var;
|
return var;
|
||||||
}
|
}
|
||||||
@ -8335,7 +8335,7 @@ static void sub_80D07B0(u8 arg0, u8 arg1)
|
|||||||
|
|
||||||
if (species != SPECIES_NONE)
|
if (species != SPECIES_NONE)
|
||||||
{
|
{
|
||||||
const u8 *iconGfx = GetMonIconPtr(species, personality, 1);
|
const u8 *iconGfx = GetMonIconPtr(species, personality);
|
||||||
u8 index = GetValidMonIconPalIndex(species) + 8;
|
u8 index = GetValidMonIconPalIndex(species) + 8;
|
||||||
|
|
||||||
BlitBitmapRectToWindow4BitTo8Bit(sPSSData->field_2200,
|
BlitBitmapRectToWindow4BitTo8Bit(sPSSData->field_2200,
|
||||||
|
@ -3863,26 +3863,17 @@ static u8 LoadMonGfxAndSprite(struct Pokemon *mon, s16 *state)
|
|||||||
case 0:
|
case 0:
|
||||||
if (gMain.inBattle)
|
if (gMain.inBattle)
|
||||||
{
|
{
|
||||||
if (sub_80688F8(3, sMonSummaryScreen->curMonIndex))
|
HandleLoadSpecialPokePic(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites[1], summary->species2, summary->pid);
|
||||||
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites[1], summary->species2, summary->pid);
|
|
||||||
else
|
|
||||||
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites[1], summary->species2, summary->pid);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (gMonSpritesGfxPtr != NULL)
|
if (gMonSpritesGfxPtr != NULL)
|
||||||
{
|
{
|
||||||
if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == PSS_MODE_BOX || sMonSummaryScreen->unk40EF == TRUE)
|
HandleLoadSpecialPokePic(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites[1], summary->species2, summary->pid);
|
||||||
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites[1], summary->species2, summary->pid);
|
|
||||||
else
|
|
||||||
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites[1], summary->species2, summary->pid);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == PSS_MODE_BOX || sMonSummaryScreen->unk40EF == TRUE)
|
HandleLoadSpecialPokePic(&gMonFrontPicTable[summary->species2], sub_806F4F8(0, 1), summary->species2, summary->pid);
|
||||||
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], sub_806F4F8(0, 1), summary->species2, summary->pid);
|
|
||||||
else
|
|
||||||
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], sub_806F4F8(0, 1), summary->species2, summary->pid);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(*state)++;
|
(*state)++;
|
||||||
|
@ -912,7 +912,7 @@ u16 DrawRibbonsMonFrontPic(s32 unused0, s32 unused1)
|
|||||||
u32 personality, otId;
|
u32 personality, otId;
|
||||||
|
|
||||||
GetCurrMonInfo2(&species, &personality, &otId);
|
GetCurrMonInfo2(&species, &personality, &otId);
|
||||||
spriteId = CreateMonPicSprite_HandleDeoxys(species, otId, personality, TRUE, 40, 104, 15, 0xFFFF);
|
spriteId = CreateMonPicSprite(species, otId, personality, TRUE, 40, 104, 15, 0xFFFF);
|
||||||
gSprites[spriteId].oam.priority = 0;
|
gSprites[spriteId].oam.priority = 0;
|
||||||
return spriteId;
|
return spriteId;
|
||||||
}
|
}
|
||||||
|
21
src/trade.c
21
src/trade.c
@ -484,8 +484,7 @@ static void CB2_CreateTradeMenu(void)
|
|||||||
(sTradeMonSpriteCoords[i][0] * 8) + 14,
|
(sTradeMonSpriteCoords[i][0] * 8) + 14,
|
||||||
(sTradeMonSpriteCoords[i][1] * 8) - 12,
|
(sTradeMonSpriteCoords[i][1] * 8) - 12,
|
||||||
1,
|
1,
|
||||||
GetMonData(mon, MON_DATA_PERSONALITY),
|
GetMonData(mon, MON_DATA_PERSONALITY));
|
||||||
TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < sTradeMenuData->partyCounts[TRADE_PARTNER]; i++)
|
for (i = 0; i < sTradeMenuData->partyCounts[TRADE_PARTNER]; i++)
|
||||||
@ -496,8 +495,7 @@ static void CB2_CreateTradeMenu(void)
|
|||||||
(sTradeMonSpriteCoords[i + PARTY_SIZE][0] * 8) + 14,
|
(sTradeMonSpriteCoords[i + PARTY_SIZE][0] * 8) + 14,
|
||||||
(sTradeMonSpriteCoords[i + PARTY_SIZE][1] * 8) - 12,
|
(sTradeMonSpriteCoords[i + PARTY_SIZE][1] * 8) - 12,
|
||||||
1,
|
1,
|
||||||
GetMonData(mon, MON_DATA_PERSONALITY),
|
GetMonData(mon, MON_DATA_PERSONALITY));
|
||||||
FALSE);
|
|
||||||
}
|
}
|
||||||
gMain.state++;
|
gMain.state++;
|
||||||
break;
|
break;
|
||||||
@ -671,8 +669,7 @@ static void CB2_ReturnToTradeMenu(void)
|
|||||||
(sTradeMonSpriteCoords[i][0] * 8) + 14,
|
(sTradeMonSpriteCoords[i][0] * 8) + 14,
|
||||||
(sTradeMonSpriteCoords[i][1] * 8) - 12,
|
(sTradeMonSpriteCoords[i][1] * 8) - 12,
|
||||||
1,
|
1,
|
||||||
GetMonData(mon, MON_DATA_PERSONALITY),
|
GetMonData(mon, MON_DATA_PERSONALITY));
|
||||||
TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < sTradeMenuData->partyCounts[TRADE_PARTNER]; i++)
|
for (i = 0; i < sTradeMenuData->partyCounts[TRADE_PARTNER]; i++)
|
||||||
@ -683,8 +680,7 @@ static void CB2_ReturnToTradeMenu(void)
|
|||||||
(sTradeMonSpriteCoords[i + PARTY_SIZE][0] * 8) + 14,
|
(sTradeMonSpriteCoords[i + PARTY_SIZE][0] * 8) + 14,
|
||||||
(sTradeMonSpriteCoords[i + PARTY_SIZE][1] * 8) - 12,
|
(sTradeMonSpriteCoords[i + PARTY_SIZE][1] * 8) - 12,
|
||||||
1,
|
1,
|
||||||
GetMonData(mon, MON_DATA_PERSONALITY),
|
GetMonData(mon, MON_DATA_PERSONALITY));
|
||||||
FALSE);
|
|
||||||
}
|
}
|
||||||
gMain.state++;
|
gMain.state++;
|
||||||
break;
|
break;
|
||||||
@ -2723,10 +2719,7 @@ static void LoadTradeMonPic(u8 whichParty, u8 state)
|
|||||||
species = GetMonData(mon, MON_DATA_SPECIES2);
|
species = GetMonData(mon, MON_DATA_SPECIES2);
|
||||||
personality = GetMonData(mon, MON_DATA_PERSONALITY);
|
personality = GetMonData(mon, MON_DATA_PERSONALITY);
|
||||||
|
|
||||||
if (whichParty == TRADE_PLAYER)
|
HandleLoadSpecialPokePic(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[whichParty * 2 + 1], species, personality);
|
||||||
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[1], species, personality);
|
|
||||||
else
|
|
||||||
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[whichParty * 2 + 1], species, personality);
|
|
||||||
|
|
||||||
LoadCompressedSpritePalette(GetMonSpritePalStruct(mon));
|
LoadCompressedSpritePalette(GetMonSpritePalStruct(mon));
|
||||||
sTradeData->monSpecies[whichParty] = species;
|
sTradeData->monSpecies[whichParty] = species;
|
||||||
@ -3659,7 +3652,7 @@ static bool8 AnimateTradeSequenceCable(void)
|
|||||||
case 65:
|
case 65:
|
||||||
if (gSprites[sTradeData->unk_D3].callback == SpriteCallbackDummy)
|
if (gSprites[sTradeData->unk_D3].callback == SpriteCallbackDummy)
|
||||||
{
|
{
|
||||||
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[sTradeData->monSpecies[TRADE_PARTNER]], gMonSpritesGfxPtr->sprites[3], sTradeData->monSpecies[TRADE_PARTNER], sTradeData->monPersonalities[TRADE_PARTNER]);
|
HandleLoadSpecialPokePic(&gMonFrontPicTable[sTradeData->monSpecies[TRADE_PARTNER]], gMonSpritesGfxPtr->sprites[3], sTradeData->monSpecies[TRADE_PARTNER], sTradeData->monPersonalities[TRADE_PARTNER]);
|
||||||
sTradeData->state++;
|
sTradeData->state++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -4174,7 +4167,7 @@ static bool8 AnimateTradeSequenceWireless(void)
|
|||||||
case 65:
|
case 65:
|
||||||
if (gSprites[sTradeData->unk_D3].callback == SpriteCallbackDummy)
|
if (gSprites[sTradeData->unk_D3].callback == SpriteCallbackDummy)
|
||||||
{
|
{
|
||||||
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[sTradeData->monSpecies[TRADE_PARTNER]], gMonSpritesGfxPtr->sprites[3], sTradeData->monSpecies[TRADE_PARTNER], sTradeData->monPersonalities[TRADE_PARTNER]);
|
HandleLoadSpecialPokePic(&gMonFrontPicTable[sTradeData->monSpecies[TRADE_PARTNER]], gMonSpritesGfxPtr->sprites[3], sTradeData->monSpecies[TRADE_PARTNER], sTradeData->monPersonalities[TRADE_PARTNER]);
|
||||||
sTradeData->state++;
|
sTradeData->state++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1379,7 +1379,7 @@ static void LoadMonIconGfx(void)
|
|||||||
for (i = 0; i < PARTY_SIZE; i++)
|
for (i = 0; i < PARTY_SIZE; i++)
|
||||||
{
|
{
|
||||||
if (sData->trainerCard.monSpecies[i])
|
if (sData->trainerCard.monSpecies[i])
|
||||||
LoadBgTiles(3, GetMonIconTiles(sData->trainerCard.monSpecies[i], FALSE, 0), 512, 16 * i + 32);
|
LoadBgTiles(3, GetMonIconTiles(sData->trainerCard.monSpecies[i], 0), 512, 16 * i + 32);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,23 +62,17 @@ bool16 ResetAllPicSprites(void)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool16 DecompressPic(u16 species, u32 personality, bool8 isFrontPic, u8 *dest, bool8 isTrainer, bool8 ignoreDeoxys)
|
static bool16 DecompressPic(u16 species, u32 personality, bool8 isFrontPic, u8 *dest, bool8 isTrainer)
|
||||||
{
|
{
|
||||||
if (!isTrainer)
|
if (!isTrainer)
|
||||||
{
|
{
|
||||||
if (isFrontPic)
|
if (isFrontPic)
|
||||||
{
|
{
|
||||||
if (!ignoreDeoxys)
|
LoadSpecialPokePic(&gMonFrontPicTable[species], dest, species, personality, isFrontPic);
|
||||||
LoadSpecialPokePic(&gMonFrontPicTable[species], dest, species, personality, isFrontPic);
|
|
||||||
else
|
|
||||||
LoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], dest, species, personality, isFrontPic);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!ignoreDeoxys)
|
LoadSpecialPokePic(&gMonBackPicTable[species], dest, species, personality, isFrontPic);
|
||||||
LoadSpecialPokePic(&gMonBackPicTable[species], dest, species, personality, isFrontPic);
|
|
||||||
else
|
|
||||||
LoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[species], dest, species, personality, isFrontPic);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -91,11 +85,6 @@ static bool16 DecompressPic(u16 species, u32 personality, bool8 isFrontPic, u8 *
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool16 DecompressPic_HandleDeoxys(u16 species, u32 personality, bool8 isFrontPic, u8 *dest, bool8 isTrainer)
|
|
||||||
{
|
|
||||||
return DecompressPic(species, personality, isFrontPic, dest, isTrainer, FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void LoadPicPaletteByTagOrSlot(u16 species, u32 otId, u32 personality, u8 paletteSlot, u16 paletteTag, bool8 isTrainer)
|
static void LoadPicPaletteByTagOrSlot(u16 species, u32 otId, u32 personality, u8 paletteSlot, u16 paletteTag, bool8 isTrainer)
|
||||||
{
|
{
|
||||||
if (!isTrainer)
|
if (!isTrainer)
|
||||||
@ -142,7 +131,7 @@ static void AssignSpriteAnimsTable(bool8 isTrainer)
|
|||||||
sCreatingSpriteTemplate.anims = gTrainerFrontAnimsPtrTable[0];
|
sCreatingSpriteTemplate.anims = gTrainerFrontAnimsPtrTable[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
static u16 CreatePicSprite(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag, bool8 isTrainer, bool8 ignoreDeoxys)
|
static u16 CreatePicSprite(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag, bool8 isTrainer)
|
||||||
{
|
{
|
||||||
u8 i;
|
u8 i;
|
||||||
u8 *framePics;
|
u8 *framePics;
|
||||||
@ -172,7 +161,7 @@ static u16 CreatePicSprite(u16 species, u32 otId, u32 personality, bool8 isFront
|
|||||||
Free(framePics);
|
Free(framePics);
|
||||||
return 0xFFFF;
|
return 0xFFFF;
|
||||||
}
|
}
|
||||||
if (DecompressPic(species, personality, isFrontPic, framePics, isTrainer, ignoreDeoxys))
|
if (DecompressPic(species, personality, isFrontPic, framePics, isTrainer))
|
||||||
{
|
{
|
||||||
// debug trap?
|
// debug trap?
|
||||||
return 0xFFFF;
|
return 0xFFFF;
|
||||||
@ -202,11 +191,6 @@ static u16 CreatePicSprite(u16 species, u32 otId, u32 personality, bool8 isFront
|
|||||||
return spriteId;
|
return spriteId;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u16 CreatePicSprite_HandleDeoxys(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag, bool8 isTrainer)
|
|
||||||
{
|
|
||||||
return CreatePicSprite(species, otId, personality, isFrontPic, x, y, paletteSlot, paletteTag, isTrainer, FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
u16 CreatePicSprite2(u16 species, u32 otId, u32 personality, u8 flags, s16 x, s16 y, u8 paletteSlot, u16 paletteTag)
|
u16 CreatePicSprite2(u16 species, u32 otId, u32 personality, u8 flags, s16 x, s16 y, u8 paletteSlot, u16 paletteTag)
|
||||||
{
|
{
|
||||||
u8 *framePics;
|
u8 *framePics;
|
||||||
@ -247,7 +231,7 @@ u16 CreatePicSprite2(u16 species, u32 otId, u32 personality, u8 flags, s16 x, s1
|
|||||||
Free(framePics);
|
Free(framePics);
|
||||||
return 0xFFFF;
|
return 0xFFFF;
|
||||||
}
|
}
|
||||||
if (DecompressPic(species, personality, flags, framePics, FALSE, FALSE))
|
if (DecompressPic(species, personality, flags, framePics, FALSE))
|
||||||
{
|
{
|
||||||
// debug trap?
|
// debug trap?
|
||||||
return 0xFFFF;
|
return 0xFFFF;
|
||||||
@ -322,7 +306,7 @@ static u16 FreeAndDestroyPicSpriteInternal(u16 spriteId)
|
|||||||
|
|
||||||
static u16 sub_818D65C(u16 species, u32 otId, u32 personality, bool8 isFrontPic, u8 paletteSlot, u8 windowId, bool8 isTrainer)
|
static u16 sub_818D65C(u16 species, u32 otId, u32 personality, bool8 isFrontPic, u8 paletteSlot, u8 windowId, bool8 isTrainer)
|
||||||
{
|
{
|
||||||
if (DecompressPic_HandleDeoxys(species, personality, isFrontPic, (u8 *)GetWindowAttribute(windowId, WINDOW_TILE_DATA), FALSE))
|
if (DecompressPic(species, personality, isFrontPic, (u8 *)GetWindowAttribute(windowId, WINDOW_TILE_DATA), FALSE))
|
||||||
{
|
{
|
||||||
return 0xFFFF;
|
return 0xFFFF;
|
||||||
}
|
}
|
||||||
@ -335,7 +319,7 @@ static u16 CreateTrainerCardSprite(u16 species, u32 otId, u32 personality, bool8
|
|||||||
u8 *framePics;
|
u8 *framePics;
|
||||||
|
|
||||||
framePics = Alloc(4 * 0x800);
|
framePics = Alloc(4 * 0x800);
|
||||||
if (framePics && !DecompressPic_HandleDeoxys(species, personality, isFrontPic, framePics, isTrainer))
|
if (framePics && !DecompressPic(species, personality, isFrontPic, framePics, isTrainer))
|
||||||
{
|
{
|
||||||
BlitBitmapRectToWindow(windowId, framePics, 0, 0, 0x40, 0x40, destX, destY, 0x40, 0x40);
|
BlitBitmapRectToWindow(windowId, framePics, 0, 0, 0x40, 0x40, destX, destY, 0x40, 0x40);
|
||||||
LoadPicPaletteBySlot(species, otId, personality, paletteSlot, isTrainer);
|
LoadPicPaletteBySlot(species, otId, personality, paletteSlot, isTrainer);
|
||||||
@ -345,14 +329,9 @@ static u16 CreateTrainerCardSprite(u16 species, u32 otId, u32 personality, bool8
|
|||||||
return 0xFFFF;
|
return 0xFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u16 CreateMonPicSprite(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag, bool8 ignoreDeoxys)
|
u16 CreateMonPicSprite(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag)
|
||||||
{
|
{
|
||||||
return CreatePicSprite(species, otId, personality, isFrontPic, x, y, paletteSlot, paletteTag, FALSE, ignoreDeoxys);
|
return CreatePicSprite(species, otId, personality, isFrontPic, x, y, paletteSlot, paletteTag, FALSE);
|
||||||
}
|
|
||||||
|
|
||||||
u16 CreateMonPicSprite_HandleDeoxys(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag)
|
|
||||||
{
|
|
||||||
return CreateMonPicSprite(species, otId, personality, isFrontPic, x, y, paletteSlot, paletteTag, FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u16 FreeAndDestroyMonPicSprite(u16 spriteId)
|
u16 FreeAndDestroyMonPicSprite(u16 spriteId)
|
||||||
@ -373,7 +352,7 @@ u16 CreateTrainerCardMonIconSprite(u16 species, u32 otId, u32 personality, bool8
|
|||||||
|
|
||||||
u16 CreateTrainerPicSprite(u16 species, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag)
|
u16 CreateTrainerPicSprite(u16 species, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag)
|
||||||
{
|
{
|
||||||
return CreatePicSprite_HandleDeoxys(species, 0, 0, isFrontPic, x, y, paletteSlot, paletteTag, TRUE);
|
return CreatePicSprite(species, 0, 0, isFrontPic, x, y, paletteSlot, paletteTag, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
u16 FreeAndDestroyTrainerPicSprite(u16 spriteId)
|
u16 FreeAndDestroyTrainerPicSprite(u16 spriteId)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user