diff options
Diffstat (limited to 'src/wild_encounter.c')
-rw-r--r-- | src/wild_encounter.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/wild_encounter.c b/src/wild_encounter.c index 906cca3a0..2e6f1642a 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -88,20 +88,12 @@ static bool8 CheckFeebas(void) x -= 7; y -= 7; -#ifdef NONMATCHING + if (y >= gRoute119WaterTileData[3 * 0 + 0] && y <= gRoute119WaterTileData[3 * 0 + 1]) + route119Section = 0; if (y >= gRoute119WaterTileData[3 * 1 + 0] && y <= gRoute119WaterTileData[3 * 1 + 1]) route119Section = 1; if (y >= gRoute119WaterTileData[3 * 2 + 0] && y <= gRoute119WaterTileData[3 * 2 + 1]) route119Section = 2; -#else - { - register const u16 *arr asm("r0"); - if (y >= (arr = gRoute119WaterTileData)[3 * 1 + 0] && y <= arr[3 * 1 + 1]) - route119Section = 1; - if (y >= arr[3 * 2 + 0] && y <= arr[3 * 2 + 1]) - route119Section = 2; - } -#endif if (Random() % 100 > 49) // 50% chance of encountering Feebas return FALSE; @@ -251,7 +243,7 @@ static u8 ChooseWildMonLevel(const struct WildPokemon *wildPokemon) rand = Random() % range; // check ability for max level mon - if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_BIT3)) + if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) { u8 ability = GetMonAbility(&gPlayerParty[0]); if (ability == ABILITY_HUSTLE || ability == ABILITY_VITAL_SPIRIT || ability == ABILITY_PRESSURE) @@ -332,7 +324,7 @@ static u8 PickWildMonNature(void) } } // check synchronize for a pokemon with the same ability - if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_BIT3) + if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG) && GetMonAbility(&gPlayerParty[0]) == ABILITY_SYNCHRONIZE && Random() % 2 == 0) { @@ -360,7 +352,7 @@ static void CreateWildMon(u16 species, u8 level) } if (checkCuteCharm - && !GetMonData(&gPlayerParty[0], MON_DATA_SANITY_BIT3) + && !GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG) && GetMonAbility(&gPlayerParty[0]) == ABILITY_CUTE_CHARM && Random() % 3 != 0) { @@ -478,7 +470,7 @@ static bool8 DoWildEncounterRateTest(u32 encounterRate, bool8 ignoreAbility) encounterRate = encounterRate * 80 / 100; ApplyFluteEncounterRateMod(&encounterRate); ApplyCleanseTagEncounterRateMod(&encounterRate); - if (!ignoreAbility && !GetMonData(&gPlayerParty[0], MON_DATA_SANITY_BIT3)) + if (!ignoreAbility && !GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) { u32 ability = GetMonAbility(&gPlayerParty[0]); @@ -868,7 +860,7 @@ static bool8 IsAbilityAllowingEncounter(u8 level) { u8 ability; - if (GetMonData(&gPlayerParty[0], MON_DATA_SANITY_BIT3)) + if (GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) return TRUE; ability = GetMonAbility(&gPlayerParty[0]); @@ -905,7 +897,7 @@ static bool8 TryGetRandomWildMonIndexByType(const struct WildPokemon *wildMon, u static bool8 TryGetAbilityInfluencedWildMonIndex(const struct WildPokemon *wildMon, u8 type, u8 ability, u8 *monIndex) { - if (GetMonData(&gPlayerParty[0], MON_DATA_SANITY_BIT3)) + if (GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) return FALSE; else if (GetMonAbility(&gPlayerParty[0]) != ability) return FALSE; |