-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbirch_pc.c
72 lines (66 loc) · 2.1 KB
/
birch_pc.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include "global.h"
#include "event_data.h"
#include "field_message_box.h"
#include "pokedex.h"
#include "strings.h"
bool16 ScriptGetPokedexInfo(void)
{
if (gSpecialVar_0x8004 == 0) // is national dex not present?
{
gSpecialVar_0x8005 = GetHoennPokedexCount(FLAG_GET_SEEN);
gSpecialVar_0x8006 = GetHoennPokedexCount(FLAG_GET_CAUGHT);
}
else
{
gSpecialVar_0x8005 = GetNationalPokedexCount(FLAG_GET_SEEN);
gSpecialVar_0x8006 = GetNationalPokedexCount(FLAG_GET_CAUGHT);
}
return IsNationalPokedexEnabled();
}
#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,
};
// This shows your Hoenn Pokédex rating and not your National Dex.
const u8 *GetPokedexRatingText(u32 count)
{
u32 i, j;
u16 maxDex = HOENN_DEX_COUNT - 1;
// doesNotCountForRegionalPokedex
for(i = 0; i < HOENN_DEX_COUNT; i++)
{
j = NationalPokedexNumToSpecies(HoennToNationalOrder(i + 1));
if (gSpeciesInfo[j].isMythical && !gSpeciesInfo[j].dexForceRequired)
{
if (GetSetPokedexFlag(j, FLAG_GET_CAUGHT))
count--;
maxDex--;
}
}
return sBirchDexRatingTexts[(count * (BIRCH_DEX_STRINGS - 1)) / maxDex];
}
void ShowPokedexRatingMessage(void)
{
ShowFieldMessage(GetPokedexRatingText(gSpecialVar_0x8004));
}