Revert "Removed Unown hack"

This commit is contained in:
Eduardo Quezada D'Ottone 2023-01-07 11:39:56 -03:00 committed by GitHub
parent 34d27eca0e
commit 7622d84a4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 256 additions and 133 deletions

View File

@ -202,7 +202,7 @@
#define SPECIES_MURKROW 198
#define SPECIES_SLOWKING 199
#define SPECIES_MISDREAVUS 200
#define SPECIES_UNOWN_A 201
#define SPECIES_UNOWN 201
#define SPECIES_WOBBUFFET 202
#define SPECIES_GIRAFARIG 203
#define SPECIES_PINECO 204
@ -1373,6 +1373,4 @@
#define NUM_SPECIES SPECIES_EGG
#define SPECIES_UNOWN NUM_SPECIES + 1 // Used for random Unown form based on personality.
#endif // GUARD_CONSTANTS_SPECIES_H

View File

@ -338,6 +338,7 @@ void SetContestants(u8 contestType, u8 rank);
void SetLinkAIContestants(u8 contestType, u8 rank, bool32 isPostgame);
u8 GetContestEntryEligibility(struct Pokemon *pkmn);
void CalculateRound1Points(u8 contestCategory);
bool8 IsSpeciesNotUnown(u16 species);
bool8 Contest_IsMonsTurnDisabled(u8 contestant);
void SaveLinkContestResults(void);
void SortContestants(bool8 useRanking);

View File

@ -22,6 +22,8 @@ void ClearAllMail(void);
void ClearMail(struct Mail *mail);
bool8 MonHasMail(struct Pokemon *mon);
u8 GiveMailToMonByItemId(struct Pokemon *mon, u16 itemId);
u16 SpeciesToMailSpecies(u16 species, u32 personality);
u16 MailSpeciesToSpecies(u16 mailSpecies, u16 *buffer);
u8 GiveMailToMon(struct Pokemon *mon, struct Mail *mail);
void TakeMailFromMon(struct Pokemon *mon);
void ClearMailItemId(u8 mailId);

View File

@ -739,7 +739,7 @@ void MoveBattlerSpriteToBG(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible)
battlerSpriteId = gBattlerSpriteIds[battlerId];
gBattle_BG1_X = -(gSprites[battlerSpriteId].x + gSprites[battlerSpriteId].x2) + 0x20;
if (IsContest())
if (IsContest() && IsSpeciesNotUnown(gContestResources->moveAnim->species))
gBattle_BG1_X--;
gBattle_BG1_Y = -(gSprites[battlerSpriteId].y + gSprites[battlerSpriteId].y2) + 0x20;
@ -797,6 +797,8 @@ static void FlipBattlerBgTiles(void)
struct BattleAnimBgData animBg;
u16 *ptr;
if (IsSpeciesNotUnown(gContestResources->moveAnim->species))
{
GetBattleAnimBg1Data(&animBg);
ptr = animBg.bgTilemap;
for (i = 0; i < 8; i++)
@ -813,6 +815,7 @@ static void FlipBattlerBgTiles(void)
ptr[j + i * 32] ^= 0x400;
}
}
}
void RelocateBattleBgPal(u16 paletteNum, u16 *dest, u32 offset, bool8 largeScreen)
{

View File

@ -2378,7 +2378,33 @@ void AnimTask_TransformMon(u8 taskId)
LoadBgTiles(1, animBg.bgTiles, 0x800, animBg.tilesOffset);
if (IsContest())
{
if (IsSpeciesNotUnown(gContestResources->moveAnim->species) != IsSpeciesNotUnown(gContestResources->moveAnim->targetSpecies))
{
bgTilemap = (u16 *)animBg.bgTilemap;
for (i = 0; i < 8; i++)
{
for (j = 0; j < 4; j++)
{
u16 temp = bgTilemap[j + i * 0x20];
bgTilemap[j + i * 0x20] = bgTilemap[(7 - j) + i * 0x20];
bgTilemap[(7 - j) + i * 0x20] = temp;
}
}
for (i = 0; i < 8; i++)
{
for (j = 0; j < 8; j++)
{
bgTilemap[j + i * 0x20] ^= 0x400;
}
}
}
if (IsSpeciesNotUnown(gContestResources->moveAnim->targetSpecies))
gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gAffineAnims_BattleSpriteContest;
else
gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gAffineAnims_BattleSpriteOpponentSide;
StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimAttacker]], BATTLER_AFFINE_NORMAL);
}

View File

@ -177,22 +177,65 @@ u8 GetBattlerYDelta(u8 battlerId, u16 species)
if (GetBattlerSide(battlerId) == B_SIDE_PLAYER || IsContest())
{
if (species == SPECIES_CASTFORM)
ret = sCastformBackSpriteYCoords[gBattleMonForms[battlerId]];
else if (species > NUM_SPECIES)
ret = gMonBackPicCoords[0].y_offset;
if (species == SPECIES_UNOWN)
{
if (IsContest())
{
if (gContestResources->moveAnim->hasTargetAnim)
personality = gContestResources->moveAnim->targetPersonality;
else
ret = gMonBackPicCoords[species].y_offset;
personality = gContestResources->moveAnim->personality;
}
else
{
if (species == SPECIES_CASTFORM)
ret = gCastformFrontSpriteCoords[gBattleMonForms[battlerId]].y_offset;
else if (species > NUM_SPECIES)
ret = gMonFrontPicCoords[0].y_offset;
spriteInfo = gBattleSpritesDataPtr->battlerData;
if (!spriteInfo[battlerId].transformSpecies)
personality = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_PERSONALITY);
else
personality = gTransformedPersonalities[battlerId];
}
coordSpecies = GetUnownSpeciesId(personality);
ret = gMonBackPicCoords[coordSpecies].y_offset;
}
else if (species == SPECIES_CASTFORM)
{
ret = sCastformBackSpriteYCoords[gBattleMonForms[battlerId]];
}
else if (species > NUM_SPECIES)
{
ret = gMonBackPicCoords[0].y_offset;
}
else
{
ret = gMonBackPicCoords[species].y_offset;
}
}
else
{
if (species == SPECIES_UNOWN)
{
spriteInfo = gBattleSpritesDataPtr->battlerData;
if (!spriteInfo[battlerId].transformSpecies)
personality = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerId]], MON_DATA_PERSONALITY);
else
personality = gTransformedPersonalities[battlerId];
coordSpecies = GetUnownSpeciesId(personality);
ret = gMonFrontPicCoords[coordSpecies].y_offset;
}
else if (species == SPECIES_CASTFORM)
{
ret = gCastformFrontSpriteCoords[gBattleMonForms[battlerId]].y_offset;
}
else if (species > NUM_SPECIES)
{
ret = gMonFrontPicCoords[0].y_offset;
}
else
{
ret = gMonFrontPicCoords[species].y_offset;
}
}
return ret;
}
@ -1274,7 +1317,17 @@ void SetSpriteRotScale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation)
// Pokémon in Contests (except Unown) should be flipped.
static bool8 ShouldRotScaleSpeciesBeFlipped(void)
{
return IsContest();
if (IsContest())
{
if (gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)].data[2] == SPECIES_UNOWN)
return FALSE;
else
return TRUE;
}
else
{
return FALSE;
}
}
void PrepareBattlerSpriteForRotScale(u8 spriteId, u8 objMode)
@ -2144,8 +2197,12 @@ s16 GetBattlerSpriteCoordAttr(u8 battlerId, u8 attr)
species = gContestResources->moveAnim->species;
personality = gContestResources->moveAnim->personality;
}
if (species == SPECIES_CASTFORM)
if (species == SPECIES_UNOWN)
{
species = GetUnownSpeciesId(personality);
coords = &gMonBackPicCoords[species];
}
else if (species == SPECIES_CASTFORM)
{
coords = &gCastformFrontSpriteCoords[gBattleMonForms[battlerId]];
}
@ -2174,11 +2231,20 @@ s16 GetBattlerSpriteCoordAttr(u8 battlerId, u8 attr)
personality = gTransformedPersonalities[battlerId];
}
if (species > NUM_SPECIES)
coords = &gMonBackPicCoords[0];
else
if (species == SPECIES_UNOWN)
{
species = GetUnownSpeciesId(personality);
coords = &gMonBackPicCoords[species];
}
else if (species > NUM_SPECIES)
{
coords = &gMonBackPicCoords[0];
}
else
{
coords = &gMonBackPicCoords[species];
}
}
else
{
spriteInfo = gBattleSpritesDataPtr->battlerData;
@ -2193,13 +2259,24 @@ s16 GetBattlerSpriteCoordAttr(u8 battlerId, u8 attr)
personality = gTransformedPersonalities[battlerId];
}
if (species == SPECIES_CASTFORM)
coords = &gCastformFrontSpriteCoords[gBattleMonForms[battlerId]];
else if (species > NUM_SPECIES)
coords = &gMonFrontPicCoords[0];
else
if (species == SPECIES_UNOWN)
{
species = GetUnownSpeciesId(personality);
coords = &gMonFrontPicCoords[species];
}
else if (species == SPECIES_CASTFORM)
{
coords = &gCastformFrontSpriteCoords[gBattleMonForms[battlerId]];
}
else if (species > NUM_SPECIES)
{
coords = &gMonFrontPicCoords[0];
}
else
{
coords = &gMonFrontPicCoords[species];
}
}
}
switch (attr)

View File

@ -334,7 +334,7 @@ static void GenerateOpponentMons(void)
u16 monId = GetFactoryMonId(lvlMode, challengeNum, FALSE);
// Unown (FRONTIER_MON_UNOWN) is forbidden on opponent Factory teams.
if (GET_BASE_SPECIES_ID(gFacilityTrainerMons[monId].species) == SPECIES_UNOWN_A)
if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN)
continue;
// Ensure none of the opponent's pokemon are the same as the potential rental pokemon for the player
@ -559,7 +559,7 @@ static void GenerateInitialRentalMons(void)
else
monId = GetFactoryMonId(factoryLvlMode, challengeNum, FALSE);
if (GET_BASE_SPECIES_ID(gFacilityTrainerMons[monId].species) == SPECIES_UNOWN_A)
if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN)
continue;
// Cannot have two pokemon of the same species.
@ -771,7 +771,7 @@ void FillFactoryBrainParty(void)
{
u16 monId = GetFactoryMonId(lvlMode, challengeNum, FALSE);
if (GET_BASE_SPECIES_ID(gFacilityTrainerMons[monId].species) == SPECIES_UNOWN_A)
if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN)
continue;
if (monLevel == FRONTIER_MAX_LEVEL_50 && monId > FRONTIER_MONS_HIGH_TIER)
continue;

View File

@ -2662,7 +2662,12 @@ void SpriteCB_FaintOpponentMon(struct Sprite *sprite)
GetMonData(&gEnemyParty[gBattlerPartyIndexes[battler]], MON_DATA_PERSONALITY); // Unused return value.
if (species == SPECIES_CASTFORM)
if (species == SPECIES_UNOWN)
{
species = GetUnownSpeciesId(personality);
yOffset = gMonFrontPicCoords[species].y_offset;
}
else if (species == SPECIES_CASTFORM)
{
yOffset = gCastformFrontSpriteCoords[gBattleMonForms[battler]].y_offset;
}

View File

@ -3136,12 +3136,23 @@ static u8 CreateContestantSprite(u16 species, u32 otId, u32 personality, u32 ind
gSprites[spriteId].callback = SpriteCallbackDummy;
gSprites[spriteId].data[0] = gSprites[spriteId].oam.paletteNum;
gSprites[spriteId].data[2] = species;
if (IsSpeciesNotUnown(species))
gSprites[spriteId].affineAnims = gAffineAnims_BattleSpriteContest;
else
gSprites[spriteId].affineAnims = gAffineAnims_BattleSpriteOpponentSide;
StartSpriteAffineAnim(&gSprites[spriteId], BATTLER_AFFINE_NORMAL);
return spriteId;
}
bool8 IsSpeciesNotUnown(u16 species)
{
if (species == SPECIES_UNOWN)
return FALSE;
else
return TRUE;
}
// The contestant info windows and general-purpose text box are drawn on one half, while
// the moves and move description windows are drawn on another screen. Only the first 32 * 20
// tiles are actually drawn on screen.

View File

