diff options
author | camthesaxman <cameronghall@cox.net> | 2017-08-24 20:50:39 -0500 |
---|---|---|
committer | camthesaxman <cameronghall@cox.net> | 2017-08-24 20:50:39 -0500 |
commit | 8c57ef0fad270bc795d0b64a75d96fafc0f63513 (patch) | |
tree | 83f7abe8a9b19ad34f1ec4c2ed58cf82f5c0483d | |
parent | 670255f950a98f8a5cc636a20682b9ed42a31b21 (diff) |
finish labeling script
-rw-r--r-- | data-de/text/giddy.inc | 8 | ||||
-rw-r--r-- | data/scripts/mauville_man.inc | 161 | ||||
-rw-r--r-- | data/specials.inc | 14 | ||||
-rw-r--r-- | data/text/giddy.inc | 8 | ||||
-rw-r--r-- | include/global.h | 5 | ||||
-rw-r--r-- | src/mauville_old_man.c | 143 |
6 files changed, 163 insertions, 176 deletions
diff --git a/data-de/text/giddy.inc b/data-de/text/giddy.inc index 6e1a46883..8bc5bebda 100644 --- a/data-de/text/giddy.inc +++ b/data-de/text/giddy.inc @@ -1,16 +1,16 @@ -MauvilleCity_PokemonCenter_1F_Text_1B092A:: @ 81B092A +gTextGiddy_Introduction:: @ 81B092A .string "Ich bin MÄRCHEN-MAN! Ich habe eine sehr\n" .string "geistreiche Geschichte für dich!\p" .string "Soll ich sie dir erzählen?$" -MauvilleCity_PokemonCenter_1F_Text_1B097C:: @ 81B097C +gTextGiddy_YouveDeflatedMe:: @ 81B097C .string "Oh...\n" .string "Du hast mir die Luft rausgelassen...$" -MauvilleCity_PokemonCenter_1F_Text_1B0998:: @ 81B0998 +gTextGiddy_AlsoIWasThinking:: @ 81B0998 .string "Und ich war in Gedanken vertieft...$" -MauvilleCity_PokemonCenter_1F_Text_1B09B0:: @ 81B09B0 +gTextGiddy_ByeBye:: @ 81B09B0 .string "Das wäre alles, glaube ich...\p" .string "Wir sollten bald wieder ein Schwätzchen\n" .string "halten! Tschüss!$" diff --git a/data/scripts/mauville_man.inc b/data/scripts/mauville_man.inc index 6a8f5f051..239c360dc 100644 --- a/data/scripts/mauville_man.inc +++ b/data/scripts/mauville_man.inc @@ -14,7 +14,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_1AE744:: @ 81AE744 case MAUVILLE_MAN_HIPSTER, speak_to_hipster case MAUVILLE_MAN_TRADER, speak_to_trader case MAUVILLE_MAN_STORYTELLER, speak_to_storyteller - case MAUVILLE_MAN_GIDDY, MauvilleCity_PokemonCenter_1F_EventScript_1B09EB + case MAUVILLE_MAN_GIDDY, speak_to_giddy end @------------------------------------------------------------------------------- @@ -145,10 +145,10 @@ do_trader_menu_get: jumpeq player_has_no_decorations jump do_trader_menu_give end -cancelled_get_menu:: @ 81AEC2D +cancelled_get_menu: msgbox gTextTrader_DontWantAnything, 2 end -rare_item_cant_trade_away:: @ 81AEC36 +rare_item_cant_trade_away: message gTextTrader_ICantTradeThatOneAway waittext jump do_trader_menu_get @@ -158,10 +158,10 @@ dont_want_item: waittext jump do_trader_menu_get end -player_has_no_decorations:: @ 81AEC4E +player_has_no_decorations: msgbox gTextTrader_YouDontHaveDecorations, 2 end -do_trader_menu_give:: @ 81AEC57 +do_trader_menu_give: msgbox gTextTrader_PickDecorationYoullTrade, 4 special ScrSpecial_TraderMenuGiveDecoration waitstate @@ -178,14 +178,14 @@ do_trader_menu_give:: @ 81AEC57 special ScrSpecial_TraderDoDecorationTrade msgbox gTextTrader_ThenWellTrade, 2 end -cancelled_give_menu:: @ 81AECA6 +cancelled_give_menu: msgbox gTextTrader_FeelUnwanted2, 2 end -decoration_is_in_use:: @ 81AECAF +decoration_is_in_use: msgbox gTextTrader_InUseYouCantTradeIt, 4 jump do_trader_menu_give end -decorations_full:: @ 81AECBD +decorations_full: msgbox gTextTrader_NoRoomForThis, 2 end @@ -195,7 +195,7 @@ decorations_full:: @ 81AECBD .include "data/text/storyteller.inc" -speak_to_storyteller:: @ 81B0816 +speak_to_storyteller: setvar 0x8008, 0 setvar 0x8009, 0 setvar 0x800a, 0 @@ -204,75 +204,66 @@ speak_to_storyteller:: @ 81B0816 faceplayer msgbox gTextStoryteller_Introduction, MSGBOX_YESNO compare RESULT, NO - jumpeq dont_hear_tale - specialval RESULT, sub_80F889C - compare RESULT, 0 - jumpeq MauvilleCity_PokemonCenter_1F_EventScript_1B08D3 - -MauvilleCity_PokemonCenter_1F_EventScript_1B084F:: @ 81B084F + jumpeq dont_hear_story + specialval RESULT, ScrSpecial_StorytellerGetFreeStorySlot + compare RESULT, 0 @ If slot is 0, then the list is empty + jumpeq no_stories_recorded +choose_story: message gTextStoryteller_WhichTale waittext - special sub_80F8874 + special ScrSpecial_StorytellerStoryListMenu waitstate - compare RESULT, 0 - jumpeq MauvilleCity_PokemonCenter_1F_EventScript_1B0883 + compare RESULT, FALSE + jumpeq cancel_story_menu setvar 0x8008, 1 - special sub_80F8888 + special ScrSpecial_StorytellerDisplayStory waittext waitbutton - specialval RESULT, sub_80F88AC - compare RESULT, 0 - jumpeq MauvilleCity_PokemonCenter_1F_EventScript_1B0893 - jump MauvilleCity_PokemonCenter_1F_EventScript_1B0909 - -MauvilleCity_PokemonCenter_1F_EventScript_1B0883:: @ 81B0883 + specialval RESULT, ScrSpecial_StorytellerUpdateStat + compare RESULT, FALSE + jumpeq no_stat_update + jump stat_update +cancel_story_menu: compare 0x8008, 0 - jumpeq dont_hear_tale - jump MauvilleCity_PokemonCenter_1F_EventScript_1B08AE - -MauvilleCity_PokemonCenter_1F_EventScript_1B0893:: @ 81B0893 + jumpeq dont_hear_story + jump yes_hear_story +no_stat_update: msgbox gTextStoryteller_CouldThereBeOtherTrainers, 4 msgbox gTextStoryteller_HearAnotherLegendaryTale, MSGBOX_YESNO - compare RESULT, 1 - jumpeq MauvilleCity_PokemonCenter_1F_EventScript_1B084F - -MauvilleCity_PokemonCenter_1F_EventScript_1B08AE:: @ 81B08AE - specialval RESULT, sub_80F88E0 - compare RESULT, 1 - jumpeq MauvilleCity_PokemonCenter_1F_EventScript_1B091F - specialval RESULT, sub_80F889C + compare RESULT, YES + jumpeq choose_story +yes_hear_story: + specialval RESULT, ScrSpecial_HasStorytellerAlreadyRecorded + compare RESULT, TRUE + jumpeq cant_record_story @ already recorded story + specialval RESULT, ScrSpecial_StorytellerGetFreeStorySlot compare RESULT, 4 - jumpeq MauvilleCity_PokemonCenter_1F_EventScript_1B091F - jump MauvilleCity_PokemonCenter_1F_EventScript_1B08DB - -MauvilleCity_PokemonCenter_1F_EventScript_1B08D3:: @ 81B08D3 + jumpeq cant_record_story @ story list is full + jump prompt_record_story +no_stories_recorded: msgbox gTextStoryteller_ButIKnowOfNoLegendaryTrainers, 4 - -MauvilleCity_PokemonCenter_1F_EventScript_1B08DB:: @ 81B08DB +prompt_record_story: msgbox gTextStoryteller_HaveYouAnyTales, MSGBOX_YESNO - compare RESULT, 0 - jumpeq dont_hear_tale - specialval RESULT, sub_80F88FC - compare RESULT, 1 - jumpeq MauvilleCity_PokemonCenter_1F_EventScript_1B0909 + compare RESULT, NO + jumpeq dont_hear_story + specialval RESULT, ScrSpecial_StorytellerInitializeRandomStat + compare RESULT, TRUE + jumpeq stat_update msgbox gTextStoryteller_ImNotSatisfied, 4 closebutton release end - -MauvilleCity_PokemonCenter_1F_EventScript_1B0909:: @ 81B0909 +stat_update: msgbox gTextStoryteller_BirthOfANewLegend, 4 closebutton release end - -dont_hear_tale:: @ 81B0914 +dont_hear_story: msgbox gTextStoryteller_OhIFeelStifled, 4 closebutton release end - -MauvilleCity_PokemonCenter_1F_EventScript_1B091F:: @ 81B091F +cant_record_story: msgbox gTextStoryteller_WishMorePeopleWould, 4 closebutton release @@ -284,55 +275,49 @@ MauvilleCity_PokemonCenter_1F_EventScript_1B091F:: @ 81B091F .include "data/text/giddy.inc" -MauvilleCity_PokemonCenter_1F_EventScript_1B09EB:: @ 81B09EB +speak_to_giddy: lock faceplayer - msgbox MauvilleCity_PokemonCenter_1F_Text_1B092A, MSGBOX_YESNO - compare RESULT, 1 - jumpeq MauvilleCity_PokemonCenter_1F_EventScript_1B0A0C - compare RESULT, 0 - jumpeq MauvilleCity_PokemonCenter_1F_EventScript_1B0A6F + msgbox gTextGiddy_Introduction, MSGBOX_YESNO + compare RESULT, YES + jumpeq yes_hear_giddy + compare RESULT, NO + jumpeq dont_hear_giddy end - -MauvilleCity_PokemonCenter_1F_EventScript_1B0A0C:: @ 81B0A0C - special sub_80F7CC8 - compare RESULT, 1 - jumpeq MauvilleCity_PokemonCenter_1F_EventScript_1B0A4E - compare RESULT, 0 - jumpeq MauvilleCity_PokemonCenter_1F_EventScript_1B0A79 +yes_hear_giddy: + special ScrSpecial_GiddyShouldTellAnotherTale + compare RESULT, TRUE + jumpeq tell_giddy_tale + compare RESULT, FALSE + jumpeq bye_bye end - -MauvilleCity_PokemonCenter_1F_EventScript_1B0A26:: @ 81B0A26 - special sub_80F7CC8 - compare RESULT, 1 - jumpeq MauvilleCity_PokemonCenter_1F_EventScript_1B0A40 - compare RESULT, 0 - jumpeq MauvilleCity_PokemonCenter_1F_EventScript_1B0A79 +tell_another_giddy_tale: + special ScrSpecial_GiddyShouldTellAnotherTale + compare RESULT, TRUE + jumpeq also_i_was_thinking + compare RESULT, FALSE + jumpeq bye_bye end - -MauvilleCity_PokemonCenter_1F_EventScript_1B0A40:: @ 81B0A40 - msgbox MauvilleCity_PokemonCenter_1F_Text_1B0998, 4 - jump MauvilleCity_PokemonCenter_1F_EventScript_1B0A4E +also_i_was_thinking: + msgbox gTextGiddy_AlsoIWasThinking, 4 + jump tell_giddy_tale end - -MauvilleCity_PokemonCenter_1F_EventScript_1B0A4E:: @ 81B0A4E +tell_giddy_tale: special ScrSpecial_GenerateGiddyLine special ShowFieldMessageStringVar4 waittext yesnobox 20, 8 compare RESULT, 1 - jumpeq MauvilleCity_PokemonCenter_1F_EventScript_1B0A26 + jumpeq tell_another_giddy_tale compare RESULT, 0 - jumpeq MauvilleCity_PokemonCenter_1F_EventScript_1B0A26 + jumpeq tell_another_giddy_tale end - -MauvilleCity_PokemonCenter_1F_EventScript_1B0A6F:: @ 81B0A6F - msgbox MauvilleCity_PokemonCenter_1F_Text_1B097C, 4 +dont_hear_giddy: + msgbox gTextGiddy_YouveDeflatedMe, 4 release end - -MauvilleCity_PokemonCenter_1F_EventScript_1B0A79:: @ 81B0A79 - msgbox MauvilleCity_PokemonCenter_1F_Text_1B09B0, 4 +bye_bye: + msgbox gTextGiddy_ByeBye, 4 release end diff --git a/data/specials.inc b/data/specials.inc index cff97f455..a17bc943a 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -113,13 +113,13 @@ gSpecials:: def_special ScrSpecial_PlayBardSong def_special sub_80F83D0 def_special ScrSpecial_GenerateGiddyLine - def_special sub_80F7CC8 - def_special sub_80F889C - def_special sub_80F8888 - def_special sub_80F8874 - def_special sub_80F88AC - def_special sub_80F88FC - def_special sub_80F88E0 + def_special ScrSpecial_GiddyShouldTellAnotherTale + def_special ScrSpecial_StorytellerGetFreeStorySlot + def_special ScrSpecial_StorytellerDisplayStory + def_special ScrSpecial_StorytellerStoryListMenu + def_special ScrSpecial_StorytellerUpdateStat + def_special ScrSpecial_StorytellerInitializeRandomStat + def_special ScrSpecial_HasStorytellerAlreadyRecorded def_special ScrSpecial_TraderMenuGetDecoration def_special ScrSpecial_GetTraderTradedFlag def_special ScrSpecial_DoesPlayerHaveNoDecorations diff --git a/data/text/giddy.inc b/data/text/giddy.inc index 040ef2ae5..a763776bf 100644 --- a/data/text/giddy.inc +++ b/data/text/giddy.inc @@ -1,16 +1,16 @@ -MauvilleCity_PokemonCenter_1F_Text_1B092A:: @ 81B092A +gTextGiddy_Introduction:: @ 81B092A .string "I’m GIDDY!\n" .string "I have a scintillating story for you!\p" .string "Would you like to hear my story?$" -MauvilleCity_PokemonCenter_1F_Text_1B097C:: @ 81B097C +gTextGiddy_YouveDeflatedMe:: @ 81B097C .string "Oh...\n" .string "You’ve deflated me...$" -MauvilleCity_PokemonCenter_1F_Text_1B0998:: @ 81B0998 +gTextGiddy_AlsoIWasThinking:: @ 81B0998 .string "Also, I was thinking...$" -MauvilleCity_PokemonCenter_1F_Text_1B09B0:: @ 81B09B0 +gTextGiddy_ByeBye:: @ 81B09B0 .string "That’s about it, I think...\p" .string "We should chat again!\n" .string "Bye-bye!$" diff --git a/include/global.h b/include/global.h index 875ea7815..7c673f13e 100644 --- a/include/global.h +++ b/include/global.h @@ -494,11 +494,10 @@ struct MauvilleManStoryteller struct MauvilleManGiddy { /*0x00*/ u8 id; - /*0x01*/ u8 unk1; + /*0x01*/ u8 taleCounter; /*0x02*/ u8 questionNum; - /*0x04*/ u16 mauvilleOldMan_ecArray[10]; + /*0x04*/ u16 randomWords[10]; /*0x18*/ u8 questionList[12]; - /*0x24*/ u8 fillerF[0x2]; }; /*size = 0x2C*/ diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index a5b5cb914..6feee5184 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -214,7 +214,7 @@ void SetupGiddy(void) struct MauvilleManGiddy *giddy = &gSaveBlock1.mauvilleMan.giddy; giddy->id = MAUVILLE_MAN_GIDDY; - giddy->unk1 = 0; + giddy->taleCounter = 0; } void SetupTrader(void) @@ -248,7 +248,7 @@ void SetupMauvilleOldMan(void) sub_80F83D0(); } -//#define TEST MAUVILLE_MAN_BARD +//#define TEST MAUVILLE_MAN_STORYTELLER #ifdef TEST // Safely changes man to test functionality @@ -344,10 +344,10 @@ void PrepareSongText(void) *str = CHAR_SONG_WORD_SEPARATOR; str++; } - + str++; *(wordEnd++) = CHAR_SPACE; - + wordEnd = EasyChat_GetWordText(wordEnd, *(lyrics++)); while (wordEnd != str) { @@ -355,10 +355,10 @@ void PrepareSongText(void) *str = CHAR_SONG_WORD_SEPARATOR; str++; } - + str++; *(wordEnd++) = CHAR_NEWLINE; - + wordEnd = EasyChat_GetWordText(wordEnd, *(lyrics++)); while (wordEnd != str) { @@ -366,7 +366,7 @@ void PrepareSongText(void) *str = CHAR_SONG_WORD_SEPARATOR; str++; } - + if (lineNum == 0) { *(wordEnd++) = EXT_CTRL_CODE_BEGIN; @@ -412,14 +412,14 @@ void ScrSpecial_HipsterTeachWord(void) } } -void sub_80F7CC8(void) +void ScrSpecial_GiddyShouldTellAnotherTale(void) { - struct MauvilleManBard *bard = &gSaveBlock1.mauvilleMan.bard; + struct MauvilleManGiddy *giddy = &gSaveBlock1.mauvilleMan.giddy; - if (bard->unk_2D95 == 10) + if (giddy->taleCounter == 10) { gScriptResult = FALSE; - bard->unk_2D95 = 0; + giddy->taleCounter = 0; } else { @@ -431,16 +431,16 @@ void ScrSpecial_GenerateGiddyLine(void) { struct MauvilleManGiddy *giddy = &gSaveBlock1.mauvilleMan.giddy; - if (giddy->unk1 == 0) + if (giddy->taleCounter == 0) sub_80F7DC0(); - if (giddy->mauvilleOldMan_ecArray[giddy->unk1] != 0xFFFF) // is not the last element of the array? + if (giddy->randomWords[giddy->taleCounter] != 0xFFFF) // is not the last element of the array? { u8 *stringPtr; u32 adjective = Random(); adjective %= 8; - stringPtr = EasyChat_GetWordText(gStringVar4, giddy->mauvilleOldMan_ecArray[giddy->unk1]); + stringPtr = EasyChat_GetWordText(gStringVar4, giddy->randomWords[giddy->taleCounter]); stringPtr = StringCopy(stringPtr, gOtherText_Is); stringPtr = StringCopy(stringPtr, gGiddyAdjectives[adjective]); StringCopy(stringPtr, gOtherText_DontYouAgree); @@ -451,9 +451,9 @@ void ScrSpecial_GenerateGiddyLine(void) } if (!(Random() % 10)) - giddy->unk1 = 10; + giddy->taleCounter = 10; else - giddy->unk1++; + giddy->taleCounter++; gScriptResult = TRUE; } @@ -520,8 +520,8 @@ void sub_80F7DC0(void) u16 var = Random() % 10; if (var < 3 && r7 < 8) { - //gSaveBlock1.mauvilleMan.giddy.mauvilleOldMan_ecArray[i] = 0xFFFF; - giddy->mauvilleOldMan_ecArray[i] = 0xFFFF; + //gSaveBlock1.mauvilleMan.giddy.randomWords[i] = 0xFFFF; + giddy->randomWords[i] = 0xFFFF; r7++; } //_080F7E90 @@ -541,8 +541,8 @@ void sub_80F7DC0(void) if (r1 == 6) r1 = 0; - //gSaveBlock1.mauvilleMan.giddy.mauvilleOldMan_ecArray[i] = sub_80EB784(arr[r1][0]); - giddy->mauvilleOldMan_ecArray[i] = sub_80EB784(arr[r1][0]); + //gSaveBlock1.mauvilleMan.giddy.randomWords[i] = sub_80EB784(arr[r1][0]); + giddy->randomWords[i] = sub_80EB784(arr[r1][0]); } } } @@ -796,7 +796,7 @@ void BardSingWord(struct Task *task, struct BardSong *song) lyrics = bard->temporaryLyrics; for (i = 0; i < 6; i++) song->lyrics[i] = lyrics[i]; - + // Clear phonemes for (i = 0; i < 6; i++) { @@ -1089,7 +1089,7 @@ u32 StorytellerGetGameStat(u8 stat) return GetGameStat(stat); } -const struct Story *GetStory(u32 stat) +const struct Story *GetStoryByStat(u32 stat) { s32 i; @@ -1101,22 +1101,22 @@ const struct Story *GetStory(u32 stat) return &sStorytellerStories[35]; } -const u8 *GetStoryTitle(u32 a) +const u8 *GetStoryTitleByStat(u32 stat) { - return GetStory(a)->title; + return GetStoryByStat(stat)->title; } -const u8 *GetStoryText(u32 a) +const u8 *GetStoryTextByStat(u32 stat) { - return GetStory(a)->fullText; + return GetStoryByStat(stat)->fullText; } -const u8 *GetStoryAction(u32 a) +const u8 *GetStoryActionByStat(u32 stat) { - return GetStory(a)->action; + return GetStoryByStat(stat)->action; } -u8 sub_80F849C(void) +u8 GetFreeStorySlot(void) { u8 i; @@ -1147,7 +1147,7 @@ void StorytellerSetRecordedTrainerStat(u32 trainer, u32 val) ptr[3] = val >> 24; } -bool32 sub_80F8508(u32 trainer) +bool32 HasTrainerStatIncreased(u32 trainer) { struct MauvilleManStoryteller *storyteller = &gSaveBlock1.mauvilleMan.storyteller; @@ -1157,7 +1157,7 @@ bool32 sub_80F8508(u32 trainer) return FALSE; } -void GetStorytellerPlayerName(u32 player, void *dst) +void GetStoryByStattellerPlayerName(u32 player, void *dst) { u8 *name = gSaveBlock1.mauvilleMan.storyteller.trainerNames[player]; @@ -1165,27 +1165,27 @@ void GetStorytellerPlayerName(u32 player, void *dst) memcpy(dst, name, 7); } -void SetStorytellerPlayerName(u32 player, const u8 *dst) +void StorytellerSetPlayerName(u32 player, const u8 *src) { u8 *name = gSaveBlock1.mauvilleMan.storyteller.trainerNames[player]; - u8 len = StringLength(dst); + u8 len = StringLength(src); memset(name, EOS, 7); - StringCopyN(name, dst, len); + StringCopyN(name, src, len); } -void sub_80F8598(u32 player, u32 stat) +void StorytellerRecordNewStat(u32 player, u32 stat) { struct MauvilleManStoryteller *storyteller = &gSaveBlock1.mauvilleMan.storyteller; storyteller->gameStatIDs[player] = stat; - SetStorytellerPlayerName(player, gSaveBlock2.playerName); + StorytellerSetPlayerName(player, gSaveBlock2.playerName); StorytellerSetRecordedTrainerStat(player, StorytellerGetGameStat(stat)); ConvertIntToDecimalStringN(gStringVar1, StorytellerGetGameStat(stat), 0, 10); - StringCopy(gStringVar2, GetStoryAction(stat)); + StringCopy(gStringVar2, GetStoryActionByStat(stat)); } -void sub_80F85FC(u8 *arr, s32 count) +void ScrambleStatList(u8 *arr, s32 count) { s32 i; @@ -1201,20 +1201,21 @@ void sub_80F85FC(u8 *arr, s32 count) } } -static const struct {u32 length; struct MauvilleManStoryteller *unused1; u32 unused2;} gUnknown_083E5620 = +// What purpose does this struct even serve? Only the length field is used. +static const struct {u32 length; struct MauvilleManStoryteller *unused1; u32 unused2;} sStorytellerStuff = { 36, &gSaveBlock1.mauvilleMan.storyteller, // unused - 12, // unused + 12, // unused }; -bool8 sub_80F8650(void) +bool8 StorytellerInitializeRandomStat(void) { - u8 arr[gUnknown_083E5620.length]; + u8 arr[sStorytellerStuff.length]; s32 i; s32 j; - sub_80F85FC(arr, 36); + ScrambleStatList(arr, 36); for (i = 0; i < 36; i++) { u8 stat = sStorytellerStories[arr[i]].stat; @@ -1229,44 +1230,44 @@ bool8 sub_80F8650(void) if (j == 4 && StorytellerGetGameStat(stat) >= minVal) { storyteller->unk1 = TRUE; - sub_80F8598(sub_80F849C(), stat); + StorytellerRecordNewStat(GetFreeStorySlot(), stat); return TRUE; } } return FALSE; } -void sub_80F8700(u32 player) +void StorytellerDisplayStory(u32 player) { struct MauvilleManStoryteller *storyteller = &gSaveBlock1.mauvilleMan.storyteller; - u8 r6 = storyteller->gameStatIDs[player]; + u8 stat = storyteller->gameStatIDs[player]; ConvertIntToDecimalStringN(gStringVar1, StorytellerGetRecordedTrainerStat(player), 0, 10); - StringCopy(gStringVar2, GetStoryAction(r6)); - GetStorytellerPlayerName(player, gStringVar3); - ShowFieldMessage(GetStoryText(r6)); + StringCopy(gStringVar2, GetStoryActionByStat(stat)); + GetStoryByStattellerPlayerName(player, gStringVar3); + ShowFieldMessage(GetStoryTextByStat(stat)); } -void sub_80F8758(void) +void PrintStoryList(void) { s32 i; - MenuDrawTextWindow(0, 0, 25, 4 + sub_80F849C() * 2); + MenuDrawTextWindow(0, 0, 25, 4 + GetFreeStorySlot() * 2); for (i = 0; i < 4; i++) { struct MauvilleManStoryteller *storyteller = &gSaveBlock1.mauvilleMan.storyteller; - u8 r0 = storyteller->gameStatIDs[i]; + u8 stat = storyteller->gameStatIDs[i]; - if (r0 == 0) + if (stat == 0) break; - MenuPrint(GetStoryTitle(r0), 1, 2 + i * 2); + MenuPrint(GetStoryTitleByStat(stat), 1, 2 + i * 2); } MenuPrint(gPCText_Cancel, 1, 2 + i * 2); } extern u8 gUnknown_03000748; -void sub_80F87C4(u8 taskId) +void Task_StoryListMenu(u8 taskId) { struct Task *task = &gTasks[taskId]; s32 selection; @@ -1274,15 +1275,15 @@ void sub_80F87C4(u8 taskId) switch (task->data[0]) { case 0: - sub_80F8758(); - InitMenu(0, 1, 2, sub_80F849C() + 1, 0, 24); + PrintStoryList(); + InitMenu(0, 1, 2, GetFreeStorySlot() + 1, 0, 24); task->data[0]++; break; case 1: selection = ProcessMenuInput(); if (selection == -2) break; - if (selection == -1 || selection == sub_80F849C()) + if (selection == -1 || selection == GetFreeStorySlot()) { gScriptResult = 0; } @@ -1299,35 +1300,37 @@ void sub_80F87C4(u8 taskId) } } -void sub_80F8874(void) +// Sets gScriptResult to TRUE if player selected a story +void ScrSpecial_StorytellerStoryListMenu(void) { - CreateTask(sub_80F87C4, 0x50); + CreateTask(Task_StoryListMenu, 0x50); } -void sub_80F8888(void) +void ScrSpecial_StorytellerDisplayStory(void) { - sub_80F8700(gUnknown_03000748); + StorytellerDisplayStory(gUnknown_03000748); } -u8 sub_80F889C(void) +u8 ScrSpecial_StorytellerGetFreeStorySlot(void) { - return sub_80F849C(); + return GetFreeStorySlot(); } -bool8 sub_80F88AC(void) +// Returns TRUE if stat has increased +bool8 ScrSpecial_StorytellerUpdateStat(void) { struct MauvilleManStoryteller *storyteller = &gSaveBlock1.mauvilleMan.storyteller; u8 r4 = storyteller->gameStatIDs[gUnknown_03000748]; - if (sub_80F8508(gUnknown_03000748) == TRUE) + if (HasTrainerStatIncreased(gUnknown_03000748) == TRUE) { - sub_80F8598(gUnknown_03000748, r4); + StorytellerRecordNewStat(gUnknown_03000748, r4); return TRUE; } return FALSE; } -bool8 sub_80F88E0(void) +bool8 ScrSpecial_HasStorytellerAlreadyRecorded(void) { struct MauvilleManStoryteller *storyteller = &gSaveBlock1.mauvilleMan.storyteller; @@ -1337,7 +1340,7 @@ bool8 sub_80F88E0(void) return TRUE; } -bool8 sub_80F88FC(void) +bool8 ScrSpecial_StorytellerInitializeRandomStat(void) { - return sub_80F8650(); + return StorytellerInitializeRandomStat(); } |