diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2018-01-15 21:11:01 -0500 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2018-01-15 21:11:01 -0500 |
commit | 102515325993caef0d57082cd7d8db69335b665b (patch) | |
tree | f654ab4ff045d1d32b283f5e5e69d8b672e842e2 /src | |
parent | 7a2eef97c35e4672bd17bfca86a6ea19d22a3eba (diff) |
through party_compaction
Diffstat (limited to 'src')
-rw-r--r-- | src/pokemon/pokemon_storage_system_2.c | 2 | ||||
-rw-r--r-- | src/pokemon/pokemon_storage_system_4.c | 75 |
2 files changed, 76 insertions, 1 deletions
diff --git a/src/pokemon/pokemon_storage_system_2.c b/src/pokemon/pokemon_storage_system_2.c index 4657ed158..512bde5db 100644 --- a/src/pokemon/pokemon_storage_system_2.c +++ b/src/pokemon/pokemon_storage_system_2.c @@ -343,7 +343,7 @@ void sub_8096B5C(void) switch (gPokemonStorageSystemPtr->unk_0006) { case 0: - ShowPokemonSummaryScreen(gPokemonStorageSystemPtr->unk_2690, gPokemonStorageSystemPtr->unk_268d, gPokemonStorageSystemPtr->unk_268c, sub_80969A0, gPokemonStorageSystemPtr->unk_268e); + ShowPokemonSummaryScreen(gPokemonStorageSystemPtr->unk_2690.pokemon, gPokemonStorageSystemPtr->unk_268d, gPokemonStorageSystemPtr->unk_268c, sub_80969A0, gPokemonStorageSystemPtr->unk_268e); break; case 1: DoNamingScreen(1, gPokemonStorage.boxNames[gPokemonStorage.currentBox], 0, 0, 0, sub_80969A0); diff --git a/src/pokemon/pokemon_storage_system_4.c b/src/pokemon/pokemon_storage_system_4.c index 2469d42b1..40de7d634 100644 --- a/src/pokemon/pokemon_storage_system_4.c +++ b/src/pokemon/pokemon_storage_system_4.c @@ -1,12 +1,14 @@ // Includes #include "global.h" +#include "ewram.h" #include "constants/moves.h" #include "constants/species.h" #include "palette.h" #include "string_util.h" #include "text.h" #include "menu.h" +#include "pokemon_summary_screen.h" #include "pokemon_storage_system.h" // Static type declarations @@ -1786,3 +1788,76 @@ s8 sub_809B960(void) } return -1; } + +void sub_809BB90(void) +{ + if (gUnknown_020384E6) + gUnknown_02038480 = gPokemonStorageSystemPtr->unk_25b4; +} + +void sub_809BBC0(void) +{ + if (gUnknown_020384E6) + { + if (gUnknown_020384E7 == 14) + gPokemonStorageSystemPtr->unk_25b4 = gUnknown_02038480; + else + gPokemonStorageSystemPtr->unk_25b4.box = gUnknown_02038480.box; + } +} + +void sub_809BC18(void) +{ + if (gUnknown_020384E6) + { + sub_809BB90(); + gPokemonStorageSystemPtr->unk_2690.pokemon = &gUnknown_02038480; + gPokemonStorageSystemPtr->unk_268d = 0; + gPokemonStorageSystemPtr->unk_268c = 0; + gPokemonStorageSystemPtr->unk_268e = 0; + } + else if (gUnknown_020384E4 == 1) + { + gPokemonStorageSystemPtr->unk_2690.pokemon = gPlayerParty; + gPokemonStorageSystemPtr->unk_268d = gUnknown_020384E5; + gPokemonStorageSystemPtr->unk_268c = StorageSystemGetPartySize() - 1; + gPokemonStorageSystemPtr->unk_268e = 0; + } + else + { + gPokemonStorageSystemPtr->unk_2690.box = gPokemonStorage.boxes[gPokemonStorage.currentBox]; + gPokemonStorageSystemPtr->unk_268d = gUnknown_020384E5; + gPokemonStorageSystemPtr->unk_268c = 30 - 1; + gPokemonStorageSystemPtr->unk_268e = 5; + } +} + +void sub_809BD14(void) +{ + if (gUnknown_020384E6) + sub_809BBC0(); + else + gUnknown_020384E5 = pssData.monIndex; +} + +s16 party_compaction(void) +{ + s16 retVal = -1; + u16 i; + u16 last; + + for (i = 0, last = 0; i < PARTY_SIZE; i++) + { + if ((u16)GetMonData(gPlayerParty + i, MON_DATA_SPECIES) != SPECIES_NONE) + { + if (i != last) + gPlayerParty[last] = gPlayerParty[i]; + last++; + } + else if (retVal == -1) + retVal = i; + } + for (; last < PARTY_SIZE; last++) + ZeroMonData(gPlayerParty + last); + return retVal; +} |