@ -1612,7 +1612,7 @@ const struct BardSound gBardSounds_Pokemon[NUM_SPECIES][6] = {
NULL_BARD_SOUND,
NULL_BARD_SOUND,
},
[SPECIES_UNOWN_A] = {
[SPECIES_UNOWN] = {
{ .songLengthId = 42 },
{ .songLengthId = 26 },
{ .songLengthId = 51 },

View File

@ -229,7 +229,7 @@ const u16 gEasyChatGroup_Pokemon2[] = {
SPECIES_TYRANITAR,
SPECIES_TYROGUE,
SPECIES_UMBREON,
SPECIES_UNOWN_A,
SPECIES_UNOWN,
SPECIES_URSARING,
SPECIES_VAPOREON,
SPECIES_VENOMOTH,

View File

@ -1770,7 +1770,7 @@ const u16 gEasyChatWordsByLetter_U[] = {
EC_WORD_UNDERSTANDS,
EC_WORD_UNDERSTOOD,
EC_WORD_UNION,
EC_POKEMON_NATIONAL(UNOWN_A),
EC_POKEMON_NATIONAL(UNOWN),
EC_WORD_UNTIL,
EC_WORD_UP,
EC_WORD_UPBEAT,

View File

@ -51,7 +51,7 @@ const u16 *const gFormSpeciesIdTables[NUM_SPECIES] =
[SPECIES_SLOWKING] = sSlowkingFormSpeciesIdTable,
[SPECIES_QWILFISH] = sQwilfishFormSpeciesIdTable,
[SPECIES_SNEASEL] = sSneaselFormSpeciesIdTable,
[SPECIES_UNOWN_A] = sUnownFormSpeciesIdTable,
[SPECIES_UNOWN] = sUnownFormSpeciesIdTable,
[SPECIES_STEELIX] = sSteelixFormSpeciesIdTable,
[SPECIES_SCIZOR] = sScizorFormSpeciesIdTable,
[SPECIES_HERACROSS] = sHeracrossFormSpeciesIdTable,

View File

@ -322,7 +322,7 @@ static const u16 sSneaselFormSpeciesIdTable[] = {
};
static const u16 sUnownFormSpeciesIdTable[] = {
SPECIES_UNOWN_A,
SPECIES_UNOWN,
SPECIES_UNOWN_B,
SPECIES_UNOWN_C,
SPECIES_UNOWN_D,

View File

@ -201,7 +201,7 @@ const struct LevelUpMove *const gLevelUpLearnsets[NUM_SPECIES] =
[SPECIES_MURKROW] = sMurkrowLevelUpLearnset,
[SPECIES_SLOWKING] = sSlowkingLevelUpLearnset,
[SPECIES_MISDREAVUS] = sMisdreavusLevelUpLearnset,
[SPECIES_UNOWN_A] = sUnownLevelUpLearnset,
[SPECIES_UNOWN] = sUnownLevelUpLearnset,
[SPECIES_WOBBUFFET] = sWobbuffetLevelUpLearnset,
[SPECIES_GIRAFARIG] = sGirafarigLevelUpLearnset,
[SPECIES_PINECO] = sPinecoLevelUpLearnset,

View File

@ -5941,7 +5941,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.noFlip = FALSE,
},
[SPECIES_UNOWN_A] = UNOWN_SPECIES_INFO(FLIP),
[SPECIES_UNOWN] = UNOWN_SPECIES_INFO(FLIP),
[SPECIES_WOBBUFFET] =
{

View File

@ -201,7 +201,7 @@ const u16 *const gTeachableLearnsets[NUM_SPECIES] =
[SPECIES_MURKROW] = sMurkrowTeachableLearnset,
[SPECIES_SLOWKING] = sSlowkingTeachableLearnset,
[SPECIES_MISDREAVUS] = sMisdreavusTeachableLearnset,
[SPECIES_UNOWN_A] = sUnownTeachableLearnset,
[SPECIES_UNOWN] = sUnownTeachableLearnset,
[SPECIES_WOBBUFFET] = sWobbuffetTeachableLearnset,
[SPECIES_GIRAFARIG] = sGirafarigTeachableLearnset,
[SPECIES_PINECO] = sPinecoTeachableLearnset,

View File

@ -224,7 +224,7 @@ const struct MonCoords gMonBackPicCoords[] =
[SPECIES_MURKROW] = { .size = MON_COORDS_SIZE(40, 56), .y_offset = 10 },
[SPECIES_SLOWKING] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 3 },
[SPECIES_MISDREAVUS] = { .size = MON_COORDS_SIZE(56, 48), .y_offset = 9 },
[SPECIES_UNOWN_A] = { .size = MON_COORDS_SIZE(24, 48), .y_offset = 8 },
[SPECIES_UNOWN] = { .size = MON_COORDS_SIZE(24, 48), .y_offset = 8 },
[SPECIES_WOBBUFFET] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 10 },
[SPECIES_GIRAFARIG] = { .size = MON_COORDS_SIZE(64, 64), .y_offset = 1 },
[SPECIES_PINECO] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 13 },

View File

@ -201,7 +201,7 @@ const struct CompressedSpriteSheet gMonBackPicTable[] =
SPECIES_SPRITE(MURKROW, gMonBackPic_Murkrow),
SPECIES_SPRITE(SLOWKING, gMonBackPic_Slowking),
SPECIES_SPRITE(MISDREAVUS, gMonBackPic_Misdreavus),
SPECIES_SPRITE(UNOWN_A, gMonBackPic_Unown),
SPECIES_SPRITE(UNOWN, gMonBackPic_Unown),
SPECIES_SPRITE(WOBBUFFET, gMonBackPic_Wobbuffet),
SPECIES_SPRITE(GIRAFARIG, gMonBackPic_Girafarig),
SPECIES_SPRITE(PINECO, gMonBackPic_Pineco),

View File

@ -27,7 +27,7 @@ const u8 gEnemyMonElevation[NUM_SPECIES] =
[SPECIES_YANMA] = 13,
[SPECIES_MURKROW] = 12,
[SPECIES_MISDREAVUS] = 12,
[SPECIES_UNOWN_A] = 8,
[SPECIES_UNOWN] = 8,
[SPECIES_GLIGAR] = 8,
[SPECIES_MANTINE] = 6,
[SPECIES_PORYGON2] = 9,

View File

@ -201,7 +201,7 @@ const u8 *const gMonFootprintTable[] =
[SPECIES_MURKROW] = gMonFootprint_Murkrow,
[SPECIES_SLOWKING] = gMonFootprint_Slowking,
[SPECIES_MISDREAVUS] = gMonFootprint_Misdreavus,
[SPECIES_UNOWN_A] = gMonFootprint_Unown,
[SPECIES_UNOWN] = gMonFootprint_Unown,
[SPECIES_WOBBUFFET] = gMonFootprint_Wobbuffet,
[SPECIES_GIRAFARIG] = gMonFootprint_Girafarig,
[SPECIES_PINECO] = gMonFootprint_Pineco,

View File

@ -2342,7 +2342,7 @@ static const union AnimCmd sAnim_Misdreavus_1[] =
ANIMCMD_END,
};
static const union AnimCmd sAnim_UnownA_1[] =
static const union AnimCmd sAnim_Unown_1[] =
{
ANIMCMD_FRAME(0, 30),
ANIMCMD_FRAME(1, 30),
@ -10704,7 +10704,7 @@ SINGLE_ANIMATION(Umbreon);
SINGLE_ANIMATION(Murkrow);
SINGLE_ANIMATION(Slowking);
SINGLE_ANIMATION(Misdreavus);
SINGLE_ANIMATION(UnownA);
SINGLE_ANIMATION(Unown);
DOUBLE_ANIMATION(Wobbuffet);
DOUBLE_ANIMATION(Girafarig);
SINGLE_ANIMATION(Pineco);
@ -11840,7 +11840,7 @@ const union AnimCmd *const *const gMonFrontAnimsPtrTable[] =
[SPECIES_MURKROW] = sAnims_Murkrow,
[SPECIES_SLOWKING] = sAnims_Slowking,
[SPECIES_MISDREAVUS] = sAnims_Misdreavus,
[SPECIES_UNOWN_A] = sAnims_UnownA,
[SPECIES_UNOWN] = sAnims_Unown,
[SPECIES_WOBBUFFET] = sAnims_Wobbuffet,
[SPECIES_GIRAFARIG] = sAnims_Girafarig,
[SPECIES_PINECO] = sAnims_Pineco,

View File

@ -205,7 +205,7 @@ const struct MonCoords gMonFrontPicCoords[] =
[SPECIES_MURKROW] = { .size = MON_COORDS_SIZE(48, 40), .y_offset = 15 },
[SPECIES_SLOWKING] = { .size = MON_COORDS_SIZE(48, 64), .y_offset = 1 },
[SPECIES_MISDREAVUS] = { .size = MON_COORDS_SIZE(48, 48), .y_offset = 13 },
[SPECIES_UNOWN_A] = { .size = MON_COORDS_SIZE(24, 40), .y_offset = 15 },
[SPECIES_UNOWN] = { .size = MON_COORDS_SIZE(24, 40), .y_offset = 15 },
[SPECIES_WOBBUFFET] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 5 },
[SPECIES_GIRAFARIG] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 },
[SPECIES_PINECO] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 12 },

View File

@ -201,7 +201,7 @@ const struct CompressedSpriteSheet gMonFrontPicTable[] =
SPECIES_SPRITE(MURKROW, gMonFrontPic_Murkrow),
SPECIES_SPRITE(SLOWKING, gMonFrontPic_Slowking),
SPECIES_SPRITE(MISDREAVUS, gMonFrontPic_Misdreavus),
SPECIES_SPRITE(UNOWN_A, gMonFrontPic_Unown),
SPECIES_SPRITE(UNOWN, gMonFrontPic_Unown),
SPECIES_SPRITE(WOBBUFFET, gMonFrontPic_Wobbuffet),
SPECIES_SPRITE(GIRAFARIG, gMonFrontPic_Girafarig),
SPECIES_SPRITE(PINECO, gMonFrontPic_Pineco),

View File

@ -201,7 +201,7 @@ const struct CompressedSpritePalette gMonPaletteTable[] =
SPECIES_PAL(MURKROW, gMonPalette_Murkrow),
SPECIES_PAL(SLOWKING, gMonPalette_Slowking),
SPECIES_PAL(MISDREAVUS, gMonPalette_Misdreavus),
SPECIES_PAL(UNOWN_A, gMonPalette_Unown),
SPECIES_PAL(UNOWN, gMonPalette_Unown),
SPECIES_PAL(WOBBUFFET, gMonPalette_Wobbuffet),
SPECIES_PAL(GIRAFARIG, gMonPalette_Girafarig),
SPECIES_PAL(PINECO, gMonPalette_Pineco),

