Merge pull request #566 from AsparagusEduardo/PE-GenderDifferences
Support for Gender Differences
This commit is contained in:
commit
7a9476323c
17 changed files with 105 additions and 13 deletions
BIN
graphics/pokemon/eevee/anim_frontf.png
Normal file
BIN
graphics/pokemon/eevee/anim_frontf.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 945 B |
BIN
graphics/pokemon/eevee/backf.png
Normal file
BIN
graphics/pokemon/eevee/backf.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 696 B |
|
@ -93,8 +93,11 @@ extern const union AnimCmd *const gUnknown_082FF70C[];
|
|||
extern const struct MonCoords gMonFrontPicCoords[];
|
||||
extern const struct MonCoords gMonBackPicCoords[];
|
||||
extern const struct CompressedSpriteSheet gMonBackPicTable[];
|
||||
extern const struct CompressedSpriteSheet gMonBackPicTableFemale[];
|
||||
extern const struct CompressedSpritePalette gMonPaletteTable[];
|
||||
extern const struct CompressedSpritePalette gMonPaletteTableFemale[];
|
||||
extern const struct CompressedSpritePalette gMonShinyPaletteTable[];
|
||||
extern const struct CompressedSpritePalette gMonShinyPaletteTableFemale[];
|
||||
extern const union AnimCmd *const *const gTrainerFrontAnimsPtrTable[];
|
||||
extern const struct MonCoords gTrainerFrontPicCoords[];
|
||||
extern const struct CompressedSpriteSheet gTrainerFrontPicTable[];
|
||||
|
@ -108,6 +111,8 @@ extern const u8 gEnemyMonElevation[NUM_SPECIES];
|
|||
|
||||
extern const union AnimCmd *const *const gMonFrontAnimsPtrTable[];
|
||||
extern const struct CompressedSpriteSheet gMonFrontPicTable[];
|
||||
extern const struct CompressedSpriteSheet gMonFrontPicTableFemale[];
|
||||
extern const bool8 SpeciesHasGenderDifference[NUM_SPECIES];
|
||||
|
||||
extern const struct Trainer gTrainers[];
|
||||
extern const u8 gTrainerClassNames[][13];
|
||||
|
|
|
@ -169,6 +169,7 @@ extern const u32 gMonFrontPic_Gyarados[];
|
|||
extern const u32 gMonFrontPic_Lapras[];
|
||||
extern const u32 gMonFrontPic_Ditto[];
|
||||
extern const u32 gMonFrontPic_Eevee[];
|
||||
extern const u32 gMonFrontPic_EeveeF[];
|
||||
extern const u32 gMonFrontPic_Vaporeon[];
|
||||
extern const u32 gMonFrontPic_Jolteon[];
|
||||
extern const u32 gMonFrontPic_Flareon[];
|
||||
|
@ -1019,6 +1020,7 @@ extern const u32 gMonBackPic_Gyarados[];
|
|||
extern const u32 gMonBackPic_Lapras[];
|
||||
extern const u32 gMonBackPic_Ditto[];
|
||||
extern const u32 gMonBackPic_Eevee[];
|
||||
extern const u32 gMonBackPic_EeveeF[];
|
||||
extern const u32 gMonBackPic_Vaporeon[];
|
||||
extern const u32 gMonBackPic_Jolteon[];
|
||||
extern const u32 gMonBackPic_Flareon[];
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
#define GUARD_POKEMON_ICON_H
|
||||
|
||||
extern const u8 gMonIconPaletteIndices[];
|
||||
extern const u8 gMonIconPaletteIndicesFemale[];
|
||||
|
||||
const u8 *GetMonIconTiles(u16 species, bool32);
|
||||
const u8 *GetMonIconTiles(u16 species, bool32, u32 personality);
|
||||
void sub_80D304C(u16 offset);
|
||||
u8 GetValidMonIconPalIndex(u16 species);
|
||||
const u8 *GetMonIconPtr(u16 speciesId, u32 personality, u32 frameNo);
|
||||
|
|
|
@ -300,6 +300,11 @@ const union AnimCmd *const gUnknown_082FF70C[] =
|
|||
|
||||
#define TRAINER_BACK_PAL(trainerPic, pal) [TRAINER_BACK_PIC_##trainerPic] = {pal, TRAINER_BACK_PIC_##trainerPic}
|
||||
|
||||
const bool8 SpeciesHasGenderDifference[NUM_SPECIES] =
|
||||
{
|
||||
[SPECIES_EEVEE] = TRUE,
|
||||
};
|
||||
|
||||
#include "data/pokemon_graphics/front_pic_coordinates.h"
|
||||
#include "data/pokemon_graphics/back_pic_coordinates.h"
|
||||
|
||||
|
|
|
@ -132,6 +132,7 @@ const u32 gMonFrontPic_Gyarados[] = INCBIN_U32("graphics/pokemon/gyarados/anim_f
|
|||
const u32 gMonFrontPic_Lapras[] = INCBIN_U32("graphics/pokemon/lapras/anim_front.4bpp.lz");
|
||||
const u32 gMonFrontPic_Ditto[] = INCBIN_U32("graphics/pokemon/ditto/anim_front.4bpp.lz");
|
||||
const u32 gMonFrontPic_Eevee[] = INCBIN_U32("graphics/pokemon/eevee/anim_front.4bpp.lz");
|
||||
const u32 gMonFrontPic_EeveeF[] = INCBIN_U32("graphics/pokemon/eevee/anim_frontf.4bpp.lz");
|
||||
const u32 gMonFrontPic_Vaporeon[] = INCBIN_U32("graphics/pokemon/vaporeon/anim_front.4bpp.lz");
|
||||
const u32 gMonFrontPic_Jolteon[] = INCBIN_U32("graphics/pokemon/jolteon/anim_front.4bpp.lz");
|
||||
const u32 gMonFrontPic_Flareon[] = INCBIN_U32("graphics/pokemon/flareon/anim_front.4bpp.lz");
|
||||
|
@ -982,6 +983,7 @@ const u32 gMonBackPic_Gyarados[] = INCBIN_U32("graphics/pokemon/gyarados/back.4b
|
|||
const u32 gMonBackPic_Lapras[] = INCBIN_U32("graphics/pokemon/lapras/back.4bpp.lz");
|
||||
const u32 gMonBackPic_Ditto[] = INCBIN_U32("graphics/pokemon/ditto/back.4bpp.lz");
|
||||
const u32 gMonBackPic_Eevee[] = INCBIN_U32("graphics/pokemon/eevee/back.4bpp.lz");
|
||||
const u32 gMonBackPic_EeveeF[] = INCBIN_U32("graphics/pokemon/eevee/backf.4bpp.lz");
|
||||
const u32 gMonBackPic_Vaporeon[] = INCBIN_U32("graphics/pokemon/vaporeon/back.4bpp.lz");
|
||||
const u32 gMonBackPic_Jolteon[] = INCBIN_U32("graphics/pokemon/jolteon/back.4bpp.lz");
|
||||
const u32 gMonBackPic_Flareon[] = INCBIN_U32("graphics/pokemon/flareon/back.4bpp.lz");
|
||||
|
|
|
@ -943,3 +943,8 @@ const struct CompressedSpriteSheet gMonBackPicTable[] =
|
|||
SPECIES_SPRITE(UNOWN_EMARK, gMonBackPic_UnownExclamationMark),
|
||||
SPECIES_SPRITE(UNOWN_QMARK, gMonBackPic_UnownQuestionMark),
|
||||
};
|
||||
|
||||
const struct CompressedSpriteSheet gMonBackPicTableFemale[] =
|
||||
{
|
||||
SPECIES_SPRITE(EEVEE, gMonBackPic_EeveeF),
|
||||
};
|
||||
|
|
|
@ -943,3 +943,8 @@ const struct CompressedSpriteSheet gMonFrontPicTable[] =
|
|||
SPECIES_SPRITE(UNOWN_EMARK, gMonFrontPic_UnownExclamationMark),
|
||||
SPECIES_SPRITE(UNOWN_QMARK, gMonFrontPic_UnownQuestionMark),
|
||||
};
|
||||
|
||||
const struct CompressedSpriteSheet gMonFrontPicTableFemale[] =
|
||||
{
|
||||
SPECIES_SPRITE(EEVEE, gMonFrontPic_EeveeF),
|
||||
};
|
||||
|
|
|
@ -943,3 +943,8 @@ const struct CompressedSpritePalette gMonPaletteTable[] =
|
|||
SPECIES_PAL(UNOWN_EMARK, gMonPalette_Unown),
|
||||
SPECIES_PAL(UNOWN_QMARK, gMonPalette_Unown),
|
||||
};
|
||||
|
||||
const struct CompressedSpritePalette gMonPaletteTableFemale[] =
|
||||
{
|
||||
SPECIES_PAL(EEVEE, gMonPalette_Eevee),
|
||||
};
|
||||
|
|
|
@ -943,3 +943,8 @@ const struct CompressedSpritePalette gMonShinyPaletteTable[] =
|
|||
SPECIES_SHINY_PAL(UNOWN_EMARK, gMonShinyPalette_Unown),
|
||||
SPECIES_SHINY_PAL(UNOWN_QMARK, gMonShinyPalette_Unown),
|
||||
};
|
||||
|
||||
const struct CompressedSpritePalette gMonShinyPaletteTableFemale[] =
|
||||
{
|
||||
SPECIES_SHINY_PAL(EEVEE, gMonShinyPalette_Eevee),
|
||||
};
|
||||
|
|
|
@ -95,6 +95,13 @@ void LoadSpecialPokePic(const struct CompressedSpriteSheet *src, void *dest, s32
|
|||
}
|
||||
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);
|
||||
|
||||
|
@ -311,6 +318,13 @@ void LoadSpecialPokePic_2(const struct CompressedSpriteSheet *src, void *dest, s
|
|||
}
|
||||
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);
|
||||
|
||||
|
@ -363,6 +377,13 @@ void LoadSpecialPokePic_DontHandleDeoxys(const struct CompressedSpriteSheet *src
|
|||
}
|
||||
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);
|
||||
|
||||
|
|
|
@ -4600,7 +4600,7 @@ static u32 GetPokedexMonPersonality(u16 species)
|
|||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
return 0xFF; //Changed from 0 to make it so the Pokédex shows the default mon pics instead of the female versions.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6745,9 +6745,19 @@ const u32 *GetMonSpritePalFromSpeciesAndPersonality(u16 species, u32 otId, u32 p
|
|||
|
||||
shinyValue = HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality);
|
||||
if (shinyValue < SHINY_ODDS)
|
||||
return gMonShinyPaletteTable[species].data;
|
||||
{
|
||||
if (SpeciesHasGenderDifference[species] && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE)
|
||||
return gMonShinyPaletteTableFemale[species].data;
|
||||
else
|
||||
return gMonShinyPaletteTable[species].data;
|
||||
}
|
||||
else
|
||||
return gMonPaletteTable[species].data;
|
||||
{
|
||||
if (SpeciesHasGenderDifference[species] && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE)
|
||||
return gMonPaletteTableFemale[species].data;
|
||||
else
|
||||
return gMonPaletteTable[species].data;
|
||||
}
|
||||
}
|
||||
|
||||
const struct CompressedSpritePalette *GetMonSpritePalStruct(struct Pokemon *mon)
|
||||
|
@ -6764,9 +6774,19 @@ const struct CompressedSpritePalette *GetMonSpritePalStructFromOtIdPersonality(u
|
|||
|
||||
shinyValue = HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality);
|
||||
if (shinyValue < SHINY_ODDS)
|
||||
return &gMonShinyPaletteTable[species];
|
||||
{
|
||||
if (SpeciesHasGenderDifference[species] && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE)
|
||||
return &gMonShinyPaletteTableFemale[species];
|
||||
else
|
||||
return &gMonShinyPaletteTable[species];
|
||||
}
|
||||
else
|
||||
return &gMonPaletteTable[species];
|
||||
{
|
||||
if (SpeciesHasGenderDifference[species] && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE)
|
||||
return &gMonPaletteTableFemale[species];
|
||||
else
|
||||
return &gMonPaletteTable[species];
|
||||
}
|
||||
}
|
||||
|
||||
bool32 IsHMMove2(u16 move)
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "palette.h"
|
||||
#include "pokemon_icon.h"
|
||||
#include "sprite.h"
|
||||
#include "data.h"
|
||||
|
||||
#define POKE_ICON_BASE_PAL_TAG 56000
|
||||
|
||||
|
@ -962,7 +963,11 @@ const u8 *const gMonIconTable[] =
|
|||
[SPECIES_UNOWN_Z] = gMonIcon_UnownZ,
|
||||
[SPECIES_UNOWN_EMARK] = gMonIcon_UnownExclamationMark,
|
||||
[SPECIES_UNOWN_QMARK] = gMonIcon_UnownQuestionMark,
|
||||
};
|
||||
|
||||
const u8 *const gMonIconTableFemale[] =
|
||||
{
|
||||
[SPECIES_EEVEE] = gMonIcon_Eevee,
|
||||
};
|
||||
|
||||
const u8 gMonIconPaletteIndices[] =
|
||||
|
@ -1876,6 +1881,11 @@ const u8 gMonIconPaletteIndices[] =
|
|||
[SPECIES_EGG] = 1,
|
||||
};
|
||||
|
||||
const u8 gMonIconPaletteIndicesFemale[] =
|
||||
{
|
||||
[SPECIES_EEVEE] = 2,
|
||||
};
|
||||
|
||||
const struct SpritePalette gMonIconPaletteTable[] =
|
||||
{
|
||||
{ gMonIconPalettes[0], POKE_ICON_BASE_PAL_TAG + 0 },
|
||||
|
@ -2004,6 +2014,8 @@ u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u
|
|||
|
||||
if (species > NUM_SPECIES)
|
||||
iconTemplate.paletteTag = POKE_ICON_BASE_PAL_TAG;
|
||||
else if (SpeciesHasGenderDifference[species] && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE)
|
||||
iconTemplate.paletteTag = POKE_ICON_BASE_PAL_TAG + gMonIconPaletteIndicesFemale[species];
|
||||
|
||||
spriteId = CreateMonIconSprite(&iconTemplate, x, y, subpriority);
|
||||
|
||||
|
@ -2025,7 +2037,7 @@ u8 sub_80D2D78(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8
|
|||
.paletteTag = POKE_ICON_BASE_PAL_TAG + gMonIconPaletteIndices[species],
|
||||
};
|
||||
|
||||
iconTemplate.image = GetMonIconTiles(species, extra);
|
||||
iconTemplate.image = GetMonIconTiles(species, extra, 0);
|
||||
spriteId = CreateMonIconSprite(&iconTemplate, x, y, subpriority);
|
||||
|
||||
UpdateMonIconFrame(&gSprites[spriteId]);
|
||||
|
@ -2080,7 +2092,7 @@ u16 sub_80D2E84(u16 species)
|
|||
|
||||
const u8 *GetMonIconPtr(u16 species, u32 personality, bool32 handleDeoxys)
|
||||
{
|
||||
return GetMonIconTiles(GetIconSpecies(species, personality), handleDeoxys);
|
||||
return GetMonIconTiles(GetIconSpecies(species, personality), handleDeoxys, personality);
|
||||
}
|
||||
|
||||
void FreeAndDestroyMonIconSprite(struct Sprite *sprite)
|
||||
|
@ -2142,13 +2154,17 @@ void SpriteCB_MonIcon(struct Sprite *sprite)
|
|||
UpdateMonIconFrame(sprite);
|
||||
}
|
||||
|
||||
const u8* GetMonIconTiles(u16 species, bool32 handleDeoxys)
|
||||
const u8* GetMonIconTiles(u16 species, bool32 handleDeoxys, u32 personality)
|
||||
{
|
||||
const u8* iconSprite = gMonIconTable[species];
|
||||
if (species == SPECIES_DEOXYS && handleDeoxys == TRUE)
|
||||
{
|
||||
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];
|
||||
}
|
||||
return iconSprite;
|
||||
}
|
||||
|
||||
|
|
|
@ -5145,7 +5145,7 @@ static void sub_80CC100(struct Sprite *sprite)
|
|||
sprite->pos1.y = sPSSData->field_CB4->pos1.y + sPSSData->field_CB4->pos2.y + 4;
|
||||
}
|
||||
|
||||
static u16 sub_80CC124(u16 species)
|
||||
static u16 sub_80CC124(u16 species, u32 personality)
|
||||
{
|
||||
u16 i, var;
|
||||
|
||||
|
@ -5169,7 +5169,7 @@ static u16 sub_80CC124(u16 species)
|
|||
sPSSData->field_B58[i] = species;
|
||||
sPSSData->field_B08[i]++;
|
||||
var = 16 * i;
|
||||
CpuCopy32(GetMonIconTiles(species, TRUE), (void*)(OBJ_VRAM0) + var * 32, 0x200);
|
||||
CpuCopy32(GetMonIconTiles(species, TRUE, personality), (void*)(OBJ_VRAM0) + var * 32, 0x200);
|
||||
|
||||
return var;
|
||||
}
|
||||
|
@ -5197,7 +5197,7 @@ static struct Sprite *CreateMonIconSprite(u16 species, u32 personality, s16 x, s
|
|||
|
||||
species = GetIconSpecies(species, personality);
|
||||
tempalte.paletteTag = 0xDAC0 + gMonIconPaletteIndices[species];
|
||||
tileNum = sub_80CC124(species);
|
||||
tileNum = sub_80CC124(species, personality);
|
||||
if (tileNum == 0xFFFF)
|
||||
return NULL;
|
||||
|
||||
|
|
|
@ -1379,7 +1379,7 @@ static void LoadMonIconGfx(void)
|
|||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
if (sData->trainerCard.monSpecies[i])
|
||||
LoadBgTiles(3, GetMonIconTiles(sData->trainerCard.monSpecies[i], 0), 512, 16 * i + 32);
|
||||
LoadBgTiles(3, GetMonIconTiles(sData->trainerCard.monSpecies[i], FALSE, 0), 512, 16 * i + 32);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue