diff options
author | ultima-soul <33333039+ultima-soul@users.noreply.github.com> | 2018-08-26 11:12:22 -0700 |
---|---|---|
committer | Marcus Huderle <huderlem@gmail.com> | 2018-08-26 13:12:22 -0500 |
commit | 3f1288e3e055013e0ab847ba5fea4b566bc31996 (patch) | |
tree | 2d674bed66c39c1a6f8a2a5c0251142785f294a6 /src | |
parent | 56868d92501b11e22b79aabb3ba11f2715e8f733 (diff) |
Add Defines for Pokedex Related Numbers and Fixed Comment in birch_pc.c (#680)
* Changed pokedex_orders.h to use defines from species.h
* Fixed leading white space by converting tabs to 4 spaces.
* Removed comments as they are redundant.
* Added German comments back.
* Added defines for Pokedex Count and Species Count related numbers
* Fix a comment in birch_pc.c
* Added HOENN_DEX_COUNT to birch_pc.
Diffstat (limited to 'src')
-rw-r--r-- | src/birch_pc.c | 10 | ||||
-rw-r--r-- | src/pokedex.c | 9 | ||||
-rw-r--r-- | src/pokemon_3.c | 15 |
3 files changed, 17 insertions, 17 deletions
diff --git a/src/birch_pc.c b/src/birch_pc.c index 4b0025504..2a76b3c8c 100644 --- a/src/birch_pc.c +++ b/src/birch_pc.c @@ -87,24 +87,24 @@ const u8 *GetPokedexRatingText(u16 count) return gBirchDexRatingText_LessThan180; if (count < 190) return gBirchDexRatingText_LessThan190; - if (count < 200) + if (count < HOENN_DEX_COUNT - 2) return gBirchDexRatingText_LessThan200; - if (count == 200) + if (count == HOENN_DEX_COUNT - 2) { if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), 1) || GetSetPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), 1)) // 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 == 201) + if (count == HOENN_DEX_COUNT - 1) { if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), 1) && GetSetPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), 1)) // If both of these flags are enabled, it means the actual count is less than 200. return gBirchDexRatingText_LessThan200; return gBirchDexRatingText_DexCompleted; } - if (count == 202) - return gBirchDexRatingText_DexCompleted; // Hoenn dex is considered complete, even though the hoenn dex count is 210. + if (count == HOENN_DEX_COUNT) + return gBirchDexRatingText_DexCompleted; // Hoenn dex is considered complete, a count of 202 means Jirachi and Deoxys are obtained return gBirchDexRatingText_LessThan10; } diff --git a/src/pokedex.c b/src/pokedex.c index eb4d1d918..caa6a1565 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -26,7 +26,6 @@ #include "scanline_effect.h" #include "ewram.h" -#define NATIONAL_DEX_COUNT 386 struct PokedexListItem { @@ -1971,7 +1970,7 @@ static void SortPokedex(u8 dexMode, u8 sortMode) { default: case DEX_MODE_HOENN: - vars[0] = 202; + vars[0] = HOENN_DEX_COUNT; vars[1] = 1; break; case DEX_MODE_NATIONAL: @@ -1982,7 +1981,7 @@ static void SortPokedex(u8 dexMode, u8 sortMode) } else { - vars[0] = 202; + vars[0] = HOENN_DEX_COUNT; vars[1] = 1; } break; @@ -2028,7 +2027,7 @@ static void SortPokedex(u8 dexMode, u8 sortMode) } break; case 1: - for (i = 0; i < 411; i++) + for (i = 0; i < POKEMON_SLOTS_NUMBER - 1; i++) { vars[2] = gPokedexOrder_Alphabetical[i]; @@ -4060,7 +4059,7 @@ u16 GetHoennPokedexCount(u8 caseID) u16 count = 0; u16 i; - for (i = 0; i < 202; i++) + for (i = 0; i < HOENN_DEX_COUNT; i++) { switch (caseID) { diff --git a/src/pokemon_3.c b/src/pokemon_3.c index 30e9503cd..4814c900d 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -12,6 +12,7 @@ #include "main.h" #include "move_tutor_menu.h" #include "pokemon.h" +#include "pokedex.h" #include "random.h" #include "overworld.h" #include "rom_8077ABC.h" @@ -390,10 +391,10 @@ u16 HoennPokedexNumToSpecies(u16 hoennNum) species = 0; - while (species < 411 && gSpeciesToHoennPokedexNum[species] != hoennNum) + while (species < POKEMON_SLOTS_NUMBER - 1 && gSpeciesToHoennPokedexNum[species] != hoennNum) species++; - if (species == 411) + if (species == POKEMON_SLOTS_NUMBER - 1) return 0; return species + 1; @@ -408,10 +409,10 @@ u16 NationalPokedexNumToSpecies(u16 nationalNum) species = 0; - while (species < 411 && gSpeciesToNationalPokedexNum[species] != nationalNum) + while (species < POKEMON_SLOTS_NUMBER - 1 && gSpeciesToNationalPokedexNum[species] != nationalNum) species++; - if (species == 411) + if (species == POKEMON_SLOTS_NUMBER - 1) return 0; return species + 1; @@ -426,10 +427,10 @@ u16 NationalToHoennOrder(u16 nationalNum) hoennNum = 0; - while (hoennNum < 411 && gHoennToNationalOrder[hoennNum] != nationalNum) + while (hoennNum < POKEMON_SLOTS_NUMBER - 1 && gHoennToNationalOrder[hoennNum] != nationalNum) hoennNum++; - if (hoennNum == 411) + if (hoennNum == POKEMON_SLOTS_NUMBER - 1) return 0; return hoennNum + 1; @@ -1095,7 +1096,7 @@ u16 SpeciesToPokedexNum(u16 species) else { species = SpeciesToHoennPokedexNum(species); - if (species <= 202) + if (species <= HOENN_DEX_COUNT) return species; return 0xFFFF; } |