Document mauville_man.inc

This commit is contained in:
GriffinR 2019-10-20 16:11:07 -04:00 committed by huderlem
parent 2f36bd62d7
commit 973e6f9667
19 changed files with 731 additions and 541 deletions

View File

@ -25,6 +25,7 @@
#include "constants/lilycove_lady.h"
#include "constants/map_scripts.h"
#include "constants/maps.h"
#include "constants/mauville_old_man.h"
#include "constants/metatile_labels.h"
#include "constants/moves.h"
#include "constants/party_menu.h"

View File

@ -37,7 +37,7 @@
"movement_range_y": 0,
"trainer_type": "0",
"trainer_sight_or_berry_tree_id": "0",
"script": "MauvilleCity_PokemonCenter_1F_EventScript_28E066",
"script": "MauvilleCity_PokemonCenter_1F_EventScript_MauvilleOldMan",
"flag": "0"
},
{

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,4 @@
@ Only contains a portion of the mauville_man text. The rest is in scripts/mauville_man.inc
gText_SoPretty:: @ 8294295
.string " so pretty!$"

View File

@ -1095,6 +1095,7 @@
#define EC_WORD_OLD (EC_GROUP_TRENDY_SAYING << 9) | 0x1e
#define EC_WORD_YOUNG (EC_GROUP_TRENDY_SAYING << 9) | 0x1f
#define EC_WORD_UGLY (EC_GROUP_TRENDY_SAYING << 9) | 0x20
#define NUM_ADDITIONAL_PHRASES 33
#define EC_POKEMON(mon) ((EC_GROUP_POKEMON << 9) | SPECIES_##mon)
#define EC_POKEMON2(mon) ((EC_GROUP_POKEMON_2 << 9) | SPECIES_##mon)

View File

@ -67,6 +67,10 @@
#define FEMALE 1
#define GENDER_COUNT 2
#define BARD_SONG_LENGTH 6
#define NUM_STORYTELLER_TALES 4
#define NUM_TRADER_ITEMS 4
#define OPTIONS_BUTTON_MODE_NORMAL 0
#define OPTIONS_BUTTON_MODE_LR 1
#define OPTIONS_BUTTON_MODE_L_EQUALS_A 2

View File

@ -1,10 +0,0 @@
#ifndef GUARD_CONSTANTS_MAUVILLE_MAN_H
#define GUARD_CONSTANTS_MAUVILLE_MAN_H
#define MAUVILLE_MAN_BARD 0
#define MAUVILLE_MAN_HIPSTER 1
#define MAUVILLE_MAN_TRADER 2
#define MAUVILLE_MAN_STORYTELLER 3
#define MAUVILLE_MAN_GIDDY 4
#endif // GUARD_CONSTANTS_MAUVILLE_MAN_H

View File

@ -0,0 +1,12 @@
#ifndef GUARD_CONSTANTS_MAUVILLE_OLD_MAN_H
#define GUARD_CONSTANTS_MAUVILLE_OLD_MAN_H
#define MAUVILLE_MAN_BARD 0
#define MAUVILLE_MAN_HIPSTER 1
#define MAUVILLE_MAN_TRADER 2
#define MAUVILLE_MAN_STORYTELLER 3
#define MAUVILLE_MAN_GIDDY 4
#define MAUVILLE_MAN_UNUSED1 5
#define MAUVILLE_MAN_UNUSED2 6
#endif // GUARD_CONSTANTS_MAUVILLE_OLD_MAN_H

View File

@ -129,11 +129,11 @@ void InitializeEasyChatWordArray(u16 *words, u16 length);
u8 *ConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 columns, u16 rows);
bool8 ECWord_CheckIfOutsideOfValidRange(u16 word);
u16 sub_811EE38(u16 group);
u16 sub_811F01C(void);
u16 GetNewHipsterPhraseToTeach(void);
u16 EasyChat_GetNumWordsInGroup(u8);
u16 sub_811EE90(u16);
void DoEasyChatScreen(u8 type, u16 *words, MainCallback callback, u8 displayedPersonType);
void sub_811F8BC(void);
void sub_811EFC0(u8 additionalPhraseId);
void UnlockAdditionalPhrase(u8 additionalPhraseId);
#endif // GUARD_EASYCHAT_H

View File