View File

@ -201,7 +201,7 @@ const struct CompressedSpritePalette gMonShinyPaletteTable[] =
SPECIES_SHINY_PAL(MURKROW, gMonShinyPalette_Murkrow),
SPECIES_SHINY_PAL(SLOWKING, gMonShinyPalette_Slowking),
SPECIES_SHINY_PAL(MISDREAVUS, gMonShinyPalette_Misdreavus),
SPECIES_SHINY_PAL(UNOWN_A, gMonShinyPalette_Unown),
SPECIES_SHINY_PAL(UNOWN, gMonShinyPalette_Unown),
SPECIES_SHINY_PAL(WOBBUFFET, gMonShinyPalette_Wobbuffet),
SPECIES_SHINY_PAL(GIRAFARIG, gMonShinyPalette_Girafarig),
SPECIES_SHINY_PAL(PINECO, gMonShinyPalette_Pineco),

View File

@ -200,7 +200,7 @@ const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1] = {
[SPECIES_MURKROW] = _("Murkrow"),
[SPECIES_SLOWKING] = _("Slowking"),
[SPECIES_MISDREAVUS] = _("Misdreavus"),
[SPECIES_UNOWN_A] = _("Unown"),
[SPECIES_UNOWN] = _("Unown"),
[SPECIES_WOBBUFFET] = _("Wobbuffet"),
[SPECIES_GIRAFARIG] = _("Girafarig"),
[SPECIES_PINECO] = _("Pineco"),

View File

@ -83,7 +83,16 @@ void HandleLoadSpecialPokePic(bool32 isFrontPic, void *dest, s32 species, u32 pe
void LoadSpecialPokePic(void *dest, s32 species, u32 personality, bool8 isFrontPic)
{
if (species > NUM_SPECIES) // is species unknown? draw the ? icon
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
{
if (isFrontPic)
LZ77UnCompWram(gMonFrontPicTable[0].data, dest);

View File

@ -445,6 +445,7 @@ static const struct MailLayout sMailLayouts_Tall[] = {
void ReadMail(struct Mail *mail, void (*exitCallback)(void), bool8 hasText)
{
u16 buffer[2];
u16 species;
sMailRead = AllocZeroed(sizeof(*sMailRead));
@ -472,7 +473,8 @@ void ReadMail(struct Mail *mail, void (*exitCallback)(void), bool8 hasText)
sMailRead->layout = &sMailLayouts_Tall[sMailRead->mailType];
break;
}
if (mail->species > SPECIES_NONE && mail->species < NUM_SPECIES)
species = MailSpeciesToSpecies(mail->species, buffer);
if (species > SPECIES_NONE && species < NUM_SPECIES)
{
switch (sMailRead->mailType)
{

View File

@ -67,7 +67,9 @@ u8 GiveMailToMonByItemId(struct Pokemon *mon, u16 itemId)
for (i = 0; i < TRAINER_ID_LENGTH; i++)
gSaveBlock1Ptr->mail[id].trainerId[i] = gSaveBlock2Ptr->playerTrainerId[i];
gSaveBlock1Ptr->mail[id].species = GetBoxMonData(&mon->box, MON_DATA_SPECIES);
species = GetBoxMonData(&mon->box, MON_DATA_SPECIES);
personality = GetBoxMonData(&mon->box, MON_DATA_PERSONALITY);
gSaveBlock1Ptr->mail[id].species = SpeciesToMailSpecies(species, personality);
gSaveBlock1Ptr->mail[id].itemId = itemId;
SetMonData(mon, MON_DATA_MAIL, &id);
SetMonData(mon, MON_DATA_HELD_ITEM, heldItem);
@ -78,6 +80,34 @@ u8 GiveMailToMonByItemId(struct Pokemon *mon, u16 itemId)
return MAIL_NONE;
}
u16 SpeciesToMailSpecies(u16 species, u32 personality)
{
if (species == SPECIES_UNOWN)
{
u32 species = GetUnownLetterByPersonality(personality) + UNOWN_OFFSET;
return species;
}
return species;
}
u16 MailSpeciesToSpecies(u16 mailSpecies, u16 *buffer)
{
u16 result;
if (mailSpecies >= UNOWN_OFFSET && mailSpecies < UNOWN_OFFSET + NUM_UNOWN_FORMS)
{
result = SPECIES_UNOWN;
*buffer = mailSpecies - UNOWN_OFFSET;
}
else
{
result = mailSpecies;
}
return result;
}
u8 GiveMailToMon(struct Pokemon *mon, struct Mail *mail)
{
u8 heldItem[2];

View File

@ -4592,9 +4592,9 @@ static u16 GetNextPosition(u8 direction, u16 position, u16 min, u16 max)
// All others use personality 0
static u32 GetPokedexMonPersonality(u16 species)
{
if (species == SPECIES_UNOWN_A || species == SPECIES_SPINDA)
if (species == SPECIES_UNOWN || species == SPECIES_SPINDA)
{
if (species == SPECIES_UNOWN_A)
if (species == SPECIES_UNOWN)
return gSaveBlock2Ptr->pokedex.unownPersonality;
else
return gSaveBlock2Ptr->pokedex.spindaPersonality;

View File

@ -538,7 +538,7 @@ static const u16 sSpeciesToNationalPokedexNum[NUM_SPECIES - 1] =
SPECIES_TO_NATIONAL(MURKROW),
SPECIES_TO_NATIONAL(SLOWKING),
SPECIES_TO_NATIONAL(MISDREAVUS),
[SPECIES_UNOWN_A - 1] = NATIONAL_DEX_UNOWN,
SPECIES_TO_NATIONAL(UNOWN),
SPECIES_TO_NATIONAL(WOBBUFFET),
SPECIES_TO_NATIONAL(GIRAFARIG),
SPECIES_TO_NATIONAL(PINECO),
@ -2163,34 +2163,7 @@ const u8 sMonFrontAnimIdsTable[NUM_SPECIES - 1] =
[SPECIES_MURKROW - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_SLOWKING - 1] = ANIM_SHRINK_GROW,
[SPECIES_MISDREAVUS - 1] = ANIM_V_SLIDE_WOBBLE,
[SPECIES_UNOWN_A - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_B - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_C - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_D - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_E - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_F - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_G - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_H - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_I - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_J - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_K - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_L - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_M - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_N - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_O - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_P - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_Q - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_R - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_S - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_T - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_U - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_V - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_W - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_X - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_Y - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_Z - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_EMARK - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN_QMARK - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_UNOWN - 1] = ANIM_ZIGZAG_FAST,
[SPECIES_WOBBUFFET - 1] = ANIM_GROW_VIBRATE,
[SPECIES_GIRAFARIG - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_PINECO - 1] = ANIM_SWING_CONCAVE,
@ -3465,9 +3438,6 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV,
else
personality = Random32();
if (species == SPECIES_UNOWN)
species = GetUnownSpeciesId(personality);
// Determine original trainer ID
if (otIdType == OT_ID_RANDOM_NO_SHINY)
{
@ -4490,7 +4460,7 @@ u32 GetUnownSpeciesId(u32 personality)
u16 unownLetter = GetUnownLetterByPersonality(personality);
if (unownLetter == 0)
return SPECIES_UNOWN_A;
return SPECIES_UNOWN;
return unownLetter + SPECIES_UNOWN_B - 1;
}
@ -8254,7 +8224,7 @@ void HandleSetPokedexFlag(u16 nationalNum, u8 caseId, u32 personality)
if (!GetSetPokedexFlag(nationalNum, getFlagCaseId)) // don't set if it's already set
{
GetSetPokedexFlag(nationalNum, caseId);
if (GET_BASE_SPECIES_ID(NationalPokedexNumToSpecies(nationalNum)) == SPECIES_UNOWN_A)
if (NationalPokedexNumToSpecies(nationalNum) == SPECIES_UNOWN)
gSaveBlock2Ptr->pokedex.unownPersonality = personality;
if (NationalPokedexNumToSpecies(nationalNum) == SPECIES_SPINDA)
gSaveBlock2Ptr->pokedex.spindaPersonality = personality;
@ -8277,12 +8247,13 @@ const u8 *GetTrainerNameFromId(u16 trainerId)
bool8 HasTwoFramesAnimation(u16 species)
{
species = GET_BASE_SPECIES_ID(species);
return (species != SPECIES_CASTFORM
&& species != SPECIES_SPINDA
&& species != SPECIES_UNOWN_A
&& species != SPECIES_CHERRIM);
&& species != SPECIES_UNOWN
&& species != SPECIES_CHERRIM
&& species != SPECIES_CASTFORM_SUNNY
&& species != SPECIES_CASTFORM_RAINY
&& species != SPECIES_CASTFORM_SNOWY);
}
static bool8 ShouldSkipFriendshipChange(void)

View File

@ -414,34 +414,7 @@ static const u8 sSpeciesToBackAnimSet[NUM_SPECIES] =
[SPECIES_MURKROW] = BACK_ANIM_CONCAVE_ARC_SMALL,
[SPECIES_SLOWKING] = BACK_ANIM_DIP_RIGHT_SIDE,
[SPECIES_MISDREAVUS] = BACK_ANIM_H_VIBRATE,
[SPECIES_UNOWN_A] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_B] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_C] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_D] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_E] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_F] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_G] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_H] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_I] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_J] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_K] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_L] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_M] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_N] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_O] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_P] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_Q] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_R] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_S] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_T] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_U] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_V] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_W] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_X] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_Y] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_Z] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_EMARK] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN_QMARK] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_UNOWN] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_WOBBUFFET] = BACK_ANIM_V_STRETCH,
[SPECIES_GIRAFARIG] = BACK_ANIM_SHRINK_GROW_VIBRATE,
[SPECIES_PINECO] = BACK_ANIM_H_SHAKE,

