Fix giftRibbons Field in SaveBlock1 & Relabel Gift Ribbons in pokemon.h

The giftRibbons field has been split out into proper subfields. The new ExternalEvent structs deal with interconnectivity between external games/peripherals and Emerald, such as PokéCoupon storage and the flag for receiving Wishmaker Jirachi.

The giftRibbon fields in `PokemonSubstruct3` have also been renamed to their appropriate ribbons, and commented with distribution info if applicable. The previous `fatefulEncounter` field was actually filler, and relabeled as such, while the obedient bit was renamed `fatefulEncounter`. All relevant constants and functions dealing with the Pokémon data structure were renamed with these changes in mind.
This commit is contained in:
Deokishisu
2021-02-15 11:40:16 -05:00
parent 5f58ea02c6
commit b89c3e901e
21 changed files with 168 additions and 131 deletions

View File

@@ -1489,7 +1489,7 @@ static u8 CheckValidityOfTradeMons(u8 *aliveMons, u8 playerPartyCount, u8 player
// Partner cant trade illegitimate Deoxys or Mew
if (partnerSpecies == SPECIES_DEOXYS || partnerSpecies == SPECIES_MEW)
{
if (!GetMonData(&gEnemyParty[partnerMonIdx], MON_DATA_OBEDIENCE))
if (!GetMonData(&gEnemyParty[partnerMonIdx], MON_DATA_FATEFUL_ENCOUNTER))
return PARTNER_MON_INVALID;
}
@@ -2329,7 +2329,7 @@ static u32 CanTradeSelectedMon(struct Pokemon *playerParty, int partyCount, int
if (species[monIdx] == SPECIES_DEOXYS || species[monIdx] == SPECIES_MEW)
{
if (!GetMonData(&playerParty[monIdx], MON_DATA_OBEDIENCE))
if (!GetMonData(&playerParty[monIdx], MON_DATA_FATEFUL_ENCOUNTER))
return CANT_TRADE_INVALID_MON;
}
@@ -2394,17 +2394,17 @@ s32 GetGameProgressForLinkTrade(void)
return TRADE_BOTH_PLAYERS_READY;
}
static bool32 IsDeoxysOrMewUntradable(u16 species, bool8 isObedientBitSet)
static bool32 IsDeoxysOrMewUntradable(u16 species, bool8 isFatefulEncounter)
{
if (species == SPECIES_DEOXYS || species == SPECIES_MEW)
{
if (!isObedientBitSet)
if (!isFatefulEncounter)
return TRUE;
}
return FALSE;
}
int GetUnionRoomTradeMessageId(struct GFtgtGnameSub rfuPlayer, struct GFtgtGnameSub rfuPartner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, u8 isObedientBitSet)
int GetUnionRoomTradeMessageId(struct GFtgtGnameSub rfuPlayer, struct GFtgtGnameSub rfuPartner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, u8 isFatefulEncounter)
{
bool8 playerHasNationalDex = rfuPlayer.hasNationalDex;
bool8 playerIsChampion = rfuPlayer.isChampion;
@@ -2424,7 +2424,7 @@ int GetUnionRoomTradeMessageId(struct GFtgtGnameSub rfuPlayer, struct GFtgtGname
}
}
if (IsDeoxysOrMewUntradable(playerSpecies, isObedientBitSet))
if (IsDeoxysOrMewUntradable(playerSpecies, isFatefulEncounter))
{
return UR_TRADE_MSG_MON_CANT_BE_TRADED_2;
}
@@ -2475,11 +2475,11 @@ int GetUnionRoomTradeMessageId(struct GFtgtGnameSub rfuPlayer, struct GFtgtGname
return UR_TRADE_MSG_NONE;
}
int CanRegisterMonForTradingBoard(struct GFtgtGnameSub rfuPlayer, u16 species2, u16 species, u8 isObedientBitSet)
int CanRegisterMonForTradingBoard(struct GFtgtGnameSub rfuPlayer, u16 species2, u16 species, u8 isFatefulEncounter)
{
bool8 hasNationalDex = rfuPlayer.hasNationalDex;
if (IsDeoxysOrMewUntradable(species, isObedientBitSet))
if (IsDeoxysOrMewUntradable(species, isFatefulEncounter))
return CANT_REGISTER_MON;
if (hasNationalDex)