From bc20fda6041244d83775f6e3084f74ebe81a5fda Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 19 Jan 2021 04:03:16 -0500 Subject: Use GET_UNOWN_LETTER macro --- include/pokemon.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/pokemon.h b/include/pokemon.h index addf580e9..0320da1f2 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -238,6 +238,15 @@ struct Evolution u16 targetSpecies; }; +#define NUM_UNOWN_FORMS 28 + +#define GET_UNOWN_LETTER(personality) (( \ + ((personality & 0x03000000) >> 18) \ + | ((personality & 0x00030000) >> 12) \ + | ((personality & 0x00000300) >> 6) \ + | ((personality & 0x00000003) >> 0) \ +) % NUM_UNOWN_FORMS) + extern u8 gPlayerPartyCount; extern struct Pokemon gPlayerParty[PARTY_SIZE]; extern u8 gEnemyPartyCount; -- cgit v1.2.3