diff options
author | Deokishisu <6993375+Deokishisu@users.noreply.github.com> | 2021-02-15 11:40:16 -0500 |
---|---|---|
committer | Deokishisu <6993375+Deokishisu@users.noreply.github.com> | 2021-02-15 11:40:16 -0500 |
commit | b89c3e901e1de2f3513d74fa548373d82d3f26d0 (patch) | |
tree | 8e6fa5b51b3f71c1cf7928af02d22bc745b5fb77 /src/battle_util.c | |
parent | 5f58ea02c66a7e1a7d0164ba497bfa2d7527328b (diff) |
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.
Diffstat (limited to 'src/battle_util.c')
-rw-r--r-- | src/battle_util.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/battle_util.c b/src/battle_util.c index 210e418c6..7914356dc 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3949,14 +3949,14 @@ u8 GetMoveTarget(u16 move, u8 setTarget) return targetBattler; } -static bool32 HasObedientBitSet(u8 battlerId) +static bool32 IsNotEventMewOrDeoxys(u8 battlerId) { if (GetBattlerSide(battlerId) == B_SIDE_OPPONENT) return TRUE; if (GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES, NULL) != SPECIES_DEOXYS && GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES, NULL) != SPECIES_MEW) return TRUE; - return GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_OBEDIENCE, NULL); + return GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_FATEFUL_ENCOUNTER, NULL); } u8 IsMonDisobedient(void) @@ -3970,7 +3970,7 @@ u8 IsMonDisobedient(void) if (GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT) return 0; - if (HasObedientBitSet(gBattlerAttacker)) // only if species is Mew or Deoxys + if (IsNotEventMewOrDeoxys(gBattlerAttacker)) // only if species is Mew or Deoxys { if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && GetBattlerPosition(gBattlerAttacker) == 2) return 0; |