Use new gift ribbons size, label unused ribbons

This commit is contained in:
GriffinR
2021-02-17 14:11:45 -05:00
parent 549ddb8c95
commit e059c4fdfa
8 changed files with 24 additions and 22 deletions

View File

@@ -553,20 +553,20 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon* mon)
const struct Evolution *evos2;
CopyMon(&gPlayerParty[gPlayerPartyCount], mon, sizeof(struct Pokemon));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_SPECIES, (&gEvolutionTable[preEvoSpecies][1].targetSpecies));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_NICKNAME, (gSpeciesNames[gEvolutionTable[preEvoSpecies][1].targetSpecies]));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_HELD_ITEM, (&data));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_MARKINGS, (&data));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_ENCRYPT_SEPARATOR, (&data));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_SPECIES, &gEvolutionTable[preEvoSpecies][1].targetSpecies);
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_NICKNAME, gSpeciesNames[gEvolutionTable[preEvoSpecies][1].targetSpecies]);
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_HELD_ITEM, &data);
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_MARKINGS, &data);
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_ENCRYPT_SEPARATOR, &data);
for (i = MON_DATA_COOL_RIBBON; i < MON_DATA_COOL_RIBBON + CONTEST_CATEGORIES_COUNT; i++)
SetMonData(&gPlayerParty[gPlayerPartyCount], i, (&data));
for (i = MON_DATA_CHAMPION_RIBBON; i <= MON_DATA_FILLER; i++)
SetMonData(&gPlayerParty[gPlayerPartyCount], i, (&data));
SetMonData(&gPlayerParty[gPlayerPartyCount], i, &data);
for (i = MON_DATA_CHAMPION_RIBBON; i <= MON_DATA_UNUSED_RIBBONS; i++)
SetMonData(&gPlayerParty[gPlayerPartyCount], i, &data);
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_STATUS, (&data));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_STATUS, &data);
data = 0xFF;
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_MAIL, (&data));
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_MAIL, &data);
CalculateMonStats(&gPlayerParty[gPlayerPartyCount]);
CalculatePlayerPartyCount();

View File

@@ -3928,8 +3928,8 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data)
case MON_DATA_WORLD_RIBBON:
retVal = substruct3->worldRibbon;
break;
case MON_DATA_FILLER:
retVal = substruct3->filler;
case MON_DATA_UNUSED_RIBBONS:
retVal = substruct3->unusedRibbons;
break;
case MON_DATA_EVENT_LEGAL:
retVal = substruct3->eventLegal;
@@ -4307,8 +4307,8 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg)
case MON_DATA_WORLD_RIBBON:
SET8(substruct3->worldRibbon);
break;
case MON_DATA_FILLER:
SET8(substruct3->filler);
case MON_DATA_UNUSED_RIBBONS:
SET8(substruct3->unusedRibbons);
break;
case MON_DATA_EVENT_LEGAL:
SET8(substruct3->eventLegal);

View File

@@ -36,7 +36,8 @@ static const struct UnknownStruct sBigMonSizeTable[] =
{ 1700, 1, -26 },
};
static const u8 sGiftRibbonsMonDataIds[] =
// - 4 for unused gift ribbon bits in MON_DATA_UNUSED_RIBBONS
static const u8 sGiftRibbonsMonDataIds[GIFT_RIBBONS_COUNT - 4] =
{
MON_DATA_MARINE_RIBBON, MON_DATA_LAND_RIBBON, MON_DATA_SKY_RIBBON,
MON_DATA_COUNTRY_RIBBON, MON_DATA_NATIONAL_RIBBON, MON_DATA_EARTH_RIBBON,
@@ -200,7 +201,7 @@ void GiveGiftRibbonToParty(u8 index, u8 ribbonId)
u8 array[8];
memcpy(array, sGiftRibbonsMonDataIds, sizeof(sGiftRibbonsMonDataIds));
if (index < 11 && ribbonId < 65)
if (index < GIFT_RIBBONS_COUNT && ribbonId < 65)
{
gSaveBlock1Ptr->giftRibbons[index] = ribbonId;
for (i = 0; i < PARTY_SIZE; i++)

View File

@@ -110,7 +110,7 @@ static EWRAM_DATA struct {
/*0x007F*/ u8 unused_7F;
/*0x0080*/ u16 linkData[20];
/*0x00A8*/ u8 timer;
/*0x00A9*/ u8 giftRibbons[11];
/*0x00A9*/ u8 giftRibbons[GIFT_RIBBONS_COUNT];
/*0x00B4*/ u8 filler_B4[0x8D0-0xB4];
/*0x08D0*/ struct {
bool8 queued;