Merge pull request #2457 from AsparagusEduardo/RHH/pr/cleanup/unown

Removed Unown hack
This commit is contained in:
Eduardo Quezada D'Ottone 2023-01-04 18:57:28 -03:00 committed by GitHub
commit 34d27eca0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 127 additions and 250 deletions

View File

@ -202,7 +202,7 @@
#define SPECIES_MURKROW 198
#define SPECIES_SLOWKING 199
#define SPECIES_MISDREAVUS 200
#define SPECIES_UNOWN 201
#define SPECIES_UNOWN_A 201
#define SPECIES_WOBBUFFET 202
#define SPECIES_GIRAFARIG 203
#define SPECIES_PINECO 204
@ -1373,4 +1373,6 @@
#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,7 +338,6 @@ 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,8 +22,6 @@ 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() && IsSpeciesNotUnown(gContestResources->moveAnim->species))
if (IsContest())
gBattle_BG1_X--;
gBattle_BG1_Y = -(gSprites[battlerSpriteId].y + gSprites[battlerSpriteId].y2) + 0x20;
@ -797,24 +797,21 @@ 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++)
{
GetBattleAnimBg1Data(&animBg);
ptr = animBg.bgTilemap;
for (i = 0; i < 8; i++)
for (j = 0; j < 4; j++)
{
for (j = 0; j < 4; j++)
{
u16 temp;
SWAP(ptr[j + i * 32], ptr[7 - j + i * 32], temp);
}
}
for (i = 0; i < 8; i++)
{
for (j = 0; j < 8; j++)
ptr[j + i * 32] ^= 0x400;
u16 temp;
SWAP(ptr[j + i * 32], ptr[7 - j + i * 32], temp);
}
}
for (i = 0; i < 8; i++)
{
for (j = 0; j < 8; j++)
ptr[j + i * 32] ^= 0x400;
}
}
void RelocateBattleBgPal(u16 paletteNum, u16 *dest, u32 offset, bool8 largeScreen)

View File

@ -2378,33 +2378,7 @@ 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;
gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gAffineAnims_BattleSpriteContest;
StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimAttacker]], BATTLER_AFFINE_NORMAL);
}

View File

@ -177,64 +177,21 @@ u8 GetBattlerYDelta(u8 battlerId, u16 species)
if (GetBattlerSide(battlerId) == B_SIDE_PLAYER || IsContest())
{
if (species == SPECIES_UNOWN)
{
if (IsContest())
{
if (gContestResources->moveAnim->hasTargetAnim)
personality = gContestResources->moveAnim->targetPersonality;
else
personality = gContestResources->moveAnim->personality;
}
else
{
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)
{
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)
{
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;
}
@ -1317,17 +1274,7 @@ void SetSpriteRotScale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation)
// Pokémon in Contests (except Unown) should be flipped.
static bool8 ShouldRotScaleSpeciesBeFlipped(void)
{
if (IsContest())
{
if (gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)].data[2] == SPECIES_UNOWN)
return FALSE;
else
return TRUE;
}
else
{
return FALSE;
}
return IsContest();
}
void PrepareBattlerSpriteForRotScale(u8 spriteId, u8 objMode)
@ -2197,12 +2144,8 @@ s16 GetBattlerSpriteCoordAttr(u8 battlerId, u8 attr)
species = gContestResources->moveAnim->species;
personality = gContestResources->moveAnim->personality;
}
if (species == SPECIES_UNOWN)
{
species = GetUnownSpeciesId(personality);
coords = &gMonBackPicCoords[species];
}
else if (species == SPECIES_CASTFORM)
if (species == SPECIES_CASTFORM)
{
coords = &gCastformFrontSpriteCoords[gBattleMonForms[battlerId]];
}
@ -2231,19 +2174,10 @@ s16 GetBattlerSpriteCoordAttr(u8 battlerId, u8 attr)
personality = gTransformedPersonalities[battlerId];
}
if (species == SPECIES_UNOWN)
{
species = GetUnownSpeciesId(personality);
coords = &gMonBackPicCoords[species];
}
else if (species > NUM_SPECIES)
{
if (species > NUM_SPECIES)
coords = &gMonBackPicCoords[0];
}
else
{
coords = &gMonBackPicCoords[species];
}
}
else
{
@ -2259,23 +2193,12 @@ s16 GetBattlerSpriteCoordAttr(u8 battlerId, u8 attr)
personality = gTransformedPersonalities[battlerId];
}
if (species == SPECIES_UNOWN)
{
species = GetUnownSpeciesId(personality);
coords = &gMonFrontPicCoords[species];
}
else if (species == SPECIES_CASTFORM)
{
if (species == SPECIES_CASTFORM)
coords = &gCastformFrontSpriteCoords[gBattleMonForms[battlerId]];
}
else if (species > NUM_SPECIES)
{
coords = &gMonFrontPicCoords[0];
}
else
{
coords = &gMonFrontPicCoords[species];
}
}
}

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 (gFacilityTrainerMons[monId].species == SPECIES_UNOWN)
if (GET_BASE_SPECIES_ID(gFacilityTrainerMons[monId].species) == SPECIES_UNOWN_A)
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 (gFacilityTrainerMons[monId].species == SPECIES_UNOWN)
if (GET_BASE_SPECIES_ID(gFacilityTrainerMons[monId].species) == SPECIES_UNOWN_A)
continue;
// Cannot have two pokemon of the same species.
@ -771,7 +771,7 @@ void FillFactoryBrainParty(void)
{
u16 monId = GetFactoryMonId(lvlMode, challengeNum, FALSE);
if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN)
if (GET_BASE_SPECIES_ID(gFacilityTrainerMons[monId].species) == SPECIES_UNOWN_A)
continue;
if (monLevel == FRONTIER_MAX_LEVEL_50 && monId > FRONTIER_MONS_HIGH_TIER)
continue;

