diff options
author | Seth Barberee <seth.barberee@gmail.com> | 2021-02-07 19:10:12 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-07 21:10:12 -0600 |
commit | 8dfd044ef3a6ea8da204265b4560716aa67391d1 (patch) | |
tree | 15274fab1fd9b1d4e477bbfddbfb855ade1eabeb /src/personality_test.c | |
parent | 74daf03fd70e7c71b92390c9133c9dd543bcb28d (diff) |
Some Personality and data (#26)
* decomp few personality funcs and clean up some pointers in the dungeon data
* de-pointer-ify friend area dialogue
* clean pointers on a personality test question
* decomp a few more main menu funcs and dump some more data
* label some funcs
Diffstat (limited to 'src/personality_test.c')
-rw-r--r-- | src/personality_test.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/src/personality_test.c b/src/personality_test.c index c0562e4..9aef10a 100644 --- a/src/personality_test.c +++ b/src/personality_test.c @@ -1,5 +1,8 @@ #include "global.h" #include "constants/species.h" +#include "pokemon.h" + +#define NUM_PARTNERS 10 // TODO convert this... maybe a script? const u8 gUnknown_80F4244[32] = @@ -14,7 +17,7 @@ const u8 gUnknown_80F4244[32] = 'p', 'k', 's', 'd', 'i', 'r', '0', 0 }; -const u16 gPartners[10] = +const s16 gPartners[NUM_PARTNERS] = { SPECIES_CHARMANDER, SPECIES_BULBASAUR, @@ -32,6 +35,40 @@ extern u8 gUnknown_80F42D0[]; extern u8 gUnknown_80F42F0[]; extern u8 gUnknown_203B408; +struct unkStruct_203B404 +{ + // Size: 0xB8 + /* 0x0 */ s16 StarterID; + /* 0x2 */ s16 PartnerArray[NUM_PARTNERS]; +}; + +extern struct unkStruct_203B404 *gUnknown_203B404; + +s32 GetValidPartners(void) +{ + u8 PlayerType[2]; + u8 currentPartnerTypes[2]; + s32 counter; + s32 ValidPartnerCounter; + s32 CurrentPartnerID; + + ValidPartnerCounter = 0; + PlayerType[0] = GetPokemonType(gUnknown_203B404->StarterID,0); + PlayerType[1] = GetPokemonType(gUnknown_203B404->StarterID,1); + for(counter = 0; counter < NUM_PARTNERS; counter++){ + CurrentPartnerID = gPartners[counter]; + currentPartnerTypes[0] = GetPokemonType(CurrentPartnerID,0); + currentPartnerTypes[1] = GetPokemonType(CurrentPartnerID,1); + if (((currentPartnerTypes[0] == '\0') || ((currentPartnerTypes[0] != PlayerType[0] && (currentPartnerTypes[0] != PlayerType[1])))) + && ((currentPartnerTypes[1] == '\0' || ((currentPartnerTypes[1] != PlayerType[0] && (currentPartnerTypes[1] != PlayerType[1]))) + ))) { + gUnknown_203B404->PartnerArray[ValidPartnerCounter] = CurrentPartnerID; + ValidPartnerCounter++; + } + } + return ValidPartnerCounter; +} + u8 sub_803D0D8() { return gUnknown_203B408; |