diff options
author | Marcus Huderle <huderlem@gmail.com> | 2017-09-21 21:06:01 -0700 |
---|---|---|
committer | Marcus Huderle <huderlem@gmail.com> | 2017-09-21 21:06:01 -0700 |
commit | bbdef672b72d069a44f332c8c550edfe8bab25c5 (patch) | |
tree | 00b2127d12a3b8b8e60d401d2863492566995251 /src | |
parent | 18e88baffa65cc6a647f96441446238616df275c (diff) |
Decompile PartyMenuPrintMonLevelOrStatus funcs
Diffstat (limited to 'src')
-rw-r--r-- | src/choose_party.c | 1 | ||||
-rw-r--r-- | src/party_menu.c | 56 |
2 files changed, 54 insertions, 3 deletions
diff --git a/src/choose_party.c b/src/choose_party.c index c666cc68f..ed96bf3a7 100644 --- a/src/choose_party.c +++ b/src/choose_party.c @@ -69,7 +69,6 @@ extern void CreateHeldItemIcon_806DCD4(int, u8, int); extern u8 GetMonStatusAndPokerus(); extern void PartyMenuPrintHP(); extern void PartyMenuPutStatusTilemap(u8, int, u8); -extern void PartyMenuPrintLevel(); extern void PrintPartyMenuMonNickname(); extern bool8 sub_80F9344(void); extern void sub_806D4AC(); diff --git a/src/party_menu.c b/src/party_menu.c index 38a01345e..467820111 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -120,6 +120,58 @@ void sub_806AEDC(void) #define WINDOW_RIGHT (29) #endif +extern void PartyMenuPutStatusTilemap(u8 monIndex, u8 b, u8 status); +extern void PartyMenuDoPrintLevel(u8 monIndex, u8 b, u8 level); + + +void PartyMenuPrintLevel(u8 monIndex, u8 b, struct Pokemon *pokemon) +{ + u16 level = GetMonData(pokemon, MON_DATA_LEVEL); + PartyMenuDoPrintLevel(monIndex, b, level); +} + +void PartyMenuPrintMonLevelOrStatus(u8 monIndex, struct Pokemon *pokemon) +{ + if (GetMonData(pokemon, MON_DATA_SPECIES) && !GetMonData(pokemon, MON_DATA_IS_EGG)) + { + u8 statusAndPkrs; + u8 isLinkDoubleBattle; + u8 b; + + statusAndPkrs = GetMonStatusAndPokerus(pokemon); + + isLinkDoubleBattle = IsLinkDoubleBattle(); + if (isLinkDoubleBattle == TRUE) + { + b = 2; + } + else + { + b = IsDoubleBattle(); + } + + if (statusAndPkrs != 0 && statusAndPkrs != 6) + { + PartyMenuPutStatusTilemap(monIndex, b, statusAndPkrs - 1); + } + else + { + PartyMenuPrintLevel(monIndex, b, pokemon); + } + + PartyMenuPrintGenderIcon(monIndex, b, pokemon); + } +} + +void PartyMenuPrintMonsLevelOrStatus() +{ + u8 i; + + for (i = 0; i < PARTY_SIZE; i++) + { + PartyMenuPrintMonLevelOrStatus(i, &gPlayerParty[i]); + } +} void PartyMenuDoPrintGenderIcon(u16 species, u8 gender, u8 c, u8 monIndex, u8 *nickname) { @@ -181,8 +233,8 @@ void PartyMenuTryPrintHP(u8 monIndex, struct Pokemon *pokemon) { if (GetMonData(pokemon, MON_DATA_SPECIES) && !GetMonData(pokemon, MON_DATA_IS_EGG)) { - u8 isDoubleBattle = IsLinkDoubleBattle(); - if (isDoubleBattle == TRUE) + u8 isLinkDoubleBattle = IsLinkDoubleBattle(); + if (isLinkDoubleBattle == TRUE) { PartyMenuPrintHP(monIndex, 2, pokemon); } |