View File

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

View File

@ -3136,23 +3136,12 @@ 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;
gSprites[spriteId].affineAnims = gAffineAnims_BattleSpriteContest;
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] = {
[SPECIES_UNOWN_A] = {
{ .songLengthId = 42 },
{ .songLengthId = 26 },
{ .songLengthId = 51 },

View File

@ -229,7 +229,7 @@ const u16 gEasyChatGroup_Pokemon2[] = {
SPECIES_TYRANITAR,
SPECIES_TYROGUE,
SPECIES_UMBREON,
SPECIES_UNOWN,
SPECIES_UNOWN_A,
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),
EC_POKEMON_NATIONAL(UNOWN_A),
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] = sUnownFormSpeciesIdTable,
[SPECIES_UNOWN_A] = 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,
SPECIES_UNOWN_A,
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] = sUnownLevelUpLearnset,
[SPECIES_UNOWN_A] = sUnownLevelUpLearnset,
[SPECIES_WOBBUFFET] = sWobbuffetLevelUpLearnset,
[SPECIES_GIRAFARIG] = sGirafarigLevelUpLearnset,
[SPECIES_PINECO] = sPinecoLevelUpLearnset,

View File

@ -5941,7 +5941,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.noFlip = FALSE,
},
[SPECIES_UNOWN] = UNOWN_SPECIES_INFO(FLIP),
[SPECIES_UNOWN_A] = 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] = sUnownTeachableLearnset,
[SPECIES_UNOWN_A] = 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] = { .size = MON_COORDS_SIZE(24, 48), .y_offset = 8 },
[SPECIES_UNOWN_A] = { .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, gMonBackPic_Unown),
SPECIES_SPRITE(UNOWN_A, 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] = 8,
[SPECIES_UNOWN_A] = 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] = gMonFootprint_Unown,
[SPECIES_UNOWN_A] = 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_Unown_1[] =
static const union AnimCmd sAnim_UnownA_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(Unown);
SINGLE_ANIMATION(UnownA);
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] = sAnims_Unown,
[SPECIES_UNOWN_A] = sAnims_UnownA,
[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] = { .size = MON_COORDS_SIZE(24, 40), .y_offset = 15 },
[SPECIES_UNOWN_A] = { .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, gMonFrontPic_Unown),
SPECIES_SPRITE(UNOWN_A, 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, gMonPalette_Unown),
SPECIES_PAL(UNOWN_A, 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, gMonShinyPalette_Unown),
SPECIES_SHINY_PAL(UNOWN_A, 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] = _("Unown"),
[SPECIES_UNOWN_A] = _("Unown"),
[SPECIES_WOBBUFFET] = _("Wobbuffet"),
[SPECIES_GIRAFARIG] = _("Girafarig"),
[SPECIES_PINECO] = _("Pineco"),

View File

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

View File

