mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-13 23:23:43 +01:00
Clean up mauville_old_man, drop ScrSpecial prefix
This commit is contained in:
parent
ed6fdd743f
commit
db8ce5d7f9
@ -12,7 +12,7 @@ MauvilleCity_PokemonCenter_1F_OnTransition:
|
||||
end
|
||||
|
||||
MauvilleCity_PokemonCenter_1F_EventScript_SetMauvilleOldManGfx::
|
||||
special ScrSpecial_SetMauvilleOldManObjEventGfx
|
||||
special SetMauvilleOldManObjEventGfx
|
||||
end
|
||||
|
||||
MauvilleCity_PokemonCenter_1F_EventScript_Nurse::
|
||||
|
@ -1,5 +1,5 @@
|
||||
MauvilleCity_PokemonCenter_1F_EventScript_MauvilleOldMan::
|
||||
special ScrSpecial_GetCurrentMauvilleMan
|
||||
special Script_GetCurrentMauvilleMan
|
||||
switch VAR_RESULT
|
||||
case MAUVILLE_MAN_BARD, MauvilleCity_PokemonCenter_1F_EventScript_Bard
|
||||
case MAUVILLE_MAN_HIPSTER, MauvilleCity_PokemonCenter_1F_EventScript_Hipster
|
||||
@ -21,9 +21,9 @@ MauvilleCity_PokemonCenter_1F_EventScript_Bard::
|
||||
|
||||
MauvilleCity_PokemonCenter_1F_EventScript_PlaySong::
|
||||
setvar VAR_0x8004, 0
|
||||
special ScrSpecial_PlayBardSong
|
||||
special PlayBardSong
|
||||
delay 60
|
||||
special ScrSpecial_HasBardSongBeenChanged
|
||||
special HasBardSongBeenChanged
|
||||
compare VAR_RESULT, FALSE
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_AskToWriteLyrics
|
||||
msgbox MauvilleCity_PokemonCenter_1F_Text_WishICouldPlaySongForOthers, MSGBOX_DEFAULT
|
||||
@ -52,12 +52,12 @@ MauvilleCity_PokemonCenter_1F_EventScript_WriteLyrics::
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DeclineWritingLyrics
|
||||
msgbox MauvilleCity_PokemonCenter_1F_Text_LetMeSingItForYou, MSGBOX_DEFAULT
|
||||
setvar VAR_0x8004, 1
|
||||
special ScrSpecial_PlayBardSong
|
||||
special PlayBardSong
|
||||
delay 60
|
||||
msgbox MauvilleCity_PokemonCenter_1F_Text_ThatHowYouWantedSongToGo, MSGBOX_YESNO
|
||||
compare VAR_RESULT, NO
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_WriteLyrics
|
||||
special ScrSpecial_SaveBardSongLyrics
|
||||
special SaveBardSongLyrics
|
||||
msgbox MauvilleCity_PokemonCenter_1F_Text_IllSingThisSongForAWhile, MSGBOX_DEFAULT
|
||||
release
|
||||
end
|
||||
@ -73,7 +73,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_Hipster::
|
||||
faceplayer
|
||||
setflag FLAG_SYS_HIPSTER_MEET
|
||||
msgbox MauvilleCity_PokemonCenter_1F_Text_TeachWhatsHipAndHappening, MSGBOX_DEFAULT
|
||||
special ScrSpecial_GetHipsterSpokenFlag
|
||||
special GetHipsterSpokenFlag
|
||||
compare VAR_RESULT, FALSE
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_TryTeachWord
|
||||
msgbox MauvilleCity_PokemonCenter_1F_Text_IAlreadyTaughtYou, MSGBOX_DEFAULT
|
||||
@ -81,7 +81,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_Hipster::
|
||||
end
|
||||
|
||||
MauvilleCity_PokemonCenter_1F_EventScript_TryTeachWord::
|
||||
special ScrSpecial_HipsterTeachWord
|
||||
special HipsterTryTeachWord
|
||||
compare VAR_RESULT, TRUE
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_TeachWord
|
||||
msgbox MauvilleCity_PokemonCenter_1F_Text_IveGotNothingNewToTeach, MSGBOX_DEFAULT
|
||||
@ -90,7 +90,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_TryTeachWord::
|
||||
|
||||
MauvilleCity_PokemonCenter_1F_EventScript_TeachWord::
|
||||
msgbox MauvilleCity_PokemonCenter_1F_Text_HaveYouHeardOfPhrase, MSGBOX_DEFAULT
|
||||
special ScrSpecial_SetHipsterSpokenFlag
|
||||
special SetHipsterSpokenFlag
|
||||
release
|
||||
end
|
||||
|
||||
@ -160,7 +160,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_Trader::
|
||||
msgbox MauvilleCity_PokemonCenter_1F_Text_WantToTradeDecor, MSGBOX_YESNO
|
||||
compare VAR_RESULT, NO
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DeclineTrade
|
||||
special ScrSpecial_GetTraderTradedFlag
|
||||
special GetTraderTradedFlag
|
||||
compare VAR_RESULT, TRUE
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_AlreadyTraded
|
||||
message MauvilleCity_PokemonCenter_1F_Text_PickADecorItem
|
||||
@ -179,7 +179,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_AlreadyTraded::
|
||||
end
|
||||
|
||||
MauvilleCity_PokemonCenter_1F_EventScript_PickDecorToReceive::
|
||||
special ScrSpecial_TraderMenuGetDecoration
|
||||
special TraderMenuGetDecoration
|
||||
waitstate
|
||||
compare VAR_0x8004, 0
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_CancelPickDecor
|
||||
@ -188,7 +188,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_PickDecorToReceive::
|
||||
msgbox MauvilleCity_PokemonCenter_1F_Text_OnceBelongedToPlayerDoYouWantIt, MSGBOX_YESNO
|
||||
compare VAR_RESULT, NO
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_PickDifferentDecor
|
||||
special ScrSpecial_DoesPlayerHaveNoDecorations
|
||||
special DoesPlayerHaveNoDecorations
|
||||
compare VAR_RESULT, TRUE
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DontHaveAnyDecor
|
||||
goto MauvilleCity_PokemonCenter_1F_EventScript_PickDecorToGive
|
||||
@ -218,19 +218,19 @@ MauvilleCity_PokemonCenter_1F_EventScript_DontHaveAnyDecor::
|
||||
|
||||
MauvilleCity_PokemonCenter_1F_EventScript_PickDecorToGive::
|
||||
msgbox MauvilleCity_PokemonCenter_1F_Text_PickTheDecorToTrade, MSGBOX_DEFAULT
|
||||
special ScrSpecial_TraderMenuGiveDecoration
|
||||
special TraderShowDecorationMenu
|
||||
waitstate
|
||||
compare VAR_0x8006, 0
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_CancelGiveDecor
|
||||
compare VAR_0x8006, 0xFFFF
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DecorInUse
|
||||
special ScrSpecial_IsDecorationFull
|
||||
special IsDecorationCategoryFull
|
||||
compare VAR_RESULT, TRUE
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_NoRoomForDecor
|
||||
msgbox MauvilleCity_PokemonCenter_1F_Text_SoWellTradeTheseDecor, MSGBOX_YESNO
|
||||
compare VAR_RESULT, NO
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_PickDecorToGive
|
||||
special ScrSpecial_TraderDoDecorationTrade
|
||||
special TraderDoDecorationTrade
|
||||
msgbox MauvilleCity_PokemonCenter_1F_Text_SendDecorToYourPC, MSGBOX_DEFAULT
|
||||
release
|
||||
end
|
||||
@ -818,20 +818,20 @@ MauvilleCity_PokemonCenter_1F_EventScript_Storyteller::
|
||||
msgbox MauvilleCity_PokemonCenter_1F_Text_WillYouHearMyTale, MSGBOX_YESNO
|
||||
compare VAR_RESULT, NO
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DeclineStoryteller
|
||||
specialvar VAR_RESULT, ScrSpecial_StorytellerGetFreeStorySlot
|
||||
specialvar VAR_RESULT, StorytellerGetFreeStorySlot
|
||||
compare VAR_RESULT, 0
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_KnowNoTales
|
||||
message MauvilleCity_PokemonCenter_1F_Text_WhichTaleToTell
|
||||
waitmessage
|
||||
special ScrSpecial_StorytellerStoryListMenu
|
||||
special StorytellerStoryListMenu
|
||||
waitstate
|
||||
compare VAR_RESULT, 0
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_CancelStorySelection
|
||||
setvar VAR_0x8008, 1
|
||||
special ScrSpecial_StorytellerDisplayStory
|
||||
special Script_StorytellerDisplayStory
|
||||
waitmessage
|
||||
waitbuttonpress
|
||||
specialvar VAR_RESULT, ScrSpecial_StorytellerUpdateStat
|
||||
specialvar VAR_RESULT, StorytellerUpdateStat
|
||||
compare VAR_RESULT, 0
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_AreThereOtherTales
|
||||
goto MauvilleCity_PokemonCenter_1F_EventScript_TellPlayersTale
|
||||
@ -842,7 +842,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_CancelStorySelection::
|
||||
|
||||
MauvilleCity_PokemonCenter_1F_EventScript_AreThereOtherTales::
|
||||
msgbox MauvilleCity_PokemonCenter_1F_Text_CouldThereBeOtherLegends, MSGBOX_DEFAULT
|
||||
specialvar VAR_RESULT, ScrSpecial_HasStorytellerAlreadyRecorded
|
||||
specialvar VAR_RESULT, HasStorytellerAlreadyRecorded
|
||||
compare VAR_RESULT, TRUE
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_StorytellerEnd
|
||||
goto MauvilleCity_PokemonCenter_1F_EventScript_DoYouHaveAnyTales
|
||||
@ -853,7 +853,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_DoYouHaveAnyTales::
|
||||
msgbox MauvilleCity_PokemonCenter_1F_Text_HaveYouAnyLegendaryTales, MSGBOX_YESNO
|
||||
compare VAR_RESULT, NO
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_DeclineStoryteller
|
||||
specialvar VAR_RESULT, ScrSpecial_StorytellerInitializeRandomStat
|
||||
specialvar VAR_RESULT, Script_StorytellerInitializeRandomStat
|
||||
compare VAR_RESULT, 1
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_TellPlayersTale
|
||||
msgbox MauvilleCity_PokemonCenter_1F_Text_NotWorthyOfLegend, MSGBOX_DEFAULT
|
||||
@ -909,7 +909,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_Giddy::
|
||||
end
|
||||
|
||||
MauvilleCity_PokemonCenter_1F_EventScript_TryTellTale::
|
||||
special ScrSpecial_GiddyShouldTellAnotherTale
|
||||
special GiddyShouldTellAnotherTale
|
||||
compare VAR_RESULT, TRUE
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_GiddyTellTale
|
||||
compare VAR_RESULT, FALSE
|
||||
@ -917,7 +917,7 @@ MauvilleCity_PokemonCenter_1F_EventScript_TryTellTale::
|
||||
end
|
||||
|
||||
MauvilleCity_PokemonCenter_1F_EventScript_TryTellNewTale::
|
||||
special ScrSpecial_GiddyShouldTellAnotherTale
|
||||
special GiddyShouldTellAnotherTale
|
||||
compare VAR_RESULT, TRUE
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_GiddyStartNewTale
|
||||
compare VAR_RESULT, FALSE
|
||||
@ -929,15 +929,16 @@ MauvilleCity_PokemonCenter_1F_EventScript_GiddyStartNewTale::
|
||||
goto MauvilleCity_PokemonCenter_1F_EventScript_GiddyTellTale
|
||||
end
|
||||
|
||||
@ Regardless of whether yes or no is selected below, Giddy will continue to tell stories until he's told 10
|
||||
@ Giddy will continue to tell stories regardless of whether yes or no is selected below.
|
||||
@ Each story there is a 10% chance it will be his last. Otherwise he will stop at 10 stories.
|
||||
MauvilleCity_PokemonCenter_1F_EventScript_GiddyTellTale::
|
||||
special ScrSpecial_GenerateGiddyLine
|
||||
special GenerateGiddyLine
|
||||
special ShowFieldMessageStringVar4
|
||||
waitmessage
|
||||
yesnobox 20, 8
|
||||
compare VAR_RESULT, 1
|
||||
compare VAR_RESULT, YES
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_TryTellNewTale
|
||||
compare VAR_RESULT, 0
|
||||
compare VAR_RESULT, NO
|
||||
goto_if_eq MauvilleCity_PokemonCenter_1F_EventScript_TryTellNewTale
|
||||
end
|
||||
|
||||
|
@ -108,28 +108,28 @@ gSpecials::
|
||||
def_special DoWateringBerryTreeAnim
|
||||
def_special ShowEasyChatScreen
|
||||
def_special ShowEasyChatProfile
|
||||
def_special ScrSpecial_GetCurrentMauvilleMan
|
||||
def_special ScrSpecial_HasBardSongBeenChanged
|
||||
def_special ScrSpecial_SaveBardSongLyrics
|
||||
def_special ScrSpecial_GetHipsterSpokenFlag
|
||||
def_special ScrSpecial_SetHipsterSpokenFlag
|
||||
def_special ScrSpecial_HipsterTeachWord
|
||||
def_special ScrSpecial_PlayBardSong
|
||||
def_special ScrSpecial_SetMauvilleOldManObjEventGfx
|
||||
def_special ScrSpecial_GenerateGiddyLine
|
||||
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
|
||||
def_special ScrSpecial_IsDecorationFull
|
||||
def_special ScrSpecial_TraderMenuGiveDecoration
|
||||
def_special ScrSpecial_TraderDoDecorationTrade
|
||||
def_special Script_GetCurrentMauvilleMan
|
||||
def_special HasBardSongBeenChanged
|
||||
def_special SaveBardSongLyrics
|
||||
def_special GetHipsterSpokenFlag
|
||||
def_special SetHipsterSpokenFlag
|
||||
def_special HipsterTryTeachWord
|
||||
def_special PlayBardSong
|
||||
def_special SetMauvilleOldManObjEventGfx
|
||||
def_special GenerateGiddyLine
|
||||
def_special GiddyShouldTellAnotherTale
|
||||
def_special StorytellerGetFreeStorySlot
|
||||
def_special Script_StorytellerDisplayStory
|
||||
def_special StorytellerStoryListMenu
|
||||
def_special StorytellerUpdateStat
|
||||
def_special Script_StorytellerInitializeRandomStat
|
||||
def_special HasStorytellerAlreadyRecorded
|
||||
def_special TraderMenuGetDecoration
|
||||
def_special GetTraderTradedFlag
|
||||
def_special DoesPlayerHaveNoDecorations
|
||||
def_special IsDecorationCategoryFull
|
||||
def_special TraderShowDecorationMenu
|
||||
def_special TraderDoDecorationTrade
|
||||
def_special GetSeedotSizeRecordInfo
|
||||
def_special CompareSeedotSize
|
||||
def_special GetLotadSizeRecordInfo
|
||||
|
@ -95,6 +95,7 @@
|
||||
#define BARD_SONG_LENGTH 6
|
||||
#define NUM_STORYTELLER_TALES 4
|
||||
#define NUM_TRADER_ITEMS 4
|
||||
#define GIDDY_MAX_TALES 10
|
||||
|
||||
#define OPTIONS_BUTTON_MODE_NORMAL 0
|
||||
#define OPTIONS_BUTTON_MODE_LR 1
|
||||
|
@ -639,7 +639,7 @@ struct MauvilleManGiddy
|
||||
/*0x00*/ u8 id;
|
||||
/*0x01*/ u8 taleCounter;
|
||||
/*0x02*/ u8 questionNum;
|
||||
/*0x04*/ u16 randomWords[10];
|
||||
/*0x04*/ u16 randomWords[GIDDY_MAX_TALES];
|
||||
/*0x18*/ u8 questionList[8];
|
||||
/*0x20*/ u8 language;
|
||||
}; /*size = 0x2C*/
|
||||
|
@ -5,7 +5,7 @@ extern struct BardSong gBardSong;
|
||||
|
||||
void SetMauvilleOldMan(void);
|
||||
u8 GetCurrentMauvilleOldMan(void);
|
||||
void ScrSpecial_SetMauvilleOldManObjEventGfx(void);
|
||||
void SetMauvilleOldManObjEventGfx(void);
|
||||
u8 sub_81201C8(void);
|
||||
void SanitizeMauvilleOldManForRuby(OldMan *dest);
|
||||
void sub_8120670(void);
|
||||
|
@ -33,7 +33,6 @@ extern const struct WildPokemonHeader gWildMonHeaders[];
|
||||
|
||||
void DisableWildEncounters(bool8 disabled);
|
||||
bool8 StandardWildEncounter(u16 currMetaTileBehavior, u16 previousMetaTileBehavior);
|
||||
void ScrSpecial_RockSmashWildEncounter(void);
|
||||
bool8 SweetScentWildEncounter(void);
|
||||
bool8 DoesCurrentMapHaveFishingMons(void);
|
||||
void FishingWildEncounter(u8 rod);
|
||||
|
@ -21,12 +21,11 @@
|
||||
#include "field_message_box.h"
|
||||
#include "script_menu.h"
|
||||
#include "trader.h"
|
||||
#include "m4a.h"
|
||||
#include "constants/mauville_old_man.h"
|
||||
|
||||
#define CHAR_SONG_WORD_SEPARATOR 0x37
|
||||
|
||||
extern struct MusicPlayerInfo gMPlayInfo_SE2;
|
||||
|
||||
static void InitGiddyTaleList(void);
|
||||
static void StartBardSong(bool8 useTemporaryLyrics);
|
||||
static void Task_BardSong(u8 taskId);
|
||||
@ -136,30 +135,25 @@ void SetMauvilleOldMan(void)
|
||||
SetupGiddy();
|
||||
break;
|
||||
}
|
||||
ScrSpecial_SetMauvilleOldManObjEventGfx();
|
||||
SetMauvilleOldManObjEventGfx();
|
||||
}
|
||||
|
||||
u8 GetCurrentMauvilleOldMan(void)
|
||||
{
|
||||
struct MauvilleManCommon *common = &gSaveBlock1Ptr->oldMan.common;
|
||||
|
||||
return common->id;
|
||||
return gSaveBlock1Ptr->oldMan.common.id;
|
||||
}
|
||||
|
||||
void ScrSpecial_GetCurrentMauvilleMan(void)
|
||||
void Script_GetCurrentMauvilleMan(void)
|
||||
{
|
||||
gSpecialVar_Result = GetCurrentMauvilleOldMan();
|
||||
}
|
||||
|
||||
void ScrSpecial_HasBardSongBeenChanged(void)
|
||||
void HasBardSongBeenChanged(void)
|
||||
{
|
||||
u16 *scriptResult = &gSpecialVar_Result; // why??
|
||||
struct MauvilleManBard *bard = &gSaveBlock1Ptr->oldMan.bard;
|
||||
|
||||
*scriptResult = bard->hasChangedSong;
|
||||
gSpecialVar_Result = (&gSaveBlock1Ptr->oldMan.bard)->hasChangedSong;
|
||||
}
|
||||
|
||||
void ScrSpecial_SaveBardSongLyrics(void)
|
||||
void SaveBardSongLyrics(void)
|
||||
{
|
||||
u16 i;
|
||||
struct MauvilleManBard *bard = &gSaveBlock1Ptr->oldMan.bard;
|
||||
@ -225,28 +219,23 @@ static void PrepareSongText(void)
|
||||
}
|
||||
}
|
||||
|
||||
void ScrSpecial_PlayBardSong(void)
|
||||
void PlayBardSong(void)
|
||||
{
|
||||
StartBardSong(gSpecialVar_0x8004);
|
||||
ScriptContext1_Stop();
|
||||
}
|
||||
|
||||
void ScrSpecial_GetHipsterSpokenFlag(void)
|
||||
void GetHipsterSpokenFlag(void)
|
||||
{
|
||||
u16 *scriptResult = &gSpecialVar_Result; // again??
|
||||
struct MauvilleManHipster *hipster = &gSaveBlock1Ptr->oldMan.hipster;
|
||||
|
||||
*scriptResult = hipster->alreadySpoken;
|
||||
gSpecialVar_Result = (&gSaveBlock1Ptr->oldMan.hipster)->alreadySpoken;
|
||||
}
|
||||
|
||||
void ScrSpecial_SetHipsterSpokenFlag(void)
|
||||
void SetHipsterSpokenFlag(void)
|
||||
{
|
||||
struct MauvilleManHipster *hipster = &gSaveBlock1Ptr->oldMan.hipster;
|
||||
|
||||
hipster->alreadySpoken = TRUE;
|
||||
(&gSaveBlock1Ptr->oldMan.hipster)->alreadySpoken = TRUE;
|
||||
}
|
||||
|
||||
void ScrSpecial_HipsterTeachWord(void)
|
||||
void HipsterTryTeachWord(void)
|
||||
{
|
||||
u16 phrase = GetNewHipsterPhraseToTeach();
|
||||
|
||||
@ -261,11 +250,11 @@ void ScrSpecial_HipsterTeachWord(void)
|
||||
}
|
||||
}
|
||||
|
||||
void ScrSpecial_GiddyShouldTellAnotherTale(void)
|
||||
void GiddyShouldTellAnotherTale(void)
|
||||
{
|
||||
struct MauvilleManGiddy *giddy = &gSaveBlock1Ptr->oldMan.giddy;
|
||||
|
||||
if (giddy->taleCounter == 10)
|
||||
if (giddy->taleCounter == GIDDY_MAX_TALES)
|
||||
{
|
||||
gSpecialVar_Result = FALSE;
|
||||
giddy->taleCounter = 0;
|
||||
@ -276,7 +265,7 @@ void ScrSpecial_GiddyShouldTellAnotherTale(void)
|
||||
}
|
||||
}
|
||||
|
||||
void ScrSpecial_GenerateGiddyLine(void)
|
||||
void GenerateGiddyLine(void)
|
||||
{
|
||||
struct MauvilleManGiddy *giddy = &gSaveBlock1Ptr->oldMan.giddy;
|
||||
|
||||
@ -300,7 +289,7 @@ void ScrSpecial_GenerateGiddyLine(void)
|
||||
}
|
||||
|
||||
if (!(Random() % 10))
|
||||
giddy->taleCounter = 10;
|
||||
giddy->taleCounter = GIDDY_MAX_TALES;
|
||||
else
|
||||
giddy->taleCounter++;
|
||||
|
||||
@ -310,7 +299,7 @@ void ScrSpecial_GenerateGiddyLine(void)
|
||||
static void InitGiddyTaleList(void)
|
||||
{
|
||||
struct MauvilleManGiddy *giddy = &gSaveBlock1Ptr->oldMan.giddy;
|
||||
u16 arr[][2] = {
|
||||
u16 wordGroupsAndCount[][2] = {
|
||||
{EC_GROUP_POKEMON, 0},
|
||||
{EC_GROUP_LIFESTYLE, 0},
|
||||
{EC_GROUP_HOBBIES, 0},
|
||||
@ -323,27 +312,25 @@ static void InitGiddyTaleList(void)
|
||||
u16 r7;
|
||||
u16 r1;
|
||||
|
||||
// Shuffle question list
|
||||
for (i = 0; i < 8; i++)
|
||||
giddy->questionList[i] = i;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
r1 = Random() % (i + 1);
|
||||
r7 = giddy->questionList[i];
|
||||
giddy->questionList[i] = giddy->questionList[r1];
|
||||
giddy->questionList[r1] = r7;
|
||||
SWAP(giddy->questionList[i], giddy->questionList[r1], r7);
|
||||
}
|
||||
|
||||
r10 = 0;
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
arr[i][1] = EasyChat_GetNumWordsInGroup(arr[i][0]);
|
||||
r10 += arr[i][1];
|
||||
wordGroupsAndCount[i][1] = EasyChat_GetNumWordsInGroup(wordGroupsAndCount[i][0]);
|
||||
r10 += wordGroupsAndCount[i][1];
|
||||
}
|
||||
|
||||
giddy->questionNum = 0;
|
||||
r7 = 0;
|
||||
for (i = 0; i < 10; i++)
|
||||
for (i = 0; i < GIDDY_MAX_TALES; i++)
|
||||
{
|
||||
r1 = Random() % 10;
|
||||
if (r1 < 3 && r7 < 8)
|
||||
@ -355,26 +342,22 @@ static void InitGiddyTaleList(void)
|
||||
{
|
||||
s16 r2 = Random() % r10;
|
||||
for (r1 = 0; i < 6; r1++)
|
||||
if ((r2 -= arr[r1][1]) <= 0)
|
||||
if ((r2 -= wordGroupsAndCount[r1][1]) <= 0)
|
||||
break;
|
||||
if (r1 == 6)
|
||||
r1 = 0;
|
||||
giddy->randomWords[i] = GetRandomEasyChatWordFromUnlockedGroup(arr[r1][0]);
|
||||
giddy->randomWords[i] = GetRandomEasyChatWordFromUnlockedGroup(wordGroupsAndCount[r1][0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
static void ResetBardFlag(void)
|
||||
{
|
||||
struct MauvilleManBard *bard = &gSaveBlock1Ptr->oldMan.bard;
|
||||
|
||||
bard->hasChangedSong = FALSE;
|
||||
(&gSaveBlock1Ptr->oldMan.bard)->hasChangedSong = FALSE;
|
||||
}
|
||||
|
||||
static void ResetHipsterFlag(void)
|
||||
{
|
||||
struct MauvilleManHipster *hipster = &gSaveBlock1Ptr->oldMan.hipster;
|
||||
|
||||
hipster->alreadySpoken = FALSE;
|
||||
(&gSaveBlock1Ptr->oldMan.hipster)->alreadySpoken = FALSE;
|
||||
}
|
||||
|
||||
static void ResetTraderFlag(void)
|
||||
@ -406,7 +389,7 @@ void ResetMauvilleOldManFlag(void)
|
||||
case MAUVILLE_MAN_GIDDY:
|
||||
break;
|
||||
}
|
||||
ScrSpecial_SetMauvilleOldManObjEventGfx();
|
||||
SetMauvilleOldManObjEventGfx();
|
||||
}
|
||||
|
||||
|
||||
@ -430,15 +413,15 @@ static void EnableTextPrinters(void)
|
||||
gDisableTextPrinters = FALSE;
|
||||
}
|
||||
|
||||
static void BardSong_DisableTextPrinters(struct TextPrinterTemplate * printer, u16 a1)
|
||||
static void DisableTextPrinters(struct TextPrinterTemplate * printer, u16 a1)
|
||||
{
|
||||
gDisableTextPrinters = TRUE;
|
||||
}
|
||||
|
||||
static void sub_8120708(const u8 * src)
|
||||
static void sub_8120708(const u8 * str)
|
||||
{
|
||||
DrawDialogueFrame(0, 0);
|
||||
AddTextPrinterParameterized(0, 1, src, 0, 1, 1, BardSong_DisableTextPrinters);
|
||||
AddTextPrinterParameterized(0, 1, str, 0, 1, 1, DisableTextPrinters);
|
||||
gDisableTextPrinters = TRUE;
|
||||
CopyWindowToVram(0, 3);
|
||||
}
|
||||
@ -548,7 +531,7 @@ static void BardSing(struct Task *task, struct BardSong *song)
|
||||
|
||||
static void Task_BardSong(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId]; // r5
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
BardSing(task, &gBardSong);
|
||||
switch (task->tState)
|
||||
@ -673,7 +656,7 @@ static void Task_BardSong(u8 taskId)
|
||||
RunTextPrintersAndIsPrinter0Active();
|
||||
}
|
||||
|
||||
void ScrSpecial_SetMauvilleOldManObjEventGfx(void)
|
||||
void SetMauvilleOldManObjEventGfx(void)
|
||||
{
|
||||
VarSet(VAR_OBJ_GFX_ID_0, OBJ_EVENT_GFX_BARD);
|
||||
}
|
||||
@ -720,7 +703,8 @@ void SanitizeMauvilleOldManForRuby(union OldMan * oldMan)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8120C0C(union OldMan * oldMan, u32 r8, u32 r7, u32 r3)
|
||||
// Unused
|
||||
static void SetMauvilleOldManLanguage(union OldMan * oldMan, u32 language1, u32 language2, u32 language3)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@ -733,13 +717,9 @@ void sub_8120C0C(union OldMan * oldMan, u32 r8, u32 r7, u32 r3)
|
||||
for (i = 0; i < NUM_TRADER_ITEMS; i++)
|
||||
{
|
||||
if (IsStringJapanese(trader->playerNames[i]))
|
||||
{
|
||||
trader->language[i] = r8;
|
||||
}
|
||||
trader->language[i] = language1;
|
||||
else
|
||||
{
|
||||
trader->language[i] = r7;
|
||||
}
|
||||
trader->language[i] = language2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -750,13 +730,9 @@ void sub_8120C0C(union OldMan * oldMan, u32 r8, u32 r7, u32 r3)
|
||||
for (i = 0; i < NUM_STORYTELLER_TALES; i++)
|
||||
{
|
||||
if (IsStringJapanese(storyteller->trainerNames[i]))
|
||||
{
|
||||
storyteller->language[i] = r8;
|
||||
}
|
||||
storyteller->language[i] = language1;
|
||||
else
|
||||
{
|
||||
storyteller->language[i] = r7;
|
||||
}
|
||||
storyteller->language[i] = language2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -764,30 +740,30 @@ void sub_8120C0C(union OldMan * oldMan, u32 r8, u32 r7, u32 r3)
|
||||
{
|
||||
struct MauvilleManBard * bard = &oldMan->bard;
|
||||
|
||||
if (r3 == LANGUAGE_JAPANESE)
|
||||
bard->language = r8;
|
||||
if (language3 == LANGUAGE_JAPANESE)
|
||||
bard->language = language1;
|
||||
else
|
||||
bard->language = r7;
|
||||
bard->language = language2;
|
||||
}
|
||||
break;
|
||||
case MAUVILLE_MAN_HIPSTER:
|
||||
{
|
||||
struct MauvilleManHipster * hipster = &oldMan->hipster;
|
||||
|
||||
if (r3 == LANGUAGE_JAPANESE)
|
||||
hipster->language = r8;
|
||||
if (language3 == LANGUAGE_JAPANESE)
|
||||
hipster->language = language1;
|
||||
else
|
||||
hipster->language = r7;
|
||||
hipster->language = language2;
|
||||
}
|
||||
break;
|
||||
case MAUVILLE_MAN_GIDDY:
|
||||
{
|
||||
struct MauvilleManGiddy * giddy = &oldMan->giddy;
|
||||
|
||||
if (r3 == LANGUAGE_JAPANESE)
|
||||
giddy->language = r8;
|
||||
if (language3 == LANGUAGE_JAPANESE)
|
||||
giddy->language = language1;
|
||||
else
|
||||
giddy->language = r7;
|
||||
giddy->language = language2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -1260,9 +1236,8 @@ static void ScrambleStatList(u8 * arr, s32 count)
|
||||
{
|
||||
u32 a = Random() % count;
|
||||
u32 b = Random() % count;
|
||||
u8 temp = arr[a];
|
||||
arr[a] = arr[b];
|
||||
arr[b] = temp;
|
||||
u8 temp;
|
||||
SWAP(arr[a], arr[b], temp);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1379,38 +1354,38 @@ static void Task_StoryListMenu(u8 taskId)
|
||||
}
|
||||
|
||||
// Sets gSpecialVar_Result to TRUE if player selected a story
|
||||
void ScrSpecial_StorytellerStoryListMenu(void)
|
||||
void StorytellerStoryListMenu(void)
|
||||
{
|
||||
CreateTask(Task_StoryListMenu, 80);
|
||||
}
|
||||
|
||||
void ScrSpecial_StorytellerDisplayStory(void)
|
||||
void Script_StorytellerDisplayStory(void)
|
||||
{
|
||||
StorytellerDisplayStory(sSelectedStory);
|
||||
}
|
||||
|
||||
u8 ScrSpecial_StorytellerGetFreeStorySlot(void)
|
||||
u8 StorytellerGetFreeStorySlot(void)
|
||||
{
|
||||
sStorytellerPtr = &gSaveBlock1Ptr->oldMan.storyteller;
|
||||
return GetFreeStorySlot();
|
||||
}
|
||||
|
||||
// Returns TRUE if stat has increased
|
||||
bool8 ScrSpecial_StorytellerUpdateStat(void)
|
||||
bool8 StorytellerUpdateStat(void)
|
||||
{
|
||||
u8 r4;
|
||||
u8 stat;
|
||||
sStorytellerPtr = &gSaveBlock1Ptr->oldMan.storyteller;
|
||||
r4 = sStorytellerPtr->gameStatIDs[sSelectedStory];
|
||||
stat = sStorytellerPtr->gameStatIDs[sSelectedStory];
|
||||
|
||||
if (HasTrainerStatIncreased(sSelectedStory) == TRUE)
|
||||
{
|
||||
StorytellerRecordNewStat(sSelectedStory, r4);
|
||||
StorytellerRecordNewStat(sSelectedStory, stat);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrSpecial_HasStorytellerAlreadyRecorded(void)
|
||||
bool8 HasStorytellerAlreadyRecorded(void)
|
||||
{
|
||||
sStorytellerPtr = &gSaveBlock1Ptr->oldMan.storyteller;
|
||||
|
||||
@ -1420,7 +1395,7 @@ bool8 ScrSpecial_HasStorytellerAlreadyRecorded(void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 ScrSpecial_StorytellerInitializeRandomStat(void)
|
||||
bool8 Script_StorytellerInitializeRandomStat(void)
|
||||
{
|
||||
sStorytellerPtr = &gSaveBlock1Ptr->oldMan.storyteller;
|
||||
return StorytellerInitializeRandomStat();
|
||||
|
12
src/trader.c
12
src/trader.c
@ -130,13 +130,13 @@ void Task_HandleGetDecorationMenuInput(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
void ScrSpecial_GetTraderTradedFlag(void)
|
||||
void GetTraderTradedFlag(void)
|
||||
{
|
||||
struct MauvilleOldManTrader *trader = &gSaveBlock1Ptr->oldMan.trader;
|
||||
gSpecialVar_Result = trader->alreadyTraded;
|
||||
}
|
||||
|
||||
void ScrSpecial_DoesPlayerHaveNoDecorations(void)
|
||||
void DoesPlayerHaveNoDecorations(void)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
@ -151,7 +151,7 @@ void ScrSpecial_DoesPlayerHaveNoDecorations(void)
|
||||
gSpecialVar_Result = TRUE;
|
||||
}
|
||||
|
||||
void ScrSpecial_IsDecorationFull(void)
|
||||
void IsDecorationCategoryFull(void)
|
||||
{
|
||||
gSpecialVar_Result = FALSE;
|
||||
if (gDecorations[gSpecialVar_0x8004].category != gDecorations[gSpecialVar_0x8006].category
|
||||
@ -162,7 +162,7 @@ void ScrSpecial_IsDecorationFull(void)
|
||||
}
|
||||
}
|
||||
|
||||
void ScrSpecial_TraderMenuGiveDecoration(void)
|
||||
void TraderShowDecorationMenu(void)
|
||||
{
|
||||
CreateTask(ShowDecorationCategoriesWindow, 0);
|
||||
}
|
||||
@ -190,7 +190,7 @@ void ExitTraderMenu(u8 taskId)
|
||||
EnableBothScriptContexts();
|
||||
}
|
||||
|
||||
void ScrSpecial_TraderDoDecorationTrade(void)
|
||||
void TraderDoDecorationTrade(void)
|
||||
{
|
||||
struct MauvilleOldManTrader *trader = &gSaveBlock1Ptr->oldMan.trader;
|
||||
|
||||
@ -202,7 +202,7 @@ void ScrSpecial_TraderDoDecorationTrade(void)
|
||||
trader->alreadyTraded = TRUE;
|
||||
}
|
||||
|
||||
void ScrSpecial_TraderMenuGetDecoration(void)
|
||||
void TraderMenuGetDecoration(void)
|
||||
{
|
||||
u8 taskId = CreateTask(Task_HandleGetDecorationMenuInput, 0);
|
||||
CreateAvailableDecorationsMenu(taskId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user