summaryrefslogtreecommitdiff
path: root/src/pokemon_summary_screen.c
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2018-04-09 20:06:14 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2018-04-09 20:06:14 -0400
commit45a2675c9de2644b546e59240d8482a7dfc5c9d7 (patch)
tree8c045e88ce39b04e132ad055c6bdcda6aac7e490 /src/pokemon_summary_screen.c
parent4987b746365ec09af10bc2a1ce11dbffaa284b50 (diff)
parent1f60ac0f857da06bd8a678f7150c42cc94940f3f (diff)
Merge branch 'master' into nohara
Diffstat (limited to 'src/pokemon_summary_screen.c')
-rw-r--r--src/pokemon_summary_screen.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c
index f8f075296..a463e8054 100644
--- a/src/pokemon_summary_screen.c
+++ b/src/pokemon_summary_screen.c
@@ -4823,20 +4823,20 @@ void sub_80A1C30(u8 a)
}
}
-u8 pokemon_ailments_get_primary(u32 status)
+u8 GetPrimaryStatus(u32 status)
{
- if (status & 0x88)
- return 1;
- if (status & 0x40)
- return 2;
- if (status & 0x7)
- return 3;
- if (status & 0x20)
- return 4;
- if (status & 0x10)
- return 5;
-
- return 0;
+ if (status & (STATUS_POISON | STATUS_TOXIC_POISON))
+ return STATUS_PRIMARY_POISON;
+ if (status & STATUS_PARALYSIS)
+ return STATUS_PRIMARY_PARALYSIS;
+ if (status & STATUS_SLEEP)
+ return STATUS_PRIMARY_SLEEP;
+ if (status & STATUS_FREEZE)
+ return STATUS_PRIMARY_FREEZE;
+ if (status & STATUS_BURN)
+ return STATUS_PRIMARY_BURN;
+
+ return STATUS_PRIMARY_NONE;
}
u8 GetMonStatusAndPokerus(struct Pokemon *mon)
@@ -4844,15 +4844,15 @@ u8 GetMonStatusAndPokerus(struct Pokemon *mon)
u8 statusAilment;
if (GetMonData(mon, MON_DATA_HP) == 0)
- return 7;
+ return STATUS_PRIMARY_FAINTED;
- statusAilment = pokemon_ailments_get_primary(GetMonData(mon, MON_DATA_STATUS));
- if (statusAilment == 0)
+ statusAilment = GetPrimaryStatus(GetMonData(mon, MON_DATA_STATUS));
+ if (statusAilment == STATUS_PRIMARY_NONE)
{
if (!CheckPartyPokerus(mon, 0))
- return 0;
+ return STATUS_PRIMARY_NONE;
else
- return 6;
+ return STATUS_PRIMARY_POKERUS;
}
return statusAilment;