2018-02-12 10:12:15 +00:00
|
|
|
#include "global.h"
|
|
|
|
#include "event_data.h"
|
|
|
|
#include "field_message_box.h"
|
|
|
|
#include "pokedex.h"
|
2018-02-13 04:02:40 +00:00
|
|
|
#include "strings.h"
|
2018-02-12 10:12:15 +00:00
|
|
|
|
|
|
|
bool16 ScriptGetPokedexInfo(void)
|
|
|
|
{
|
|
|
|
if (gSpecialVar_0x8004 == 0) // is national dex not present?
|
|
|
|
{
|
2019-10-07 06:13:34 +01:00
|
|
|
gSpecialVar_0x8005 = GetHoennPokedexCount(FLAG_GET_SEEN);
|
|
|
|
gSpecialVar_0x8006 = GetHoennPokedexCount(FLAG_GET_CAUGHT);
|
2018-02-12 10:12:15 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-10-07 06:13:34 +01:00
|
|
|
gSpecialVar_0x8005 = GetNationalPokedexCount(FLAG_GET_SEEN);
|
|
|
|
gSpecialVar_0x8006 = GetNationalPokedexCount(FLAG_GET_CAUGHT);
|
2018-02-12 10:12:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return IsNationalPokedexEnabled();
|
|
|
|
}
|
|
|
|
|
2024-01-05 08:47:28 +00:00
|
|
|
// Species in this array are ignored in the progress towards a full regional dex
|
|
|
|
static const u16 sRegionalNotCountedList[] = {
|
|
|
|
SPECIES_JIRACHI,
|
|
|
|
SPECIES_DEOXYS,
|
|
|
|
SPECIES_NONE
|
|
|
|
};
|
|
|
|
|
|
|
|
#define BIRCH_DEX_STRINGS 21
|
|
|
|
|
|
|
|
static const u8 *const sBirchDexRatingTexts[BIRCH_DEX_STRINGS] =
|
|
|
|
{
|
|
|
|
gBirchDexRatingText_LessThan10,
|
|
|
|
gBirchDexRatingText_LessThan20,
|
|
|
|
gBirchDexRatingText_LessThan30,
|
|
|
|
gBirchDexRatingText_LessThan40,
|
|
|
|
gBirchDexRatingText_LessThan50,
|
|
|
|
gBirchDexRatingText_LessThan60,
|
|
|
|
gBirchDexRatingText_LessThan70,
|
|
|
|
gBirchDexRatingText_LessThan80,
|
|
|
|
gBirchDexRatingText_LessThan90,
|
|
|
|
gBirchDexRatingText_LessThan100,
|
|
|
|
gBirchDexRatingText_LessThan110,
|
|
|
|
gBirchDexRatingText_LessThan120,
|
|
|
|
gBirchDexRatingText_LessThan130,
|
|
|
|
gBirchDexRatingText_LessThan140,
|
|
|
|
gBirchDexRatingText_LessThan150,
|
|
|
|
gBirchDexRatingText_LessThan160,
|
|
|
|
gBirchDexRatingText_LessThan170,
|
|
|
|
gBirchDexRatingText_LessThan180,
|
|
|
|
gBirchDexRatingText_LessThan190,
|
|
|
|
gBirchDexRatingText_LessThan200,
|
|
|
|
gBirchDexRatingText_DexCompleted,
|
|
|
|
};
|
|
|
|
|
2018-02-12 10:12:15 +00:00
|
|
|
// This shows your Hoenn Pokedex rating and not your National Dex.
|
|
|
|
const u8 *GetPokedexRatingText(u16 count)
|
|
|
|
{
|
2024-01-05 08:47:28 +00:00
|
|
|
u32 i;
|
|
|
|
u16 maxDex = HOENN_DEX_COUNT - 1;
|
|
|
|
for(i = 0; sRegionalNotCountedList[i] != SPECIES_NONE; i++)
|
2018-02-12 10:12:15 +00:00
|
|
|
{
|
2024-01-05 08:47:28 +00:00
|
|
|
if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(sRegionalNotCountedList[i]), FLAG_GET_CAUGHT))
|
|
|
|
count--;
|
|
|
|
maxDex--;
|
2018-02-12 10:12:15 +00:00
|
|
|
}
|
2024-01-05 08:47:28 +00:00
|
|
|
return sBirchDexRatingTexts[(count * (BIRCH_DEX_STRINGS - 1)) / maxDex];
|
2018-02-12 10:12:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ShowPokedexRatingMessage(void)
|
|
|
|
{
|
|
|
|
ShowFieldMessage(GetPokedexRatingText(gSpecialVar_0x8004));
|
|
|
|
}
|