@ -407,115 +407,115 @@ extern const u8 gMauvilleManText_WhenYouSeeTheSettingSunDoesIt[];
extern const u8 gMauvilleManText_LyingBackInTheGreenGrass[];
extern const u8 gMauvilleManText_SecretBasesAreSoWonderful[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28E930[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28E947[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28E956[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28E9D7[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28E9EF[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28E9FE[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EA7D[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EA98[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EAA8[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EB19[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EB31[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EB3E[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EBB5[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EBCD[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EBDD[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EC60[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EC79[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EC81[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28ED04[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28ED21[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28ED30[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EDA1[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EDB5[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EDCF[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EE45[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EE5D[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EE6A[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EEDD[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EEF1[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EF01[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EF73[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EF95[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28EFAA[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F045[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F05A[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F071[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F0F3[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F10D[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F125[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F1BE[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F1D5[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F1DE[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F24F[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F269[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F277[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F2FC[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F314[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F32A[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F3AD[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F3C6[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F3D2[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F44B[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F461[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F47C[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F50C[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F51B[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F538[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F5BE[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F5D1[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F5F2[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F678[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F694[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F6B4[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F751[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F76A[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F776[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F7F6[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F811[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F822[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F89C[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F8AF[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F8BC[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F92F[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F941[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F949[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F9D1[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F9EA[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28F9FD[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FA81[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FA99[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FAA7[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FB1D[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FB35[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FB47[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FBC4[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FBD9[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FBEA[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FC6B[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FC85[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FC98[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FD1D[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FD35[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FD40[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FDA2[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FDBD[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FDCE[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FE57[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FE72[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FE88[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FF0C[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FF27[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FF44[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FFDD[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_28FFFA[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_29000D[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_290097[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_2900B5[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_2900CB[];
// mauville old man storyteller
extern const u8 MauvilleCity_PokemonCenter_1F_Text_SavedGameTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_SavedGameAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_SavedGameStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_TrendsStartedTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_TrendsStartedAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_TrendsStartedStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_BerriesPlantedTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_BerriesPlantedAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_BerriesPlantedStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_BikeTradesTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_BikeTradesAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_BikeTradesStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_InterviewsTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_InterviewsAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_InterviewsStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_TrainerBattlesTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_TrainerBattlesAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_TrainerBattlesStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_PokemonCaughtTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_PokemonCaughtAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_PokemonCaughtStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_FishingPokemonCaughtTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_FishingPokemonCaughtAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_FishingPokemonCaughtStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_EggsHatchedTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_EggsHatchedAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_EggsHatchedStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_PokemonEvolvedTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_PokemonEvolvedAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_PokemonEvolvedStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedPokemonCenterTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedPokemonCenterAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedPokemonCenterStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_RestedAtHomeTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_RestedAtHomeAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_RestedAtHomeStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_SafariGamesTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_SafariGamesAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_SafariGamesStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedCutTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedCutAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedCutStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedRockSmashTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedRockSmashAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedRockSmashStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_MovedBasesTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_MovedBasesAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_MovedBasesStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedSplashTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedSplashAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedSplashStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedStruggleTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedStruggleAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedStruggleStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_SlotJackpotsTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_SlotJackpotsAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_SlotJackpotsStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_RouletteWinsTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_RouletteWinsAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_RouletteWinsStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_BattleTowerChallengesTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_BattleTowerChallengesAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_BattleTowerChallengesStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_MadePokeblocksTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_MadePokeblocksAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_MadePokeblocksStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_EnteredContestsTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_EnteredContestsAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_EnteredContestsStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_WonContestsTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_WonContestsAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_WonContestsStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_TimesShoppedTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_TimesShoppedAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_TimesShoppedStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedItemFinderTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedItemFinderAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedItemFinderStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_TimesRainedTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_TimesRainedAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_TimesRainedStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_CheckedPokedexTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_CheckedPokedexAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_CheckedPokedexStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_ReceivedRibbonsTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_ReceivedRibbonsAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_ReceivedRibbonsStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_LedgesJumpedTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_LedgesJumpedAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_LedgesJumpedStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_TVWatchedTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_TVWatchedAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_TVWatchedStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_CheckedClockTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_CheckedClockAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_CheckedClockStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_WonLotteryTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_WonLotteryAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_WonLotteryStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedDaycareTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedDaycareAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_UsedDaycareStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_RodeCableCarTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_RodeCableCarAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_RodeCableCarStory[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_HotSpringsTitle[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_HotSpringsAction[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_HotSpringsStory[];
extern const u8 EventScript_PlayerPCMale[];
extern const u8 EventScript_PlayerPCFemale[];

View File

@ -594,9 +594,9 @@ struct MauvilleManCommon
struct MauvilleManBard
{
/*0x00*/ u8 id;
/*0x02*/ u16 songLyrics[6];
/*0x0E*/ u16 temporaryLyrics[6];
/*0x1A*/ u8 playerName[8];
/*0x02*/ u16 songLyrics[BARD_SONG_LENGTH];
/*0x0E*/ u16 temporaryLyrics[BARD_SONG_LENGTH];
/*0x1A*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
/*0x22*/ u8 filler_2DB6[0x3];
/*0x25*/ u8 playerTrainerId[TRAINER_ID_LENGTH];
/*0x29*/ bool8 hasChangedSong;
@ -608,10 +608,10 @@ struct MauvilleManStoryteller
u8 id;
bool8 alreadyRecorded;
u8 filler2[2];
u8 gameStatIDs[4];
u8 trainerNames[4][7];
u8 statValues[4][4];
u8 language[4];
u8 gameStatIDs[NUM_STORYTELLER_TALES];
u8 trainerNames[NUM_STORYTELLER_TALES][PLAYER_NAME_LENGTH];
u8 statValues[NUM_STORYTELLER_TALES][4];
u8 language[NUM_STORYTELLER_TALES];
};
struct MauvilleManGiddy
@ -634,10 +634,10 @@ struct MauvilleManHipster
struct MauvilleOldManTrader
{
u8 id;
u8 decorIds[4];
u8 playerNames[4][11];
u8 decorIds[NUM_TRADER_ITEMS];
u8 playerNames[NUM_TRADER_ITEMS][11];
u8 alreadyTraded;
u8 language[4];
u8 language[NUM_TRADER_ITEMS];
};
typedef union OldMan

View File

@ -1,16 +1,6 @@
#ifndef GUARD_MAUVILLE_OLD_MAN_H
#define GUARD_MAUVILLE_OLD_MAN_H
enum MauvilleOldManType
{
MAUVILLE_MAN_BARD,
MAUVILLE_MAN_HIPSTER,
MAUVILLE_MAN_TRADER,
MAUVILLE_MAN_STORYTELLER,
MAUVILLE_MAN_GIDDY
};
extern struct BardSong gBardSong;
void SetMauvilleOldMan(void);

View File

@ -489,11 +489,11 @@ const struct EventObjectGraphicsInfo *const gEventObjectGraphicsInfoPointers[] =
};
const struct EventObjectGraphicsInfo *const gMauvilleOldManGraphicsInfoPointers[] = {
&gEventObjectGraphicsInfo_Bard,
&gEventObjectGraphicsInfo_Hipster,
&gEventObjectGraphicsInfo_Trader,
&gEventObjectGraphicsInfo_Storyteller,
&gEventObjectGraphicsInfo_Giddy,
&gEventObjectGraphicsInfo_UnusedMauvilleOldMan1,
&gEventObjectGraphicsInfo_UnusedMauvilleOldMan2,
[MAUVILLE_MAN_BARD] = &gEventObjectGraphicsInfo_Bard,
[MAUVILLE_MAN_HIPSTER] = &gEventObjectGraphicsInfo_Hipster,
[MAUVILLE_MAN_TRADER] = &gEventObjectGraphicsInfo_Trader,
[MAUVILLE_MAN_STORYTELLER] = &gEventObjectGraphicsInfo_Storyteller,
[MAUVILLE_MAN_GIDDY] = &gEventObjectGraphicsInfo_Giddy,
[MAUVILLE_MAN_UNUSED1] = &gEventObjectGraphicsInfo_UnusedMauvilleOldMan1,
[MAUVILLE_MAN_UNUSED2] = &gEventObjectGraphicsInfo_UnusedMauvilleOldMan2,
};

View File

@ -31,6 +31,7 @@
#include "constants/event_objects.h"
#include "constants/flags.h"
#include "constants/lilycove_lady.h"
#include "constants/mauville_old_man.h"
#include "constants/songs.h"
#include "constants/species.h"
#include "constants/rgb.h"
@ -220,7 +221,7 @@ static void sub_811E0EC(s8, s8);
static void sub_811E1A4(s8, s8);
static void sub_811E2DC(struct Sprite *);
static void sub_811E34C(u8, u8);
static bool8 sub_811F0F8(void);
static bool8 EasyChatIsNationalPokedexEnabled(void);
static u16 sub_811F108(void);
static void sub_811F2D4(void);
static void sub_811F46C(void);
@ -1263,7 +1264,7 @@ void ShowEasyChatScreen(void)
break;
case EASY_CHAT_TYPE_BARD_SONG:
bard = &gSaveBlock1Ptr->oldMan.bard;
for (i = 0; i < 6; i ++)
for (i = 0; i < BARD_SONG_LENGTH; i ++)
bard->temporaryLyrics[i] = bard->songLyrics[i];
words = bard->temporaryLyrics;
@ -4809,7 +4810,7 @@ static void sub_811E948(void)
PutWindowTilemap(windowId);
}
static bool8 sub_811EA28(u8 groupId)
static bool8 IsEasyChatGroupUnlocked(u8 groupId)
{
switch (groupId)
{
@ -4820,7 +4821,7 @@ static bool8 sub_811EA28(u8 groupId)
case EC_GROUP_MOVE_2:
return FlagGet(FLAG_SYS_GAME_CLEAR);
case EC_GROUP_POKEMON_2:
return sub_811F0F8();
return EasyChatIsNationalPokedexEnabled();
default:
return TRUE;
}
@ -4831,7 +4832,7 @@ u16 EasyChat_GetNumWordsInGroup(u8 groupId)
if (groupId == EC_GROUP_POKEMON)
return GetNationalPokedexCount(FLAG_GET_SEEN);
if (sub_811EA28(groupId))
if (IsEasyChatGroupUnlocked(groupId))
return gEasyChatGroups[groupId].numEnabledWords;
return 0;
@ -5071,7 +5072,7 @@ u16 sub_811EE38(u16 groupId)
u16 sub_811EE90(u16 groupId)
{
if (!sub_811EA28(groupId))
if (!IsEasyChatGroupUnlocked(groupId))
return 0xFFFF;
if (groupId == EC_GROUP_POKEMON)
@ -5129,16 +5130,16 @@ void sub_811EF6C(void)
CopyEasyChatWord(gStringVar2, easyChatWord);
}
static bool8 sub_811EF98(u8 additionalPhraseId)
static bool8 IsAdditionalPhraseUnlocked(u8 additionalPhraseId)
{
int byteOffset = additionalPhraseId / 8;
int shift = additionalPhraseId % 8;
return (gSaveBlock1Ptr->additionalPhrases[byteOffset] >> shift) & 1;
}
void sub_811EFC0(u8 additionalPhraseId)
void UnlockAdditionalPhrase(u8 additionalPhraseId)
{
if (additionalPhraseId < 33)
if (additionalPhraseId < NUM_ADDITIONAL_PHRASES)
{
int byteOffset = additionalPhraseId / 8;
int shift = additionalPhraseId % 8;
@ -5146,32 +5147,32 @@ void sub_811EFC0(u8 additionalPhraseId)
}
}
u8 sub_811EFF0(void)
static u8 GetNumAdditionalPhrasesUnlocked(void)
{
u8 i;
u8 numAdditionalPhrasesUnlocked;
for (i = 0, numAdditionalPhrasesUnlocked = 0; i < 33; i++)
for (i = 0, numAdditionalPhrasesUnlocked = 0; i < NUM_ADDITIONAL_PHRASES; i++)
{
if (sub_811EF98(i))
if (IsAdditionalPhraseUnlocked(i))
numAdditionalPhrasesUnlocked++;
}
return numAdditionalPhrasesUnlocked;
}
u16 sub_811F01C(void)
u16 GetNewHipsterPhraseToTeach(void)
{
u16 i;
u16 additionalPhraseId;
u8 numAdditionalPhrasesUnlocked = sub_811EFF0();
if (numAdditionalPhrasesUnlocked == 33)
u8 numAdditionalPhrasesUnlocked = GetNumAdditionalPhrasesUnlocked();
if (numAdditionalPhrasesUnlocked == NUM_ADDITIONAL_PHRASES)
return 0xFFFF;
additionalPhraseId = Random() % (33 - numAdditionalPhrasesUnlocked);
for (i = 0; i < 33; i++)
additionalPhraseId = Random() % (NUM_ADDITIONAL_PHRASES - numAdditionalPhrasesUnlocked);
for (i = 0; i < NUM_ADDITIONAL_PHRASES; i++)
{
if (!sub_811EF98(i))
if (!IsAdditionalPhraseUnlocked(i))
{
if (additionalPhraseId)
{
@ -5179,7 +5180,7 @@ u16 sub_811F01C(void)
}
else
{
sub_811EFC0(i);
UnlockAdditionalPhrase(i);
return EC_WORD(EC_GROUP_TRENDY_SAYING, i);
}
}
@ -5188,17 +5189,18 @@ u16 sub_811F01C(void)
return 0xFFFF;
}
u16 sub_811F090(void)
// Unused
u16 GetRandomTaughtHipsterPhrase(void)
{
u16 i;
u16 additionalPhraseId = sub_811EFF0();
u16 additionalPhraseId = GetNumAdditionalPhrasesUnlocked();
if (additionalPhraseId == 0)
return 0xFFFF;
additionalPhraseId = Random() % additionalPhraseId;
for (i = 0; i < 33; i++)
for (i = 0; i < NUM_ADDITIONAL_PHRASES; i++)
{
if (sub_811EF98(i))
if (IsAdditionalPhraseUnlocked(i))
{
if (additionalPhraseId)
additionalPhraseId--;
@ -5210,7 +5212,7 @@ u16 sub_811F090(void)
return 0xFFFF;
}
static bool8 sub_811F0F8(void)
static bool8 EasyChatIsNationalPokedexEnabled(void)
{
return IsNationalPokedexEnabled();
}
@ -5497,7 +5499,7 @@ static bool8 sub_811F764(u16 wordIndex, u8 groupId)
case EC_GROUP_MOVE_2:
return TRUE;
case EC_GROUP_TRENDY_SAYING:
return sub_811EF98(wordIndex);
return IsAdditionalPhraseUnlocked(wordIndex);
default:
return gEasyChatGroups[groupId].wordData.words[wordIndex].enabled;
}
@ -5545,7 +5547,7 @@ bool32 sub_811F8D8(int easyChatWord)
int groupId = EC_GROUP(easyChatWord);
int mask = 0x7F;
int index = EC_INDEX(easyChatWord);
if (!sub_811EA28(groupId & mask))
if (!IsEasyChatGroupUnlocked(groupId & mask))
return FALSE;
else
return sub_811F764(index, groupId & mask);

View File

@ -26,6 +26,7 @@
#include "constants/event_objects.h"
#include "constants/field_effects.h"
#include "constants/items.h"
#include "constants/mauville_old_man.h"
// this file was known as evobjmv.c in Game Freak's original source

View File

@ -22,6 +22,7 @@
#include "field_message_box.h"
#include "script_menu.h"
#include "trader.h"
#include "constants/mauville_old_man.h"
#define CHAR_SONG_WORD_SEPARATOR 0x37
@ -41,7 +42,7 @@ static EWRAM_DATA u16 sUnknownBardRelated = 0;
static EWRAM_DATA struct MauvilleManStoryteller * sStorytellerPtr = NULL;
static EWRAM_DATA u8 sStorytellerWindowId = 0;
static const u16 sDefaultBardSongLyrics[6] = {
static const u16 sDefaultBardSongLyrics[BARD_SONG_LENGTH] = {
EC_WORD_SHAKE,
EC_WORD_IT,
EC_WORD_DO,
@ -80,7 +81,7 @@ static void SetupBard(void)
bard->id = MAUVILLE_MAN_BARD;
bard->hasChangedSong = FALSE;
bard->language = gGameLanguage;
for (i = 0; i < 6; i++)
for (i = 0; i < BARD_SONG_LENGTH; i++)
bard->songLyrics[i] = sDefaultBardSongLyrics[i];
}
@ -166,10 +167,10 @@ void ScrSpecial_SaveBardSongLyrics(void)
StringCopy(bard->playerName, gSaveBlock2Ptr->playerName);
for (i = 0; i < 4; i++)
for (i = 0; i < TRAINER_ID_LENGTH; i++)
bard->playerTrainerId[i] = gSaveBlock2Ptr->playerTrainerId[i];
for (i = 0; i < 6; i++)
for (i = 0; i < BARD_SONG_LENGTH; i++)
bard->songLyrics[i] = bard->temporaryLyrics[i];
bard->hasChangedSong = TRUE;
@ -248,15 +249,15 @@ void ScrSpecial_SetHipsterSpokenFlag(void)
void ScrSpecial_HipsterTeachWord(void)
{
u16 var = sub_811F01C();
u16 phrase = GetNewHipsterPhraseToTeach();
if (var == 0xFFFF)
if (phrase == 0xFFFF)
{
gSpecialVar_Result = FALSE;
}
else
{
CopyEasyChatWord(gStringVar1, var);
CopyEasyChatWord(gStringVar1, phrase);
gSpecialVar_Result = TRUE;
}
}
@ -458,7 +459,7 @@ static void BardSing(struct Task *task, struct BardSong *song)
lyrics = bard->songLyrics;
else
lyrics = bard->temporaryLyrics;
for (i = 0; i < 6; i++)
for (i = 0; i < BARD_SONG_LENGTH; i++)
song->lyrics[i] = lyrics[i];
song->currWord = 0;
}
@ -690,7 +691,7 @@ void sub_8120B70(union OldMan * oldMan)
case MAUVILLE_MAN_TRADER:
{
struct MauvilleOldManTrader * trader = &oldMan->trader;
for (i = 0; i < 4; i++)
for (i = 0; i < NUM_TRADER_ITEMS; i++)
{
if (trader->language[i] == LANGUAGE_JAPANESE)
{
@ -702,17 +703,17 @@ void sub_8120B70(union OldMan * oldMan)
case MAUVILLE_MAN_STORYTELLER:
{
struct MauvilleManStoryteller * storyteller = &oldMan->storyteller;
for (i = 0; i < 4; i++)
for (i = 0; i < NUM_STORYTELLER_TALES; i++)
{
if (storyteller->gameStatIDs[i] != 0)
{
memcpy(sp00, storyteller->trainerNames[i], 7);
sp00[7] = EOS;
memcpy(sp00, storyteller->trainerNames[i], PLAYER_NAME_LENGTH);
sp00[PLAYER_NAME_LENGTH] = EOS;
if (IsStringJapanese(sp00))
{
memset(sp00, CHAR_SPACE, 8);
memset(sp00, CHAR_SPACE, PLAYER_NAME_LENGTH + 1);
StringCopy(sp00, gText_Friend);
memcpy(storyteller->trainerNames[i], sp00, 7);
memcpy(storyteller->trainerNames[i], sp00, PLAYER_NAME_LENGTH);
storyteller->language[i] = GAME_LANGUAGE;
}
}
@ -732,7 +733,7 @@ void sub_8120C0C(union OldMan * oldMan, u32 r8, u32 r7, u32 r3)
{
struct MauvilleOldManTrader * trader = &oldMan->trader;
for (i = 0; i < 4; i++)
for (i = 0; i < NUM_TRADER_ITEMS; i++)
{
if (IsStringJapanese(trader->playerNames[i]))
{
@ -749,7 +750,7 @@ void sub_8120C0C(union OldMan * oldMan, u32 r8, u32 r7, u32 r3)
{
struct MauvilleManStoryteller * storyteller = &oldMan->storyteller;
for (i = 0; i < 4; i++)
for (i = 0; i < NUM_STORYTELLER_TALES; i++)
{
if (IsStringJapanese(storyteller->trainerNames[i]))
{
@ -803,12 +804,12 @@ void SanitizeReceivedEmeraldOldMan(union OldMan * oldMan, u32 version, u32 langu
{
struct MauvilleManStoryteller * storyteller = &oldMan->storyteller;
for (i = 0; i < 4; i++)
for (i = 0; i < NUM_STORYTELLER_TALES; i++)
{
if (storyteller->gameStatIDs[i] != 0)
{
memcpy(sp00, storyteller->trainerNames[i], 7);
sp00[7] = EOS;
memcpy(sp00, storyteller->trainerNames[i], PLAYER_NAME_LENGTH);
sp00[PLAYER_NAME_LENGTH] = EOS;
if (IsStringJapanese(sp00))
storyteller->language[i] = LANGUAGE_JAPANESE;
else
@ -831,7 +832,7 @@ void SanitizeReceivedRubyOldMan(union OldMan * oldMan, u32 version, u32 language
if (isRuby)
{
for (i = 0; i < 4; i++)
for (i = 0; i < NUM_TRADER_ITEMS; i++)
{
u8 * str = trader->playerNames[i];
if (str[0] == EXT_CTRL_CODE_BEGIN && str[1] == EXT_CTRL_CODE_JPN)
@ -845,7 +846,7 @@ void SanitizeReceivedRubyOldMan(union OldMan * oldMan, u32 version, u32 language
}
else
{
for (i = 0; i < 4; i++)
for (i = 0; i < NUM_TRADER_ITEMS; i++)
{
if (trader->language[i] == LANGUAGE_JAPANESE)
{
@ -863,7 +864,7 @@ void SanitizeReceivedRubyOldMan(union OldMan * oldMan, u32 version, u32 language
if (isRuby)
{
for (i = 0; i < 4; i++)
for (i = 0; i < NUM_STORYTELLER_TALES; i++)
{
if (storyteller->gameStatIDs[i] != 0)
storyteller->language[i] = language;
@ -914,42 +915,223 @@ struct Story
};
static const struct Story sStorytellerStories[] = {
{GAME_STAT_NUM_UNION_ROOM_BATTLES, 1, MauvilleCity_PokemonCenter_1F_Text_28E930, MauvilleCity_PokemonCenter_1F_Text_28E947, MauvilleCity_PokemonCenter_1F_Text_28E956},
{GAME_STAT_STARTED_TRENDS, 1, MauvilleCity_PokemonCenter_1F_Text_28E9D7, MauvilleCity_PokemonCenter_1F_Text_28E9EF, MauvilleCity_PokemonCenter_1F_Text_28E9FE},
{GAME_STAT_PLANTED_BERRIES, 1, MauvilleCity_PokemonCenter_1F_Text_28EA7D, MauvilleCity_PokemonCenter_1F_Text_28EA98, MauvilleCity_PokemonCenter_1F_Text_28EAA8},
{GAME_STAT_TRADED_BIKES, 1, MauvilleCity_PokemonCenter_1F_Text_28EB19, MauvilleCity_PokemonCenter_1F_Text_28EB31, MauvilleCity_PokemonCenter_1F_Text_28EB3E},
{GAME_STAT_GOT_INTERVIEWED, 1, MauvilleCity_PokemonCenter_1F_Text_28EBB5, MauvilleCity_PokemonCenter_1F_Text_28EBCD, MauvilleCity_PokemonCenter_1F_Text_28EBDD},
{GAME_STAT_TRAINER_BATTLES, 1, MauvilleCity_PokemonCenter_1F_Text_28EC60, MauvilleCity_PokemonCenter_1F_Text_28EC79, MauvilleCity_PokemonCenter_1F_Text_28EC81},
{GAME_STAT_POKEMON_CAPTURES, 1, MauvilleCity_PokemonCenter_1F_Text_28ED04, MauvilleCity_PokemonCenter_1F_Text_28ED21, MauvilleCity_PokemonCenter_1F_Text_28ED30},
{GAME_STAT_FISHING_CAPTURES, 1, MauvilleCity_PokemonCenter_1F_Text_28EDA1, MauvilleCity_PokemonCenter_1F_Text_28EDB5, MauvilleCity_PokemonCenter_1F_Text_28EDCF},
{GAME_STAT_HATCHED_EGGS, 1, MauvilleCity_PokemonCenter_1F_Text_28EE45, MauvilleCity_PokemonCenter_1F_Text_28EE5D, MauvilleCity_PokemonCenter_1F_Text_28EE6A},
{GAME_STAT_EVOLVED_POKEMON, 1, MauvilleCity_PokemonCenter_1F_Text_28EEDD, MauvilleCity_PokemonCenter_1F_Text_28EEF1, MauvilleCity_PokemonCenter_1F_Text_28EF01},
{GAME_STAT_USED_POKECENTER, 1, MauvilleCity_PokemonCenter_1F_Text_28EF73, MauvilleCity_PokemonCenter_1F_Text_28EF95, MauvilleCity_PokemonCenter_1F_Text_28EFAA},
{GAME_STAT_RESTED_AT_HOME, 1, MauvilleCity_PokemonCenter_1F_Text_28F045, MauvilleCity_PokemonCenter_1F_Text_28F05A, MauvilleCity_PokemonCenter_1F_Text_28F071},
{GAME_STAT_ENTERED_SAFARI_ZONE, 1, MauvilleCity_PokemonCenter_1F_Text_28F0F3, MauvilleCity_PokemonCenter_1F_Text_28F10D, MauvilleCity_PokemonCenter_1F_Text_28F125},
{GAME_STAT_USED_CUT, 1, MauvilleCity_PokemonCenter_1F_Text_28F1BE, MauvilleCity_PokemonCenter_1F_Text_28F1D5, MauvilleCity_PokemonCenter_1F_Text_28F1DE},
{GAME_STAT_USED_ROCK_SMASH, 1, MauvilleCity_PokemonCenter_1F_Text_28F24F, MauvilleCity_PokemonCenter_1F_Text_28F269, MauvilleCity_PokemonCenter_1F_Text_28F277},
{GAME_STAT_MOVED_SECRET_BASE, 1, MauvilleCity_PokemonCenter_1F_Text_28F2FC, MauvilleCity_PokemonCenter_1F_Text_28F314, MauvilleCity_PokemonCenter_1F_Text_28F32A},
{GAME_STAT_USED_SPLASH, 1, MauvilleCity_PokemonCenter_1F_Text_28F3AD, MauvilleCity_PokemonCenter_1F_Text_28F3C6, MauvilleCity_PokemonCenter_1F_Text_28F3D2},
{GAME_STAT_USED_STRUGGLE, 1, MauvilleCity_PokemonCenter_1F_Text_28F44B, MauvilleCity_PokemonCenter_1F_Text_28F461, MauvilleCity_PokemonCenter_1F_Text_28F47C},
{GAME_STAT_SLOT_JACKPOTS, 1, MauvilleCity_PokemonCenter_1F_Text_28F50C, MauvilleCity_PokemonCenter_1F_Text_28F51B, MauvilleCity_PokemonCenter_1F_Text_28F538},
{GAME_STAT_CONSECUTIVE_ROULETTE_WINS, 2, MauvilleCity_PokemonCenter_1F_Text_28F5BE, MauvilleCity_PokemonCenter_1F_Text_28F5D1, MauvilleCity_PokemonCenter_1F_Text_28F5F2},
{GAME_STAT_ENTERED_BATTLE_TOWER, 1, MauvilleCity_PokemonCenter_1F_Text_28F678, MauvilleCity_PokemonCenter_1F_Text_28F694, MauvilleCity_PokemonCenter_1F_Text_28F6B4},
{GAME_STAT_POKEBLOCKS, 1, MauvilleCity_PokemonCenter_1F_Text_28F751, MauvilleCity_PokemonCenter_1F_Text_28F76A, MauvilleCity_PokemonCenter_1F_Text_28F776},
{GAME_STAT_ENTERED_CONTEST, 1, MauvilleCity_PokemonCenter_1F_Text_28F7F6, MauvilleCity_PokemonCenter_1F_Text_28F811, MauvilleCity_PokemonCenter_1F_Text_28F822},
{GAME_STAT_WON_CONTEST, 1, MauvilleCity_PokemonCenter_1F_Text_28F89C, MauvilleCity_PokemonCenter_1F_Text_28F8AF, MauvilleCity_PokemonCenter_1F_Text_28F8BC},
{GAME_STAT_SHOPPED, 1, MauvilleCity_PokemonCenter_1F_Text_28F92F, MauvilleCity_PokemonCenter_1F_Text_28F941, MauvilleCity_PokemonCenter_1F_Text_28F949},
{GAME_STAT_USED_ITEMFINDER, 1, MauvilleCity_PokemonCenter_1F_Text_28F9D1, MauvilleCity_PokemonCenter_1F_Text_28F9EA, MauvilleCity_PokemonCenter_1F_Text_28F9FD},
{GAME_STAT_GOT_RAINED_ON, 1, MauvilleCity_PokemonCenter_1F_Text_28FA81, MauvilleCity_PokemonCenter_1F_Text_28FA99, MauvilleCity_PokemonCenter_1F_Text_28FAA7},
{GAME_STAT_CHECKED_POKEDEX, 1, MauvilleCity_PokemonCenter_1F_Text_28FB1D, MauvilleCity_PokemonCenter_1F_Text_28FB35, MauvilleCity_PokemonCenter_1F_Text_28FB47},
{GAME_STAT_RECEIVED_RIBBONS, 1, MauvilleCity_PokemonCenter_1F_Text_28FBC4, MauvilleCity_PokemonCenter_1F_Text_28FBD9, MauvilleCity_PokemonCenter_1F_Text_28FBEA},
{GAME_STAT_JUMPED_DOWN_LEDGES, 1, MauvilleCity_PokemonCenter_1F_Text_28FC6B, MauvilleCity_PokemonCenter_1F_Text_28FC85, MauvilleCity_PokemonCenter_1F_Text_28FC98},
{GAME_STAT_WATCHED_TV, 1, MauvilleCity_PokemonCenter_1F_Text_28FD1D, MauvilleCity_PokemonCenter_1F_Text_28FD35, MauvilleCity_PokemonCenter_1F_Text_28FD40},
{GAME_STAT_CHECKED_CLOCK, 1, MauvilleCity_PokemonCenter_1F_Text_28FDA2, MauvilleCity_PokemonCenter_1F_Text_28FDBD, MauvilleCity_PokemonCenter_1F_Text_28FDCE},
{GAME_STAT_WON_POKEMON_LOTTERY, 1, MauvilleCity_PokemonCenter_1F_Text_28FE57, MauvilleCity_PokemonCenter_1F_Text_28FE72, MauvilleCity_PokemonCenter_1F_Text_28FE88},
{GAME_STAT_USED_DAYCARE, 1, MauvilleCity_PokemonCenter_1F_Text_28FF0C, MauvilleCity_PokemonCenter_1F_Text_28FF27, MauvilleCity_PokemonCenter_1F_Text_28FF44},
{GAME_STAT_RODE_CABLE_CAR, 1, MauvilleCity_PokemonCenter_1F_Text_28FFDD, MauvilleCity_PokemonCenter_1F_Text_28FFFA, MauvilleCity_PokemonCenter_1F_Text_29000D},
{GAME_STAT_ENTERED_HOT_SPRINGS, 1, MauvilleCity_PokemonCenter_1F_Text_290097, MauvilleCity_PokemonCenter_1F_Text_2900B5, MauvilleCity_PokemonCenter_1F_Text_2900CB}
// The 50 below is replaced with GAME_STAT_SAVED_GAME
{
50, 1,
MauvilleCity_PokemonCenter_1F_Text_SavedGameTitle,
MauvilleCity_PokemonCenter_1F_Text_SavedGameAction,
MauvilleCity_PokemonCenter_1F_Text_SavedGameStory
},
{
GAME_STAT_STARTED_TRENDS, 1,
MauvilleCity_PokemonCenter_1F_Text_TrendsStartedTitle,
MauvilleCity_PokemonCenter_1F_Text_TrendsStartedAction,
MauvilleCity_PokemonCenter_1F_Text_TrendsStartedStory
},
{
GAME_STAT_PLANTED_BERRIES, 1,
MauvilleCity_PokemonCenter_1F_Text_BerriesPlantedTitle,
MauvilleCity_PokemonCenter_1F_Text_BerriesPlantedAction,
MauvilleCity_PokemonCenter_1F_Text_BerriesPlantedStory
},
{
GAME_STAT_TRADED_BIKES, 1,
MauvilleCity_PokemonCenter_1F_Text_BikeTradesTitle,
MauvilleCity_PokemonCenter_1F_Text_BikeTradesAction,
MauvilleCity_PokemonCenter_1F_Text_BikeTradesStory
},
{
GAME_STAT_GOT_INTERVIEWED, 1,
MauvilleCity_PokemonCenter_1F_Text_InterviewsTitle,
MauvilleCity_PokemonCenter_1F_Text_InterviewsAction,
MauvilleCity_PokemonCenter_1F_Text_InterviewsStory
},
{
GAME_STAT_TRAINER_BATTLES, 1,
MauvilleCity_PokemonCenter_1F_Text_TrainerBattlesTitle,
MauvilleCity_PokemonCenter_1F_Text_TrainerBattlesAction,
MauvilleCity_PokemonCenter_1F_Text_TrainerBattlesStory
},
{
GAME_STAT_POKEMON_CAPTURES, 1,
MauvilleCity_PokemonCenter_1F_Text_PokemonCaughtTitle,
MauvilleCity_PokemonCenter_1F_Text_PokemonCaughtAction,
MauvilleCity_PokemonCenter_1F_Text_PokemonCaughtStory
},
{
GAME_STAT_FISHING_CAPTURES, 1,
MauvilleCity_PokemonCenter_1F_Text_FishingPokemonCaughtTitle,
MauvilleCity_PokemonCenter_1F_Text_FishingPokemonCaughtAction,
MauvilleCity_PokemonCenter_1F_Text_FishingPokemonCaughtStory
},
{
GAME_STAT_HATCHED_EGGS, 1,
MauvilleCity_PokemonCenter_1F_Text_EggsHatchedTitle,
MauvilleCity_PokemonCenter_1F_Text_EggsHatchedAction,
MauvilleCity_PokemonCenter_1F_Text_EggsHatchedStory
},
{
GAME_STAT_EVOLVED_POKEMON, 1,
MauvilleCity_PokemonCenter_1F_Text_PokemonEvolvedTitle,
MauvilleCity_PokemonCenter_1F_Text_PokemonEvolvedAction,
MauvilleCity_PokemonCenter_1F_Text_PokemonEvolvedStory
},
{
GAME_STAT_USED_POKECENTER, 1,
MauvilleCity_PokemonCenter_1F_Text_UsedPokemonCenterTitle,
MauvilleCity_PokemonCenter_1F_Text_UsedPokemonCenterAction,
MauvilleCity_PokemonCenter_1F_Text_UsedPokemonCenterStory
},
{
GAME_STAT_RESTED_AT_HOME, 1,
MauvilleCity_PokemonCenter_1F_Text_RestedAtHomeTitle,
MauvilleCity_PokemonCenter_1F_Text_RestedAtHomeAction,
MauvilleCity_PokemonCenter_1F_Text_RestedAtHomeStory
},
{
GAME_STAT_ENTERED_SAFARI_ZONE, 1,
MauvilleCity_PokemonCenter_1F_Text_SafariGamesTitle,
MauvilleCity_PokemonCenter_1F_Text_SafariGamesAction,
MauvilleCity_PokemonCenter_1F_Text_SafariGamesStory
},
{
GAME_STAT_USED_CUT, 1,
MauvilleCity_PokemonCenter_1F_Text_UsedCutTitle,
MauvilleCity_PokemonCenter_1F_Text_UsedCutAction,
MauvilleCity_PokemonCenter_1F_Text_UsedCutStory
},
{
GAME_STAT_USED_ROCK_SMASH, 1,
MauvilleCity_PokemonCenter_1F_Text_UsedRockSmashTitle,
MauvilleCity_PokemonCenter_1F_Text_UsedRockSmashAction,
MauvilleCity_PokemonCenter_1F_Text_UsedRockSmashStory
},
{
GAME_STAT_MOVED_SECRET_BASE, 1,
MauvilleCity_PokemonCenter_1F_Text_MovedBasesTitle,
MauvilleCity_PokemonCenter_1F_Text_MovedBasesAction,
MauvilleCity_PokemonCenter_1F_Text_MovedBasesStory
},
{
GAME_STAT_USED_SPLASH, 1,
MauvilleCity_PokemonCenter_1F_Text_UsedSplashTitle,
MauvilleCity_PokemonCenter_1F_Text_UsedSplashAction,
MauvilleCity_PokemonCenter_1F_Text_UsedSplashStory
},
{
GAME_STAT_USED_STRUGGLE, 1,
MauvilleCity_PokemonCenter_1F_Text_UsedStruggleTitle,
MauvilleCity_PokemonCenter_1F_Text_UsedStruggleAction,
MauvilleCity_PokemonCenter_1F_Text_UsedStruggleStory
},
{
GAME_STAT_SLOT_JACKPOTS, 1,
MauvilleCity_PokemonCenter_1F_Text_SlotJackpotsTitle,
MauvilleCity_PokemonCenter_1F_Text_SlotJackpotsAction,
MauvilleCity_PokemonCenter_1F_Text_SlotJackpotsStory
},
{
GAME_STAT_CONSECUTIVE_ROULETTE_WINS, 2,
MauvilleCity_PokemonCenter_1F_Text_RouletteWinsTitle,
MauvilleCity_PokemonCenter_1F_Text_RouletteWinsAction,
MauvilleCity_PokemonCenter_1F_Text_RouletteWinsStory
},
{
GAME_STAT_ENTERED_BATTLE_TOWER, 1,
MauvilleCity_PokemonCenter_1F_Text_BattleTowerChallengesTitle,
MauvilleCity_PokemonCenter_1F_Text_BattleTowerChallengesAction,
MauvilleCity_PokemonCenter_1F_Text_BattleTowerChallengesStory
},
{
GAME_STAT_POKEBLOCKS, 1,
MauvilleCity_PokemonCenter_1F_Text_MadePokeblocksTitle,
MauvilleCity_PokemonCenter_1F_Text_MadePokeblocksAction,
MauvilleCity_PokemonCenter_1F_Text_MadePokeblocksStory
},
{
GAME_STAT_ENTERED_CONTEST, 1,
MauvilleCity_PokemonCenter_1F_Text_EnteredContestsTitle,
MauvilleCity_PokemonCenter_1F_Text_EnteredContestsAction,
MauvilleCity_PokemonCenter_1F_Text_EnteredContestsStory
},
{
GAME_STAT_WON_CONTEST, 1,
MauvilleCity_PokemonCenter_1F_Text_WonContestsTitle,
MauvilleCity_PokemonCenter_1F_Text_WonContestsAction,
MauvilleCity_PokemonCenter_1F_Text_WonContestsStory
},
{
GAME_STAT_SHOPPED, 1,
MauvilleCity_PokemonCenter_1F_Text_TimesShoppedTitle,
MauvilleCity_PokemonCenter_1F_Text_TimesShoppedAction,
MauvilleCity_PokemonCenter_1F_Text_TimesShoppedStory
},
{
GAME_STAT_USED_ITEMFINDER, 1,
MauvilleCity_PokemonCenter_1F_Text_UsedItemFinderTitle,
MauvilleCity_PokemonCenter_1F_Text_UsedItemFinderAction,
MauvilleCity_PokemonCenter_1F_Text_UsedItemFinderStory
},
{
GAME_STAT_GOT_RAINED_ON, 1,
MauvilleCity_PokemonCenter_1F_Text_TimesRainedTitle,
MauvilleCity_PokemonCenter_1F_Text_TimesRainedAction,
MauvilleCity_PokemonCenter_1F_Text_TimesRainedStory
},
{
GAME_STAT_CHECKED_POKEDEX, 1,
MauvilleCity_PokemonCenter_1F_Text_CheckedPokedexTitle,
MauvilleCity_PokemonCenter_1F_Text_CheckedPokedexAction,
MauvilleCity_PokemonCenter_1F_Text_CheckedPokedexStory
},
{
GAME_STAT_RECEIVED_RIBBONS, 1,
MauvilleCity_PokemonCenter_1F_Text_ReceivedRibbonsTitle,
MauvilleCity_PokemonCenter_1F_Text_ReceivedRibbonsAction,
MauvilleCity_PokemonCenter_1F_Text_ReceivedRibbonsStory
},
{
GAME_STAT_JUMPED_DOWN_LEDGES, 1,
MauvilleCity_PokemonCenter_1F_Text_LedgesJumpedTitle,
MauvilleCity_PokemonCenter_1F_Text_LedgesJumpedAction,
MauvilleCity_PokemonCenter_1F_Text_LedgesJumpedStory
},
{
GAME_STAT_WATCHED_TV, 1,
MauvilleCity_PokemonCenter_1F_Text_TVWatchedTitle,
MauvilleCity_PokemonCenter_1F_Text_TVWatchedAction,
MauvilleCity_PokemonCenter_1F_Text_TVWatchedStory
},
{
GAME_STAT_CHECKED_CLOCK, 1,
MauvilleCity_PokemonCenter_1F_Text_CheckedClockTitle,
MauvilleCity_PokemonCenter_1F_Text_CheckedClockAction,
MauvilleCity_PokemonCenter_1F_Text_CheckedClockStory
},
{
GAME_STAT_WON_POKEMON_LOTTERY, 1,
MauvilleCity_PokemonCenter_1F_Text_WonLotteryTitle,
MauvilleCity_PokemonCenter_1F_Text_WonLotteryAction,
MauvilleCity_PokemonCenter_1F_Text_WonLotteryStory
},
{
GAME_STAT_USED_DAYCARE, 1,
MauvilleCity_PokemonCenter_1F_Text_UsedDaycareTitle,
MauvilleCity_PokemonCenter_1F_Text_UsedDaycareAction,
MauvilleCity_PokemonCenter_1F_Text_UsedDaycareStory
},
{
GAME_STAT_RODE_CABLE_CAR, 1,
MauvilleCity_PokemonCenter_1F_Text_RodeCableCarTitle,
MauvilleCity_PokemonCenter_1F_Text_RodeCableCarAction,
MauvilleCity_PokemonCenter_1F_Text_RodeCableCarStory
},
{
GAME_STAT_ENTERED_HOT_SPRINGS, 1,
MauvilleCity_PokemonCenter_1F_Text_HotSpringsTitle,
MauvilleCity_PokemonCenter_1F_Text_HotSpringsAction,
MauvilleCity_PokemonCenter_1F_Text_HotSpringsStory
}
};
static void StorytellerSetup(void)
@ -959,7 +1141,7 @@ static void StorytellerSetup(void)
sStorytellerPtr->id = MAUVILLE_MAN_STORYTELLER;
sStorytellerPtr->alreadyRecorded = FALSE;
for (i = 0; i < 4; i++)
for (i = 0; i < NUM_STORYTELLER_TALES; i++)
{
sStorytellerPtr->gameStatIDs[i] = 0;
sStorytellerPtr->trainerNames[0][i] = EOS; // Maybe they meant storyteller->trainerNames[i][0] instead?
@ -977,7 +1159,7 @@ static void Storyteller_ResetFlag(void)
static u32 StorytellerGetGameStat(u8 stat)
{
if (stat == 50)
stat = 0;
stat = GAME_STAT_SAVED_GAME;
return GetGameStat(stat);
}
@ -985,12 +1167,12 @@ static const struct Story *GetStoryByStat(u32 stat)
{
s32 i;
for (i = 0; i < 36; i++)
for (i = 0; i < (int)ARRAY_COUNT(sStorytellerStories); i++)
{
if (sStorytellerStories[i].stat == stat)
return &sStorytellerStories[i];
}
return &sStorytellerStories[35];
return &sStorytellerStories[ARRAY_COUNT(sStorytellerStories) - 1];
}
static const u8 *GetStoryTitleByStat(u32 stat)
@ -1012,7 +1194,7 @@ static u8 GetFreeStorySlot(void)
{
u8 i;
for (i = 0; i < 4; i++)
for (i = 0; i < NUM_STORYTELLER_TALES; i++)
{
if (sStorytellerPtr->gameStatIDs[i] == 0)
break;
@ -1049,15 +1231,15 @@ static void GetStoryByStattellerPlayerName(u32 player, void *dst)
{
u8 *name = sStorytellerPtr->trainerNames[player];
memset(dst, EOS, 8);
memcpy(dst, name, 7);
memset(dst, EOS, PLAYER_NAME_LENGTH + 1);
memcpy(dst, name, PLAYER_NAME_LENGTH);
}
static void StorytellerSetPlayerName(u32 player, const u8 * src)
{
u8 * name = sStorytellerPtr->trainerNames[player];
memset(name, EOS, 7);
memcpy(name, src, 7);
memset(name, EOS, PLAYER_NAME_LENGTH);
memcpy(name, src, PLAYER_NAME_LENGTH);
}
@ -1110,15 +1292,15 @@ static bool8 StorytellerInitializeRandomStat(void)
u8 stat = sStorytellerStories[arr[i]].stat;
u8 minVal = sStorytellerStories[arr[i]].minVal;
for (j = 0; j < 4; j++)
for (j = 0; j < NUM_STORYTELLER_TALES; j++)
{
if (sStorytellerPtr->gameStatIDs[j] == stat)
break;
}
if (j == 4 && StorytellerGetGameStat(stat) >= minVal)
if (j == NUM_STORYTELLER_TALES && StorytellerGetGameStat(stat) >= minVal)
{
sStorytellerPtr->alreadyRecorded = TRUE;
if (GetFreeStorySlot() == 4)
if (GetFreeStorySlot() == NUM_STORYTELLER_TALES)
StorytellerRecordNewStat(sSelectedStory, stat);
else
StorytellerRecordNewStat(GetFreeStorySlot(), stat);
@ -1144,7 +1326,7 @@ static void PrintStoryList(void)
s32 i;
s32 width = GetStringWidth(1, gText_Exit, 0);
u8 tileWidth;
for (i = 0; i < 4; i++)
for (i = 0; i < NUM_STORYTELLER_TALES; i++)
{
s32 curWidth;
u16 gameStatID = sStorytellerPtr->gameStatIDs[i];
@ -1157,7 +1339,7 @@ static void PrintStoryList(void)
}
sStorytellerWindowId = CreateWindowFromRect(0, 0, ConvertPixelWidthToTileWidth(width), GetFreeStorySlot() * 2 + 2);
SetStandardWindowBorderStyle(sStorytellerWindowId, 0);
for (i = 0; i < 4; i++)
for (i = 0; i < NUM_STORYTELLER_TALES; i++)
{
u16 gameStatID = sStorytellerPtr->gameStatIDs[i];
if (gameStatID == 0)
@ -1169,7 +1351,7 @@ static void PrintStoryList(void)
CopyWindowToVram(sStorytellerWindowId, 3);
}
static void Task_StoryListMenu(u8 taskId) // Task_StoryListMenu
static void Task_StoryListMenu(u8 taskId)
{
struct Task *task = &gTasks[taskId];
s32 selection;

View File

@ -286,7 +286,7 @@ bool8 MEScrCmd_givenationaldex(struct ScriptContext *ctx)
bool8 MEScrCmd_addrareword(struct ScriptContext *ctx)
{
sub_811EFC0(ScriptReadByte(ctx));
UnlockAdditionalPhrase(ScriptReadByte(ctx));
StringExpandPlaceholders(gStringVar4, gText_MysteryGiftRareWord);
ctx->data[2] = 2;
return FALSE;

View File

@ -631,7 +631,7 @@ static void ReceiveOldManData(OldMan *oldMan, size_t recordSize, u8 which)
u8 version;
u16 language;
OldMan *dest;
u32 mixIndices[4];
u32 mixIndices[MAX_LINK_PLAYERS];
ShufflePlayerIndices(mixIndices);
dest = (void *)oldMan + recordSize * mixIndices[which];

View File

@ -1,6 +1,6 @@
#include "global.h"
#include "constants/decorations.h"
#include "constants/mauville_man.h"
#include "constants/mauville_old_man.h"
#include "decoration.h"
#include "decoration_inventory.h"
#include "event_data.h"
@ -86,7 +86,7 @@ void CreateAvailableDecorationsMenu(u8 taskId)
schedule_bg_copy_tilemap_to_vram(0);
}
void sub_8133BE4(u8 taskId, u8 decorationId)
void Task_BufferDecorSelectionAndCloseWindow(u8 taskId, u8 decorationId)
{
s16 * data = gTasks[taskId].data;
if (decorationId > NUM_DECORATIONS)
@ -118,14 +118,14 @@ void Task_HandleGetDecorationMenuInput(u8 taskId)
case MENU_B_PRESSED:
case 4:
PlaySE(SE_SELECT);
sub_8133BE4(taskId, 0);
Task_BufferDecorSelectionAndCloseWindow(taskId, 0);
break;
default:
PlaySE(SE_SELECT);
gSpecialVar_0x8005 = input;
StringCopy(gStringVar1, trader->playerNames[input]);
ConvertInternationalString(gStringVar1, trader->language[input]);
sub_8133BE4(taskId, trader->decorIds[input]);
Task_BufferDecorSelectionAndCloseWindow(taskId, trader->decorIds[input]);
break;
}
}