Merge pull request #1393 from GriffinRichards/doc-dewfordtrend
Document Dewford Trend and match_call.c
This commit is contained in:
@@ -10,7 +10,7 @@ DewfordTown_Hall_EventScript_Girl:: @ 81FD4D0
|
|||||||
lock
|
lock
|
||||||
faceplayer
|
faceplayer
|
||||||
call Common_EventScript_BufferTrendyPhrase
|
call Common_EventScript_BufferTrendyPhrase
|
||||||
special TrendyPhraseIsOld
|
special IsTrendyPhraseBoring
|
||||||
compare VAR_RESULT, TRUE
|
compare VAR_RESULT, TRUE
|
||||||
goto_if_eq DewfordTown_Hall_EventScript_GirlBoredOfTrend
|
goto_if_eq DewfordTown_Hall_EventScript_GirlBoredOfTrend
|
||||||
msgbox DewfordTown_Hall_Text_CantImagineLifeWithoutTrend, MSGBOX_DEFAULT
|
msgbox DewfordTown_Hall_Text_CantImagineLifeWithoutTrend, MSGBOX_DEFAULT
|
||||||
|
|||||||
+1
-1
@@ -138,7 +138,7 @@ gSpecials:: @ 81DBA64
|
|||||||
def_special BufferMonNickname
|
def_special BufferMonNickname
|
||||||
def_special IsMonOTIDNotPlayers
|
def_special IsMonOTIDNotPlayers
|
||||||
def_special BufferTrendyPhraseString
|
def_special BufferTrendyPhraseString
|
||||||
def_special TrendyPhraseIsOld
|
def_special IsTrendyPhraseBoring
|
||||||
def_special BufferDeepLinkPhrase
|
def_special BufferDeepLinkPhrase
|
||||||
def_special GetDewfordHallPaintingNameIndex
|
def_special GetDewfordHallPaintingNameIndex
|
||||||
def_special SwapRegisteredBike
|
def_special SwapRegisteredBike
|
||||||
|
|||||||
+9
-7
@@ -1229,7 +1229,7 @@ gTVTodaysRivalTrainerText06:: @ 082849AE
|
|||||||
.string "Let's all keep moving forward\n"
|
.string "Let's all keep moving forward\n"
|
||||||
.string "and ahead of our rivals!$"
|
.string "and ahead of our rivals!$"
|
||||||
|
|
||||||
gTVDewfordTrendWatcherNetworkText00:: @ 08284A3E
|
TrendWatcher_Text_Intro:: @ 08284A3E
|
||||||
.string "DEWFORD TREND-WATCHER NETWORK!\p"
|
.string "DEWFORD TREND-WATCHER NETWORK!\p"
|
||||||
.string "MC: Wassup?\n"
|
.string "MC: Wassup?\n"
|
||||||
.string "We'll keep it real with the latest on\l"
|
.string "We'll keep it real with the latest on\l"
|
||||||
@@ -1251,17 +1251,18 @@ gTVDewfordTrendWatcherNetworkText00:: @ 08284A3E
|
|||||||
.string "MC: Uh, no. What we want to know is\n"
|
.string "MC: Uh, no. What we want to know is\n"
|
||||||
.string "what's the in thing of the moment…$"
|
.string "what's the in thing of the moment…$"
|
||||||
|
|
||||||
gTVDewfordTrendWatcherNetworkText01:: @ 08284C55
|
@ Identical to below, may have been different in other languages
|
||||||
|
TrendWatcher_Text_MaleTaughtMePhrase:: @ 08284C55
|
||||||
.string "Old man: {STR_VAR_1} {STR_VAR_2}\n"
|
.string "Old man: {STR_VAR_1} {STR_VAR_2}\n"
|
||||||
.string "was what {STR_VAR_3} from LITTLEROOT\l"
|
.string "was what {STR_VAR_3} from LITTLEROOT\l"
|
||||||
.string "taught me as being trendy…$"
|
.string "taught me as being trendy…$"
|
||||||
|
|
||||||
gTVDewfordTrendWatcherNetworkText02:: @ 08284C9B
|
TrendWatcher_Text_FemaleTaughtMePhrase:: @ 08284C9B
|
||||||
.string "Old man: {STR_VAR_1} {STR_VAR_2}\n"
|
.string "Old man: {STR_VAR_1} {STR_VAR_2}\n"
|
||||||
.string "was what {STR_VAR_3} from LITTLEROOT\l"
|
.string "was what {STR_VAR_3} from LITTLEROOT\l"
|
||||||
.string "taught me as being trendy…$"
|
.string "taught me as being trendy…$"
|
||||||
|
|
||||||
gTVDewfordTrendWatcherNetworkText03:: @ 08284CE1
|
TrendWatcher_Text_PhraseWasHopeless:: @ 08284CE1
|
||||||
.string "But it was utterly hopeless.\p"
|
.string "But it was utterly hopeless.\p"
|
||||||
.string "{STR_VAR_1} {STR_VAR_2} festival!\p"
|
.string "{STR_VAR_1} {STR_VAR_2} festival!\p"
|
||||||
.string "{STR_VAR_1} {STR_VAR_2} contest!\p"
|
.string "{STR_VAR_1} {STR_VAR_2} contest!\p"
|
||||||
@@ -1272,17 +1273,18 @@ gTVDewfordTrendWatcherNetworkText03:: @ 08284CE1
|
|||||||
.string "MC: Uh, excuse me, compadre, I need\n"
|
.string "MC: Uh, excuse me, compadre, I need\n"
|
||||||
.string "to hear about what's in now…$"
|
.string "to hear about what's in now…$"
|
||||||
|
|
||||||
gTVDewfordTrendWatcherNetworkText04:: @ 08284DB6
|
@ Identical to below, may have been different in other languages
|
||||||
|
TrendWatcher_Text_MaleTellMeBigger:: @ 08284DB6
|
||||||
.string "Old man: {STR_VAR_3}!\n"
|
.string "Old man: {STR_VAR_3}!\n"
|
||||||
.string "Please, tell me something bigger than\l"
|
.string "Please, tell me something bigger than\l"
|
||||||
.string "that {STR_VAR_1} {STR_VAR_2}!$"
|
.string "that {STR_VAR_1} {STR_VAR_2}!$"
|
||||||
|
|
||||||
gTVDewfordTrendWatcherNetworkText05:: @ 08284DF5
|
TrendWatcher_Text_FemaleTellMeBigger:: @ 08284DF5
|
||||||
.string "Old man: {STR_VAR_3}!\n"
|
.string "Old man: {STR_VAR_3}!\n"
|
||||||
.string "Please, tell me something bigger than\l"
|
.string "Please, tell me something bigger than\l"
|
||||||
.string "that {STR_VAR_1} {STR_VAR_2}!$"
|
.string "that {STR_VAR_1} {STR_VAR_2}!$"
|
||||||
|
|
||||||
gTVDewfordTrendWatcherNetworkText06:: @ 08284E34
|
TrendWatcher_Text_Outro:: @ 08284E34
|
||||||
.string "MC: …Uh… So, there you have it,\n"
|
.string "MC: …Uh… So, there you have it,\n"
|
||||||
.string "all you trendy, hep cats out there!\p"
|
.string "all you trendy, hep cats out there!\p"
|
||||||
.string "{STR_VAR_1} {STR_VAR_2}…uh…\n"
|
.string "{STR_VAR_1} {STR_VAR_2}…uh…\n"
|
||||||
|
|||||||
+4
-4
@@ -1,10 +1,10 @@
|
|||||||
#ifndef GUARD_STRING_UTIL_H
|
#ifndef GUARD_STRING_UTIL_H
|
||||||
#define GUARD_STRING_UTIL_H
|
#define GUARD_STRING_UTIL_H
|
||||||
|
|
||||||
extern u8 gStringVar1[];
|
extern u8 gStringVar1[0x100];
|
||||||
extern u8 gStringVar2[];
|
extern u8 gStringVar2[0x100];
|
||||||
extern u8 gStringVar3[];
|
extern u8 gStringVar3[0x100];
|
||||||
extern u8 gStringVar4[];
|
extern u8 gStringVar4[0x3E8];
|
||||||
|
|
||||||
enum StringConvertMode
|
enum StringConvertMode
|
||||||
{
|
{
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 192 B After Width: | Height: | Size: 192 B |
Binary file not shown.
|
Before Width: | Height: | Size: 150 B |
@@ -1,19 +0,0 @@
|
|||||||
JASC-PAL
|
|
||||||
0100
|
|
||||||
16
|
|
||||||
255 255 148
|
|
||||||
255 197 148
|
|
||||||
238 139 90
|
|
||||||
189 90 41
|
|
||||||
255 213 213
|
|
||||||
246 180 180
|
|
||||||
197 131 131
|
|
||||||
0 0 0
|
|
||||||
0 0 0
|
|
||||||
0 0 0
|
|
||||||
0 0 0
|
|
||||||
41 49 49
|
|
||||||
98 98 98
|
|
||||||
180 189 180
|
|
||||||
222 213 222
|
|
||||||
255 255 255
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 209 B |
@@ -1,19 +0,0 @@
|
|||||||
JASC-PAL
|
|
||||||
0100
|
|
||||||
16
|
|
||||||
0 0 0
|
|
||||||
255 255 255
|
|
||||||
0 0 0
|
|
||||||
197 197 205
|
|
||||||
32 222 148
|
|
||||||
106 238 180
|
|
||||||
180 255 213
|
|
||||||
213 197 255
|
|
||||||
238 230 255
|
|
||||||
255 189 180
|
|
||||||
255 222 213
|
|
||||||
189 148 0
|
|
||||||
238 238 230
|
|
||||||
0 0 0
|
|
||||||
0 0 0
|
|
||||||
0 0 0
|
|
||||||
@@ -1402,7 +1402,7 @@
|
|||||||
#define FLAG_SYS_TV_HOME (SYSTEM_FLAGS + 0x30)
|
#define FLAG_SYS_TV_HOME (SYSTEM_FLAGS + 0x30)
|
||||||
#define FLAG_SYS_TV_WATCH (SYSTEM_FLAGS + 0x31)
|
#define FLAG_SYS_TV_WATCH (SYSTEM_FLAGS + 0x31)
|
||||||
#define FLAG_SYS_TV_START (SYSTEM_FLAGS + 0x32)
|
#define FLAG_SYS_TV_START (SYSTEM_FLAGS + 0x32)
|
||||||
#define FLAG_SYS_POPWORD_INPUT (SYSTEM_FLAGS + 0x33)
|
#define FLAG_SYS_CHANGED_DEWFORD_TREND (SYSTEM_FLAGS + 0x33)
|
||||||
#define FLAG_SYS_MIX_RECORD (SYSTEM_FLAGS + 0x34)
|
#define FLAG_SYS_MIX_RECORD (SYSTEM_FLAGS + 0x34)
|
||||||
#define FLAG_SYS_CLOCK_SET (SYSTEM_FLAGS + 0x35)
|
#define FLAG_SYS_CLOCK_SET (SYSTEM_FLAGS + 0x35)
|
||||||
#define FLAG_SYS_NATIONAL_DEX (SYSTEM_FLAGS + 0x36)
|
#define FLAG_SYS_NATIONAL_DEX (SYSTEM_FLAGS + 0x36)
|
||||||
|
|||||||
@@ -52,6 +52,7 @@
|
|||||||
#define NUM_CONTEST_WINNERS 13
|
#define NUM_CONTEST_WINNERS 13
|
||||||
#define UNION_ROOM_KB_ROW_COUNT 10
|
#define UNION_ROOM_KB_ROW_COUNT 10
|
||||||
#define GIFT_RIBBONS_COUNT 11
|
#define GIFT_RIBBONS_COUNT 11
|
||||||
|
#define SAVED_TRENDS_COUNT 5
|
||||||
|
|
||||||
#define PYRAMID_BAG_ITEMS_COUNT 10
|
#define PYRAMID_BAG_ITEMS_COUNT 10
|
||||||
#define HALL_FACILITIES_COUNT 9 // 7 facilities for single mode + tower double mode + tower multi mode.
|
#define HALL_FACILITIES_COUNT 9 // 7 facilities for single mode + tower double mode + tower multi mode.
|
||||||
|
|||||||
@@ -206,4 +206,13 @@
|
|||||||
#define SPOTCUTIES_STATE_RIBBON_EFFORT 14
|
#define SPOTCUTIES_STATE_RIBBON_EFFORT 14
|
||||||
#define SPOTCUTIES_STATE_OUTRO 15
|
#define SPOTCUTIES_STATE_OUTRO 15
|
||||||
|
|
||||||
|
// TV Show states for Trend Watcher
|
||||||
|
#define TRENDWATCHER_STATE_INTRO 0
|
||||||
|
#define TRENDWATCHER_STATE_TAUGHT_MALE 1
|
||||||
|
#define TRENDWATCHER_STATE_TAUGHT_FEMALE 2
|
||||||
|
#define TRENDWATCHER_STATE_PHRASE_HOPELESS 3
|
||||||
|
#define TRENDWATCHER_STATE_BIGGER_MALE 4
|
||||||
|
#define TRENDWATCHER_STATE_BIGGER_FEMALE 5
|
||||||
|
#define TRENDWATCHER_STATE_OUTRO 6
|
||||||
|
|
||||||
#endif //GUARD_CONSTANTS_TV_H
|
#endif //GUARD_CONSTANTS_TV_H
|
||||||
|
|||||||
@@ -2,10 +2,9 @@
|
|||||||
#define GUARD_DEWFORDTREND_H
|
#define GUARD_DEWFORDTREND_H
|
||||||
|
|
||||||
void InitDewfordTrend(void);
|
void InitDewfordTrend(void);
|
||||||
void UpdateDewfordTrendPerDay(u16);
|
|
||||||
void UpdateDewfordTrendPerDay(u16 days);
|
void UpdateDewfordTrendPerDay(u16 days);
|
||||||
bool8 IsPhraseTrendy(u16 *a);
|
bool8 TrySetTrendyPhrase(u16 *phrase);
|
||||||
void ReceiveEasyChatPairsData(struct EasyChatPair *a, size_t b, u8 unused);
|
void ReceiveDewfordTrendData(struct DewfordTrend *linkedTrends, size_t size, u8 unused);
|
||||||
|
|
||||||
|
|
||||||
#endif // GUARD_DEWFORDTREND_H
|
#endif // GUARD_DEWFORDTREND_H
|
||||||
|
|||||||
@@ -135,13 +135,13 @@ extern const u8 gTVTodaysRivalTrainerText03[];
|
|||||||
extern const u8 gTVTodaysRivalTrainerText04[];
|
extern const u8 gTVTodaysRivalTrainerText04[];
|
||||||
extern const u8 gTVTodaysRivalTrainerText05[];
|
extern const u8 gTVTodaysRivalTrainerText05[];
|
||||||
extern const u8 gTVTodaysRivalTrainerText06[];
|
extern const u8 gTVTodaysRivalTrainerText06[];
|
||||||
extern const u8 gTVDewfordTrendWatcherNetworkText00[];
|
extern const u8 TrendWatcher_Text_Intro[];
|
||||||
extern const u8 gTVDewfordTrendWatcherNetworkText01[];
|
extern const u8 TrendWatcher_Text_MaleTaughtMePhrase[];
|
||||||
extern const u8 gTVDewfordTrendWatcherNetworkText02[];
|
extern const u8 TrendWatcher_Text_FemaleTaughtMePhrase[];
|
||||||
extern const u8 gTVDewfordTrendWatcherNetworkText03[];
|
extern const u8 TrendWatcher_Text_PhraseWasHopeless[];
|
||||||
extern const u8 gTVDewfordTrendWatcherNetworkText04[];
|
extern const u8 TrendWatcher_Text_MaleTellMeBigger[];
|
||||||
extern const u8 gTVDewfordTrendWatcherNetworkText05[];
|
extern const u8 TrendWatcher_Text_FemaleTellMeBigger[];
|
||||||
extern const u8 gTVDewfordTrendWatcherNetworkText06[];
|
extern const u8 TrendWatcher_Text_Outro[];
|
||||||
extern const u8 gTVHoennTreasureInvestigatorsText00[];
|
extern const u8 gTVHoennTreasureInvestigatorsText00[];
|
||||||
extern const u8 gTVHoennTreasureInvestigatorsText01[];
|
extern const u8 gTVHoennTreasureInvestigatorsText01[];
|
||||||
extern const u8 gTVHoennTreasureInvestigatorsText02[];
|
extern const u8 gTVHoennTreasureInvestigatorsText02[];
|
||||||
|
|||||||
+7
-6
@@ -587,12 +587,13 @@ struct RamScript
|
|||||||
struct RamScriptData data;
|
struct RamScriptData data;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct EasyChatPair
|
// See dewford_trend.c
|
||||||
|
struct DewfordTrend
|
||||||
{
|
{
|
||||||
u16 unk0_0:7;
|
u16 trendiness:7;
|
||||||
u16 unk0_7:7;
|
u16 maxTrendiness:7;
|
||||||
u16 unk1_6:1;
|
u16 gainingTrendiness:1;
|
||||||
u16 unk2;
|
u16 rand;
|
||||||
u16 words[2];
|
u16 words[2];
|
||||||
}; /*size = 0x8*/
|
}; /*size = 0x8*/
|
||||||
|
|
||||||
@@ -1021,7 +1022,7 @@ struct SaveBlock1
|
|||||||
/*0x2BE0*/ struct MailStruct mail[MAIL_COUNT];
|
/*0x2BE0*/ struct MailStruct mail[MAIL_COUNT];
|
||||||
/*0x2E20*/ u8 additionalPhrases[8]; // bitfield for 33 additional phrases in easy chat system
|
/*0x2E20*/ u8 additionalPhrases[8]; // bitfield for 33 additional phrases in easy chat system
|
||||||
/*0x2E28*/ OldMan oldMan;
|
/*0x2E28*/ OldMan oldMan;
|
||||||
/*0x2e64*/ struct EasyChatPair easyChatPairs[5]; //Dewford trend [0] and some other stuff
|
/*0x2e64*/ struct DewfordTrend dewfordTrends[SAVED_TRENDS_COUNT];
|
||||||
/*0x2e90*/ struct ContestWinner contestWinners[NUM_CONTEST_WINNERS]; // see CONTEST_WINNER_*
|
/*0x2e90*/ struct ContestWinner contestWinners[NUM_CONTEST_WINNERS]; // see CONTEST_WINNER_*
|
||||||
/*0x3030*/ struct DayCare daycare;
|
/*0x3030*/ struct DayCare daycare;
|
||||||
/*0x3150*/ struct LinkBattleRecords linkBattleRecords;
|
/*0x3150*/ struct LinkBattleRecords linkBattleRecords;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ bool32 IsMatchCallTaskActive(void);
|
|||||||
void StartMatchCallFromScript(const u8 *message);
|
void StartMatchCallFromScript(const u8 *message);
|
||||||
void BufferPokedexRatingForMatchCall(u8 *destStr);
|
void BufferPokedexRatingForMatchCall(u8 *destStr);
|
||||||
bool32 SelectMatchCallMessage(int, u8 *);
|
bool32 SelectMatchCallMessage(int, u8 *);
|
||||||
void sub_8197184(u32 windowId, u32 destOffset, u32 paletteId);
|
void LoadMatchCallWindowGfx(u32 windowId, u32 destOffset, u32 paletteId);
|
||||||
void sub_81971C4(u32 windowId, u32 tileOffset, u32 paletteId);
|
void DrawMatchCallTextBoxBorder(u32 windowId, u32 tileOffset, u32 paletteId);
|
||||||
|
|
||||||
#endif //GUARD_MATCH_CALL_H
|
#endif //GUARD_MATCH_CALL_H
|
||||||
|
|||||||
+1
-1
@@ -31,7 +31,7 @@ void AlertTVThatPlayerPlayedRoulette(u16 nCoinsSpent);
|
|||||||
void AlertTVOfNewCoinTotal(u16 nCoinsPaidOut);
|
void AlertTVOfNewCoinTotal(u16 nCoinsPaidOut);
|
||||||
void TryPutSecretBaseSecretsOnAir(void);
|
void TryPutSecretBaseSecretsOnAir(void);
|
||||||
void TryPutTodaysRivalTrainerOnAir(void);
|
void TryPutTodaysRivalTrainerOnAir(void);
|
||||||
void sub_80EDC60(const u16 *words);
|
void TryPutTrendWatcherOnAir(const u16 *words);
|
||||||
void sub_80EDA80(void);
|
void sub_80EDA80(void);
|
||||||
void ReceivePokeNewsData(void *src, u32 size, u8 masterIdx);
|
void ReceivePokeNewsData(void *src, u32 size, u8 masterIdx);
|
||||||
void sub_80F0BB8(void);
|
void sub_80F0BB8(void);
|
||||||
|
|||||||
+257
-181
@@ -10,311 +10,388 @@
|
|||||||
#include "string_util.h"
|
#include "string_util.h"
|
||||||
#include "constants/easy_chat.h"
|
#include "constants/easy_chat.h"
|
||||||
|
|
||||||
// static functions
|
/*
|
||||||
static void sub_8122804(struct EasyChatPair *s, u16 b, u8 c);
|
## Overview ##
|
||||||
static bool8 sub_8122A58(struct EasyChatPair *a, struct EasyChatPair *b, u8 c);
|
This file handles the "Dewford Trend", a pair of Easy Chat words
|
||||||
static void sub_8122B28(struct EasyChatPair *s);
|
repeated by NPCs around Dewford Hall.
|
||||||
static bool8 SB1ContainsWords(u16 *a);
|
|
||||||
static bool8 IsEasyChatPairEqual(u16 *words1, u16 *words2);
|
The NPC outside Dewford Hall will ask what the player thinks of the
|
||||||
static s16 GetEqualEasyChatPairIndex(struct EasyChatPair *s, struct EasyChatPair *a, u16 b);
|
current trendy phrase, and the player may submit a new pair of words.
|
||||||
|
If the NPC thinks the submitted phrase is "trendier" than the
|
||||||
|
current one (see TrySetTrendyPhrase), it becomes the new phrase.
|
||||||
|
|
||||||
|
## struct DewfordTrend ##
|
||||||
|
Information about a Dewford trend is stored in a struct DewfordTrend.
|
||||||
|
In addition to the two easy chat words that make up the trend's phrase,
|
||||||
|
each trend has a few randomly generated values associated with it.
|
||||||
|
- rand:
|
||||||
|
This is a 16 bit value generated once when the phrase is created.
|
||||||
|
It's used in calculations for Feebas tiles, Slot Machines, and Match Call.
|
||||||
|
- trendiness / maxTrendiness:
|
||||||
|
Initialized as a random value between 30-127 inclusive. This is used to
|
||||||
|
compare how trendy one phrase is vs another. If a submitted phrase is
|
||||||
|
less trendy than the current one it won't be accepted. If the trend is
|
||||||
|
"boring" (see below) it will lose trendiness over time until it reaches 0,
|
||||||
|
at which point it will stop being boring and gain trendiness until it
|
||||||
|
reaches maxTrendiness (then it becomes boring again and the cycle repeats).
|
||||||
|
- gainingTrendiness:
|
||||||
|
This is a flag that determines whether a phrase should be gaining or losing
|
||||||
|
trendiness. An NPC in Dewford Hall will comment on whether the current phrase
|
||||||
|
is "boring" or not, and if it is gaining trendiness (or if it is still trendier
|
||||||
|
than the last phrase) it is not boring. This field will always be TRUE for any
|
||||||
|
new phrase submitted after the 1st submission.
|
||||||
|
|
||||||
|
## Saving trends ##
|
||||||
|
Each time a potential trendy phrase is submitted, it is saved in gSaveBlock1Ptr->dewfordTrends[].
|
||||||
|
Up to SAVED_TRENDS_COUNT (5) trends may be saved at one time. The trends in this array are kept
|
||||||
|
in sorted order from most trendy to least trendy. The current trendy phrase is always at
|
||||||
|
gSaveBlock1Ptr->dewfordTrends[0]. If the player mixes records with another player, their own
|
||||||
|
trends are replaced with their mixing partner's, unless the phrase is the same, in which case
|
||||||
|
the version with a higher trendiness value is used (see ReceiveDewfordTrendData).
|
||||||
|
|
||||||
|
## TV Show ##
|
||||||
|
If a submitted phrase is only trendier than 1 or none of the saved trends, it may trigger a
|
||||||
|
TV Show called Trend Watcher (see TryPutTrendWatcherOnAir) that, ironically, spends the
|
||||||
|
show talking about how the submitted phrase was not trendy.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SORT_MODE_NORMAL,
|
||||||
|
SORT_MODE_MAX_FIRST,
|
||||||
|
SORT_MODE_FULL,
|
||||||
|
};
|
||||||
|
|
||||||
|
static void SortTrends(struct DewfordTrend *, u16, u8);
|
||||||
|
static bool8 CompareTrends(struct DewfordTrend *, struct DewfordTrend *, u8);
|
||||||
|
static void SeedTrendRng(struct DewfordTrend *);
|
||||||
|
static bool8 IsPhraseInSavedTrends(u16 *);
|
||||||
|
static bool8 IsEasyChatPairEqual(u16 *, u16 *);
|
||||||
|
static s16 GetSavedTrendIndex(struct DewfordTrend *, struct DewfordTrend *, u16);
|
||||||
|
|
||||||
// text
|
|
||||||
void InitDewfordTrend(void)
|
void InitDewfordTrend(void)
|
||||||
{
|
{
|
||||||
u16 i;
|
u16 i;
|
||||||
|
|
||||||
for (i = 0; i < 5; i++)
|
for (i = 0; i < SAVED_TRENDS_COUNT; i++)
|
||||||
{
|
{
|
||||||
gSaveBlock1Ptr->easyChatPairs[i].words[0] = GetRandomEasyChatWordFromGroup(EC_GROUP_CONDITIONS);
|
gSaveBlock1Ptr->dewfordTrends[i].words[0] = GetRandomEasyChatWordFromGroup(EC_GROUP_CONDITIONS);
|
||||||
|
|
||||||
if (Random() & 1)
|
if (Random() & 1)
|
||||||
gSaveBlock1Ptr->easyChatPairs[i].words[1] = GetRandomEasyChatWordFromGroup(EC_GROUP_LIFESTYLE);
|
gSaveBlock1Ptr->dewfordTrends[i].words[1] = GetRandomEasyChatWordFromGroup(EC_GROUP_LIFESTYLE);
|
||||||
else
|
else
|
||||||
gSaveBlock1Ptr->easyChatPairs[i].words[1] = GetRandomEasyChatWordFromGroup(EC_GROUP_HOBBIES);
|
gSaveBlock1Ptr->dewfordTrends[i].words[1] = GetRandomEasyChatWordFromGroup(EC_GROUP_HOBBIES);
|
||||||
|
|
||||||
gSaveBlock1Ptr->easyChatPairs[i].unk1_6 = Random() & 1;
|
gSaveBlock1Ptr->dewfordTrends[i].gainingTrendiness = Random() & 1;
|
||||||
sub_8122B28(&(gSaveBlock1Ptr->easyChatPairs[i]));
|
SeedTrendRng(&(gSaveBlock1Ptr->dewfordTrends[i]));
|
||||||
}
|
}
|
||||||
sub_8122804(gSaveBlock1Ptr->easyChatPairs, 5, 0);
|
SortTrends(gSaveBlock1Ptr->dewfordTrends, SAVED_TRENDS_COUNT, SORT_MODE_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateDewfordTrendPerDay(u16 a)
|
void UpdateDewfordTrendPerDay(u16 days)
|
||||||
{
|
{
|
||||||
u16 i;
|
u16 i;
|
||||||
|
|
||||||
if (a != 0)
|
if (days != 0)
|
||||||
{
|
{
|
||||||
u32 sp0 = a * 5;
|
u32 clockRand = days * 5;
|
||||||
|
|
||||||
for (i = 0; i < 5; i++)
|
for (i = 0; i < SAVED_TRENDS_COUNT; i++)
|
||||||
{
|
{
|
||||||
u32 r4;
|
u32 trendiness;
|
||||||
u32 r2 = sp0;
|
u32 rand = clockRand;
|
||||||
struct EasyChatPair *r5 = &(gSaveBlock1Ptr->easyChatPairs[i]);
|
struct DewfordTrend *trend = &gSaveBlock1Ptr->dewfordTrends[i];
|
||||||
|
|
||||||
if (r5->unk1_6 == 0)
|
if (!trend->gainingTrendiness)
|
||||||
{
|
{
|
||||||
if (r5->unk0_0 >= (u16)r2)
|
// This trend is "boring"
|
||||||
|
// Lose trendiness until it becomes 0
|
||||||
|
if (trend->trendiness >= (u16)rand)
|
||||||
{
|
{
|
||||||
r5->unk0_0 -= r2;
|
trend->trendiness -= rand;
|
||||||
if (r5->unk0_0 == 0)
|
if (trend->trendiness == 0)
|
||||||
r5->unk1_6 = 1;
|
trend->gainingTrendiness = TRUE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
r2 -= r5->unk0_0;
|
rand -= trend->trendiness;
|
||||||
r5->unk0_0 = 0;
|
trend->trendiness = 0;
|
||||||
r5->unk1_6 = 1;
|
trend->gainingTrendiness = TRUE;
|
||||||
}
|
}
|
||||||
r4 = r5->unk0_0 + r2;
|
|
||||||
if ((u16)r4 > r5->unk0_7)
|
|
||||||
{
|
|
||||||
u32 sp4 = r4 % r5->unk0_7;
|
|
||||||
r4 = r4 / r5->unk0_7;
|
|
||||||
|
|
||||||
r5->unk1_6 = r4 ^ 1;
|
trendiness = trend->trendiness + rand;
|
||||||
if (r5->unk1_6)
|
if ((u16)trendiness > trend->maxTrendiness)
|
||||||
r5->unk0_0 = sp4;
|
{
|
||||||
|
// Reached limit, reset trendiness
|
||||||
|
u32 newTrendiness = trendiness % trend->maxTrendiness;
|
||||||
|
trendiness = trendiness / trend->maxTrendiness;
|
||||||
|
|
||||||
|
trend->gainingTrendiness = trendiness ^ 1;
|
||||||
|
if (trend->gainingTrendiness)
|
||||||
|
trend->trendiness = newTrendiness;
|
||||||
else
|
else
|
||||||
r5->unk0_0 = r5->unk0_7 - sp4;
|
trend->trendiness = trend->maxTrendiness - newTrendiness;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
r5->unk0_0 = r4;
|
// Increase trendiness
|
||||||
|
trend->trendiness = trendiness;
|
||||||
|
|
||||||
if (r5->unk0_0 == r5->unk0_7)
|
// Trend has reached its max, becoming "boring" and start losing trendiness
|
||||||
r5->unk1_6 = 0;
|
if (trend->trendiness == trend->maxTrendiness)
|
||||||
|
trend->gainingTrendiness = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sub_8122804(gSaveBlock1Ptr->easyChatPairs, 5, 0);
|
SortTrends(gSaveBlock1Ptr->dewfordTrends, SAVED_TRENDS_COUNT, SORT_MODE_NORMAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns TRUE if the current trendy phrase was successfully changed to the given phrase
|
||||||
bool8 IsPhraseTrendy(u16 *a)
|
// Returns FALSE otherwise
|
||||||
|
// Regardless of whether or not the current trendy phrase was changed, the submitted
|
||||||
|
// phrase is always saved in gSaveBlock1Ptr->dewfordTrends
|
||||||
|
bool8 TrySetTrendyPhrase(u16 *phrase)
|
||||||
{
|
{
|
||||||
struct EasyChatPair s = {0};
|
struct DewfordTrend trend = {0};
|
||||||
u16 i;
|
u16 i;
|
||||||
|
|
||||||
if (!SB1ContainsWords(a))
|
if (!IsPhraseInSavedTrends(phrase))
|
||||||
{
|
{
|
||||||
if (!FlagGet(FLAG_SYS_POPWORD_INPUT))
|
if (!FlagGet(FLAG_SYS_CHANGED_DEWFORD_TREND))
|
||||||
{
|
{
|
||||||
FlagSet(FLAG_SYS_POPWORD_INPUT);
|
FlagSet(FLAG_SYS_CHANGED_DEWFORD_TREND);
|
||||||
|
|
||||||
|
// Make sure player couldn't have received this phrase by mixing records
|
||||||
if (!FlagGet(FLAG_SYS_MIX_RECORD))
|
if (!FlagGet(FLAG_SYS_MIX_RECORD))
|
||||||
{
|
{
|
||||||
gSaveBlock1Ptr->easyChatPairs[0].words[0] = a[0];
|
// This is the first time submitting a phrase
|
||||||
gSaveBlock1Ptr->easyChatPairs[0].words[1] = a[1];
|
// No need to check saved phrases or reset rng, just set the new words
|
||||||
|
gSaveBlock1Ptr->dewfordTrends[0].words[0] = phrase[0];
|
||||||
|
gSaveBlock1Ptr->dewfordTrends[0].words[1] = phrase[1];
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s.words[0] = a[0];
|
// Initialize DewfordTrend using given phrase
|
||||||
s.words[1] = a[1];
|
trend.words[0] = phrase[0];
|
||||||
s.unk1_6 = 1;
|
trend.words[1] = phrase[1];
|
||||||
sub_8122B28(&s);
|
trend.gainingTrendiness = TRUE;
|
||||||
|
SeedTrendRng(&trend);
|
||||||
|
|
||||||
for (i = 0; i < 5; i++)
|
for (i = 0; i < SAVED_TRENDS_COUNT; i++)
|
||||||
{
|
{
|
||||||
if (sub_8122A58(&s, &(gSaveBlock1Ptr->easyChatPairs[i]), 0))
|
if (CompareTrends(&trend, &(gSaveBlock1Ptr->dewfordTrends[i]), SORT_MODE_NORMAL))
|
||||||
{
|
{
|
||||||
u16 r3 = 4;
|
// New trend is "trendier" than dewfordTrend[i]
|
||||||
|
// Shift other trends back to insert new trend
|
||||||
while (r3 > i)
|
u16 j = SAVED_TRENDS_COUNT - 1;
|
||||||
|
while (j > i)
|
||||||
{
|
{
|
||||||
gSaveBlock1Ptr->easyChatPairs[r3] = gSaveBlock1Ptr->easyChatPairs[r3 - 1];
|
gSaveBlock1Ptr->dewfordTrends[j] = gSaveBlock1Ptr->dewfordTrends[j - 1];
|
||||||
r3--;
|
j--;
|
||||||
}
|
}
|
||||||
gSaveBlock1Ptr->easyChatPairs[i] = s;
|
gSaveBlock1Ptr->dewfordTrends[i] = trend;
|
||||||
if(i == 4)
|
|
||||||
sub_80EDC60(a);
|
if (i == SAVED_TRENDS_COUNT - 1)
|
||||||
|
TryPutTrendWatcherOnAir(phrase);
|
||||||
|
|
||||||
|
// If i is 0, the given phrase is the new current phrase
|
||||||
return (i == 0);
|
return (i == 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gSaveBlock1Ptr->easyChatPairs[4] = s;
|
|
||||||
sub_80EDC60(a);
|
// New trend is less "trendy" than all other saved trends, put it in last
|
||||||
|
gSaveBlock1Ptr->dewfordTrends[SAVED_TRENDS_COUNT - 1] = trend;
|
||||||
|
TryPutTrendWatcherOnAir(phrase);
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void sub_8122804(struct EasyChatPair *s, u16 b, u8 c)
|
static void SortTrends(struct DewfordTrend *trends, u16 numTrends, u8 mode)
|
||||||
{
|
{
|
||||||
u16 h;
|
|
||||||
|
|
||||||
for (h = 0; h < b; h++)
|
|
||||||
{
|
|
||||||
u16 i;
|
u16 i;
|
||||||
|
for (i = 0; i < numTrends; i++)
|
||||||
for (i = h + 1; i < b; i++)
|
|
||||||
{
|
{
|
||||||
if (sub_8122A58(&s[i], &s[h], c))
|
u16 j;
|
||||||
|
for (j = i + 1; j < numTrends; j++)
|
||||||
{
|
{
|
||||||
struct EasyChatPair temp;
|
if (CompareTrends(&trends[j], &trends[i], mode))
|
||||||
|
{
|
||||||
temp = s[i];
|
struct DewfordTrend temp;
|
||||||
s[i] = s[h];
|
SWAP(trends[j], trends[i], temp);
|
||||||
s[h] = temp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReceiveEasyChatPairsData(struct EasyChatPair *a, size_t size, u8 unused)
|
#define SAVED_TRENDS_SIZE (sizeof(struct DewfordTrend) * SAVED_TRENDS_COUNT)
|
||||||
{
|
#define BUFFER_SIZE (SAVED_TRENDS_SIZE * MAX_LINK_PLAYERS > 0x100 ? SAVED_TRENDS_SIZE * MAX_LINK_PLAYERS : 0x100) // More space was allocated than needed
|
||||||
u16 i, j, r3, players;
|
|
||||||
struct EasyChatPair *buffer1, *buffer2, *src, *dst, *foo_of_buffer2;
|
|
||||||
|
|
||||||
buffer1 = Alloc(0x100);
|
void ReceiveDewfordTrendData(struct DewfordTrend *linkedTrends, size_t size, u8 unused)
|
||||||
if(buffer1 != NULL)
|
{
|
||||||
|
u16 i, j, numTrends, players;
|
||||||
|
struct DewfordTrend *linkedTrendsBuffer, *savedTrendsBuffer, *src, *dst, *temp;
|
||||||
|
|
||||||
|
// Exit if alloc fails
|
||||||
|
if (!(linkedTrendsBuffer = Alloc(BUFFER_SIZE)))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Exit if alloc fails
|
||||||
|
if (!(savedTrendsBuffer = Alloc(BUFFER_SIZE)))
|
||||||
{
|
{
|
||||||
buffer2 = Alloc(0x100);
|
Free(linkedTrendsBuffer);
|
||||||
if(buffer2 == NULL)
|
return;
|
||||||
{
|
|
||||||
Free(buffer1);
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
// Buffer the new trends being received via Record Mixing
|
||||||
players = GetLinkPlayerCount();
|
players = GetLinkPlayerCount();
|
||||||
for (i = 0; i < players; i++)
|
for (i = 0; i < players; i++)
|
||||||
memcpy(&(buffer1[i * 5]), (u8 *)a + i * size, 40);
|
memcpy(&linkedTrendsBuffer[i * SAVED_TRENDS_COUNT], (u8 *)linkedTrends + i * size, SAVED_TRENDS_SIZE);
|
||||||
src = buffer1;
|
|
||||||
dst = buffer2;
|
// Determine which of the received trends should be saved.
|
||||||
r3 = 0;
|
// savedTrendsBuffer starts empty, and when finished will contain
|
||||||
|
// which of the linked trends to save in the saveblock.
|
||||||
|
src = linkedTrendsBuffer;
|
||||||
|
dst = savedTrendsBuffer;
|
||||||
|
numTrends = 0;
|
||||||
for (i = 0; i < players; i++)
|
for (i = 0; i < players; i++)
|
||||||
{
|
{
|
||||||
for (j = 0; j < 5; j++)
|
for (j = 0; j < SAVED_TRENDS_COUNT; j++)
|
||||||
{
|
{
|
||||||
s16 foo = GetEqualEasyChatPairIndex(buffer2, src, r3);
|
s16 idx = GetSavedTrendIndex(savedTrendsBuffer, src, numTrends);
|
||||||
if (foo < 0)
|
if (idx < 0)
|
||||||
{
|
{
|
||||||
|
// This phrase is not a currently saved trend, save it
|
||||||
*(dst++) = *src;
|
*(dst++) = *src;
|
||||||
r3++;
|
numTrends++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foo_of_buffer2 = (struct EasyChatPair *)((u32)buffer2 + (foo * 8)); //required to do this to reverse the order of register operands in add ASM statement
|
// This phrase already exists as a saved phrase
|
||||||
if (foo_of_buffer2->unk0_0 < src->unk0_0)
|
// Only overwrrite it if it's "trendier"
|
||||||
|
temp = &savedTrendsBuffer[idx];
|
||||||
|
if (temp->trendiness < src->trendiness)
|
||||||
{
|
{
|
||||||
*foo_of_buffer2 = *src;
|
*temp = *src;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
src++;
|
src++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sub_8122804(buffer2, r3, 2);
|
SortTrends(savedTrendsBuffer, numTrends, SORT_MODE_FULL);
|
||||||
src = buffer2;
|
|
||||||
dst = gSaveBlock1Ptr->easyChatPairs;
|
// Overwrite current saved trends with new saved trends
|
||||||
for (i = 0; i < 5; i++)
|
src = savedTrendsBuffer;
|
||||||
|
dst = gSaveBlock1Ptr->dewfordTrends;
|
||||||
|
for (i = 0; i < SAVED_TRENDS_COUNT; i++)
|
||||||
*(dst++) = *(src++);
|
*(dst++) = *(src++);
|
||||||
Free(buffer1);
|
|
||||||
Free(buffer2);
|
Free(linkedTrendsBuffer);
|
||||||
}
|
Free(savedTrendsBuffer);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BufferTrendyPhraseString(void)
|
void BufferTrendyPhraseString(void)
|
||||||
{
|
{
|
||||||
struct EasyChatPair *s = &gSaveBlock1Ptr->easyChatPairs[gSpecialVar_0x8004];
|
struct DewfordTrend *trend = &gSaveBlock1Ptr->dewfordTrends[gSpecialVar_0x8004];
|
||||||
|
ConvertEasyChatWordsToString(gStringVar1, trend->words, 2, 1);
|
||||||
ConvertEasyChatWordsToString(gStringVar1, s->words, 2, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrendyPhraseIsOld(void)
|
// Returns TRUE if the current trendy phrase is "boring", FALSE otherwise
|
||||||
|
// This only influences the comment of an NPC inside the Dewford Town Hall
|
||||||
|
void IsTrendyPhraseBoring(void)
|
||||||
{
|
{
|
||||||
u16 result = 0;
|
bool16 result = FALSE;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (gSaveBlock1Ptr->easyChatPairs[0].unk0_0 - gSaveBlock1Ptr->easyChatPairs[1].unk0_0 > 1)
|
if (gSaveBlock1Ptr->dewfordTrends[0].trendiness - gSaveBlock1Ptr->dewfordTrends[1].trendiness > 1)
|
||||||
break;
|
break;
|
||||||
if (gSaveBlock1Ptr->easyChatPairs[0].unk1_6)
|
if (gSaveBlock1Ptr->dewfordTrends[0].gainingTrendiness)
|
||||||
break;
|
break;
|
||||||
if (!gSaveBlock1Ptr->easyChatPairs[1].unk1_6)
|
if (!gSaveBlock1Ptr->dewfordTrends[1].gainingTrendiness)
|
||||||
break;
|
break;
|
||||||
result = 1;
|
result = TRUE;
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
gSpecialVar_Result = result;
|
gSpecialVar_Result = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A painting hangs on the wall of the Dewford Hall
|
||||||
|
// When interacted with it says "{trendy phrase}'S {name} is the title"
|
||||||
|
// {name} is one of 8 pre-set words, depending on the current phrase
|
||||||
|
// See DewfordTown_Hall_EventScript_Painting
|
||||||
void GetDewfordHallPaintingNameIndex(void)
|
void GetDewfordHallPaintingNameIndex(void)
|
||||||
{
|
{
|
||||||
gSpecialVar_Result = (gSaveBlock1Ptr->easyChatPairs[0].words[0] + gSaveBlock1Ptr->easyChatPairs[0].words[1]) & 7;
|
gSpecialVar_Result = (gSaveBlock1Ptr->dewfordTrends[0].words[0] + gSaveBlock1Ptr->dewfordTrends[0].words[1]) & 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool8 sub_8122A58(struct EasyChatPair *a, struct EasyChatPair *b, u8 c)
|
// Returns TRUE if a > b (a is "trendier" than b), FALSE if a < b (b is "trendier" than a)
|
||||||
|
// How one trend is compared to the other depends on the mode
|
||||||
|
// In SORT_MODE_FULL if the trends are equal then TRUE is always returned, otherwise TRUE or FALSE is returned randomly
|
||||||
|
static bool8 CompareTrends(struct DewfordTrend *a, struct DewfordTrend *b, u8 mode)
|
||||||
{
|
{
|
||||||
switch (c)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case 0:
|
case SORT_MODE_NORMAL:
|
||||||
if (a->unk0_0 > b->unk0_0)
|
if (a->trendiness > b->trendiness) return TRUE;
|
||||||
return 1;
|
if (a->trendiness < b->trendiness) return FALSE;
|
||||||
if (a->unk0_0 < b->unk0_0)
|
|
||||||
return 0;
|
if (a->maxTrendiness > b->maxTrendiness) return TRUE;
|
||||||
if (a->unk0_7 > b->unk0_7)
|
if (a->maxTrendiness < b->maxTrendiness) return FALSE;
|
||||||
return 1;
|
|
||||||
if (a->unk0_7 < b->unk0_7)
|
|
||||||
return 0;
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case SORT_MODE_MAX_FIRST: // Unused
|
||||||
if (a->unk0_7 > b->unk0_7)
|
if (a->maxTrendiness > b->maxTrendiness) return TRUE;
|
||||||
return 1;
|
if (a->maxTrendiness < b->maxTrendiness) return FALSE;
|
||||||
if (a->unk0_7 < b->unk0_7)
|
|
||||||
return 0;
|
if (a->trendiness > b->trendiness) return TRUE;
|
||||||
if (a->unk0_0 > b->unk0_0)
|
if (a->trendiness < b->trendiness) return FALSE;
|
||||||
return 1;
|
|
||||||
if (a->unk0_0 < b->unk0_0)
|
|
||||||
return 0;
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case SORT_MODE_FULL:
|
||||||
if (a->unk0_0 > b->unk0_0)
|
if (a->trendiness > b->trendiness) return TRUE;
|
||||||
return 1;
|
if (a->trendiness < b->trendiness) return FALSE;
|
||||||
if (a->unk0_0 < b->unk0_0)
|
|
||||||
return 0;
|
if (a->maxTrendiness > b->maxTrendiness) return TRUE;
|
||||||
if (a->unk0_7 > b->unk0_7)
|
if (a->maxTrendiness < b->maxTrendiness) return FALSE;
|
||||||
return 1;
|
|
||||||
if (a->unk0_7 < b->unk0_7)
|
if (a->rand > b->rand) return TRUE;
|
||||||
return 0;
|
if (a->rand < b->rand) return FALSE;
|
||||||
if (a->unk2 > b->unk2)
|
|
||||||
return 1;
|
if (a->words[0] > b->words[0]) return TRUE;
|
||||||
if (a->unk2 < b->unk2)
|
if (a->words[0] < b->words[0]) return FALSE;
|
||||||
return 0;
|
|
||||||
if (a->words[0] > b->words[0])
|
if (a->words[1] > b->words[1]) return TRUE;
|
||||||
return 1;
|
if (a->words[1] < b->words[1]) return FALSE;
|
||||||
if (a->words[0] < b->words[0])
|
return TRUE;
|
||||||
return 0;
|
|
||||||
if (a->words[1] > b->words[1])
|
|
||||||
return 1;
|
|
||||||
if (a->words[1] < b->words[1])
|
|
||||||
return 0;
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Invalid mode given, or trends are equal in SORT_MODE_NORMAL or SORT_MODE_MAX_FIRST
|
||||||
|
// Randomly pick one of the phrases
|
||||||
return Random() & 1;
|
return Random() & 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sub_8122B28(struct EasyChatPair *s)
|
static void SeedTrendRng(struct DewfordTrend *trend)
|
||||||
{
|
{
|
||||||
u16 r4;
|
u16 rand;
|
||||||
|
|
||||||
r4 = Random() % 98;
|
rand = Random() % 98;
|
||||||
if (r4 > 50)
|
if (rand > 50)
|
||||||
{
|
{
|
||||||
r4 = Random() % 98;
|
rand = Random() % 98;
|
||||||
if (r4 > 80)
|
if (rand > 80)
|
||||||
r4 = Random() % 98;
|
rand = Random() % 98;
|
||||||
}
|
}
|
||||||
s->unk0_7 = r4 + 30;
|
trend->maxTrendiness = rand + 30;
|
||||||
s->unk0_0 = (Random() % (r4 + 1)) + 30;
|
trend->trendiness = (Random() % (rand + 1)) + 30;
|
||||||
s->unk2 = Random();
|
trend->rand = Random();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool8 SB1ContainsWords(u16 *a)
|
static bool8 IsPhraseInSavedTrends(u16 *phrase)
|
||||||
{
|
{
|
||||||
u16 i;
|
u16 i;
|
||||||
|
|
||||||
for (i = 0; i < 5; i++)
|
for (i = 0; i < SAVED_TRENDS_COUNT; i++)
|
||||||
{
|
{
|
||||||
if (IsEasyChatPairEqual(a, gSaveBlock1Ptr->easyChatPairs[i].words) != 0)
|
if (IsEasyChatPairEqual(phrase, gSaveBlock1Ptr->dewfordTrends[i].words))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -332,15 +409,14 @@ static bool8 IsEasyChatPairEqual(u16 *words1, u16 *words2)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static s16 GetEqualEasyChatPairIndex(struct EasyChatPair*s, struct EasyChatPair *a, u16 b)
|
static s16 GetSavedTrendIndex(struct DewfordTrend *savedTrends, struct DewfordTrend *trend, u16 numSaved)
|
||||||
{
|
{
|
||||||
s16 i;
|
s16 i;
|
||||||
|
for (i = 0; i < numSaved; i++)
|
||||||
for (i = 0; i < b; i++)
|
|
||||||
{
|
{
|
||||||
if (IsEasyChatPairEqual(a->words, s->words))
|
if (IsEasyChatPairEqual(trend->words, savedTrends->words))
|
||||||
return i;
|
return i;
|
||||||
s++;
|
savedTrends++;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
+20
-17
@@ -230,14 +230,14 @@ static void DoQuizSetQuestionEasyChatScreen(void);
|
|||||||
#define PALTAG_TRIANGLE_CURSOR 0
|
#define PALTAG_TRIANGLE_CURSOR 0
|
||||||
#define PALTAG_RECTANGLE_CURSOR 1
|
#define PALTAG_RECTANGLE_CURSOR 1
|
||||||
#define PALTAG_MISC_UI 2
|
#define PALTAG_MISC_UI 2
|
||||||
#define PALTAG_3 3
|
#define PALTAG_RS_INTERVIEW_FRAME 3
|
||||||
|
|
||||||
#define GFXTAG_TRIANGLE_CURSOR 0
|
#define GFXTAG_TRIANGLE_CURSOR 0
|
||||||
#define GFXTAG_RECTANGLE_CURSOR 1
|
#define GFXTAG_RECTANGLE_CURSOR 1
|
||||||
#define GFXTAG_SCROLL_INDICATOR 2
|
#define GFXTAG_SCROLL_INDICATOR 2
|
||||||
#define GFXTAG_START_SELECT_BUTTONS 3
|
#define GFXTAG_START_SELECT_BUTTONS 3
|
||||||
#define GFXTAG_MODE_WINDOW 4
|
#define GFXTAG_MODE_WINDOW 4
|
||||||
#define GFXTAG_5 5
|
#define GFXTAG_RS_INTERVIEW_FRAME 5
|
||||||
#define GFXTAG_BUTTON_WINDOW 6
|
#define GFXTAG_BUTTON_WINDOW 6
|
||||||
|
|
||||||
// State values for sEasyChatScreen->inputState
|
// State values for sEasyChatScreen->inputState
|
||||||
@@ -698,13 +698,16 @@ static const u16 sTriangleCursor_Pal[] = INCBIN_U16("graphics/easy_chat/triangle
|
|||||||
static const u32 sTriangleCursor_Gfx[] = INCBIN_U32("graphics/easy_chat/triangle_cursor.4bpp");
|
static const u32 sTriangleCursor_Gfx[] = INCBIN_U32("graphics/easy_chat/triangle_cursor.4bpp");
|
||||||
static const u32 sScrollIndicator_Gfx[] = INCBIN_U32("graphics/easy_chat/scroll_indicator.4bpp");
|
static const u32 sScrollIndicator_Gfx[] = INCBIN_U32("graphics/easy_chat/scroll_indicator.4bpp");
|
||||||
static const u32 sStartSelectButtons_Gfx[] = INCBIN_U32("graphics/easy_chat/start_select_buttons.4bpp");
|
static const u32 sStartSelectButtons_Gfx[] = INCBIN_U32("graphics/easy_chat/start_select_buttons.4bpp");
|
||||||
static const u16 sUnknown_085979C0[] = INCBIN_U16("graphics/misc/interview_frame.gbapal");
|
// In Ruby/Sapphire Easy Chat screens had a black background, and when the player & interviewer were present
|
||||||
static const u32 sUnknown_085979E0[] = INCBIN_U32("graphics/misc/interview_frame.4bpp.lz");
|
// on screen the interview_frame gfx was shown behind them.
|
||||||
|
// In Emerald all Easy Chat screens have a filled background, so these gfx go unused
|
||||||
|
static const u16 sRSInterviewFrame_Pal[] = INCBIN_U16("graphics/easy_chat/interview_frame.gbapal");
|
||||||
|
static const u32 sRSInterviewFrame_Gfx[] = INCBIN_U32("graphics/easy_chat/interview_frame.4bpp.lz");
|
||||||
static const u16 sTextInputFrameOrange_Pal[] = INCBIN_U16("graphics/easy_chat/text_input_frame_orange.gbapal");
|
static const u16 sTextInputFrameOrange_Pal[] = INCBIN_U16("graphics/easy_chat/text_input_frame_orange.gbapal");
|
||||||
static const u16 sTextInputFrameGreen_Pal[] = INCBIN_U16("graphics/easy_chat/text_input_frame_green.gbapal");
|
static const u16 sTextInputFrameGreen_Pal[] = INCBIN_U16("graphics/easy_chat/text_input_frame_green.gbapal");
|
||||||
static const u32 sTextInputFrame_Gfx[] = INCBIN_U32("graphics/easy_chat/text_input_frame.4bpp.lz");
|
static const u32 sTextInputFrame_Gfx[] = INCBIN_U32("graphics/easy_chat/text_input_frame.4bpp.lz");
|
||||||
static const u16 sUnknown_08597C1C[] = INCBIN_U16("graphics/misc/8597C1C.gbapal");
|
static const u16 sTitleText_Pal[] = INCBIN_U16("graphics/easy_chat/title_text.gbapal");
|
||||||
static const u16 sUnknown_08597C24[] = INCBIN_U16("graphics/misc/8597C24.gbapal");
|
static const u16 sText_Pal[] = INCBIN_U16("graphics/easy_chat/text.gbapal");
|
||||||
|
|
||||||
static const struct EasyChatPhraseFrameDimensions sPhraseFrameDimensions[] = {
|
static const struct EasyChatPhraseFrameDimensions sPhraseFrameDimensions[] = {
|
||||||
[FRAMEID_GENERAL_2x2] = {
|
[FRAMEID_GENERAL_2x2] = {
|
||||||
@@ -895,17 +898,17 @@ static const struct SpritePalette sSpritePalettes[] = {
|
|||||||
.tag = PALTAG_MISC_UI, // The palette is generated from the button window but used for various parts of the UI
|
.tag = PALTAG_MISC_UI, // The palette is generated from the button window but used for various parts of the UI
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.data = sUnknown_085979C0,
|
.data = sRSInterviewFrame_Pal,
|
||||||
.tag = PALTAG_3,
|
.tag = PALTAG_RS_INTERVIEW_FRAME,
|
||||||
},
|
},
|
||||||
{0}
|
{0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct CompressedSpriteSheet sCompressedSpriteSheets[] = {
|
static const struct CompressedSpriteSheet sCompressedSpriteSheets[] = {
|
||||||
{
|
{
|
||||||
.data = sUnknown_085979E0,
|
.data = sRSInterviewFrame_Gfx,
|
||||||
.size = 0x800,
|
.size = 0x800,
|
||||||
.tag = GFXTAG_5,
|
.tag = GFXTAG_RS_INTERVIEW_FRAME,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.data = gEasyChatRectangleCursor_Gfx,
|
.data = gEasyChatRectangleCursor_Gfx,
|
||||||
@@ -1477,8 +1480,8 @@ void ShowEasyChatScreen(void)
|
|||||||
break;
|
break;
|
||||||
case EASY_CHAT_TYPE_TRENDY_PHRASE:
|
case EASY_CHAT_TYPE_TRENDY_PHRASE:
|
||||||
words = (u16 *)gStringVar3;
|
words = (u16 *)gStringVar3;
|
||||||
words[0] = gSaveBlock1Ptr->easyChatPairs[0].words[0];
|
words[0] = gSaveBlock1Ptr->dewfordTrends[0].words[0];
|
||||||
words[1] = gSaveBlock1Ptr->easyChatPairs[0].words[1];
|
words[1] = gSaveBlock1Ptr->dewfordTrends[0].words[1];
|
||||||
break;
|
break;
|
||||||
case EASY_CHAT_TYPE_GABBY_AND_TY:
|
case EASY_CHAT_TYPE_GABBY_AND_TY:
|
||||||
words = gSaveBlock1Ptr->gabbyAndTyData.quote;
|
words = gSaveBlock1Ptr->gabbyAndTyData.quote;
|
||||||
@@ -2958,7 +2961,7 @@ static void SetSpecialEasyChatResult(void)
|
|||||||
break;
|
break;
|
||||||
case EASY_CHAT_TYPE_TRENDY_PHRASE:
|
case EASY_CHAT_TYPE_TRENDY_PHRASE:
|
||||||
BufferCurrentPhraseToStringVar2();
|
BufferCurrentPhraseToStringVar2();
|
||||||
gSpecialVar_0x8004 = IsPhraseTrendy(sEasyChatScreen->currentPhrase);
|
gSpecialVar_0x8004 = TrySetTrendyPhrase(sEasyChatScreen->currentPhrase);
|
||||||
break;
|
break;
|
||||||
case EASY_CHAT_TYPE_GOOD_SAYING:
|
case EASY_CHAT_TYPE_GOOD_SAYING:
|
||||||
gSpecialVar_0x8004 = DidPlayerInputABerryMasterWifePhrase();
|
gSpecialVar_0x8004 = DidPlayerInputABerryMasterWifePhrase();
|
||||||
@@ -3914,10 +3917,10 @@ static void LoadEasyChatPalettes(void)
|
|||||||
LoadPalette(gEasyChatMode_Pal, 0, 32);
|
LoadPalette(gEasyChatMode_Pal, 0, 32);
|
||||||
LoadPalette(sTextInputFrameOrange_Pal, 1 * 16, 32);
|
LoadPalette(sTextInputFrameOrange_Pal, 1 * 16, 32);
|
||||||
LoadPalette(sTextInputFrameGreen_Pal, 4 * 16, 32);
|
LoadPalette(sTextInputFrameGreen_Pal, 4 * 16, 32);
|
||||||
LoadPalette(sUnknown_08597C1C, 10 * 16, 8);
|
LoadPalette(sTitleText_Pal, 10 * 16, 8);
|
||||||
LoadPalette(sUnknown_08597C24, 11 * 16, 12);
|
LoadPalette(sText_Pal, 11 * 16, 12);
|
||||||
LoadPalette(sUnknown_08597C24, 15 * 16, 12);
|
LoadPalette(sText_Pal, 15 * 16, 12);
|
||||||
LoadPalette(sUnknown_08597C24, 3 * 16, 12);
|
LoadPalette(sText_Pal, 3 * 16, 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PrintTitle(void)
|
static void PrintTitle(void)
|
||||||
|
|||||||
@@ -1336,7 +1336,7 @@ u16 GetSlotMachineId(void)
|
|||||||
static const u8 sSlotMachineIds[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5};
|
static const u8 sSlotMachineIds[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5};
|
||||||
static const u8 sSlotMachineServiceDayIds[] = {3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5};
|
static const u8 sSlotMachineServiceDayIds[] = {3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5};
|
||||||
|
|
||||||
u32 rnd = gSaveBlock1Ptr->easyChatPairs[0].unk0_0 + gSaveBlock1Ptr->easyChatPairs[0].unk2 + sSlotMachineRandomSeeds[gSpecialVar_0x8004];
|
u32 rnd = gSaveBlock1Ptr->dewfordTrends[0].trendiness + gSaveBlock1Ptr->dewfordTrends[0].rand + sSlotMachineRandomSeeds[gSpecialVar_0x8004];
|
||||||
if (GetPriceReduction(POKENEWS_GAME_CORNER))
|
if (GetPriceReduction(POKENEWS_GAME_CORNER))
|
||||||
{
|
{
|
||||||
return sSlotMachineServiceDayIds[rnd % SLOT_MACHINE_COUNT];
|
return sSlotMachineServiceDayIds[rnd % SLOT_MACHINE_COUNT];
|
||||||
|
|||||||
+718
-627
File diff suppressed because it is too large
Load Diff
@@ -1061,15 +1061,15 @@ static void UpdateWindowsToShowCheckPage(struct Pokenav4Struct *state)
|
|||||||
static void sub_81CC034(struct Pokenav4Struct *state)
|
static void sub_81CC034(struct Pokenav4Struct *state)
|
||||||
{
|
{
|
||||||
state->msgBoxWindowId = AddWindow(&sCallMsgBoxWindowTemplate);
|
state->msgBoxWindowId = AddWindow(&sCallMsgBoxWindowTemplate);
|
||||||
sub_8197184(state->msgBoxWindowId, 1, 4);
|
LoadMatchCallWindowGfx(state->msgBoxWindowId, 1, 4);
|
||||||
sub_81C7B40();
|
sub_81C7B40();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DrawMsgBoxForMatchCallMsg(struct Pokenav4Struct *state)
|
static void DrawMsgBoxForMatchCallMsg(struct Pokenav4Struct *state)
|
||||||
{
|
{
|
||||||
struct Sprite *sprite;
|
struct Sprite *sprite;
|
||||||
sub_8197184(state->msgBoxWindowId, 1, 4);
|
LoadMatchCallWindowGfx(state->msgBoxWindowId, 1, 4);
|
||||||
sub_81971C4(state->msgBoxWindowId, 1, 4);
|
DrawMatchCallTextBoxBorder(state->msgBoxWindowId, 1, 4);
|
||||||
FillWindowPixelBuffer(state->msgBoxWindowId, PIXEL_FILL(1));
|
FillWindowPixelBuffer(state->msgBoxWindowId, PIXEL_FILL(1));
|
||||||
PutWindowTilemap(state->msgBoxWindowId);
|
PutWindowTilemap(state->msgBoxWindowId);
|
||||||
CopyWindowToVram(state->msgBoxWindowId, 3);
|
CopyWindowToVram(state->msgBoxWindowId, 3);
|
||||||
|
|||||||
+9
-9
@@ -50,7 +50,7 @@ struct PlayerRecordsRS
|
|||||||
TVShow tvShows[TV_SHOWS_COUNT];
|
TVShow tvShows[TV_SHOWS_COUNT];
|
||||||
PokeNews pokeNews[POKE_NEWS_COUNT];
|
PokeNews pokeNews[POKE_NEWS_COUNT];
|
||||||
OldMan oldMan;
|
OldMan oldMan;
|
||||||
struct EasyChatPair easyChatPairs[5];
|
struct DewfordTrend dewfordTrends[SAVED_TRENDS_COUNT];
|
||||||
struct RecordMixingDayCareMail dayCareMail;
|
struct RecordMixingDayCareMail dayCareMail;
|
||||||
struct RSBattleTowerRecord battleTowerRecord;
|
struct RSBattleTowerRecord battleTowerRecord;
|
||||||
u16 giftItem;
|
u16 giftItem;
|
||||||
@@ -63,7 +63,7 @@ struct PlayerRecordsEmerald
|
|||||||
/* 0x0c80 */ TVShow tvShows[TV_SHOWS_COUNT];
|
/* 0x0c80 */ TVShow tvShows[TV_SHOWS_COUNT];
|
||||||
/* 0x1004 */ PokeNews pokeNews[POKE_NEWS_COUNT];
|
/* 0x1004 */ PokeNews pokeNews[POKE_NEWS_COUNT];
|
||||||
/* 0x1044 */ OldMan oldMan;
|
/* 0x1044 */ OldMan oldMan;
|
||||||
/* 0x1084 */ struct EasyChatPair easyChatPairs[5];
|
/* 0x1084 */ struct DewfordTrend dewfordTrends[SAVED_TRENDS_COUNT];
|
||||||
/* 0x10ac */ struct RecordMixingDayCareMail dayCareMail;
|
/* 0x10ac */ struct RecordMixingDayCareMail dayCareMail;
|
||||||
/* 0x1124 */ struct EmeraldBattleTowerRecord battleTowerRecord;
|
/* 0x1124 */ struct EmeraldBattleTowerRecord battleTowerRecord;
|
||||||
/* 0x1210 */ u16 giftItem;
|
/* 0x1210 */ u16 giftItem;
|
||||||
@@ -86,7 +86,7 @@ static struct SecretBase *sSecretBasesSave;
|
|||||||
static TVShow *sTvShowsSave;
|
static TVShow *sTvShowsSave;
|
||||||
static PokeNews *sPokeNewsSave;
|
static PokeNews *sPokeNewsSave;
|
||||||
static OldMan *sOldManSave;
|
static OldMan *sOldManSave;
|
||||||
static struct EasyChatPair *sEasyChatPairsSave;
|
static struct DewfordTrend *sDewfordTrendsSave;
|
||||||
static struct RecordMixingDayCareMail *gUnknown_03001148;
|
static struct RecordMixingDayCareMail *gUnknown_03001148;
|
||||||
static void *sBattleTowerSave;
|
static void *sBattleTowerSave;
|
||||||
static LilycoveLady *sLilycoveLadySave;
|
static LilycoveLady *sLilycoveLadySave;
|
||||||
@@ -179,7 +179,7 @@ static void SetSrcLookupPointers(void)
|
|||||||
sTvShowsSave = gSaveBlock1Ptr->tvShows;
|
sTvShowsSave = gSaveBlock1Ptr->tvShows;
|
||||||
sPokeNewsSave = gSaveBlock1Ptr->pokeNews;
|
sPokeNewsSave = gSaveBlock1Ptr->pokeNews;
|
||||||
sOldManSave = &gSaveBlock1Ptr->oldMan;
|
sOldManSave = &gSaveBlock1Ptr->oldMan;
|
||||||
sEasyChatPairsSave = gSaveBlock1Ptr->easyChatPairs;
|
sDewfordTrendsSave = gSaveBlock1Ptr->dewfordTrends;
|
||||||
gUnknown_03001148 = &gUnknown_02039F9C;
|
gUnknown_03001148 = &gUnknown_02039F9C;
|
||||||
sBattleTowerSave = &gSaveBlock2Ptr->frontier.towerPlayer;
|
sBattleTowerSave = &gSaveBlock2Ptr->frontier.towerPlayer;
|
||||||
sLilycoveLadySave = &gSaveBlock1Ptr->lilycoveLady;
|
sLilycoveLadySave = &gSaveBlock1Ptr->lilycoveLady;
|
||||||
@@ -194,7 +194,7 @@ static void PrepareUnknownExchangePacket(struct PlayerRecordsRS *dest)
|
|||||||
sub_80F14F8(dest->tvShows);
|
sub_80F14F8(dest->tvShows);
|
||||||
memcpy(dest->pokeNews, sPokeNewsSave, sizeof(dest->pokeNews));
|
memcpy(dest->pokeNews, sPokeNewsSave, sizeof(dest->pokeNews));
|
||||||
memcpy(&dest->oldMan, sOldManSave, sizeof(dest->oldMan));
|
memcpy(&dest->oldMan, sOldManSave, sizeof(dest->oldMan));
|
||||||
memcpy(dest->easyChatPairs, sEasyChatPairsSave, sizeof(dest->easyChatPairs));
|
memcpy(dest->dewfordTrends, sDewfordTrendsSave, sizeof(dest->dewfordTrends));
|
||||||
sub_80E89F8(&dest->dayCareMail);
|
sub_80E89F8(&dest->dayCareMail);
|
||||||
EmeraldBattleTowerRecordToRuby(sBattleTowerSave, &dest->battleTowerRecord);
|
EmeraldBattleTowerRecordToRuby(sBattleTowerSave, &dest->battleTowerRecord);
|
||||||
|
|
||||||
@@ -211,7 +211,7 @@ static void PrepareExchangePacketForRubySapphire(struct PlayerRecordsRS *dest)
|
|||||||
memcpy(dest->pokeNews, sPokeNewsSave, sizeof(dest->pokeNews));
|
memcpy(dest->pokeNews, sPokeNewsSave, sizeof(dest->pokeNews));
|
||||||
memcpy(&dest->oldMan, sOldManSave, sizeof(dest->oldMan));
|
memcpy(&dest->oldMan, sOldManSave, sizeof(dest->oldMan));
|
||||||
sub_8120B70(&dest->oldMan);
|
sub_8120B70(&dest->oldMan);
|
||||||
memcpy(dest->easyChatPairs, sEasyChatPairsSave, sizeof(dest->easyChatPairs));
|
memcpy(dest->dewfordTrends, sDewfordTrendsSave, sizeof(dest->dewfordTrends));
|
||||||
sub_80E89F8(&dest->dayCareMail);
|
sub_80E89F8(&dest->dayCareMail);
|
||||||
SanitizeDayCareMailForRuby(&dest->dayCareMail);
|
SanitizeDayCareMailForRuby(&dest->dayCareMail);
|
||||||
EmeraldBattleTowerRecordToRuby(sBattleTowerSave, &dest->battleTowerRecord);
|
EmeraldBattleTowerRecordToRuby(sBattleTowerSave, &dest->battleTowerRecord);
|
||||||
@@ -241,7 +241,7 @@ static void PrepareExchangePacket(void)
|
|||||||
memcpy(sSentRecord->emerald.pokeNews, sPokeNewsSave, sizeof(sSentRecord->emerald.pokeNews));
|
memcpy(sSentRecord->emerald.pokeNews, sPokeNewsSave, sizeof(sSentRecord->emerald.pokeNews));
|
||||||
memcpy(&sSentRecord->emerald.oldMan, sOldManSave, sizeof(sSentRecord->emerald.oldMan));
|
memcpy(&sSentRecord->emerald.oldMan, sOldManSave, sizeof(sSentRecord->emerald.oldMan));
|
||||||
memcpy(&sSentRecord->emerald.lilycoveLady, sLilycoveLadySave, sizeof(sSentRecord->emerald.lilycoveLady));
|
memcpy(&sSentRecord->emerald.lilycoveLady, sLilycoveLadySave, sizeof(sSentRecord->emerald.lilycoveLady));
|
||||||
memcpy(sSentRecord->emerald.easyChatPairs, sEasyChatPairsSave, sizeof(sSentRecord->emerald.easyChatPairs));
|
memcpy(sSentRecord->emerald.dewfordTrends, sDewfordTrendsSave, sizeof(sSentRecord->emerald.dewfordTrends));
|
||||||
sub_80E89F8(&sSentRecord->emerald.dayCareMail);
|
sub_80E89F8(&sSentRecord->emerald.dayCareMail);
|
||||||
memcpy(&sSentRecord->emerald.battleTowerRecord, sBattleTowerSave, sizeof(sSentRecord->emerald.battleTowerRecord));
|
memcpy(&sSentRecord->emerald.battleTowerRecord, sBattleTowerSave, sizeof(sSentRecord->emerald.battleTowerRecord));
|
||||||
SanitizeEmeraldBattleTowerRecord(&sSentRecord->emerald.battleTowerRecord);
|
SanitizeEmeraldBattleTowerRecord(&sSentRecord->emerald.battleTowerRecord);
|
||||||
@@ -266,7 +266,7 @@ static void ReceiveExchangePacket(u32 which)
|
|||||||
ReceiveTvShowsData(sReceivedRecords->ruby.tvShows, sizeof(struct PlayerRecordsRS), which);
|
ReceiveTvShowsData(sReceivedRecords->ruby.tvShows, sizeof(struct PlayerRecordsRS), which);
|
||||||
ReceivePokeNewsData(sReceivedRecords->ruby.pokeNews, sizeof(struct PlayerRecordsRS), which);
|
ReceivePokeNewsData(sReceivedRecords->ruby.pokeNews, sizeof(struct PlayerRecordsRS), which);
|
||||||
ReceiveOldManData(&sReceivedRecords->ruby.oldMan, sizeof(struct PlayerRecordsRS), which);
|
ReceiveOldManData(&sReceivedRecords->ruby.oldMan, sizeof(struct PlayerRecordsRS), which);
|
||||||
ReceiveEasyChatPairsData(sReceivedRecords->ruby.easyChatPairs, sizeof(struct PlayerRecordsRS), which);
|
ReceiveDewfordTrendData(sReceivedRecords->ruby.dewfordTrends, sizeof(struct PlayerRecordsRS), which);
|
||||||
ReceiveGiftItem(&sReceivedRecords->ruby.giftItem, which);
|
ReceiveGiftItem(&sReceivedRecords->ruby.giftItem, which);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -277,7 +277,7 @@ static void ReceiveExchangePacket(u32 which)
|
|||||||
ReceiveTvShowsData(sReceivedRecords->emerald.tvShows, sizeof(struct PlayerRecordsEmerald), which);
|
ReceiveTvShowsData(sReceivedRecords->emerald.tvShows, sizeof(struct PlayerRecordsEmerald), which);
|
||||||
ReceivePokeNewsData(sReceivedRecords->emerald.pokeNews, sizeof(struct PlayerRecordsEmerald), which);
|
ReceivePokeNewsData(sReceivedRecords->emerald.pokeNews, sizeof(struct PlayerRecordsEmerald), which);
|
||||||
ReceiveOldManData(&sReceivedRecords->emerald.oldMan, sizeof(struct PlayerRecordsEmerald), which);
|
ReceiveOldManData(&sReceivedRecords->emerald.oldMan, sizeof(struct PlayerRecordsEmerald), which);
|
||||||
ReceiveEasyChatPairsData(sReceivedRecords->emerald.easyChatPairs, sizeof(struct PlayerRecordsEmerald), which);
|
ReceiveDewfordTrendData(sReceivedRecords->emerald.dewfordTrends, sizeof(struct PlayerRecordsEmerald), which);
|
||||||
ReceiveDaycareMailData(&sReceivedRecords->emerald.dayCareMail, sizeof(struct PlayerRecordsEmerald), which, sReceivedRecords->emerald.tvShows);
|
ReceiveDaycareMailData(&sReceivedRecords->emerald.dayCareMail, sizeof(struct PlayerRecordsEmerald), which, sReceivedRecords->emerald.tvShows);
|
||||||
ReceiveBattleTowerData(&sReceivedRecords->emerald.battleTowerRecord, sizeof(struct PlayerRecordsEmerald), which);
|
ReceiveBattleTowerData(&sReceivedRecords->emerald.battleTowerRecord, sizeof(struct PlayerRecordsEmerald), which);
|
||||||
ReceiveGiftItem(&sReceivedRecords->emerald.giftItem, which);
|
ReceiveGiftItem(&sReceivedRecords->emerald.giftItem, which);
|
||||||
|
|||||||
@@ -504,13 +504,13 @@ static const u8 *const sTVTodaysRivalTrainerTextGroup[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const u8 *const sTVDewfordTrendWatcherNetworkTextGroup[] = {
|
static const u8 *const sTVDewfordTrendWatcherNetworkTextGroup[] = {
|
||||||
gTVDewfordTrendWatcherNetworkText00,
|
[TRENDWATCHER_STATE_INTRO] = TrendWatcher_Text_Intro,
|
||||||
gTVDewfordTrendWatcherNetworkText01,
|
[TRENDWATCHER_STATE_TAUGHT_MALE] = TrendWatcher_Text_MaleTaughtMePhrase,
|
||||||
gTVDewfordTrendWatcherNetworkText02,
|
[TRENDWATCHER_STATE_TAUGHT_FEMALE] = TrendWatcher_Text_FemaleTaughtMePhrase,
|
||||||
gTVDewfordTrendWatcherNetworkText03,
|
[TRENDWATCHER_STATE_PHRASE_HOPELESS] = TrendWatcher_Text_PhraseWasHopeless,
|
||||||
gTVDewfordTrendWatcherNetworkText04,
|
[TRENDWATCHER_STATE_BIGGER_MALE] = TrendWatcher_Text_MaleTellMeBigger,
|
||||||
gTVDewfordTrendWatcherNetworkText05,
|
[TRENDWATCHER_STATE_BIGGER_FEMALE] = TrendWatcher_Text_FemaleTellMeBigger,
|
||||||
gTVDewfordTrendWatcherNetworkText06
|
[TRENDWATCHER_STATE_OUTRO] = TrendWatcher_Text_Outro
|
||||||
};
|
};
|
||||||
|
|
||||||
static const u8 *const sTVHoennTreasureInvestisatorsTextGroup[] = {
|
static const u8 *const sTVHoennTreasureInvestisatorsTextGroup[] = {
|
||||||
@@ -1972,7 +1972,7 @@ void TryPutTodaysRivalTrainerOnAir(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_80EDC60(const u16 *words)
|
void TryPutTrendWatcherOnAir(const u16 *words)
|
||||||
{
|
{
|
||||||
TVShow *show;
|
TVShow *show;
|
||||||
|
|
||||||
@@ -5979,45 +5979,37 @@ static void DoTVShowDewfordTrendWatcherNetwork(void)
|
|||||||
state = sTVShowState;
|
state = sTVShowState;
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case 0:
|
case TRENDWATCHER_STATE_INTRO:
|
||||||
CopyEasyChatWord(gStringVar1, show->trendWatcher.words[0]);
|
CopyEasyChatWord(gStringVar1, show->trendWatcher.words[0]);
|
||||||
CopyEasyChatWord(gStringVar2, show->trendWatcher.words[1]);
|
CopyEasyChatWord(gStringVar2, show->trendWatcher.words[1]);
|
||||||
if (show->trendWatcher.gender == MALE)
|
if (show->trendWatcher.gender == MALE)
|
||||||
{
|
sTVShowState = TRENDWATCHER_STATE_TAUGHT_MALE;
|
||||||
sTVShowState = 1;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
sTVShowState = TRENDWATCHER_STATE_TAUGHT_FEMALE;
|
||||||
sTVShowState = 2;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case TRENDWATCHER_STATE_TAUGHT_MALE:
|
||||||
case 2:
|
case TRENDWATCHER_STATE_TAUGHT_FEMALE:
|
||||||
CopyEasyChatWord(gStringVar1, show->trendWatcher.words[0]);
|
CopyEasyChatWord(gStringVar1, show->trendWatcher.words[0]);
|
||||||
CopyEasyChatWord(gStringVar2, show->trendWatcher.words[1]);
|
CopyEasyChatWord(gStringVar2, show->trendWatcher.words[1]);
|
||||||
TVShowConvertInternationalString(gStringVar3, show->trendWatcher.playerName, show->trendWatcher.language);
|
TVShowConvertInternationalString(gStringVar3, show->trendWatcher.playerName, show->trendWatcher.language);
|
||||||
sTVShowState = 3;
|
sTVShowState = TRENDWATCHER_STATE_PHRASE_HOPELESS;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case TRENDWATCHER_STATE_PHRASE_HOPELESS:
|
||||||
CopyEasyChatWord(gStringVar1, show->trendWatcher.words[0]);
|
CopyEasyChatWord(gStringVar1, show->trendWatcher.words[0]);
|
||||||
CopyEasyChatWord(gStringVar2, show->trendWatcher.words[1]);
|
CopyEasyChatWord(gStringVar2, show->trendWatcher.words[1]);
|
||||||
if (show->trendWatcher.gender == MALE)
|
if (show->trendWatcher.gender == MALE)
|
||||||
{
|
sTVShowState = TRENDWATCHER_STATE_BIGGER_MALE;
|
||||||
sTVShowState = 4;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
sTVShowState = TRENDWATCHER_STATE_BIGGER_FEMALE;
|
||||||
sTVShowState = 5;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 4:
|
case TRENDWATCHER_STATE_BIGGER_MALE:
|
||||||
case 5:
|
case TRENDWATCHER_STATE_BIGGER_FEMALE:
|
||||||
CopyEasyChatWord(gStringVar1, show->trendWatcher.words[0]);
|
CopyEasyChatWord(gStringVar1, show->trendWatcher.words[0]);
|
||||||
CopyEasyChatWord(gStringVar2, show->trendWatcher.words[1]);
|
CopyEasyChatWord(gStringVar2, show->trendWatcher.words[1]);
|
||||||
TVShowConvertInternationalString(gStringVar3, show->trendWatcher.playerName, show->trendWatcher.language);
|
TVShowConvertInternationalString(gStringVar3, show->trendWatcher.playerName, show->trendWatcher.language);
|
||||||
sTVShowState = 6;
|
sTVShowState = TRENDWATCHER_STATE_OUTRO;
|
||||||
break;
|
break;
|
||||||
case 6:
|
case TRENDWATCHER_STATE_OUTRO:
|
||||||
CopyEasyChatWord(gStringVar1, show->trendWatcher.words[0]);
|
CopyEasyChatWord(gStringVar1, show->trendWatcher.words[0]);
|
||||||
CopyEasyChatWord(gStringVar2, show->trendWatcher.words[1]);
|
CopyEasyChatWord(gStringVar2, show->trendWatcher.words[1]);
|
||||||
TVShowDone();
|
TVShowDone();
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ static bool8 CheckFeebas(void)
|
|||||||
if (Random() % 100 > 49) // 50% chance of encountering Feebas
|
if (Random() % 100 > 49) // 50% chance of encountering Feebas
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
FeebasSeedRng(gSaveBlock1Ptr->easyChatPairs[0].unk2);
|
FeebasSeedRng(gSaveBlock1Ptr->dewfordTrends[0].rand);
|
||||||
for (i = 0; i != NUM_FEEBAS_SPOTS;)
|
for (i = 0; i != NUM_FEEBAS_SPOTS;)
|
||||||
{
|
{
|
||||||
feebasSpots[i] = FeebasRandom() % 447;
|
feebasSpots[i] = FeebasRandom() % 447;
|
||||||
|
|||||||
Reference in New Issue
Block a user