From 0a3b052bdc89eacddd1152049983c89dde37e7e4 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sun, 8 Apr 2018 12:59:08 -0700 Subject: Document friendship events, primary status ailments, and misc cleanup --- src/pokemon_summary_screen.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/pokemon_summary_screen.c') diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 75ddb52d0..2bfb42681 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) @@ -4846,8 +4846,8 @@ u8 GetMonStatusAndPokerus(struct Pokemon *mon) if (GetMonData(mon, MON_DATA_HP) == 0) return 7; - 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; -- cgit v1.2.3