View File

@ -227,7 +227,7 @@ const u8 *const gMonIconTable[] =
[SPECIES_MURKROW] = gMonIcon_Murkrow,
[SPECIES_SLOWKING] = gMonIcon_Slowking,
[SPECIES_MISDREAVUS] = gMonIcon_Misdreavus,
[SPECIES_UNOWN_A] = gMonIcon_Unown,
[SPECIES_UNOWN] = gMonIcon_Unown,
[SPECIES_WOBBUFFET] = gMonIcon_Wobbuffet,
[SPECIES_GIRAFARIG] = gMonIcon_Girafarig,
[SPECIES_PINECO] = gMonIcon_Pineco,
@ -1532,7 +1532,7 @@ const u8 gMonIconPaletteIndices[] =
[SPECIES_MURKROW] = 2,
[SPECIES_SLOWKING] = 0,
[SPECIES_MISDREAVUS] = 0,
[SPECIES_UNOWN_A] = 0,
[SPECIES_UNOWN] = 0,
[SPECIES_WOBBUFFET] = 0,
[SPECIES_GIRAFARIG] = 1,
[SPECIES_PINECO] = 0,
@ -2737,10 +2737,17 @@ u16 GetIconSpecies(u16 species, u32 personality)
{
u16 result;
if (species == SPECIES_UNOWN)
{
result = GetUnownSpeciesId(personality);
}
else
{
if (species > NUM_SPECIES)
result = INVALID_ICON_SPECIES;
else
result = species;
}
return result;
}
@ -2757,11 +2764,19 @@ u16 GetIconSpeciesNoPersonality(u16 species)
{
u16 value;
if (MailSpeciesToSpecies(species, &value) == SPECIES_UNOWN)
{
value += SPECIES_UNOWN_B; // TODO
return value;
}
else
{
if (species > NUM_SPECIES)
species = INVALID_ICON_SPECIES;
return GetIconSpecies(species, 0);
}
}
const u8 *GetMonIconPtr(u16 species, u32 personality)
{