Mirror pokeemerald PR#1329 & PR#1335 to pokefirered

The `giftRibbons` field in `SaveBlock1` has been split out into proper subfields. The new ExternalEvent structs deal with interconnectivity between external games/peripherals and FRLG. US & JP Colosseum Bonus Discs', Colosseum and XD's, Pokémon Channel's, and PokémonBox: Ruby & Sapphire's interactions with these fields has been documented.

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 `eventLegal`. All relevant constants and functions dealing with the Pokémon data structure were renamed with these changes in mind.

I still maintain that `eventLegal` is a misnomer and it should be called `fatefulEncounter` in all three repos.
This commit is contained in:
Deokishisu
2021-02-16 16:56:31 -05:00
parent bc4f88d72c
commit 57e3f5e0f8
20 changed files with 178 additions and 129 deletions
+8 -8
View File
@@ -1845,7 +1845,7 @@ static u8 PlayerHasEnoughPokemonToTrade_HandleMewDeoxys(u8 *flags, u8 partyCount
count += flags[i];
}
species = GetMonData(&gEnemyParty[sTradeMenuResourcesPtr->otherPlayerCursorPosition % 6], MON_DATA_SPECIES);
if ((species == SPECIES_DEOXYS || species == SPECIES_MEW) && !GetMonData(&gEnemyParty[sTradeMenuResourcesPtr->otherPlayerCursorPosition % 6], MON_DATA_OBEDIENCE))
if ((species == SPECIES_DEOXYS || species == SPECIES_MEW) && !GetMonData(&gEnemyParty[sTradeMenuResourcesPtr->otherPlayerCursorPosition % 6], MON_DATA_EVENT_LEGAL))
return 2;
if (count != 0)
count = 1;
@@ -2649,7 +2649,7 @@ static u32 TestWhetherSelectedMonCanBeTraded(struct Pokemon * party, int partyCo
if (species[cursorPos] == SPECIES_DEOXYS || species[cursorPos] == SPECIES_MEW)
{
if (!GetMonData(&party[cursorPos], MON_DATA_OBEDIENCE))
if (!GetMonData(&party[cursorPos], MON_DATA_EVENT_LEGAL))
{
return 4;
}
@@ -2730,17 +2730,17 @@ s32 Trade_CalcLinkPlayerCompatibilityParam(void)
return 0;
}
static bool32 IsDeoxysOrMewUntradable(u16 species, bool8 isObedientBitSet)
static bool32 IsDeoxysOrMewUntradable(u16 species, bool8 isEventLegal)
{
if (species == SPECIES_DEOXYS || species == SPECIES_MEW)
{
if (!isObedientBitSet)
if (!isEventLegal)
return TRUE;
}
return FALSE;
}
int GetUnionRoomTradeMessageId(struct GFtgtGnameSub playerSub, struct GFtgtGnameSub partnerSub, u16 species1, u16 species2, u8 type, u16 species3, u8 isObedientBitSet)
int GetUnionRoomTradeMessageId(struct GFtgtGnameSub playerSub, struct GFtgtGnameSub partnerSub, u16 species1, u16 species2, u8 type, u16 species3, u8 isEventLegal)
{
u8 playerHasNationalDex = playerSub.hasNationalDex;
u8 playerIsChampion = playerSub.isChampion;
@@ -2769,7 +2769,7 @@ int GetUnionRoomTradeMessageId(struct GFtgtGnameSub playerSub, struct GFtgtGname
}
}
if (IsDeoxysOrMewUntradable(species3, isObedientBitSet))
if (IsDeoxysOrMewUntradable(species3, isEventLegal))
{
return 4;
}
@@ -2820,11 +2820,11 @@ int GetUnionRoomTradeMessageId(struct GFtgtGnameSub playerSub, struct GFtgtGname
return 0;
}
int CanRegisterMonForTradingBoard(struct GFtgtGnameSub playerSub, u16 species2, u16 species, u8 obedience)
int CanRegisterMonForTradingBoard(struct GFtgtGnameSub playerSub, u16 species2, u16 species, u8 isEventLegal)
{
u8 canTradeEggAndNational = playerSub.hasNationalDex;
if (IsDeoxysOrMewUntradable(species, obedience))
if (IsDeoxysOrMewUntradable(species, isEventLegal))
{
return 1;
}