diff --git a/src/battle_interface.c b/src/battle_interface.c index 3039c65b67..08c771177b 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -2175,7 +2175,7 @@ static void TryAddPokeballIconToHealthbox(u8 healthboxSpriteId, bool8 noStatus) battlerId = gSprites[healthboxSpriteId].hMain_Battler; if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) return; - if (!GetSetPokedexFlag(SpeciesToNationalPokedexNum(GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES)), FLAG_GET_CAUGHT)) + if (!GetSetPokedexCaughtFlag(SpeciesToNationalPokedexNum(GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES)), FLAG_GET_CAUGHT)) return; healthBarSpriteId = gSprites[healthboxSpriteId].hMain_HealthBarSpriteId; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 3be57d197e..d4db1bd747 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -13970,7 +13970,7 @@ static void Cmd_handleballthrow(void) #endif break; case ITEM_REPEAT_BALL: - if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), FLAG_GET_CAUGHT)) + if (GetSetPokedexCaughtFlag(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), FLAG_GET_CAUGHT)) #if B_REPEAT_BALL_MODIFIER >= GEN_7 ballMultiplier = 350; #else @@ -14232,7 +14232,7 @@ static void Cmd_trysetcaughtmondexflags(void) u16 species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_SPECIES, NULL); u32 personality = GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetCatchingBattler()]], MON_DATA_PERSONALITY, NULL); - if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_GET_CAUGHT)) + if (GetSetPokedexCaughtFlag(SpeciesToNationalPokedexNum(species), FLAG_GET_CAUGHT)) { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } diff --git a/src/birch_pc.c b/src/birch_pc.c index 1f0ab23498..7a2de29038 100644 --- a/src/birch_pc.c +++ b/src/birch_pc.c @@ -65,15 +65,15 @@ const u8 *GetPokedexRatingText(u16 count) return gBirchDexRatingText_LessThan200; if (count == 200) { - if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), FLAG_GET_CAUGHT) - || GetSetPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), FLAG_GET_CAUGHT)) // Jirachi or Deoxys is not counted towards the dex completion. If either of these flags are enabled, it means the actual count is less than 200. + if (GetSetPokedexCaughtFlag(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), FLAG_GET_CAUGHT) + || GetSetPokedexCaughtFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), FLAG_GET_CAUGHT)) // Jirachi or Deoxys is not counted towards the dex completion. If either of these flags are enabled, it means the actual count is less than 200. return gBirchDexRatingText_LessThan200; return gBirchDexRatingText_DexCompleted; } if (count == HOENN_DEX_COUNT - 1) { - if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), FLAG_GET_CAUGHT) - && GetSetPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), FLAG_GET_CAUGHT)) // If both of these flags are enabled, it means the actual count is less than 200. + if (GetSetPokedexCaughtFlag(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), FLAG_GET_CAUGHT) + && GetSetPokedexCaughtFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), FLAG_GET_CAUGHT)) // If both of these flags are enabled, it means the actual count is less than 200. return gBirchDexRatingText_LessThan200; return gBirchDexRatingText_DexCompleted; } diff --git a/src/credits.c b/src/credits.c index a857e05806..ab2276af0d 100644 --- a/src/credits.c +++ b/src/credits.c @@ -1560,7 +1560,7 @@ static void DeterminePokemonToShow(void) // This basically packs all of the caught pokemon into the front of the array for (dexNum = 1, j = 0; dexNum < NATIONAL_DEX_COUNT; dexNum++) { - if (GetSetPokedexFlag(dexNum, FLAG_GET_CAUGHT)) + if (GetSetPokedexCaughtFlag(dexNum, FLAG_GET_CAUGHT)) { sCreditsData->caughtMonIds[j] = dexNum; j++; diff --git a/src/debug.c b/src/debug.c index aaf5a81316..de7602e636 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1465,10 +1465,9 @@ static void DebugAction_Flags_SetPokedexFlags(u8 taskId) { u16 i; for (i = 0; i < NATIONAL_DEX_COUNT; i++) - { - GetSetPokedexFlag(i + 1, FLAG_SET_CAUGHT); + GetSetPokedexCaughtFlag(i + 1, FLAG_SET_CAUGHT); + for (i = 0; i < NUM_SPECIES; i++) GetSetPokedexFlag(i + 1, FLAG_SET_SEEN); - } Debug_DestroyMenu_Full(taskId); ScriptContext_Enable(); } @@ -2726,7 +2725,7 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu case MON_GIVEN_TO_PARTY: case MON_GIVEN_TO_PC: GetSetPokedexFlag(nationalDexNum, FLAG_SET_SEEN); - GetSetPokedexFlag(nationalDexNum, FLAG_SET_CAUGHT); + GetSetPokedexCaughtFlag(nationalDexNum, FLAG_SET_CAUGHT); break; case MON_CANT_GIVE: break; diff --git a/src/egg_hatch.c b/src/egg_hatch.c index b7ae2e2ceb..7f7bf650cb 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -372,9 +372,8 @@ static void AddHatchedMonToParty(u8 id) GetSpeciesName(name, species); SetMonData(mon, MON_DATA_NICKNAME, name); - species = SpeciesToNationalPokedexNum(species); - GetSetPokedexFlag(species, FLAG_SET_SEEN); - GetSetPokedexFlag(species, FLAG_SET_CAUGHT); + GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_SET_SEEN); + GetSetPokedexCaughtFlag(SpeciesToNationalPokedexNum(species), FLAG_SET_CAUGHT); GetMonNickname2(mon, gStringVar1); diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 39cf8e4c23..d6a411b69f 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -584,7 +584,7 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon *mon) CalculatePlayerPartyCount(); GetSetPokedexFlag(SpeciesToNationalPokedexNum(gEvolutionTable[preEvoSpecies][1].targetSpecies), FLAG_SET_SEEN); - GetSetPokedexFlag(SpeciesToNationalPokedexNum(gEvolutionTable[preEvoSpecies][1].targetSpecies), FLAG_SET_CAUGHT); + GetSetPokedexCaughtFlag(SpeciesToNationalPokedexNum(gEvolutionTable[preEvoSpecies][1].targetSpecies), FLAG_SET_CAUGHT); if (GetMonData(shedinja, MON_DATA_SPECIES) == SPECIES_SHEDINJA && GetMonData(shedinja, MON_DATA_LANGUAGE) == LANGUAGE_JAPANESE @@ -776,7 +776,7 @@ static void Task_EvolutionScene(u8 taskId) CalculateMonStats(mon); EvolutionRenameMon(mon, gTasks[taskId].tPreEvoSpecies, gTasks[taskId].tPostEvoSpecies); GetSetPokedexFlag(SpeciesToNationalPokedexNum(gTasks[taskId].tPostEvoSpecies), FLAG_SET_SEEN); - GetSetPokedexFlag(SpeciesToNationalPokedexNum(gTasks[taskId].tPostEvoSpecies), FLAG_SET_CAUGHT); + GetSetPokedexCaughtFlag(SpeciesToNationalPokedexNum(gTasks[taskId].tPostEvoSpecies), FLAG_SET_CAUGHT); IncrementGameStat(GAME_STAT_EVOLVED_POKEMON); } break; @@ -1196,7 +1196,7 @@ static void Task_TradeEvolutionScene(u8 taskId) CalculateMonStats(mon); EvolutionRenameMon(mon, gTasks[taskId].tPreEvoSpecies, gTasks[taskId].tPostEvoSpecies); GetSetPokedexFlag(SpeciesToNationalPokedexNum(gTasks[taskId].tPostEvoSpecies), FLAG_SET_SEEN); - GetSetPokedexFlag(SpeciesToNationalPokedexNum(gTasks[taskId].tPostEvoSpecies), FLAG_SET_CAUGHT); + GetSetPokedexCaughtFlag(SpeciesToNationalPokedexNum(gTasks[taskId].tPostEvoSpecies), FLAG_SET_CAUGHT); IncrementGameStat(GAME_STAT_EVOLVED_POKEMON); } break; diff --git a/src/frontier_util.c b/src/frontier_util.c index d89fca436c..5f86dc88a4 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -1934,7 +1934,7 @@ static void CheckBattleTypeFlag(void) static u8 AppendCaughtBannedMonSpeciesName(u16 species, u8 count, s32 numBannedMonsCaught) { - if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_GET_CAUGHT)) + if (GetSetPokedexCaughtFlag(SpeciesToNationalPokedexNum(species), FLAG_GET_CAUGHT)) { count++; switch (count) @@ -2072,7 +2072,7 @@ static void CheckPartyIneligibility(void) s32 species = gFrontierBannedSpecies[0]; for (i = 0; species != 0xFFFF; i++, species = gFrontierBannedSpecies[i]) { - if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_GET_CAUGHT)) + if (GetSetPokedexCaughtFlag(SpeciesToNationalPokedexNum(species), FLAG_GET_CAUGHT)) caughtBannedMons++; } gStringVar1[0] = EOS; diff --git a/src/match_call.c b/src/match_call.c index 4f6a7b9821..d40d10700d 100644 --- a/src/match_call.c +++ b/src/match_call.c @@ -2024,9 +2024,9 @@ static u8 GetPokedexRatingLevel(u16 numSeen) if (numSeen < 200) return 19; - if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), FLAG_GET_CAUGHT)) + if (GetSetPokedexCaughtFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), FLAG_GET_CAUGHT)) numSeen--; - if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), FLAG_GET_CAUGHT)) + if (GetSetPokedexCaughtFlag(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), FLAG_GET_CAUGHT)) numSeen--; if (numSeen < 200) diff --git a/src/mystery_event_script.c b/src/mystery_event_script.c index d1b514a173..e2ccc6dfdf 100644 --- a/src/mystery_event_script.c +++ b/src/mystery_event_script.c @@ -340,7 +340,7 @@ bool8 MEScrCmd_givepokemon(struct ScriptContext *ctx) { u16 pokedexNum = SpeciesToNationalPokedexNum(species); GetSetPokedexFlag(pokedexNum, FLAG_SET_SEEN); - GetSetPokedexFlag(pokedexNum, FLAG_SET_CAUGHT); + GetSetPokedexCaughtFlag(pokedexNum, FLAG_SET_CAUGHT); } heldItem = GetMonData(&gPlayerParty[PARTY_SIZE - 1], MON_DATA_HELD_ITEM); diff --git a/src/pokedex.c b/src/pokedex.c index 006da71e7c..99df87bb89 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -2211,7 +2211,7 @@ static void CreatePokedexList(u8 dexMode, u8 order) temp_dexNum = HoennToNationalOrder(i + 1); sPokedexView->pokedexList[i].dexNum = temp_dexNum; sPokedexView->pokedexList[i].seen = GetSetPokedexFlag(temp_dexNum, FLAG_GET_SEEN); - sPokedexView->pokedexList[i].owned = GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT); + sPokedexView->pokedexList[i].owned = GetSetPokedexCaughtFlag(temp_dexNum, FLAG_GET_CAUGHT); if (sPokedexView->pokedexList[i].seen) sPokedexView->pokemonListCount = i + 1; } @@ -2228,7 +2228,7 @@ static void CreatePokedexList(u8 dexMode, u8 order) { sPokedexView->pokedexList[r5].dexNum = temp_dexNum; sPokedexView->pokedexList[r5].seen = GetSetPokedexFlag(temp_dexNum, FLAG_GET_SEEN); - sPokedexView->pokedexList[r5].owned = GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT); + sPokedexView->pokedexList[r5].owned = GetSetPokedexCaughtFlag(temp_dexNum, FLAG_GET_CAUGHT); if (sPokedexView->pokedexList[r5].seen) sPokedexView->pokemonListCount = r5 + 1; r5++; @@ -2245,7 +2245,7 @@ static void CreatePokedexList(u8 dexMode, u8 order) { sPokedexView->pokedexList[sPokedexView->pokemonListCount].dexNum = temp_dexNum; sPokedexView->pokedexList[sPokedexView->pokemonListCount].seen = TRUE; - sPokedexView->pokedexList[sPokedexView->pokemonListCount].owned = GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT); + sPokedexView->pokedexList[sPokedexView->pokemonListCount].owned = GetSetPokedexCaughtFlag(temp_dexNum, FLAG_GET_CAUGHT); sPokedexView->pokemonListCount++; } } @@ -2255,7 +2255,7 @@ static void CreatePokedexList(u8 dexMode, u8 order) { temp_dexNum = gPokedexOrder_Weight[i]; - if (temp_dexNum <= NATIONAL_DEX_COUNT && (!temp_isHoennDex || NationalToHoennOrder(temp_dexNum) != 0) && GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT)) + if (temp_dexNum <= NATIONAL_DEX_COUNT && (!temp_isHoennDex || NationalToHoennOrder(temp_dexNum) != 0) && GetSetPokedexCaughtFlag(temp_dexNum, FLAG_GET_CAUGHT)) { sPokedexView->pokedexList[sPokedexView->pokemonListCount].dexNum = temp_dexNum; sPokedexView->pokedexList[sPokedexView->pokemonListCount].seen = TRUE; @@ -2269,7 +2269,7 @@ static void CreatePokedexList(u8 dexMode, u8 order) { temp_dexNum = gPokedexOrder_Weight[i]; - if (temp_dexNum <= NATIONAL_DEX_COUNT && (!temp_isHoennDex || NationalToHoennOrder(temp_dexNum) != 0) && GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT)) + if (temp_dexNum <= NATIONAL_DEX_COUNT && (!temp_isHoennDex || NationalToHoennOrder(temp_dexNum) != 0) && GetSetPokedexCaughtFlag(temp_dexNum, FLAG_GET_CAUGHT)) { sPokedexView->pokedexList[sPokedexView->pokemonListCount].dexNum = temp_dexNum; sPokedexView->pokedexList[sPokedexView->pokemonListCount].seen = TRUE; @@ -2283,7 +2283,7 @@ static void CreatePokedexList(u8 dexMode, u8 order) { temp_dexNum = gPokedexOrder_Height[i]; - if (temp_dexNum <= NATIONAL_DEX_COUNT && (!temp_isHoennDex || NationalToHoennOrder(temp_dexNum) != 0) && GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT)) + if (temp_dexNum <= NATIONAL_DEX_COUNT && (!temp_isHoennDex || NationalToHoennOrder(temp_dexNum) != 0) && GetSetPokedexCaughtFlag(temp_dexNum, FLAG_GET_CAUGHT)) { sPokedexView->pokedexList[sPokedexView->pokemonListCount].dexNum = temp_dexNum; sPokedexView->pokedexList[sPokedexView->pokemonListCount].seen = TRUE; @@ -2297,7 +2297,7 @@ static void CreatePokedexList(u8 dexMode, u8 order) { temp_dexNum = gPokedexOrder_Height[i]; - if (temp_dexNum <= NATIONAL_DEX_COUNT && (!temp_isHoennDex || NationalToHoennOrder(temp_dexNum) != 0) && GetSetPokedexFlag(temp_dexNum, FLAG_GET_CAUGHT)) + if (temp_dexNum <= NATIONAL_DEX_COUNT && (!temp_isHoennDex || NationalToHoennOrder(temp_dexNum) != 0) && GetSetPokedexCaughtFlag(temp_dexNum, FLAG_GET_CAUGHT)) { sPokedexView->pokedexList[sPokedexView->pokemonListCount].dexNum = temp_dexNum; sPokedexView->pokedexList[sPokedexView->pokemonListCount].seen = TRUE; @@ -4355,7 +4355,7 @@ u16 GetNationalPokedexCount(u8 caseID) count++; break; case FLAG_GET_CAUGHT: - if (GetSetPokedexFlag(i + 1, FLAG_GET_CAUGHT)) + if (GetSetPokedexCaughtFlag(i + 1, FLAG_GET_CAUGHT)) count++; break; } @@ -4377,7 +4377,7 @@ u16 GetHoennPokedexCount(u8 caseID) count++; break; case FLAG_GET_CAUGHT: - if (GetSetPokedexFlag(HoennToNationalOrder(i + 1), FLAG_GET_CAUGHT)) + if (GetSetPokedexCaughtFlag(HoennToNationalOrder(i + 1), FLAG_GET_CAUGHT)) count++; break; } @@ -4399,7 +4399,7 @@ u16 GetKantoPokedexCount(u8 caseID) count++; break; case FLAG_GET_CAUGHT: - if (GetSetPokedexFlag(i + 1, FLAG_GET_CAUGHT)) + if (GetSetPokedexCaughtFlag(i + 1, FLAG_GET_CAUGHT)) count++; break; } @@ -4414,7 +4414,7 @@ bool16 HasAllHoennMons(void) // -2 excludes Jirachi and Deoxys for (i = 0; i < HOENN_DEX_COUNT - 2; i++) { - if (!GetSetPokedexFlag(HoennToNationalOrder(i + 1), FLAG_GET_CAUGHT)) + if (!GetSetPokedexCaughtFlag(HoennToNationalOrder(i + 1), FLAG_GET_CAUGHT)) return FALSE; } return TRUE; @@ -4427,7 +4427,7 @@ bool8 HasAllKantoMons(void) // -1 excludes Mew for (i = 0; i < KANTO_DEX_COUNT - 1; i++) { - if (!GetSetPokedexFlag(i + 1, FLAG_GET_CAUGHT)) + if (!GetSetPokedexCaughtFlag(i + 1, FLAG_GET_CAUGHT)) return FALSE; } return TRUE; @@ -4439,7 +4439,7 @@ bool16 HasAllMons(void) for (i = 1; i < NATIONAL_DEX_COUNT + 1; i++) { - if (!(gBaseStats[i].flags & SPECIES_FLAG_MYTHICAL) && !GetSetPokedexFlag(i, FLAG_GET_CAUGHT)) + if (!(gBaseStats[i].flags & SPECIES_FLAG_MYTHICAL) && !GetSetPokedexCaughtFlag(i, FLAG_GET_CAUGHT)) return FALSE; } diff --git a/src/script_pokemon_util.c b/src/script_pokemon_util.c index e33c8ffcad..264d0803f6 100755 --- a/src/script_pokemon_util.c +++ b/src/script_pokemon_util.c @@ -88,7 +88,7 @@ u8 ScriptGiveMon(u16 species, u8 level, u16 item, u32 unused1, u32 unused2, u8 u case MON_GIVEN_TO_PARTY: case MON_GIVEN_TO_PC: GetSetPokedexFlag(nationalDexNum, FLAG_SET_SEEN); - GetSetPokedexFlag(nationalDexNum, FLAG_SET_CAUGHT); + GetSetPokedexCaughtFlag(nationalDexNum, FLAG_SET_CAUGHT); break; } return sentToPc;