summaryrefslogtreecommitdiff
path: root/src/field_specials.c
diff options
context:
space:
mode:
authorDiegoisawesome <Diegoisawesome@users.noreply.github.com>2018-11-18 13:36:34 -0600
committerGitHub <noreply@github.com>2018-11-18 13:36:34 -0600
commit963989d760a09eab46607efe1cbc1029f00e1842 (patch)
tree736036a1a493ad2d10b9418996350a247c0ff637 /src/field_specials.c
parent0bbe03f17030c8009508714fc2b41703f1a1310a (diff)
parentf58cc47e173900537200c796501386f4e3a1f0d6 (diff)
Merge pull request #389 from DizzyEggg/num_stats
Use PARTY_SIZE and rename BATTLE_STATS_NO to NUM_BATTLE_STATS
Diffstat (limited to 'src/field_specials.c')
-rw-r--r--src/field_specials.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/field_specials.c b/src/field_specials.c
index 113f46922..562127890 100644
--- a/src/field_specials.c
+++ b/src/field_specials.c
@@ -2052,26 +2052,26 @@ _08139D7C:\n\
void sub_8139D98(void)
{
u8 i;
- u32 ivStorage[6];
+ u32 ivStorage[NUM_STATS];
- ivStorage[0] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_HP_IV);
- ivStorage[1] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_ATK_IV);
- ivStorage[2] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_DEF_IV);
- ivStorage[3] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPEED_IV);
- ivStorage[4] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPATK_IV);
- ivStorage[5] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPDEF_IV);
+ ivStorage[STAT_HP] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_HP_IV);
+ ivStorage[STAT_ATK] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_ATK_IV);
+ ivStorage[STAT_DEF] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_DEF_IV);
+ ivStorage[STAT_SPEED] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPEED_IV);
+ ivStorage[STAT_SPATK] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPATK_IV);
+ ivStorage[STAT_SPDEF] = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPDEF_IV);
gSpecialVar_0x8005 = 0;
- for (i = 0; i < ARRAY_COUNT(ivStorage); i++)
+ for (i = 0; i < NUM_STATS; i++)
{
gSpecialVar_0x8005 += ivStorage[i];
}
gSpecialVar_0x8006 = 0;
- gSpecialVar_0x8007 = ivStorage[0]; // HP IV
+ gSpecialVar_0x8007 = ivStorage[STAT_HP];
- for (i = 1; i < 6; i++)
+ for (i = 1; i < NUM_STATS; i++)
{
if (ivStorage[gSpecialVar_0x8006] < ivStorage[i])
{
@@ -2081,7 +2081,7 @@ void sub_8139D98(void)
else if (ivStorage[gSpecialVar_0x8006] == ivStorage[i])
{
u16 randomNumber = Random();
- if ((randomNumber & 1) != 0)
+ if (randomNumber & 1)
{
gSpecialVar_0x8006 = i;
gSpecialVar_0x8007 = ivStorage[i];