@ -445,7 +445,6 @@ 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));
@ -473,8 +472,7 @@ void ReadMail(struct Mail *mail, void (*exitCallback)(void), bool8 hasText)
sMailRead->layout = &sMailLayouts_Tall[sMailRead->mailType];
break;
}
species = MailSpeciesToSpecies(mail->species, buffer);
if (species > SPECIES_NONE && species < NUM_SPECIES)
if (mail->species > SPECIES_NONE && mail->species < NUM_SPECIES)
{
switch (sMailRead->mailType)
{

View File

@ -67,9 +67,7 @@ u8 GiveMailToMonByItemId(struct Pokemon *mon, u16 itemId)
for (i = 0; i < TRAINER_ID_LENGTH; i++)
gSaveBlock1Ptr->mail[id].trainerId[i] = gSaveBlock2Ptr->playerTrainerId[i];
species = GetBoxMonData(&mon->box, MON_DATA_SPECIES);
personality = GetBoxMonData(&mon->box, MON_DATA_PERSONALITY);
gSaveBlock1Ptr->mail[id].species = SpeciesToMailSpecies(species, personality);
gSaveBlock1Ptr->mail[id].species = GetBoxMonData(&mon->box, MON_DATA_SPECIES);
gSaveBlock1Ptr->mail[id].itemId = itemId;
SetMonData(mon, MON_DATA_MAIL, &id);
SetMonData(mon, MON_DATA_HELD_ITEM, heldItem);
@ -80,34 +78,6 @@ 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 || species == SPECIES_SPINDA)
if (species == SPECIES_UNOWN_A || species == SPECIES_SPINDA)
{
if (species == SPECIES_UNOWN)
if (species == SPECIES_UNOWN_A)
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_TO_NATIONAL(UNOWN),
[SPECIES_UNOWN_A - 1] = NATIONAL_DEX_UNOWN,
SPECIES_TO_NATIONAL(WOBBUFFET),
SPECIES_TO_NATIONAL(GIRAFARIG),
SPECIES_TO_NATIONAL(PINECO),
@ -2163,7 +2163,34 @@ 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 - 1] = ANIM_ZIGZAG_FAST,
[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_WOBBUFFET - 1] = ANIM_GROW_VIBRATE,
[SPECIES_GIRAFARIG - 1] = ANIM_V_SQUISH_AND_BOUNCE,
[SPECIES_PINECO - 1] = ANIM_SWING_CONCAVE,
@ -3438,6 +3465,9 @@ 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)
{
@ -4460,7 +4490,7 @@ u32 GetUnownSpeciesId(u32 personality)
u16 unownLetter = GetUnownLetterByPersonality(personality);
if (unownLetter == 0)
return SPECIES_UNOWN;
return SPECIES_UNOWN_A;
return unownLetter + SPECIES_UNOWN_B - 1;
}
@ -8224,7 +8254,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 (NationalPokedexNumToSpecies(nationalNum) == SPECIES_UNOWN)
if (GET_BASE_SPECIES_ID(NationalPokedexNumToSpecies(nationalNum)) == SPECIES_UNOWN_A)
gSaveBlock2Ptr->pokedex.unownPersonality = personality;
if (NationalPokedexNumToSpecies(nationalNum) == SPECIES_SPINDA)
gSaveBlock2Ptr->pokedex.spindaPersonality = personality;
@ -8247,13 +8277,12 @@ 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
&& species != SPECIES_CHERRIM
&& species != SPECIES_CASTFORM_SUNNY
&& species != SPECIES_CASTFORM_RAINY
&& species != SPECIES_CASTFORM_SNOWY);
&& species != SPECIES_UNOWN_A
&& species != SPECIES_CHERRIM);
}
static bool8 ShouldSkipFriendshipChange(void)

View File

@ -414,7 +414,34 @@ 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] = BACK_ANIM_SHRINK_GROW_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_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] = gMonIcon_Unown,
[SPECIES_UNOWN_A] = 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] = 0,
[SPECIES_UNOWN_A] = 0,
[SPECIES_WOBBUFFET] = 0,
[SPECIES_GIRAFARIG] = 1,
[SPECIES_PINECO] = 0,
@ -2737,17 +2737,10 @@ u16 GetIconSpecies(u16 species, u32 personality)
{
u16 result;
if (species == SPECIES_UNOWN)
{
result = GetUnownSpeciesId(personality);
}
if (species > NUM_SPECIES)
result = INVALID_ICON_SPECIES;
else
{
if (species > NUM_SPECIES)
result = INVALID_ICON_SPECIES;
else
result = species;
}
result = species;
return result;
}
@ -2764,18 +2757,10 @@ 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;
if (species > NUM_SPECIES)
species = INVALID_ICON_SPECIES;
return GetIconSpecies(species, 0);
}
return GetIconSpecies(species, 0);
}
const u8 *GetMonIconPtr(u16 species, u32 personality)