diff options
author | Seth Barberee <seth.barberee@gmail.com> | 2021-12-21 15:05:05 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-21 15:05:05 -0600 |
commit | 7a1956f51d3bbba5f49f97526b79efafa85792bb (patch) | |
tree | 42fea349311c47f61dd3d6c0823210368f7feef8 | |
parent | 4fd4208364fcaf71ef0ff35d0c49ce3d9149e98b (diff) | |
parent | 3a1307e9078214a7757f37f35b807ea54c77bfad (diff) |
Merge pull request #87 from SethBarberee/personality_test_data_2
Personality test data 2
-rw-r--r-- | data/personality_test.s | 145 | ||||
-rw-r--r-- | include/constants/personality_test.h | 5 | ||||
-rw-r--r-- | include/personality_test.h | 2 | ||||
-rw-r--r-- | src/personality_test.c | 313 |
4 files changed, 236 insertions, 229 deletions
diff --git a/data/personality_test.s b/data/personality_test.s index c7dc79e..cb4765f 100644 --- a/data/personality_test.s +++ b/data/personality_test.s @@ -1946,148 +1946,3 @@ .string "Somebody calls you {QUOTE_START}weird but funny.{QUOTE_END}\n" .string "How does that make you feel?\0" .align 2,0 - - .global gPersonalityQuestionPointerTable -gPersonalityQuestionPointerTable: @ 80F2624 (pointers to each question text) - .4byte HardyQuest1 - .4byte HardyQuest2 - .4byte HardyQuest3 - .4byte HardyQuest4 - .4byte DocileQuest1 - .4byte DocileQuest2 - .4byte DocileQuest3 - .4byte DocileQuest4 - .4byte BraveQuest1 - .4byte BraveQuest2A - .4byte BraveQuest3 - .4byte BraveQuest4 - .4byte JollyQuest1 - .4byte JollyQuest2 - .4byte JollyQuest3 - .4byte JollyQuest4 - .4byte ImpishQuest1 - .4byte ImpishQuest2 - .4byte ImpishQuest3 - .4byte ImpishQuest4 - .4byte NaiveQuest1 - .4byte NaiveQuest2 - .4byte NaiveQuest3 - .4byte NaiveQuest4 - .4byte TimidQuest1 - .4byte TimidQuest2 - .4byte TimidQuest3 - .4byte TimidQuest4 - .4byte HastyQuest1 - .4byte HastyQuest2 - .4byte HastyQuest3 - .4byte HastyQuest4 - .4byte SassyQuest1 - .4byte SassyQuest2 - .4byte SassyQuest3 - .4byte SassyQuest4 - .4byte CalmQuest1 - .4byte CalmQuest2 - .4byte CalmQuest3 - .4byte CalmQuest4 - .4byte RelaxedQuest1 - .4byte RelaxedQuest2 - .4byte RelaxedQuest3 - .4byte RelaxedQuest4 - .4byte LonelyQuest1 - .4byte LonelyQuest2 - .4byte LonelyQuest3 - .4byte LonelyQuest4 - .4byte QuirkyQuest1 - .4byte QuirkyQuest2 - .4byte QuirkyQuest3 - .4byte QuirkyQuest4 - .4byte MiscQuest1 - .4byte MiscQuest2 - .4byte MiscQuest3 - .4byte BraveQuest2B - - .global gNatureQuestionTable -gNatureQuestionTable: @ 80F2704 (Categories) - .byte 0x00, 0x00, 0x00, 0x00 @ (Hardy) - .byte 0x01, 0x01, 0x01, 0x01 @ (Docile) - .byte 0x02, 0x02, 0x02, 0x02 @ (Brave) - .byte 0x03, 0x03, 0x03, 0x03 @ (Jolly) - .byte 0x04, 0x04, 0x04, 0x04 @ (Impish) - .byte 0x05, 0x05, 0x05, 0x05 @ (Naive) - .byte 0x06, 0x06, 0x06, 0x06 @ (Timid) - .byte 0x07, 0x07, 0x07, 0x07 @ (Hasty) - .byte 0x08, 0x08, 0x08, 0x08 @ (Sassy) - .byte 0x09, 0x09, 0x09, 0x09 @ (Calm) - .byte 0x0A, 0x0A, 0x0A, 0x0A @ (Relaxed) - .byte 0x0B, 0x0B, 0x0B, 0x0B @ (Lonely) - .byte 0x0C, 0x0C, 0x0C, 0x0C @ (Quirky) - .byte 0x0D, 0x0D, 0x0D @ (Miscellaneous) - .byte 0x02 @ (Question 2b for Brave Category) - - .global gGenderText -gGenderText: @ 80F273C - .string "Are you a boy or a girl?\0" - .align 2,0 - .4byte gGenderText - - .global gGenderMenu -gGenderMenu: @ 80F275C - .4byte BoyText @ Pointer to boy text - .byte 0x00, 0x00, 0x00, 0x00 - .4byte GirlText @ Pointer to girl text - .byte 0x01, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 @ end of table - .4byte -1 - - .global GirlText - GirlText: - .string "Girl.\0" - .align 2,0 - - .global BoyText - BoyText: - .string "Boy.\0" - - .byte 0x01 - .byte 0x02 - .byte 0x03 - .byte 0x04 - .byte 0x05 - .byte 0x06 - .byte 0x07 - .byte 0x08 - .byte 0x09 - .byte 0x0A - .byte 0x0B - .byte 0x0C - .byte 0x0D - - .global gStarters -gStarters: @ 80F278E (2D Array / [Male][Female]) - .byte 0x04, 0x00 @ Charmander (Hardy M) - .byte 0x19, 0x00 @ Pikachu (Hardy F) - .byte 0x01, 0x00 @ Bulbasaur (Docile M) - .byte 0x98, 0x00 @ Chikorita (Docile F) - .byte 0x42, 0x00 @ Machop (Brave M) - .byte 0x04, 0x00 @ Charmander (Brave F) - .byte 0x07, 0x00 @ Squirtle (Jolly M) - .byte 0x9E, 0x00 @ Totodile (Jolly F) - .byte 0x19, 0x00 @ Pikachu (Impish M) - .byte 0x68, 0x00 @ Cubone (Impish F) - .byte 0x9E, 0x00 @ Totodile (Naive M) - .byte 0x85, 0x00 @ Eevee (Naive F) - .byte 0x9B, 0x00 @ Cyndaquil (Timid M) - .byte 0x1B, 0x01 @ Mudkip (Timid F) - .byte 0x18, 0x01 @ Torchic (Hasty M) - .byte 0x45, 0x01 @ Skitty (Hasty F) - .byte 0x15, 0x01 @ Treecko (Sassy M) - .byte 0x18, 0x01 @ Torchic (Sassy F) - .byte 0x1B, 0x01 @ Mudkip (Calm M) - .byte 0x01, 0x00 @ Bulbasaur (Calm F) - .byte 0x36, 0x00 @ Psyduck (Relaxed M) - .byte 0x07, 0x00 @ Squirtle (Relaxed F) - .byte 0x68, 0x00 @ Cubone (Lonely M) - .byte 0x36, 0x00 @ Psyduck (Lonely F) - .byte 0x34, 0x00 @ Meowth (Quirky M) - .byte 0x15, 0x01 @ Treecko (Quirky F) - .byte 0x00, 0x00 @ End of table diff --git a/include/constants/personality_test.h b/include/constants/personality_test.h index cfb9c3d..b2c9a92 100644 --- a/include/constants/personality_test.h +++ b/include/constants/personality_test.h @@ -15,11 +15,14 @@ enum NaturePersonalities { RELAXED, LONELY, QUIRKY, - NUM_PERSONALITIES + MISC, }; #define NUM_PARTNERS 10 #define NUM_QUIZ_QUESTIONS 55 #define MAX_ASKED_QUESTIONS 8 +#define NUM_PERSONALITIES MISC + +#define BRAVE_2B_TRIGGER 99 #endif diff --git a/include/personality_test.h b/include/personality_test.h index 71d7bf9..0351bd1 100644 --- a/include/personality_test.h +++ b/include/personality_test.h @@ -42,7 +42,6 @@ struct PersonalityStruct_203B400 u32 unkb8; u32 unkbc; }; -EWRAM_DATA struct PersonalityStruct_203B400 *gUnknown_203B400; struct PersonalityStruct_203B404 { @@ -62,7 +61,6 @@ struct PersonalityStruct_203B404 /* 0x54 */ struct UnkTextStruct2 unk54[4]; /* 0xB4 */ u8 unkb4[4]; }; -EWRAM_DATA struct PersonalityStruct_203B404 *gUnknown_203B404; void InitializeTestStats(void); void GenerateNewQuestionOrGender(void); diff --git a/src/personality_test.c b/src/personality_test.c index 2a623b6..9a54744 100644 --- a/src/personality_test.c +++ b/src/personality_test.c @@ -11,6 +11,10 @@ #include "text.h" #include "menu.h" +EWRAM_DATA struct PersonalityStruct_203B400 *gUnknown_203B400; +EWRAM_DATA struct PersonalityStruct_203B404 *gUnknown_203B404; + + extern void sub_801317C(u32 *); extern void sub_8001024(u32 *); extern s32 sub_8094E4C(void); @@ -18,7 +22,7 @@ extern void sub_8094D28(s32); extern void sub_8001044(u32 *); extern void sub_80141B4(const char *text, u32 r1, u32 r2, u16 r3); -extern void sub_8014248(const char *text, u32, u32, struct MenuItem *r0, u32, u32, u32, u32, u32); +extern void sub_8014248(const char *text, u32, u32, const struct MenuItem *r0, u32, u32, u32, u32, u32); extern u32 sub_80144A4(s32 *); @@ -49,15 +53,10 @@ extern void AddMenuCursorSprite(struct UnkInputStruct **r0); extern void xxx_call_draw_string(u32 x, u32 y, const char *text, u32, u32); extern u32 sub_80095E4(s16, u32); -extern struct PersonalityQuestion *gPersonalityQuestionPointerTable[NUM_QUIZ_QUESTIONS]; - extern struct UnkSaveStruct1 *gUnknown_203B46C; extern const char gStarterReveal[]; -extern const char gGenderText[]; -extern struct MenuItem gGenderMenu[]; -extern u8 gNatureQuestionTable[NUM_QUIZ_QUESTIONS]; extern u8 gAvailablePokemonNames[0x50]; extern const char gHardyDescription[]; @@ -73,6 +72,226 @@ extern const char gCalmDescription[]; extern const char gRelaxedDescription[]; extern const char gLonelyDescription[]; extern const char gQuirkyDescription[]; +extern const u8 GirlText[]; +extern const u8 BoyText[]; + +extern const struct PersonalityQuestion HardyQuest1; +extern const struct PersonalityQuestion HardyQuest2; +extern const struct PersonalityQuestion HardyQuest3; +extern const struct PersonalityQuestion HardyQuest4; +extern const struct PersonalityQuestion DocileQuest1; +extern const struct PersonalityQuestion DocileQuest2; +extern const struct PersonalityQuestion DocileQuest3; +extern const struct PersonalityQuestion DocileQuest4; +extern const struct PersonalityQuestion BraveQuest1; +extern const struct PersonalityQuestion BraveQuest2A; +extern const struct PersonalityQuestion BraveQuest3; +extern const struct PersonalityQuestion BraveQuest4; +extern const struct PersonalityQuestion JollyQuest1; +extern const struct PersonalityQuestion JollyQuest2; +extern const struct PersonalityQuestion JollyQuest3; +extern const struct PersonalityQuestion JollyQuest4; +extern const struct PersonalityQuestion ImpishQuest1; +extern const struct PersonalityQuestion ImpishQuest2; +extern const struct PersonalityQuestion ImpishQuest3; +extern const struct PersonalityQuestion ImpishQuest4; +extern const struct PersonalityQuestion NaiveQuest1; +extern const struct PersonalityQuestion NaiveQuest2; +extern const struct PersonalityQuestion NaiveQuest3; +extern const struct PersonalityQuestion NaiveQuest4; +extern const struct PersonalityQuestion TimidQuest1; +extern const struct PersonalityQuestion TimidQuest2; +extern const struct PersonalityQuestion TimidQuest3; +extern const struct PersonalityQuestion TimidQuest4; +extern const struct PersonalityQuestion HastyQuest1; +extern const struct PersonalityQuestion HastyQuest2; +extern const struct PersonalityQuestion HastyQuest3; +extern const struct PersonalityQuestion HastyQuest4; +extern const struct PersonalityQuestion SassyQuest1; +extern const struct PersonalityQuestion SassyQuest2; +extern const struct PersonalityQuestion SassyQuest3; +extern const struct PersonalityQuestion SassyQuest4; +extern const struct PersonalityQuestion CalmQuest1; +extern const struct PersonalityQuestion CalmQuest2; +extern const struct PersonalityQuestion CalmQuest3; +extern const struct PersonalityQuestion CalmQuest4; +extern const struct PersonalityQuestion RelaxedQuest1; +extern const struct PersonalityQuestion RelaxedQuest2; +extern const struct PersonalityQuestion RelaxedQuest3; +extern const struct PersonalityQuestion RelaxedQuest4; +extern const struct PersonalityQuestion LonelyQuest1; +extern const struct PersonalityQuestion LonelyQuest2; +extern const struct PersonalityQuestion LonelyQuest3; +extern const struct PersonalityQuestion LonelyQuest4; +extern const struct PersonalityQuestion QuirkyQuest1; +extern const struct PersonalityQuestion QuirkyQuest2; +extern const struct PersonalityQuestion QuirkyQuest3; +extern const struct PersonalityQuestion QuirkyQuest4; +extern const struct PersonalityQuestion MiscQuest1; +extern const struct PersonalityQuestion MiscQuest2; +extern const struct PersonalityQuestion MiscQuest3; +extern const struct PersonalityQuestion BraveQuest2B; + + +const struct PersonalityQuestion * const gPersonalityQuestionPointerTable[NUM_QUIZ_QUESTIONS + 1] = +{ + &HardyQuest1, + &HardyQuest2, + &HardyQuest3, + &HardyQuest4, + &DocileQuest1, + &DocileQuest2, + &DocileQuest3, + &DocileQuest4, + &BraveQuest1, + &BraveQuest2A, + &BraveQuest3, + &BraveQuest4, + &JollyQuest1, + &JollyQuest2, + &JollyQuest3, + &JollyQuest4, + &ImpishQuest1, + &ImpishQuest2, + &ImpishQuest3, + &ImpishQuest4, + &NaiveQuest1, + &NaiveQuest2, + &NaiveQuest3, + &NaiveQuest4, + &TimidQuest1, + &TimidQuest2, + &TimidQuest3, + &TimidQuest4, + &HastyQuest1, + &HastyQuest2, + &HastyQuest3, + &HastyQuest4, + &SassyQuest1, + &SassyQuest2, + &SassyQuest3, + &SassyQuest4, + &CalmQuest1, + &CalmQuest2, + &CalmQuest3, + &CalmQuest4, + &RelaxedQuest1, + &RelaxedQuest2, + &RelaxedQuest3, + &RelaxedQuest4, + &LonelyQuest1, + &LonelyQuest2, + &LonelyQuest3, + &LonelyQuest4, + &QuirkyQuest1, + &QuirkyQuest2, + &QuirkyQuest3, + &QuirkyQuest4, + &MiscQuest1, + &MiscQuest2, + &MiscQuest3, + &BraveQuest2B +}; + + +// NOTE: 2nd Part of Brave is included at the end so it isn't actually chosen +const u8 gNatureQuestionTable[NUM_QUIZ_QUESTIONS + 1] = +{ + HARDY, + HARDY, + HARDY, + HARDY, + DOCILE, + DOCILE, + DOCILE, + DOCILE, + BRAVE, + BRAVE, + BRAVE, + BRAVE, + JOLLY, + JOLLY, + JOLLY, + JOLLY, + IMPISH, + IMPISH, + IMPISH, + IMPISH, + NAIVE, + NAIVE, + NAIVE, + NAIVE, + TIMID, + TIMID, + TIMID, + TIMID, + HASTY, + HASTY, + HASTY, + HASTY, + SASSY, + SASSY, + SASSY, + SASSY, + CALM, + CALM, + CALM, + CALM, + RELAXED, + RELAXED, + RELAXED, + RELAXED, + LONELY, + LONELY, + LONELY, + LONELY, + QUIRKY, + QUIRKY, + QUIRKY, + QUIRKY, + MISC, + MISC, + MISC, + BRAVE +}; + +ALIGNED(4) const u8 gGenderText[] = "Are you a boy or a girl?"; +const char * const gGenderTextPtr = gGenderText; + + +const struct MenuItem gGenderMenu[] = +{ + {BoyText, 0}, + {GirlText, 1}, + {NULL, -1}, +}; + +ALIGNED(4) const u8 GirlText[] = "Girl."; +ALIGNED(4) const u8 BoyText[] = "Boy."; + +const u8 unknownPersonality[] = +{ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xA, 0xB, 0xC, 0xD +}; + +const s16 gStarters[NUM_PERSONALITIES][2] = +{ + // MALE / FEMALE + [HARDY] = {SPECIES_CHARMANDER, SPECIES_PIKACHU}, + [DOCILE] = {SPECIES_BULBASAUR, SPECIES_CHIKORITA}, + [BRAVE] = {SPECIES_MACHOP, SPECIES_CHARMANDER}, + [JOLLY] = {SPECIES_SQUIRTLE, SPECIES_TOTODILE}, + [IMPISH] = {SPECIES_PIKACHU, SPECIES_CUBONE}, + [NAIVE] = {SPECIES_TOTODILE, SPECIES_EEVEE}, + [TIMID] = {SPECIES_CYNDAQUIL, SPECIES_MUDKIP}, + [HASTY] = {SPECIES_TORCHIC, SPECIES_SKITTY}, + [SASSY] = {SPECIES_TREECKO, SPECIES_TORCHIC}, + [CALM] = {SPECIES_MUDKIP, SPECIES_BULBASAUR}, + [RELAXED] = {SPECIES_PSYDUCK, SPECIES_SQUIRTLE}, + [LONELY] = {SPECIES_CUBONE, SPECIES_PSYDUCK}, + [QUIRKY] = {SPECIES_MEOWTH, SPECIES_TREECKO} +}; + ALIGNED(4) const char gStarterReveal[] = _("\n{CENTER_ALIGN}The Pokémon {ARG_POKEMON_0}!"); const char * const gStarterRevealPtr = gStarterReveal; @@ -327,8 +546,10 @@ void UpdateNatureTotals() if (!sub_80144A4(&answerIndex)) { - if (answerIndex == 99) + // This is for the second part of Brave 2 Question if you fight.. + if (answerIndex == BRAVE_2B_TRIGGER) { + // Set question to BRAVE_2B and ask the question.. gUnknown_203B400->currQuestionIndex = NUM_QUIZ_QUESTIONS; gUnknown_203B400->TestState = 1; } @@ -367,7 +588,6 @@ void SetPlayerGender(void) } } -#ifdef NONMATCHING void RevealPersonality(void) { s32 currentNature; @@ -376,14 +596,12 @@ void RevealPersonality(void) gUnknown_203B400->playerNature = RandomCapped(NUM_PERSONALITIES); currentNature = gUnknown_203B400->playerNature; - // 2 Statements flip-flop but is functionaly equivalent - // Struct saving into register and intialize of the counter - for(counter = NUM_PERSONALITIES - 2; counter >= 0; counter--){ - currentNature = currentNature++; + for(counter = 0; counter < NUM_PERSONALITIES - 1; counter++){ + currentNature++; // Wraparound check - if (currentNature > NUM_PERSONALITIES - 1) { - currentNature = 0; + if (currentNature > QUIRKY) { + currentNature = HARDY; } if (gUnknown_203B400->NatureTotals[currentNature] > gUnknown_203B400->NatureTotals[gUnknown_203B400->playerNature]) { @@ -394,73 +612,6 @@ void RevealPersonality(void) PrintPersonalityTypeDescription(); gUnknown_203B400->TestState = 5; } -#else -NAKED -void RevealPersonality(void) -{ - asm_unified("\tpush {r4-r7,lr}\n" - "\tmovs r0, 0xD\n" - "\tbl RandomCapped\n" - "\tldr r2, _0803CA4C\n" - "\tldr r1, [r2]\n" - "\tadds r1, 0x40\n" - "\tstrb r0, [r1]\n" - "\tldr r0, [r2]\n" - "\tadds r0, 0x40\n" - "\tldrb r3, [r0]\n" - "\tadds r7, r2, 0\n" - "\tmovs r5, 0xB\n" -"_0803C9F2:\n" - "\tadds r3, 0x1\n" - "\tcmp r3, 0xC\n" - "\tble _0803C9FA\n" - "\tmovs r3, 0\n" -"_0803C9FA:\n" - "\tldr r0, [r7]\n" - "\tlsls r2, r3, 2\n" - "\tadds r1, r0, 0\n" - "\tadds r1, 0x44\n" - "\tadds r2, r1, r2\n" - "\tadds r4, r0, 0\n" - "\tadds r4, 0x40\n" - "\tldrb r0, [r4]\n" - "\tlsls r0, 2\n" - "\tadds r1, r0\n" - "\tldr r2, [r2]\n" - "\tldr r0, [r1]\n" - "\tldr r6, _0803CA4C\n" - "\tcmp r2, r0\n" - "\tble _0803CA1A\n" - "\tstrb r3, [r4]\n" -"_0803CA1A:\n" - "\tsubs r5, 0x1\n" - "\tcmp r5, 0\n" - "\tbge _0803C9F2\n" - "\tldr r3, [r6]\n" - "\tldr r2, _0803CA50\n" - "\tadds r0, r3, 0\n" - "\tadds r0, 0xB0\n" - "\tldr r1, [r0]\n" - "\tlsls r1, 1\n" - "\tsubs r0, 0x70\n" - "\tldrb r0, [r0]\n" - "\tlsls r0, 2\n" - "\tadds r1, r0\n" - "\tadds r1, r2\n" - "\tldrh r0, [r1]\n" - "\tstrh r0, [r3, 0x8]\n" - "\tbl PrintPersonalityTypeDescription\n" - "\tldr r1, [r6]\n" - "\tmovs r0, 0x5\n" - "\tstr r0, [r1, 0x34]\n" - "\tpop {r4-r7}\n" - "\tpop {r0}\n" - "\tbx r0\n" - "\t.align 2, 0\n" -"_0803CA4C: .4byte gUnknown_203B400\n" -"_0803CA50: .4byte gStarters"); -} -#endif void RevealStarter(void) { |