Sync pokemon.c

This commit is contained in:
GriffinR
2023-03-01 00:42:12 -05:00
parent 3a4eaa0ff5
commit ab417d1255
54 changed files with 3710 additions and 4365 deletions
+13 -13
View File
@@ -2652,7 +2652,7 @@ static void CreatePartyMonIconSprite(struct Pokemon *mon, struct PartyMenuBox *m
// If in a multi battle, show partners Deoxys icon as Normal forme
if (IsMultiBattle() == TRUE && gMain.inBattle)
handleDeoxys = (sMultiBattlePartnersPartyMask[slot] ^ handleDeoxys) ? TRUE : FALSE;
species2 = GetMonData(mon, MON_DATA_SPECIES2);
species2 = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
CreatePartyMonIconSpriteParameterized(species2, GetMonData(mon, MON_DATA_PERSONALITY), menuBox, 1, handleDeoxys);
UpdatePartyMonHPBar(menuBox->monSpriteId, mon);
}
@@ -3357,8 +3357,8 @@ static void SetSwitchedPartyOrderQuestLogEvent(void)
{
u16 *buffer = Alloc(2 * sizeof(u16));
buffer[0] = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES2);
buffer[1] = GetMonData(&gPlayerParty[gPartyMenu.slotId2], MON_DATA_SPECIES2);
buffer[0] = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES_OR_EGG);
buffer[1] = GetMonData(&gPlayerParty[gPartyMenu.slotId2], MON_DATA_SPECIES_OR_EGG);
SetQuestLogEvent(QL_EVENT_SWITCHED_PARTY_ORDER, buffer);
Free(buffer);
}
@@ -3847,11 +3847,11 @@ static void CursorCB_Store(u8 taskId)
// Register mon for the Trading Board in Union Room
static void CursorCB_Register(u8 taskId)
{
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES2);
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES_OR_EGG);
u16 species = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES);
u8 isEventLegal = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_EVENT_LEGAL);
u8 isModernFatefulEncounter = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_MODERN_FATEFUL_ENCOUNTER);
switch (CanRegisterMonForTradingBoard(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), species2, species, isEventLegal))
switch (CanRegisterMonForTradingBoard(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), species2, species, isModernFatefulEncounter))
{
case CANT_REGISTER_MON:
StringExpandPlaceholders(gStringVar4, gText_PkmnCantBeTradedNow);
@@ -3874,10 +3874,10 @@ static void CursorCB_Register(u8 taskId)
static void CursorCB_Trade1(u8 taskId)
{
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES2);
u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES_OR_EGG);
u16 species = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES);
u8 isEventLegal = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_EVENT_LEGAL);
u32 stringId = GetUnionRoomTradeMessageId(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), gRfuPartnerCompatibilityData, species2, gUnionRoomOfferedSpecies, gUnionRoomRequestedMonType, species, isEventLegal);
u8 isModernFatefulEncounter = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_MODERN_FATEFUL_ENCOUNTER);
u32 stringId = GetUnionRoomTradeMessageId(*(struct RfuGameCompatibilityData *)GetHostRfuGameData(), gRfuPartnerCompatibilityData, species2, gUnionRoomOfferedSpecies, gUnionRoomRequestedMonType, species, isModernFatefulEncounter);
if (stringId != UR_TRADE_MSG_NONE)
{
@@ -4133,7 +4133,7 @@ static void SetSwappedHeldItemQuestLogEvent(struct Pokemon *mon, u16 item, u16 i
{
u16 *ptr = Alloc(4 * sizeof(u16));
ptr[2] = GetMonData(mon, MON_DATA_SPECIES2);
ptr[2] = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
ptr[0] = item;
ptr[1] = item2;
if (gPartyMenu.action == PARTY_ACTION_GIVE_PC_ITEM)
@@ -4154,7 +4154,7 @@ static void SetUsedFieldMoveQuestLogEvent(struct Pokemon *mon, u8 fieldMove)
{
struct FieldMoveWarpParams *ptr = Alloc(sizeof(*ptr));
ptr->species = GetMonData(mon, MON_DATA_SPECIES2);
ptr->species = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
ptr->fieldMove = fieldMove;
switch (ptr->fieldMove)
{
@@ -4187,7 +4187,7 @@ void SetUsedFlyQuestLogEvent(const u8 *healLocCtrlData)
mapHeader = Overworld_GetMapHeaderByGroupAndId(ptr->mapGroup, ptr->mapNum);
Free(ptr);
ptr2 = Alloc(4);
ptr2->species = GetMonData(&gPlayerParty[GetCursorSelectionMonId()], MON_DATA_SPECIES2);
ptr2->species = GetMonData(&gPlayerParty[GetCursorSelectionMonId()], MON_DATA_SPECIES_OR_EGG);
ptr2->fieldMove = FIELD_MOVE_FLY;
ptr2->regionMapSectionId = mapHeader->regionMapSectionId;
SetQuestLogEvent(QL_EVENT_USED_FIELD_MOVE, (u16 *)ptr2);
@@ -5342,7 +5342,7 @@ u8 GetItemEffectType(u16 item)
itemEffect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
else
itemEffect = gItemEffectTable[item - ITEM_POTION];
if ((itemEffect[0] & (ITEM0_HIGH_CRIT | ITEM0_X_ATTACK)) || itemEffect[1] || itemEffect[2] || (itemEffect[3] & ITEM3_MIST))
if ((itemEffect[0] & (ITEM0_DIRE_HIT | ITEM0_X_ATTACK)) || itemEffect[1] || itemEffect[2] || (itemEffect[3] & ITEM3_GUARD_SPEC))
return ITEM_EFFECT_X_ITEM;
else if (itemEffect[0] & ITEM0_SACRED_ASH)
return ITEM_EFFECT_SACRED_ASH;