Merge pull request #530 from red031000/master

clean up easy_chat.c
This commit is contained in:
Akira Akashi 2023-07-22 02:51:40 +01:00 committed by GitHub
commit fab0794ca3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 911 additions and 488 deletions

View File

@ -43,7 +43,7 @@ Static arm9
Object unk_02012944.o
Object unk_02012CC8.o
Object mail_message.o
Object unk_020139D8.o
Object easy_chat.o
Object unk_02013CD4.o
Object unk_020142EC.o
Object unk_020144FC.o

View File

@ -1837,7 +1837,7 @@ _02052D3C:
cmp r1, #0x0
blt _02052D80
ldr r0, [sp, #0x20]
bl sub_02013C18
bl Save_EasyChat_SetGreetingFlag
_02052D80:
cmp r4, #0x7
bhi _02052DB8

View File

@ -1538,7 +1538,7 @@ sub_02065FF8: ; 0x02065FF8
ldr r0, [r0, #0x8]
cmp r0, #0x0
beq _0206600E
bl StringSetEmpty
bl String_SetEmpty
_0206600E:
pop {r3, pc}
@ -2076,7 +2076,7 @@ _02066426:
mov r0, #0x45
lsl r0, r0, #0x2
ldr r0, [r5, r0]
bl StringSetEmpty
bl String_SetEmpty
mov r0, #0x1
str r0, [sp, #0x0]
mov r0, #0x2

View File

@ -1787,7 +1787,7 @@ _020819A2:
add r0, r6, #0x0
add r0, #0xe8
ldr r0, [r0, #0x0]
bl StringSetEmpty
bl String_SetEmpty
add r1, r6, #0x0
add r1, #0xe8
ldr r1, [r1, #0x0]

View File

@ -547,7 +547,7 @@ sub_02083888: ; 0x02083888
add r4, #0xe8
lsl r7, r0, #0x2
ldr r0, [r4, r7]
bl StringSetEmpty
bl String_SetEmpty
ldr r0, [r4, r7]
add r1, r5, #0x4
bl CopyU16ArrayToString

View File

@ -742,7 +742,7 @@ _02089078:
ldr r1, [sp, #0x8]
ldr r0, [sp, #0xc]
sub r1, r2, r1
bl sub_02013B68
bl Save_EasyChat_GetTrendySayingFlag
cmp r0, #0x0
beq _020890AA
ldrh r3, [r5, #0x0]
@ -809,7 +809,7 @@ _020890F4:
bhi _0208910C
ldr r0, [sp, #0x10]
sub r1, r1, r6
bl sub_02013C0C
bl Save_EasyChat_GetGreetingsFlag
cmp r0, #0x0
beq _0208912E
_0208910C:

View File

@ -908,17 +908,17 @@
.extern EasyChatManager_ReadWordIntoString
.extern GetECWordIntoStringByIndex
.extern GetECWordIndexByPair
.extern sub_02013B28
.extern sub_02013B2C
.extern Save_EasyChat_sizeof
.extern Save_EasyChat_Init
.extern Save_EasyChat_Get
.extern sub_02013B68
.extern Save_EasyChat_RandomTrendySayingSet
.extern Save_EasyChat_GetTrendySayingFlag
.extern Save_EasyChat_SetRandomTrendySaying
.extern Save_EasyChat_TrendySayingsUnlockedAllCheck
.extern TrendyWordIdxToECWord
.extern sub_02013C0C
.extern sub_02013C18
.extern sub_02013C28
.extern sub_02013C6C
.extern Save_EasyChat_GetGreetingsFlag
.extern Save_EasyChat_SetGreetingFlag
.extern GetDuplicateWordNum
.extern RemapDuplicateWord
.extern sub_02013CD4
.extern sub_02013D18
.extern sub_02013D5C
@ -1390,7 +1390,7 @@
.extern StringGetWidth_SingleLine_HandleClearToControlCode
.extern String_New
.extern String_Delete
.extern StringSetEmpty
.extern String_SetEmpty
.extern StringCopy
.extern StringDup
.extern String16_FormatInteger

View File

@ -40451,25 +40451,25 @@ ov06_0224D14C: ; 0x0224D14C
ldr r0, [sp, #0x48]
str r0, [sp, #0x48]
ldr r0, [sp, #4]
bl sub_02013C28
bl GetDuplicateWordNum
add r0, r0, #1
lsl r0, r0, #0x18
lsr r0, r0, #0x18
str r0, [sp, #0x2c]
ldr r0, [sp, #8]
bl sub_02013C28
bl GetDuplicateWordNum
add r0, r0, #1
lsl r0, r0, #0x18
lsr r0, r0, #0x18
str r0, [sp, #0x28]
ldr r0, [sp, #0xc]
bl sub_02013C28
bl GetDuplicateWordNum
add r0, r0, #1
lsl r0, r0, #0x18
lsr r0, r0, #0x18
str r0, [sp, #0x24]
ldr r0, [sp, #0x48]
bl sub_02013C28
bl GetDuplicateWordNum
add r0, r0, #1
lsl r0, r0, #0x18
lsr r0, r0, #0x18
@ -40502,19 +40502,19 @@ _0224D1BA:
_0224D1C2:
ldr r0, [sp, #4]
ldr r1, [sp, #0x18]
bl sub_02013C6C
bl RemapDuplicateWord
add r4, r0, #0
ldr r0, [sp, #8]
ldr r1, [sp, #0x14]
bl sub_02013C6C
bl RemapDuplicateWord
add r6, r0, #0
ldr r0, [sp, #0xc]
ldr r1, [sp, #0x10]
bl sub_02013C6C
bl RemapDuplicateWord
add r7, r0, #0
ldr r0, [sp, #0x48]
add r1, r5, #0
bl sub_02013C6C
bl RemapDuplicateWord
str r0, [sp]
ldr r0, [sp, #0x1c]
add r1, r4, #0

View File

@ -9284,7 +9284,7 @@ _021DBF8C:
ldr r1, [r4, #0x14]
bl StringCopy
ldr r0, [r4, #0x14]
bl StringSetEmpty
bl String_SetEmpty
_021DBF9A:
ldrh r1, [r4, #6]
cmp r1, #0

View File

@ -2678,7 +2678,7 @@ ov55_021D8A28: ; 0x021D8A28
add r4, r6, #0
_021D8A46:
ldr r0, [r5, #0x38]
bl StringSetEmpty
bl String_SetEmpty
add r0, r7, #0
add r1, r4, #0
bl sub_0202842C
@ -5094,7 +5094,7 @@ ov55_021D9E40: ; 0x021D9E40
b _021D9EBE
_021D9EB8:
ldr r0, [r0, #0x18]
bl StringSetEmpty
bl String_SetEmpty
_021D9EBE:
add r0, r6, #0
add sp, #4

View File

@ -2650,7 +2650,7 @@ BOOL ov59_MasterController(ov59_IntroOverlayData *data)
case -2:
case 2:
StringSetEmpty(data->playerStruct->name);
String_SetEmpty(data->playerStruct->name);
data->nextControllerCounter = 63;
data->controllerCounter = 81;
break;
@ -2822,7 +2822,7 @@ BOOL ov59_MasterController(ov59_IntroOverlayData *data)
case -2:
case 2:
StringSetEmpty(data->rivalStruct->name);
String_SetEmpty(data->rivalStruct->name);
data->controllerCounter = 88;
break;
}

View File

@ -1018,7 +1018,7 @@ ov60_021D7D18: ; 0x021D7D18
str r1, [sp, #0xc]
bl AddTextPrinterParameterized2
add r0, r5, #0
bl StringSetEmpty
bl String_SetEmpty
ldr r1, _021D7DF0 ; =gGameVersion
ldr r0, [r6, #0x20]
ldrb r1, [r1]
@ -1042,7 +1042,7 @@ ov60_021D7D18: ; 0x021D7D18
add r7, #0x3c
_021D7D7E:
add r0, r5, #0
bl StringSetEmpty
bl String_SetEmpty
ldr r0, [r6, #0x20]
add r1, r4, #3
add r2, r5, #0

View File

@ -1588,7 +1588,7 @@ _021D8164:
str r0, [sp, #0x18]
_021D8196:
add r0, r5, #0
bl StringSetEmpty
bl String_SetEmpty
ldr r0, [r4, #0x20]
add r1, r6, #0
add r2, r5, #0

View File

@ -2165,7 +2165,7 @@ _021D85B4:
add r1, r1, r5
bl ov65_021D847C
ldr r0, [r4, #0x34]
bl StringSetEmpty
bl String_SetEmpty
ldr r0, [r4, #0x20]
add r0, r0, r5
ldrb r2, [r0, #0x1f]
@ -2339,7 +2339,7 @@ ov65_021D8718: ; 0x021D8718
sub sp, #8
add r4, r0, #0
ldr r0, [r4, #0x34]
bl StringSetEmpty
bl String_SetEmpty
ldrb r1, [r4, #0x1a]
ldr r2, [r4, #0x20]
ldr r0, [r4, #0x28]
@ -2376,7 +2376,7 @@ ov65_021D8764: ; 0x021D8764
sub sp, #8
add r4, r0, #0
ldr r0, [r4, #0x34]
bl StringSetEmpty
bl String_SetEmpty
ldrb r1, [r4, #0x1a]
ldr r2, [r4, #0x20]
ldr r0, [r4, #0x28]
@ -3844,7 +3844,7 @@ ov65_021D92C4: ; 0x021D92C4
mov r1, #0xff
bl FillWindowPixelBuffer
ldr r0, [r4, #0x20]
bl StringSetEmpty
bl String_SetEmpty
mov r0, #1
str r0, [sp]
mov r3, #2

View File

@ -1299,7 +1299,7 @@ _021D7EF8:
add r0, r6, #0
add r0, #0x88
ldr r0, [r0]
bl StringSetEmpty
bl String_SetEmpty
ldr r2, [r4, #0x18]
ldr r3, [r4, #0x1c]
add r0, r6, #0
@ -1717,7 +1717,7 @@ ov66_021D820C: ; 0x021D820C
ldr r6, [r5, #0x34]
add r7, r2, #0
str r3, [sp, #0x10]
bl StringSetEmpty
bl String_SetEmpty
add r0, r4, #0
mov r1, #0
bl FillWindowPixelBuffer

View File

@ -1219,7 +1219,7 @@ _021D7E5E:
mov r0, #0x19
lsl r0, r0, #4
ldr r0, [r5, r0]
bl StringSetEmpty
bl String_SetEmpty
_021D7E68:
mov r1, #0
str r1, [sp]

View File

@ -1443,7 +1443,7 @@ ov74_021D8008: ; 0x021D8008
add r1, sp, #0x10
bl sub_0202A864
ldr r0, [r4, #0x30]
bl StringSetEmpty
bl String_SetEmpty
mov r1, #0
str r1, [sp]
mov r0, #1

257
arm9/src/easy_chat.c Normal file
View File

@ -0,0 +1,257 @@
#include "global.h"
#include "msgdata.h"
#include "heap.h"
#include "save.h"
#include "math_util.h"
#include "easy_chat.h"
#include "msgdata/msg.naix"
#include "constants/abilities.h"
#include "constants/easy_chat.h"
#include "constants/moves.h"
#include "msgdata/msg/narc_0390.h"
static const u8 sLanguageToGreetingMap[6][2] = {
{ LANGUAGE_JAPANESE, narc_0390_konnichiwa },
{ LANGUAGE_ENGLISH, narc_0390_hello },
{ LANGUAGE_FRENCH, narc_0390_bonjour },
{ LANGUAGE_ITALIAN, narc_0390_ciao },
{ LANGUAGE_GERMAN, narc_0390_hallo },
{ LANGUAGE_SPANISH, narc_0390_hola },
};
static const u16 sNarcMsgBanks[EC_GROUP_MAX] = {
NARC_msg_narc_0362_bin, // Species names
NARC_msg_narc_0589_bin, // Move names
NARC_msg_narc_0565_bin, // Type names
NARC_msg_narc_0553_bin, // Ability names
NARC_msg_narc_0388_bin, // Trainer
NARC_msg_narc_0389_bin, // People
NARC_msg_narc_0390_bin, // Greetings
NARC_msg_narc_0391_bin, // Lifestyle
NARC_msg_narc_0392_bin, // Feelings
NARC_msg_narc_0393_bin, // Tough words
NARC_msg_narc_0394_bin, // Union
};
static const u16 sNarcMsgCounts[EC_GROUP_MAX] = {
EC_WORDS_POKEMON_COUNT,
EC_WORDS_MOVE_COUNT,
EC_WORDS_TYPE_COUNT,
EC_WORDS_ABILITY_COUNT,
EC_WORDS_TRAINER_COUNT,
EC_WORDS_PEOPLE_COUNT,
EC_WORDS_GREETINGS_COUNT,
EC_WORDS_LIFESTYLE_COUNT,
EC_WORDS_FEELINGS_COUNT,
EC_WORDS_TOUGH_WORDS_COUNT,
EC_WORDS_UNION_COUNT,
};
static const ecword_t sEasyChatHey[] = {EC_WORD_GREETINGS_HEY, EC_WORD_GREETINGS_HEY_2};
static const ecword_t sEasyChatHuh_[] = {EC_WORD_GREETINGS_HUH_, EC_WORD_GREETINGS_HUH__2};
static const ecword_t sEasyChatI[] = {EC_WORD_PEOPLE_I, EC_WORD_PEOPLE_I_2, EC_WORD_PEOPLE_I_3, EC_WORD_PEOPLE_I_4};
static const ecword_t sEasyChatKids[] = {EC_WORD_PEOPLE_KIDS, EC_WORD_PEOPLE_KIDS_2};
static const ecword_t sEasyChatNoWay[] = {EC_WORD_GREETINGS_NO_WAY, EC_WORD_FEELINGS_NO_WAY};
static const ecword_t sEasyChatYou[] = {EC_WORD_PEOPLE_YOU, EC_WORD_PEOPLE_YOU_2};
static const ecword_t sEasyChatAnticipation[] = {EC_WORD_ABILITY(ABILITY_ANTICIPATION), EC_WORD_FEELINGS_ANTICIPATION};
static const ecword_t sEasyChatSimple[] = {EC_WORD_ABILITY(ABILITY_SIMPLE), EC_WORD_FEELINGS_SIMPLE};
static const ecword_t sEasyChatWelcome[] = {EC_WORD_GREETINGS_WELCOME, EC_WORD_GREETINGS_WELCOME_2};
static const ecword_t sEasyChatWow[] = {EC_WORD_GREETINGS_WOW, EC_WORD_GREETINGS_WOW_2};
static const ecword_t sEasyChatPsychic[] = {EC_WORD_MOVE(MOVE_PSYCHIC), EC_WORD_TYPE(TYPE_PSYCHIC)};
static const ecword_t sEasyChatOk[] = {EC_WORD_GREETINGS_OK, EC_WORD_GREETINGS_OK_2};
typedef struct ECIdenticalPhrases {
const ecword_t *data;
s32 count;
} ECIdenticalPhrases;
static const ECIdenticalPhrases sIdenticalPhrases[12] = {
{ sEasyChatAnticipation, NELEMS(sEasyChatAnticipation) },
{ sEasyChatHey, NELEMS(sEasyChatHey) },
{ sEasyChatHuh_, NELEMS(sEasyChatHuh_) },
{ sEasyChatI, NELEMS(sEasyChatI) },
{ sEasyChatKids, NELEMS(sEasyChatKids) },
{ sEasyChatNoWay, NELEMS(sEasyChatNoWay) },
{ sEasyChatOk, NELEMS(sEasyChatOk) },
{ sEasyChatPsychic, NELEMS(sEasyChatPsychic) },
{ sEasyChatSimple, NELEMS(sEasyChatSimple) },
{ sEasyChatWelcome, NELEMS(sEasyChatWelcome) },
{ sEasyChatWow, NELEMS(sEasyChatWow) },
{ sEasyChatYou, NELEMS(sEasyChatYou) },
};
EasyChatManager *EasyChatManager_New(HeapID heapId) {
EasyChatManager *ret = AllocFromHeap(heapId, sizeof(EasyChatManager));
for (s32 i = 0; i < EC_GROUP_MAX; i++) {
ret->heapId = heapId; // inadvertently inside the loop
ret->msgData[i] = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, sNarcMsgBanks[i], heapId);
}
return ret;
}
void EasyChatManager_Delete(EasyChatManager *easyChatManager) {
for (s32 i = 0; i < EC_GROUP_MAX; i++) {
DestroyMsgData(easyChatManager->msgData[i]);
}
FreeToHeap(easyChatManager);
}
void EasyChatManager_ReadWordIntoString(EasyChatManager *easyChatManager, u16 ecWord, String *dest) {
u32 category;
u32 msgNo;
GetCategoryAndMsgNoByECWordIdx(ecWord, &category, &msgNo);
ReadMsgDataIntoString(easyChatManager->msgData[category], msgNo, dest);
}
void GetECWordIntoStringByIndex(u32 ecWord, String *dest) {
u32 category;
u32 msgNo;
if (ecWord != EC_WORD_NULL) {
GetCategoryAndMsgNoByECWordIdx(ecWord, &category, &msgNo);
category = sNarcMsgBanks[category];
ReadMsgData_NewNarc_ExistingString(NARC_MSGDATA_MSG, category, msgNo, HEAP_ID_DEFAULT, dest);
}
else {
String_SetEmpty(dest);
}
}
u16 GetECWordIndexByPair(u32 category, u32 msgNo) {
u32 bank;
u16 count;
u16 i;
for (bank = 0; bank < EC_GROUP_MAX; bank++) {
if (category == sNarcMsgBanks[bank]) {
for (i = 0, count = 0; i < bank; i++) {
count += sNarcMsgCounts[i];
}
return (u16)(count + msgNo);
}
}
return EC_WORD_NULL;
}
void GetCategoryAndMsgNoByECWordIdx(u32 ecWord, u32 *category, u32 *msgNo) {
u32 bank;
u32 count;
u32 wordId = ecWord & EC_WORD_MASK;
count = 0;
for (bank = 0; bank < NELEMS(sNarcMsgCounts); bank++) {
count += sNarcMsgCounts[bank];
if (wordId < count) {
*category = bank;
*msgNo = (wordId - (count - sNarcMsgCounts[bank]));
return;
}
}
}
u32 Save_EasyChat_sizeof(void) {
return sizeof(SaveEasyChat);
}
void Save_EasyChat_Init(SaveEasyChat *saveEasyChat) {
u32 i;
saveEasyChat->greetings = 0;
saveEasyChat->trendy = 0;
for (i = 0; i < NELEMS(sLanguageToGreetingMap); i++) {
if (sLanguageToGreetingMap[i][0] == GAME_LANGUAGE) {
Save_EasyChat_SetGreetingFlag(saveEasyChat, sLanguageToGreetingMap[i][1]);
break;
}
}
}
SaveEasyChat *Save_EasyChat_Get(SaveData *saveData) {
return SaveArray_Get(saveData, SAVE_EASY_CHAT);
}
BOOL Save_EasyChat_GetTrendySayingFlag(SaveEasyChat *saveEasyChat, u32 flag) {
return (saveEasyChat->trendy >> flag) & 1;
}
u32 Save_EasyChat_SetRandomTrendySaying(SaveEasyChat *saveEasyChat) {
u32 i;
u32 count;
u32 bit;
for (i = 0, count = 0; i < EC_WORDS_TOUGH_WORDS_COUNT; i++) {
if (!((saveEasyChat->trendy >> i) & 1)) {
count++;
}
}
if (count != 0) {
bit = LCRandom() % count;
for (i = 0; i < EC_WORDS_TOUGH_WORDS_COUNT; i++) {
if (!((saveEasyChat->trendy >> i) & 1)) {
if (bit == 0) {
saveEasyChat->trendy |= (1 << i);
return i;
}
bit--;
}
}
}
return EC_WORDS_TOUGH_WORDS_COUNT;
}
BOOL Save_EasyChat_TrendySayingsUnlockedAllCheck(SaveEasyChat *saveEasyChat) {
for (u32 i = 0; i < EC_WORDS_TOUGH_WORDS_COUNT; i++) {
if (!((saveEasyChat->trendy >> i) & 1)) {
return FALSE;
}
}
return TRUE;
}
ecword_t TrendyWordIdxToECWord(u32 word) {
s32 i;
u16 count = 0;
for (i = 0; i < EC_GROUP_TOUGH_WORDS; i++) {
count += sNarcMsgCounts[i];
}
return (ecword_t)(count + word);
}
BOOL Save_EasyChat_GetGreetingsFlag(SaveEasyChat *saveEasyChat, u32 flag) {
return (saveEasyChat->greetings >> flag) & 1;
}
void Save_EasyChat_SetGreetingFlag(SaveEasyChat *saveEasyChat, u32 flag) {
saveEasyChat->greetings |= (1 << flag);
}
s32 GetDuplicateWordNum(ecword_t word) {
for (s32 i = 0; i < NELEMS(sIdenticalPhrases); i++) {
for (s32 j = 0; j < sIdenticalPhrases[i].count; j++) {
if (word == sIdenticalPhrases[i].data[j]) {
return sIdenticalPhrases[i].count - 1;
}
}
}
return 0;
}
ecword_t RemapDuplicateWord(ecword_t word, s32 target) {
for (s32 phrases = 0; phrases < NELEMS(sIdenticalPhrases); phrases++) {
for (s32 phraseCount = 0; phraseCount < sIdenticalPhrases[phrases].count; phraseCount++) {
if (word == sIdenticalPhrases[phrases].data[phraseCount]) {
// ERROR: Infinite loop when reached
for (s32 targetCount = 0; /*targetCount <*/ sIdenticalPhrases[phrases].count; targetCount++) {
if (target == 0) {
return sIdenticalPhrases[phrases].data[targetCount];
}
target--;
}
GF_ASSERT(FALSE);
return EC_WORD_NULL;
}
}
}
return word;
}

View File

@ -16,7 +16,7 @@
#include "string_control_code.h"
#include "text.h"
#include "trainer_data.h"
#include "unk_020139D8.h"
#include "easy_chat.h"
#include "unk_02015CC0.h"
#include "unk_02024E64.h"
#include "unk_020286F8.h"
@ -523,7 +523,7 @@ void BufferGenderSymbol(MessageFormat *messageFormat, u32 idx, u32 gender)
ReadMsgDataIntoString(msgData, narc_0199_00069, messageFormat->buffer); // ♀
break;
default:
StringSetEmpty(messageFormat->buffer);
String_SetEmpty(messageFormat->buffer);
break;
}
SetStringAsPlaceholder(messageFormat, idx, messageFormat->buffer, NULL);
@ -715,7 +715,7 @@ void MessageFormat_UpperFirstChar(MessageFormat *messageFormat, u32 idx)
void StringExpandPlaceholders(MessageFormat *messageFormat, struct String * dest, struct String * src)
{
const u16 * cstr = String_c_str(src);
StringSetEmpty(dest);
String_SetEmpty(dest);
while (*cstr != EOS)
{
if (*cstr == EXT_CTRL_CODE_BEGIN)
@ -743,7 +743,7 @@ void StringExpandPlaceholders(MessageFormat *messageFormat, struct String * dest
void MessageFormat_ResetBuffers(MessageFormat *messageFormat)
{
for (int i = 0; i < messageFormat->count; i++)
StringSetEmpty(messageFormat->fields[i].msg);
String_SetEmpty(messageFormat->fields[i].msg);
}
struct UnkStruct_0200B870 * MessagePrinter_New(u32 color1, u32 color2, u32 color3, HeapID heapId)

View File

@ -107,7 +107,7 @@ static void ReadMsgData_ExistingTable_ExistingString(struct MsgDataTable * table
else
{
GF_ASSERT(FALSE);
StringSetEmpty(dest);
String_SetEmpty(dest);
}
}
@ -179,7 +179,7 @@ static void ReadMsgData_ExistingNarc_ExistingString(NARC * narc, u32 group, u32
else
{
GF_ASSERT(FALSE);
StringSetEmpty(dest);
String_SetEmpty(dest);
}
}

View File

@ -13,7 +13,7 @@
#include "daycare.h"
#include "pokedex.h"
#include "seal.h"
#include "unk_020139D8.h"
#include "easy_chat.h"
#include "unk_02024E64.h"
#include "sav_chatot.h"
#include "unk_0202A1E0.h"
@ -98,7 +98,7 @@ const struct SaveChunkHeader UNK_020EE700[] = {
{ 31, 0, (SAVSIZEFN)sub_0202AC20, (SAVINITFN)sub_0202AC28 },
{ 32, 0, (SAVSIZEFN)sub_0202BE98, (SAVINITFN)sub_0202BEA0 },
{ 33, 0, (SAVSIZEFN)sub_0202C0E0, (SAVINITFN)sub_0202C0E4 },
{ 34, 0, (SAVSIZEFN)sub_02013B28, (SAVINITFN)sub_02013B2C },
{ 34, 0, (SAVSIZEFN)Save_EasyChat_sizeof, (SAVINITFN)Save_EasyChat_Init },
{ 35, 1, (SAVSIZEFN)PCStorage_sizeof, (SAVINITFN)PCStorage_Init },
};

View File

@ -32,7 +32,7 @@
#include "text.h"
#include "text_02054590.h"
#include "unk_0200CA44.h"
#include "unk_020139D8.h"
#include "easy_chat.h"
#include "unk_02022504.h"
#include "unk_02029FB0.h"
#include "unk_020337E8.h"
@ -4472,7 +4472,7 @@ BOOL ScrCmd_BufferRandomTrendySaying(ScriptContext *ctx) { //027D
u16 *var = ScriptGetVarPointer(ctx);
u16 fieldId = ScriptGetVar(ctx);
MessageFormat **messageFormat = FieldSysGetAttrAddr(ctx->fieldSystem, SCRIPTENV_MESSAGE_FORMAT);
u32 trendy = Save_EasyChat_RandomTrendySayingSet(Save_EasyChat_Get(ctx->fieldSystem->saveData));
u32 trendy = Save_EasyChat_SetRandomTrendySaying(Save_EasyChat_Get(ctx->fieldSystem->saveData));
if (trendy == 32) {
*var = -1;
return FALSE;

View File

@ -137,7 +137,7 @@ void GetTrainerMessageByIdPair(u32 trainer_idx, u32 msg_id, struct String * str,
}
NARC_Delete(trTblNarc);
if (rdbuf[0] == trTblSize)
StringSetEmpty(str);
String_SetEmpty(str);
}
void TrainerData_ReadTrData(u32 idx, struct TrainerData * dest)

View File

@ -1,290 +0,0 @@
#include "global.h"
#include "msgdata.h"
#include "heap.h"
#include "save.h"
#include "math_util.h"
#include "unk_020139D8.h"
#include "msgdata/msg.naix"
const u8 sNarcLanguages[][2] = {
{ LANGUAGE_JAPANESE, 0 },
{ LANGUAGE_ENGLISH, 1 },
{ LANGUAGE_FRENCH, 2 },
{ LANGUAGE_ITALIAN, 3 },
{ LANGUAGE_GERMAN, 4 },
{ LANGUAGE_SPANISH, 5 },
};
const u16 sNarcMsgBanks[] = {
NARC_msg_narc_0362_bin, // Species names
NARC_msg_narc_0589_bin, // Move names
NARC_msg_narc_0565_bin, // Type names
NARC_msg_narc_0553_bin, // Ability names
NARC_msg_narc_0388_bin, // Trainer
NARC_msg_narc_0389_bin, // People
NARC_msg_narc_0390_bin, // Greetings
NARC_msg_narc_0391_bin, // Lifestyle
NARC_msg_narc_0392_bin, // Feelings
NARC_msg_narc_0393_bin, // Tough words
NARC_msg_narc_0394_bin // Union
};
const u16 sNarcMsgCounts[] = {
496, // Species names
468, // Move names
18, // Type names
124, // Ability names
38, // Trainer
38, // People
107, // Greetings
104, // Lifestyle
47, // Feelings
32, // Tough words
23 // Union
};
const u16 UNK_020ED580[] = { 0x04C0, 0x04F0 };
const u16 UNK_020ED5A8[] = { 0x04A7, 0x04E1 };
const u16 UNK_020ED5AC[] = { 0x0479, 0x0498, 0x049B, 0x049C };
const u16 UNK_020ED5A0[] = { 0x048F, 0x0497 };
const u16 UNK_020ED59C[] = { 0x04FC, 0x0596 };
const u16 UNK_020ED594[] = { 0x047A, 0x048D };
const u16 UNK_020ED58C[] = { 0x0441, 0x0599 };
const u16 UNK_020ED590[] = { 0x042C, 0x059D };
const u16 UNK_020ED5A4[] = { 0x04B0, 0x04FF };
const u16 UNK_020ED598[] = { 0x04B6, 0x0505 };
const u16 UNK_020ED584[] = { 0x024E, 0x03D2 };
const u16 UNK_020ED588[] = { 0x04BB, 0x0500 };
const struct UnkStruct_020ED5EC
{
const u16 * data;
s32 count;
} UNK_020ED5EC[] = {
{ UNK_020ED58C, NELEMS(UNK_020ED58C) },
{ UNK_020ED580, NELEMS(UNK_020ED580) },
{ UNK_020ED5A8, NELEMS(UNK_020ED5A8) },
{ UNK_020ED5AC, NELEMS(UNK_020ED5AC) },
{ UNK_020ED5A0, NELEMS(UNK_020ED5A0) },
{ UNK_020ED59C, NELEMS(UNK_020ED59C) },
{ UNK_020ED588, NELEMS(UNK_020ED588) },
{ UNK_020ED584, NELEMS(UNK_020ED584) },
{ UNK_020ED590, NELEMS(UNK_020ED590) },
{ UNK_020ED5A4, NELEMS(UNK_020ED5A4) },
{ UNK_020ED598, NELEMS(UNK_020ED598) },
{ UNK_020ED594, NELEMS(UNK_020ED594) },
};
struct UnkStruct_020139D8 * EasyChatManager_New(HeapID heapId)
{
struct UnkStruct_020139D8 * ret = (struct UnkStruct_020139D8 *)AllocFromHeap(heapId, sizeof(struct UnkStruct_020139D8));
s32 i;
for (i = 0; i < 11; i++)
{
ret->heapId = heapId; // inadvertently inside the loop
ret->msgDatas[i] = NewMsgDataFromNarc(MSGDATA_LOAD_LAZY, NARC_MSGDATA_MSG, sNarcMsgBanks[i], heapId);
}
return ret;
}
void EasyChatManager_Delete(struct UnkStruct_020139D8 * unk)
{
s32 i;
for (i = 0; i < 11; i++)
{
DestroyMsgData(unk->msgDatas[i]);
}
FreeToHeap(unk);
}
void EasyChatManager_ReadWordIntoString(struct UnkStruct_020139D8 * unk, u16 wordIdx, struct String * str)
{
s32 msgBank;
s32 msgNo;
GetCategoryAndMsgNoByECWordIdx(wordIdx, &msgBank, &msgNo);
ReadMsgDataIntoString(unk->msgDatas[msgBank], (u32)msgNo, str);
}
void GetECWordIntoStringByIndex(u32 wordIdx, struct String * a1)
{
s32 msgBank;
s32 msgNo;
if (wordIdx != 0xFFFF)
{
GetCategoryAndMsgNoByECWordIdx(wordIdx, &msgBank, &msgNo);
msgBank = sNarcMsgBanks[msgBank];
ReadMsgData_NewNarc_ExistingString(NARC_MSGDATA_MSG, (u32)msgBank, (u32)msgNo, HEAP_ID_DEFAULT, a1);
}
else
StringSetEmpty(a1);
}
u16 GetECWordIndexByPair(u16 msgBank, u16 msgNo)
{
u32 i;
u16 k;
u16 j;
for (i = 0; i < 11; i++)
{
if (msgBank == sNarcMsgBanks[i])
{
for (j = 0, k = 0; j < i; j++)
k += sNarcMsgCounts[j];
return (u16)(k + msgNo);
}
}
return 0xFFFF;
}
void GetCategoryAndMsgNoByECWordIdx(u32 wordIdx, s32 * msgBank_p, s32 * msgNo_p)
{
s32 i;
s32 j;
u32 r3;
r3 = wordIdx & 0xFFF;
j = 0;
for (i = 0; i < NELEMS(sNarcMsgCounts); i++)
{
j += sNarcMsgCounts[i];
if (r3 < j)
{
*msgBank_p = i;
*msgNo_p = (s32)(r3 - (j - sNarcMsgCounts[i]));
return;
}
}
}
u32 sub_02013B28(void)
{
return sizeof(struct SaveEasyChat);
}
void sub_02013B2C(struct SaveEasyChat * unk)
{
u32 i;
unk->unk_0 = 0;
unk->unk_4 = 0;
for (i = 0; i < 6; i++)
{
if (sNarcLanguages[i][0] == GAME_LANGUAGE)
{
sub_02013C18(unk, sNarcLanguages[i][1]);
break;
}
}
}
struct SaveEasyChat * Save_EasyChat_Get(struct SaveData * save)
{
return (struct SaveEasyChat *)SaveArray_Get(save, 34);
}
BOOL sub_02013B68(struct SaveEasyChat * unk, u32 a1)
{
return (BOOL)((unk->unk_4 >> a1) & 1);
}
u32 Save_EasyChat_RandomTrendySayingSet(struct SaveEasyChat * unk)
{
u32 i;
u32 count;
u32 which_bit;
for (i = 0, count = 0; i < 32; i++)
{
if (!((unk->unk_4 >> i) & 1))
count++;
}
if (count != 0)
{
which_bit = LCRandom() % count;
for (i = 0; i < 32; i++)
{
if (!((unk->unk_4 >> i) & 1))
{
if (which_bit == 0)
{
unk->unk_4 |= (1 << i);
return i;
}
which_bit--;
}
}
}
return 32;
}
BOOL Save_EasyChat_TrendySayingsUnlockedAllCheck(struct SaveEasyChat * unk)
{
u32 i;
for (i = 0; i < 32; i++)
{
if (!((unk->unk_4 >> i) & 1))
return FALSE;
}
return TRUE;
}
u16 TrendyWordIdxToECWord(u32 a0)
{
s32 i;
u16 skip = 0;
for (i = 0; i < 9; i++)
skip += sNarcMsgCounts[i];
return (u16)(skip + a0);
}
BOOL sub_02013C0C(struct SaveEasyChat * unk, u32 a1)
{
return (BOOL)((unk->unk_0 >> a1) & 1);
}
void sub_02013C18(struct SaveEasyChat * unk, u32 a1)
{
unk->unk_0 |= (1 << a1);
}
s32 sub_02013C28(u16 a0)
{
s32 r3;
s32 r4;
for (r3 = 0; r3 < NELEMS(UNK_020ED5EC); r3++)
{
for (r4 = 0; r4 < UNK_020ED5EC[r3].count; r4++)
{
if (a0 == UNK_020ED5EC[r3].data[r4])
return UNK_020ED5EC[r3].count - 1;
}
}
return 0;
}
u16 sub_02013C6C(u16 a0, s32 a1)
{
s32 r7;
s32 r2;
s32 r0;
for (r7 = 0; r7 < NELEMS(UNK_020ED5EC); r7++)
{
for (r2 = 0; r2 < UNK_020ED5EC[r7].count; r2++)
{
if (a0 == UNK_020ED5EC[r7].data[r2])
{
// ERROR: Infinite loop when reached
for (r0 = 0; /*r0 <*/ UNK_020ED5EC[r7].count; r0++)
{
if (a1 == 0)
return UNK_020ED5EC[r7].data[r0];
a1--;
}
GF_ASSERT(0);
return 0xFFFF;
}
}
}
return a0;
}

View File

@ -25,7 +25,7 @@ void String_Delete(struct String * str)
FreeToHeap(str);
}
void StringSetEmpty(struct String * str)
void String_SetEmpty(struct String * str)
{
ASSERT_STR16(str);
str->size = 0;
@ -87,7 +87,7 @@ void String16_FormatInteger(struct String * str, int num, u32 ndigits, enum Prin
if (str->maxsize > ndigits + isNegative)
{
charbase = (whichCharset == 0) ? sCharset_JP : sCharset_EN;
StringSetEmpty(str);
String_SetEmpty(str);
if (isNegative)
{
num *= -1;
@ -203,7 +203,7 @@ void StringGetLineN(struct String * dest, volatile struct String * src, u32 n)
}
}
}
StringSetEmpty(dest);
String_SetEmpty(dest);
for (; i < src->size; i++)
{
u16 c = src->data[i];

View File

@ -1,430 +1,430 @@
<?xml version="1.0"?>
<body language="English">
<row id="narc_0390_00000" index="0">
<row id="narc_0390_konnichiwa" index="0">
<attribute name="window_context_name">used</attribute>
<language name="English">KONNICHIWA</language>
</row>
<row id="narc_0390_00001" index="1">
<row id="narc_0390_hello" index="1">
<attribute name="window_context_name">used</attribute>
<language name="English">HELLO</language>
</row>
<row id="narc_0390_00002" index="2">
<row id="narc_0390_bonjour" index="2">
<attribute name="window_context_name">used</attribute>
<language name="English">BONJOUR</language>
</row>
<row id="narc_0390_00003" index="3">
<row id="narc_0390_ciao" index="3">
<attribute name="window_context_name">used</attribute>
<language name="English">CIAO</language>
</row>
<row id="narc_0390_00004" index="4">
<row id="narc_0390_hallo" index="4">
<attribute name="window_context_name">used</attribute>
<language name="English">HALLO</language>
</row>
<row id="narc_0390_00005" index="5">
<row id="narc_0390_hola" index="5">
<attribute name="window_context_name">used</attribute>
<language name="English">HOLA</language>
</row>
<row id="narc_0390_00006" index="6">
<row id="narc_0390_oh_well" index="6">
<attribute name="window_context_name">used</attribute>
<language name="English">OH WELL</language>
</row>
<row id="narc_0390_00007" index="7">
<row id="narc_0390_aah" index="7">
<attribute name="window_context_name">used</attribute>
<language name="English">AAH</language>
</row>
<row id="narc_0390_00008" index="8">
<row id="narc_0390_ahaha" index="8">
<attribute name="window_context_name">used</attribute>
<language name="English">AHAHA</language>
</row>
<row id="narc_0390_00009" index="9">
<row id="narc_0390_huh_" index="9">
<attribute name="window_context_name">used</attribute>
<language name="English">HUH?</language>
</row>
<row id="narc_0390_00010" index="10">
<row id="narc_0390_thanks" index="10">
<attribute name="window_context_name">used</attribute>
<language name="English">THANKS</language>
</row>
<row id="narc_0390_00011" index="11">
<row id="narc_0390_no_problem" index="11">
<attribute name="window_context_name">used</attribute>
<language name="English">NO PROBLEM</language>
</row>
<row id="narc_0390_00012" index="12">
<row id="narc_0390_nope" index="12">
<attribute name="window_context_name">used</attribute>
<language name="English">NOPE</language>
</row>
<row id="narc_0390_00013" index="13">
<row id="narc_0390_yes" index="13">
<attribute name="window_context_name">used</attribute>
<language name="English">YES</language>
</row>
<row id="narc_0390_00014" index="14">
<row id="narc_0390_here_goes" index="14">
<attribute name="window_context_name">used</attribute>
<language name="English">HERE GOES</language>
</row>
<row id="narc_0390_00015" index="15">
<row id="narc_0390_let_s_go" index="15">
<attribute name="window_context_name">used</attribute>
<language name="English">LETS GO</language>
</row>
<row id="narc_0390_00016" index="16">
<row id="narc_0390_here_i_come" index="16">
<attribute name="window_context_name">used</attribute>
<language name="English">HERE I COME</language>
</row>
<row id="narc_0390_00017" index="17">
<row id="narc_0390_yeah" index="17">
<attribute name="window_context_name">used</attribute>
<language name="English">YEAH</language>
</row>
<row id="narc_0390_00018" index="18">
<row id="narc_0390_welcome" index="18">
<attribute name="window_context_name">used</attribute>
<language name="English">WELCOME</language>
</row>
<row id="narc_0390_00019" index="19">
<row id="narc_0390_urgh" index="19">
<attribute name="window_context_name">used</attribute>
<language name="English">URGH</language>
</row>
<row id="narc_0390_00020" index="20">
<row id="narc_0390_let_me_think" index="20">
<attribute name="window_context_name">used</attribute>
<language name="English">LET ME THINK</language>
</row>
<row id="narc_0390_00021" index="21">
<row id="narc_0390_hmm" index="21">
<attribute name="window_context_name">used</attribute>
<language name="English">HMM</language>
</row>
<row id="narc_0390_00022" index="22">
<row id="narc_0390_whoa" index="22">
<attribute name="window_context_name">used</attribute>
<language name="English">WHOA</language>
</row>
<row id="narc_0390_00023" index="23">
<row id="narc_0390_wroooaar_" index="23">
<attribute name="window_context_name">used</attribute>
<language name="English">WROOOAAR!</language>
</row>
<row id="narc_0390_00024" index="24">
<row id="narc_0390_wow" index="24">
<attribute name="window_context_name">used</attribute>
<language name="English">WOW</language>
</row>
<row id="narc_0390_00025" index="25">
<row id="narc_0390_snicker" index="25">
<attribute name="window_context_name">used</attribute>
<language name="English">SNICKER</language>
</row>
<row id="narc_0390_00026" index="26">
<row id="narc_0390_cute_laugh" index="26">
<attribute name="window_context_name">used</attribute>
<language name="English">CUTE LAUGH</language>
</row>
<row id="narc_0390_00027" index="27">
<row id="narc_0390_unbelievable" index="27">
<attribute name="window_context_name">used</attribute>
<language name="English">UNBELIEVABLE</language>
</row>
<row id="narc_0390_00028" index="28">
<row id="narc_0390_cries" index="28">
<attribute name="window_context_name">used</attribute>
<language name="English">CRIES</language>
</row>
<row id="narc_0390_00029" index="29">
<row id="narc_0390_ok" index="29">
<attribute name="window_context_name">used</attribute>
<language name="English">OK</language>
</row>
<row id="narc_0390_00030" index="30">
<row id="narc_0390_agree" index="30">
<attribute name="window_context_name">used</attribute>
<language name="English">AGREE</language>
</row>
<row id="narc_0390_00031" index="31">
<row id="narc_0390_eh_" index="31">
<attribute name="window_context_name">used</attribute>
<language name="English">EH?</language>
</row>
<row id="narc_0390_00032" index="32">
<row id="narc_0390_boo_hoo" index="32">
<attribute name="window_context_name">used</attribute>
<language name="English">BOO-HOO</language>
</row>
<row id="narc_0390_00033" index="33">
<row id="narc_0390_hehehe" index="33">
<attribute name="window_context_name">used</attribute>
<language name="English">HEHEHE</language>
</row>
<row id="narc_0390_00034" index="34">
<row id="narc_0390_hey" index="34">
<attribute name="window_context_name">used</attribute>
<language name="English">HEY</language>
</row>
<row id="narc_0390_00035" index="35">
<row id="narc_0390_oh_yeah" index="35">
<attribute name="window_context_name">used</attribute>
<language name="English">OH, YEAH</language>
</row>
<row id="narc_0390_00036" index="36">
<row id="narc_0390_oh_wow_" index="36">
<attribute name="window_context_name">used</attribute>
<language name="English">OH WOW!</language>
</row>
<row id="narc_0390_00037" index="37">
<row id="narc_0390_heeey" index="37">
<attribute name="window_context_name">used</attribute>
<language name="English">HEEEY</language>
</row>
<row id="narc_0390_00038" index="38">
<row id="narc_0390_greetings" index="38">
<attribute name="window_context_name">used</attribute>
<language name="English">GREETINGS</language>
</row>
<row id="narc_0390_00039" index="39">
<row id="narc_0390_oops" index="39">
<attribute name="window_context_name">used</attribute>
<language name="English">OOPS</language>
</row>
<row id="narc_0390_00040" index="40">
<row id="narc_0390_well_done" index="40">
<attribute name="window_context_name">used</attribute>
<language name="English">WELL DONE</language>
</row>
<row id="narc_0390_00041" index="41">
<row id="narc_0390_oh_my" index="41">
<attribute name="window_context_name">used</attribute>
<language name="English">OH MY</language>
</row>
<row id="narc_0390_00042" index="42">
<row id="narc_0390_eek" index="42">
<attribute name="window_context_name">used</attribute>
<language name="English">EEK</language>
</row>
<row id="narc_0390_00043" index="43">
<row id="narc_0390_yaaah" index="43">
<attribute name="window_context_name">used</attribute>
<language name="English">YAAAH</language>
</row>
<row id="narc_0390_00044" index="44">
<row id="narc_0390_giggle" index="44">
<attribute name="window_context_name">used</attribute>
<language name="English">GIGGLE</language>
</row>
<row id="narc_0390_00045" index="45">
<row id="narc_0390_give_me" index="45">
<attribute name="window_context_name">used</attribute>
<language name="English">GIVE ME</language>
</row>
<row id="narc_0390_00046" index="46">
<row id="narc_0390_gwahahaha" index="46">
<attribute name="window_context_name">used</attribute>
<language name="English">GWAHAHAHA</language>
</row>
<row id="narc_0390_00047" index="47">
<row id="narc_0390_ugh" index="47">
<attribute name="window_context_name">used</attribute>
<language name="English">UGH</language>
</row>
<row id="narc_0390_00048" index="48">
<row id="narc_0390_sorry" index="48">
<attribute name="window_context_name">used</attribute>
<language name="English">SORRY</language>
</row>
<row id="narc_0390_00049" index="49">
<row id="narc_0390_forgive_me" index="49">
<attribute name="window_context_name">used</attribute>
<language name="English">FORGIVE ME</language>
</row>
<row id="narc_0390_00050" index="50">
<row id="narc_0390_i_m_sorry" index="50">
<attribute name="window_context_name">used</attribute>
<language name="English">IM SORRY</language>
</row>
<row id="narc_0390_00051" index="51">
<row id="narc_0390_hey_" index="51">
<attribute name="window_context_name">used</attribute>
<language name="English">HEY!</language>
</row>
<row id="narc_0390_00052" index="52">
<row id="narc_0390_good_bye" index="52">
<attribute name="window_context_name">used</attribute>
<language name="English">GOOD-BYE</language>
</row>
<row id="narc_0390_00053" index="53">
<row id="narc_0390_thank_you" index="53">
<attribute name="window_context_name">used</attribute>
<language name="English">THANK YOU</language>
</row>
<row id="narc_0390_00054" index="54">
<row id="narc_0390_i_ve_arrived" index="54">
<attribute name="window_context_name">used</attribute>
<language name="English">IVE ARRIVED</language>
</row>
<row id="narc_0390_00055" index="55">
<row id="narc_0390_weep" index="55">
<attribute name="window_context_name">used</attribute>
<language name="English">WEEP</language>
</row>
<row id="narc_0390_00056" index="56">
<row id="narc_0390_pardon_me" index="56">
<attribute name="window_context_name">used</attribute>
<language name="English">PARDON ME</language>
</row>
<row id="narc_0390_00057" index="57">
<row id="narc_0390_so_sorry" index="57">
<attribute name="window_context_name">used</attribute>
<language name="English">SO SORRY</language>
</row>
<row id="narc_0390_00058" index="58">
<row id="narc_0390_see_ya" index="58">
<attribute name="window_context_name">used</attribute>
<language name="English">SEE YA</language>
</row>
<row id="narc_0390_00059" index="59">
<row id="narc_0390_excuse_me" index="59">
<attribute name="window_context_name">used</attribute>
<language name="English">EXCUSE ME</language>
</row>
<row id="narc_0390_00060" index="60">
<row id="narc_0390_okay_then" index="60">
<attribute name="window_context_name">used</attribute>
<language name="English">OKAY THEN</language>
</row>
<row id="narc_0390_00061" index="61">
<row id="narc_0390_tut" index="61">
<attribute name="window_context_name">used</attribute>
<language name="English">TUT</language>
</row>
<row id="narc_0390_00062" index="62">
<row id="narc_0390_blush" index="62">
<attribute name="window_context_name">used</attribute>
<language name="English">BLUSH</language>
</row>
<row id="narc_0390_00063" index="63">
<row id="narc_0390_go_ahead" index="63">
<attribute name="window_context_name">used</attribute>
<language name="English">GO AHEAD</language>
</row>
<row id="narc_0390_00064" index="64">
<row id="narc_0390_cheers" index="64">
<attribute name="window_context_name">used</attribute>
<language name="English">CHEERS</language>
</row>
<row id="narc_0390_00065" index="65">
<row id="narc_0390_hey__2" index="65">
<attribute name="window_context_name">used</attribute>
<language name="English">HEY?</language>
</row>
<row id="narc_0390_00066" index="66">
<row id="narc_0390_what_s_up_" index="66">
<attribute name="window_context_name">used</attribute>
<language name="English">WHATS UP?</language>
</row>
<row id="narc_0390_00067" index="67">
<row id="narc_0390_huh__2" index="67">
<attribute name="window_context_name">used</attribute>
<language name="English">HUH?</language>
</row>
<row id="narc_0390_00068" index="68">
<row id="narc_0390_no" index="68">
<attribute name="window_context_name">used</attribute>
<language name="English">NO</language>
</row>
<row id="narc_0390_00069" index="69">
<row id="narc_0390_sigh" index="69">
<attribute name="window_context_name">used</attribute>
<language name="English">SIGH</language>
</row>
<row id="narc_0390_00070" index="70">
<row id="narc_0390_hi" index="70">
<attribute name="window_context_name">used</attribute>
<language name="English">HI</language>
</row>
<row id="narc_0390_00071" index="71">
<row id="narc_0390_yep" index="71">
<attribute name="window_context_name">used</attribute>
<language name="English">YEP</language>
</row>
<row id="narc_0390_00072" index="72">
<row id="narc_0390_yeah_yeah" index="72">
<attribute name="window_context_name">used</attribute>
<language name="English">YEAH, YEAH</language>
</row>
<row id="narc_0390_00073" index="73">
<row id="narc_0390_bye_bye" index="73">
<attribute name="window_context_name">used</attribute>
<language name="English">BYE-BYE</language>
</row>
<row id="narc_0390_00074" index="74">
<row id="narc_0390_meet_you" index="74">
<attribute name="window_context_name">used</attribute>
<language name="English">MEET YOU</language>
</row>
<row id="narc_0390_00075" index="75">
<row id="narc_0390_hahaha" index="75">
<attribute name="window_context_name">used</attribute>
<language name="English">HAHAHA</language>
</row>
<row id="narc_0390_00076" index="76">
<row id="narc_0390_aiyeeh" index="76">
<attribute name="window_context_name">used</attribute>
<language name="English">AIYEEH</language>
</row>
<row id="narc_0390_00077" index="77">
<row id="narc_0390_hiyah" index="77">
<attribute name="window_context_name">used</attribute>
<language name="English">HIYAH</language>
</row>
<row id="narc_0390_00078" index="78">
<row id="narc_0390_muhahaha" index="78">
<attribute name="window_context_name">used</attribute>
<language name="English">MUHAHAHA</language>
</row>
<row id="narc_0390_00079" index="79">
<row id="narc_0390_lol" index="79">
<attribute name="window_context_name">used</attribute>
<language name="English">LOL</language>
</row>
<row id="narc_0390_00080" index="80">
<row id="narc_0390_snort" index="80">
<attribute name="window_context_name">used</attribute>
<language name="English">SNORT</language>
</row>
<row id="narc_0390_00081" index="81">
<row id="narc_0390_humph" index="81">
<attribute name="window_context_name">used</attribute>
<language name="English">HUMPH</language>
</row>
<row id="narc_0390_00082" index="82">
<row id="narc_0390_hey_2" index="82">
<attribute name="window_context_name">used</attribute>
<language name="English">HEY</language>
</row>
<row id="narc_0390_00083" index="83">
<row id="narc_0390_he_he_he" index="83">
<attribute name="window_context_name">used</attribute>
<language name="English">HE-HE-HE</language>
</row>
<row id="narc_0390_00084" index="84">
<row id="narc_0390_heh" index="84">
<attribute name="window_context_name">used</attribute>
<language name="English">HEH</language>
</row>
<row id="narc_0390_00085" index="85">
<row id="narc_0390_hohoho" index="85">
<attribute name="window_context_name">used</attribute>
<language name="English">HOHOHO</language>
</row>
<row id="narc_0390_00086" index="86">
<row id="narc_0390_there_you_go" index="86">
<attribute name="window_context_name">used</attribute>
<language name="English">THERE YOU GO</language>
</row>
<row id="narc_0390_00087" index="87">
<row id="narc_0390_oh_dear" index="87">
<attribute name="window_context_name">used</attribute>
<language name="English">OH, DEAR</language>
</row>
<row id="narc_0390_00088" index="88">
<row id="narc_0390_bye_for_now" index="88">
<attribute name="window_context_name">used</attribute>
<language name="English">BYE FOR NOW</language>
</row>
<row id="narc_0390_00089" index="89">
<row id="narc_0390_angry" index="89">
<attribute name="window_context_name">used</attribute>
<language name="English">ANGRY</language>
</row>
<row id="narc_0390_00090" index="90">
<row id="narc_0390_mufufu" index="90">
<attribute name="window_context_name">used</attribute>
<language name="English">MUFUFU</language>
</row>
<row id="narc_0390_00091" index="91">
<row id="narc_0390_mmm" index="91">
<attribute name="window_context_name">used</attribute>
<language name="English">MMM</language>
</row>
<row id="narc_0390_00092" index="92">
<row id="narc_0390_hello_" index="92">
<attribute name="window_context_name">used</attribute>
<language name="English">HELLO?</language>
</row>
<row id="narc_0390_00093" index="93">
<row id="narc_0390_hi_there" index="93">
<attribute name="window_context_name">used</attribute>
<language name="English">HI THERE</language>
</row>
<row id="narc_0390_00094" index="94">
<row id="narc_0390_no_way" index="94">
<attribute name="window_context_name">used</attribute>
<language name="English">NO WAY</language>
</row>
<row id="narc_0390_00095" index="95">
<row id="narc_0390_yahoo" index="95">
<attribute name="window_context_name">used</attribute>
<language name="English">YAHOO</language>
</row>
<row id="narc_0390_00096" index="96">
<row id="narc_0390_yo" index="96">
<attribute name="window_context_name">used</attribute>
<language name="English">YO</language>
</row>
<row id="narc_0390_00097" index="97">
<row id="narc_0390_welcome_2" index="97">
<attribute name="window_context_name">used</attribute>
<language name="English">WELCOME</language>
</row>
<row id="narc_0390_00098" index="98">
<row id="narc_0390_ok_2" index="98">
<attribute name="window_context_name">used</attribute>
<language name="English">OK</language>
</row>
<row id="narc_0390_00099" index="99">
<row id="narc_0390_regards" index="99">
<attribute name="window_context_name">used</attribute>
<language name="English">REGARDS</language>
</row>
<row id="narc_0390_00100" index="100">
<row id="narc_0390_lalala" index="100">
<attribute name="window_context_name">used</attribute>
<language name="English">LALALA</language>
</row>
<row id="narc_0390_00101" index="101">
<row id="narc_0390_yay" index="101">
<attribute name="window_context_name">used</attribute>
<language name="English">YAY</language>
</row>
<row id="narc_0390_00102" index="102">
<row id="narc_0390_wail" index="102">
<attribute name="window_context_name">used</attribute>
<language name="English">WAIL</language>
</row>
<row id="narc_0390_00103" index="103">
<row id="narc_0390_wow_2" index="103">
<attribute name="window_context_name">used</attribute>
<language name="English">WOW</language>
</row>
<row id="narc_0390_00104" index="104">
<row id="narc_0390_boo_" index="104">
<attribute name="window_context_name">used</attribute>
<language name="English">BOO!</language>
</row>
<row id="narc_0390_00105" index="105">
<row id="narc_0390_wahaha" index="105">
<attribute name="window_context_name">used</attribute>
<language name="English">WAHAHA</language>
</row>
<row id="narc_0390_00106" index="106">
<row id="narc_0390__" index="106">
<attribute name="window_context_name">used</attribute>
<language name="English">...</language>
</row>

View File

@ -1,6 +1,458 @@
#ifndef POKEDIAMOND_CONSTANTS_EASY_CHAT_H
#define POKEDIAMOND_CONSTANTS_EASY_CHAT_H
#define EC_GROUP_POKEMON (0)
#define EC_GROUP_MOVE (1)
#define EC_GROUP_TYPE (2)
#define EC_GROUP_ABILITY (3)
#define EC_GROUP_TRAINER (4)
#define EC_GROUP_PEOPLE (5)
#define EC_GROUP_GREETINGS (6)
#define EC_GROUP_LIFESTYLE (7)
#define EC_GROUP_FEELINGS (8)
#define EC_GROUP_TOUGH_WORDS (9)
#define EC_GROUP_UNION (10)
#define EC_WORDS_POKEMON_MIN (0)
#define EC_WORDS_POKEMON_MAX (496)
#define EC_WORDS_POKEMON_COUNT (496)
#define EC_WORDS_MOVE_MIN (496)
#define EC_WORDS_MOVE_MAX (964)
#define EC_WORDS_MOVE_COUNT (468)
#define EC_WORDS_TYPE_MIN (964)
#define EC_WORDS_TYPE_MAX (982)
#define EC_WORDS_TYPE_COUNT (18)
#define EC_WORDS_ABILITY_MIN (982)
#define EC_WORDS_ABILITY_MAX (1106)
#define EC_WORDS_ABILITY_COUNT (124)
#define EC_WORDS_TRAINER_MIN (1106)
#define EC_WORDS_TRAINER_MAX (1144)
#define EC_WORDS_TRAINER_COUNT (38)
#define EC_WORDS_PEOPLE_MIN (1144)
#define EC_WORDS_PEOPLE_MAX (1182)
#define EC_WORDS_PEOPLE_COUNT (38)
#define EC_WORDS_GREETINGS_MIN (1182)
#define EC_WORDS_GREETINGS_MAX (1289)
#define EC_WORDS_GREETINGS_COUNT (107)
#define EC_WORDS_LIFESTYLE_MIN (1289)
#define EC_WORDS_LIFESTYLE_MAX (1393)
#define EC_WORDS_LIFESTYLE_COUNT (104)
#define EC_WORDS_FEELINGS_MIN (1393)
#define EC_WORDS_FEELINGS_MAX (1440)
#define EC_WORDS_FEELINGS_COUNT (47)
#define EC_WORDS_TOUGH_WORDS_MIN (1440)
#define EC_WORDS_TOUGH_WORDS_MAX (1472)
#define EC_WORDS_TOUGH_WORDS_COUNT (32)
#define EC_WORDS_UNION_MIN (1472)
#define EC_WORDS_UNION_MAX (1495)
#define EC_WORDS_UNION_COUNT (23)
#define EC_WORD_POKEMON(species) (0+species)
#define EC_WORD_MOVE(move) (496+move)
#define EC_WORD_TYPE(type) (964+type)
#define EC_WORD_ABILITY(ability) (982+ability)
#define EC_WORD_TRAINER_MATCH_UP (1106)
#define EC_WORD_TRAINER_NO_1 (1107)
#define EC_WORD_TRAINER_PREPARATION (1108)
#define EC_WORD_TRAINER_WINS (1109)
#define EC_WORD_TRAINER_NO_MATCH (1110)
#define EC_WORD_TRAINER_SPIRIT (1111)
#define EC_WORD_TRAINER_ACE_CARD (1112)
#define EC_WORD_TRAINER_COME_ON (1113)
#define EC_WORD_TRAINER_ATTACK (1114)
#define EC_WORD_TRAINER_SURRENDER (1115)
#define EC_WORD_TRAINER_COURAGE (1116)
#define EC_WORD_TRAINER_TALENT (1117)
#define EC_WORD_TRAINER_STRATEGY (1118)
#define EC_WORD_TRAINER_MATCH (1119)
#define EC_WORD_TRAINER_VICTORY (1120)
#define EC_WORD_TRAINER_SENSE (1121)
#define EC_WORD_TRAINER_VERSUS (1122)
#define EC_WORD_TRAINER_FIGHTS (1123)
#define EC_WORD_TRAINER_POWER (1124)
#define EC_WORD_TRAINER_CHALLENGE (1125)
#define EC_WORD_TRAINER_STRONG (1126)
#define EC_WORD_TRAINER_TAKE_IT_EASY (1127)
#define EC_WORD_TRAINER_FOE (1128)
#define EC_WORD_TRAINER_GENIUS (1129)
#define EC_WORD_TRAINER_LEGEND (1130)
#define EC_WORD_TRAINER_BATTLE (1131)
#define EC_WORD_TRAINER_FIGHT (1132)
#define EC_WORD_TRAINER_REVIVE (1133)
#define EC_WORD_TRAINER_POINTS (1134)
#define EC_WORD_TRAINER_SERIOUS (1135)
#define EC_WORD_TRAINER_LOSS (1136)
#define EC_WORD_TRAINER_PARTNER (1137)
#define EC_WORD_TRAINER_INVINCIBLE (1138)
#define EC_WORD_TRAINER_EASY (1139)
#define EC_WORD_TRAINER_WEAK (1140)
#define EC_WORD_TRAINER_EASY_WIN (1141)
#define EC_WORD_TRAINER_MOVE (1142)
#define EC_WORD_TRAINER_TRAINER (1143)
#define EC_WORD_PEOPLE_OPPONENT (1144)
#define EC_WORD_PEOPLE_I (1145)
#define EC_WORD_PEOPLE_YOU (1146)
#define EC_WORD_PEOPLE_MOTHER (1147)
#define EC_WORD_PEOPLE_GRANDFATHER (1148)
#define EC_WORD_PEOPLE_UNCLE (1149)
#define EC_WORD_PEOPLE_FATHER (1150)
#define EC_WORD_PEOPLE_BOY (1151)
#define EC_WORD_PEOPLE_ADULT (1152)
#define EC_WORD_PEOPLE_BROTHER (1153)
#define EC_WORD_PEOPLE_SISTER (1154)
#define EC_WORD_PEOPLE_GRANDMOTHER (1155)
#define EC_WORD_PEOPLE_AUNT (1156)
#define EC_WORD_PEOPLE_PARENT (1157)
#define EC_WORD_PEOPLE_OLD_MAN (1158)
#define EC_WORD_PEOPLE_ME (1159)
#define EC_WORD_PEOPLE_GIRL (1160)
#define EC_WORD_PEOPLE_GAL (1161)
#define EC_WORD_PEOPLE_FAMILY (1162)
#define EC_WORD_PEOPLE_HER (1163)
#define EC_WORD_PEOPLE_HIM (1164)
#define EC_WORD_PEOPLE_YOU_2 (1165)
#define EC_WORD_PEOPLE_SIBLINGS (1166)
#define EC_WORD_PEOPLE_KIDS (1167)
#define EC_WORD_PEOPLE_MR_ (1168)
#define EC_WORD_PEOPLE_MS_ (1169)
#define EC_WORD_PEOPLE_MYSELF (1170)
#define EC_WORD_PEOPLE_WHO (1171)
#define EC_WORD_PEOPLE_FRIEND (1172)
#define EC_WORD_PEOPLE_ALLY (1173)
#define EC_WORD_PEOPLE_PERSON (1174)
#define EC_WORD_PEOPLE_KIDS_2 (1175)
#define EC_WORD_PEOPLE_I_2 (1176)
#define EC_WORD_PEOPLE_EVERYONE (1177)
#define EC_WORD_PEOPLE_RIVAL (1178)
#define EC_WORD_PEOPLE_I_3 (1179)
#define EC_WORD_PEOPLE_I_4 (1180)
#define EC_WORD_PEOPLE_BABY (1181)
#define EC_WORD_GREETINGS_KONNICHIWA (1182)
#define EC_WORD_GREETINGS_HELLO (1183)
#define EC_WORD_GREETINGS_BONJOUR (1184)
#define EC_WORD_GREETINGS_CIAO (1185)
#define EC_WORD_GREETINGS_HALLO (1186)
#define EC_WORD_GREETINGS_HOLA (1187)
#define EC_WORD_GREETINGS_OH_WELL (1188)
#define EC_WORD_GREETINGS_AAH (1189)
#define EC_WORD_GREETINGS_AHAHA (1190)
#define EC_WORD_GREETINGS_HUH_ (1191)
#define EC_WORD_GREETINGS_THANKS (1192)
#define EC_WORD_GREETINGS_NO_PROBLEM (1193)
#define EC_WORD_GREETINGS_NOPE (1194)
#define EC_WORD_GREETINGS_YES (1195)
#define EC_WORD_GREETINGS_HERE_GOES (1196)
#define EC_WORD_GREETINGS_LET_S_GO (1197)
#define EC_WORD_GREETINGS_HERE_I_COME (1198)
#define EC_WORD_GREETINGS_YEAH (1199)
#define EC_WORD_GREETINGS_WELCOME (1200)
#define EC_WORD_GREETINGS_URGH (1201)
#define EC_WORD_GREETINGS_LET_ME_THINK (1202)
#define EC_WORD_GREETINGS_HMM (1203)
#define EC_WORD_GREETINGS_WHOA (1204)
#define EC_WORD_GREETINGS_WROOOAAR_ (1205)
#define EC_WORD_GREETINGS_WOW (1206)
#define EC_WORD_GREETINGS_SNICKER (1207)
#define EC_WORD_GREETINGS_CUTE_LAUGH (1208)
#define EC_WORD_GREETINGS_UNBELIEVABLE (1209)
#define EC_WORD_GREETINGS_CRIES (1210)
#define EC_WORD_GREETINGS_OK (1211)
#define EC_WORD_GREETINGS_AGREE (1212)
#define EC_WORD_GREETINGS_EH_ (1213)
#define EC_WORD_GREETINGS_BOO_HOO (1214)
#define EC_WORD_GREETINGS_HEHEHE (1215)
#define EC_WORD_GREETINGS_HEY (1216)
#define EC_WORD_GREETINGS_OH_YEAH (1217)
#define EC_WORD_GREETINGS_OH_WOW_ (1218)
#define EC_WORD_GREETINGS_HEEEY (1219)
#define EC_WORD_GREETINGS_GREETINGS (1220)
#define EC_WORD_GREETINGS_OOPS (1221)
#define EC_WORD_GREETINGS_WELL_DONE (1222)
#define EC_WORD_GREETINGS_OH_MY (1223)
#define EC_WORD_GREETINGS_EEK (1224)
#define EC_WORD_GREETINGS_YAAAH (1225)
#define EC_WORD_GREETINGS_GIGGLE (1226)
#define EC_WORD_GREETINGS_GIVE_ME (1227)
#define EC_WORD_GREETINGS_GWAHAHAHA (1228)
#define EC_WORD_GREETINGS_UGH (1229)
#define EC_WORD_GREETINGS_SORRY (1230)
#define EC_WORD_GREETINGS_FORGIVE_ME (1231)
#define EC_WORD_GREETINGS_I_M_SORRY (1232)
#define EC_WORD_GREETINGS_HEY_ (1233)
#define EC_WORD_GREETINGS_GOOD_BYE (1234)
#define EC_WORD_GREETINGS_THANK_YOU (1235)
#define EC_WORD_GREETINGS_I_VE_ARRIVED (1236)
#define EC_WORD_GREETINGS_WEEP (1237)
#define EC_WORD_GREETINGS_PARDON_ME (1238)
#define EC_WORD_GREETINGS_SO_SORRY (1239)
#define EC_WORD_GREETINGS_SEE_YA (1240)
#define EC_WORD_GREETINGS_EXCUSE_ME (1241)
#define EC_WORD_GREETINGS_OKAY_THEN (1242)
#define EC_WORD_GREETINGS_TUT (1243)
#define EC_WORD_GREETINGS_BLUSH (1244)
#define EC_WORD_GREETINGS_GO_AHEAD (1245)
#define EC_WORD_GREETINGS_CHEERS (1246)
#define EC_WORD_GREETINGS_HEY__2 (1247)
#define EC_WORD_GREETINGS_WHAT_S_UP_ (1248)
#define EC_WORD_GREETINGS_HUH__2 (1249)
#define EC_WORD_GREETINGS_NO (1250)
#define EC_WORD_GREETINGS_SIGH (1251)
#define EC_WORD_GREETINGS_HI (1252)
#define EC_WORD_GREETINGS_YEP (1253)
#define EC_WORD_GREETINGS_YEAH_YEAH (1254)
#define EC_WORD_GREETINGS_BYE_BYE (1255)
#define EC_WORD_GREETINGS_MEET_YOU (1256)
#define EC_WORD_GREETINGS_HAHAHA (1257)
#define EC_WORD_GREETINGS_AIYEEH (1258)
#define EC_WORD_GREETINGS_HIYAH (1259)
#define EC_WORD_GREETINGS_MUHAHAHA (1260)
#define EC_WORD_GREETINGS_LOL (1261)
#define EC_WORD_GREETINGS_SNORT (1262)
#define EC_WORD_GREETINGS_HUMPH (1263)
#define EC_WORD_GREETINGS_HEY_2 (1264)
#define EC_WORD_GREETINGS_HE_HE_HE (1265)
#define EC_WORD_GREETINGS_HEH (1266)
#define EC_WORD_GREETINGS_HOHOHO (1267)
#define EC_WORD_GREETINGS_THERE_YOU_GO (1268)
#define EC_WORD_GREETINGS_OH_DEAR (1269)
#define EC_WORD_GREETINGS_BYE_FOR_NOW (1270)
#define EC_WORD_GREETINGS_ANGRY (1271)
#define EC_WORD_GREETINGS_MUFUFU (1272)
#define EC_WORD_GREETINGS_MMM (1273)
#define EC_WORD_GREETINGS_HELLO_ (1274)
#define EC_WORD_GREETINGS_HI_THERE (1275)
#define EC_WORD_GREETINGS_NO_WAY (1276)
#define EC_WORD_GREETINGS_YAHOO (1277)
#define EC_WORD_GREETINGS_YO (1278)
#define EC_WORD_GREETINGS_WELCOME_2 (1279)
#define EC_WORD_GREETINGS_OK_2 (1280)
#define EC_WORD_GREETINGS_REGARDS (1281)
#define EC_WORD_GREETINGS_LALALA (1282)
#define EC_WORD_GREETINGS_YAY (1283)
#define EC_WORD_GREETINGS_WAIL (1284)
#define EC_WORD_GREETINGS_WOW_2 (1285)
#define EC_WORD_GREETINGS_BOO_ (1286)
#define EC_WORD_GREETINGS_WAHAHA (1287)
#define EC_WORD_GREETINGS__ (1288)
#define EC_WORD_LIFESTYLE_IDOL (1289)
#define EC_WORD_LIFESTYLE_TOMORROW (1290)
#define EC_WORD_LIFESTYLE_PLAYING (1291)
#define EC_WORD_LIFESTYLE_ANIME (1292)
#define EC_WORD_LIFESTYLE_JOB (1293)
#define EC_WORD_LIFESTYLE_SONG (1294)
#define EC_WORD_LIFESTYLE_HOME (1295)
#define EC_WORD_LIFESTYLE_MOVIE (1296)
#define EC_WORD_LIFESTYLE_SWEETS (1297)
#define EC_WORD_LIFESTYLE_MONEY (1298)
#define EC_WORD_LIFESTYLE_POCKET_MONEY (1299)
#define EC_WORD_LIFESTYLE_CHIT_CHAT (1300)
#define EC_WORD_LIFESTYLE_TALK (1301)
#define EC_WORD_LIFESTYLE_BATH (1302)
#define EC_WORD_LIFESTYLE_PLAY_HOUSE (1303)
#define EC_WORD_LIFESTYLE_TOYS (1304)
#define EC_WORD_LIFESTYLE_MUSIC (1305)
#define EC_WORD_LIFESTYLE_CARDS (1306)
#define EC_WORD_LIFESTYLE_SHOPPING (1307)
#define EC_WORD_LIFESTYLE_CONVERSATION (1308)
#define EC_WORD_LIFESTYLE_SCHOOL (1309)
#define EC_WORD_LIFESTYLE_CAMERA (1310)
#define EC_WORD_LIFESTYLE_VIEWING (1311)
#define EC_WORD_LIFESTYLE_SPECTATE (1312)
#define EC_WORD_LIFESTYLE_ANNIVERSARY (1313)
#define EC_WORD_LIFESTYLE_YESTERDAY (1314)
#define EC_WORD_LIFESTYLE_TODAY (1315)
#define EC_WORD_LIFESTYLE_HABIT (1316)
#define EC_WORD_LIFESTYLE_GROUP (1317)
#define EC_WORD_LIFESTYLE_GOURMET (1318)
#define EC_WORD_LIFESTYLE_GAME (1319)
#define EC_WORD_LIFESTYLE_WORD (1320)
#define EC_WORD_LIFESTYLE_COLLECTION (1321)
#define EC_WORD_LIFESTYLE_STORE (1322)
#define EC_WORD_LIFESTYLE_COMPLETE (1323)
#define EC_WORD_LIFESTYLE_SERVICE (1324)
#define EC_WORD_LIFESTYLE_MAGAZINE (1325)
#define EC_WORD_LIFESTYLE_WALK (1326)
#define EC_WORD_LIFESTYLE_WORK (1327)
#define EC_WORD_LIFESTYLE_SYSTEM (1328)
#define EC_WORD_LIFESTYLE_BICYCLE (1329)
#define EC_WORD_LIFESTYLE_TRAINING (1330)
#define EC_WORD_LIFESTYLE_CLASS (1331)
#define EC_WORD_LIFESTYLE_LESSONS (1332)
#define EC_WORD_LIFESTYLE_HOBBY (1333)
#define EC_WORD_LIFESTYLE_INFORMATION (1334)
#define EC_WORD_LIFESTYLE_SPORTS (1335)
#define EC_WORD_LIFESTYLE_DAILY_LIFE (1336)
#define EC_WORD_LIFESTYLE_TEACHER (1337)
#define EC_WORD_LIFESTYLE_SOFTWARE (1338)
#define EC_WORD_LIFESTYLE_SONGS (1339)
#define EC_WORD_LIFESTYLE_DIET (1340)
#define EC_WORD_LIFESTYLE_TOURNAMENT (1341)
#define EC_WORD_LIFESTYLE_TREASURE (1342)
#define EC_WORD_LIFESTYLE_TRAVEL (1343)
#define EC_WORD_LIFESTYLE_BIRTHDAY (1344)
#define EC_WORD_LIFESTYLE_DANCE (1345)
#define EC_WORD_LIFESTYLE_CHANNEL (1346)
#define EC_WORD_LIFESTYLE_FISHING (1347)
#define EC_WORD_LIFESTYLE_DATE (1348)
#define EC_WORD_LIFESTYLE_LETTER (1349)
#define EC_WORD_LIFESTYLE_EVENT (1350)
#define EC_WORD_LIFESTYLE_DESIGN (1351)
#define EC_WORD_LIFESTYLE_DIGITAL (1352)
#define EC_WORD_LIFESTYLE_TEST (1353)
#define EC_WORD_LIFESTYLE_DEPT_STORE (1354)
#define EC_WORD_LIFESTYLE_TELEVISION (1355)
#define EC_WORD_LIFESTYLE_TRAIN (1356)
#define EC_WORD_LIFESTYLE_PHONE (1357)
#define EC_WORD_LIFESTYLE_ITEM (1358)
#define EC_WORD_LIFESTYLE_NAME (1359)
#define EC_WORD_LIFESTYLE_NEWS (1360)
#define EC_WORD_LIFESTYLE_POPULARITY (1361)
#define EC_WORD_LIFESTYLE_STUFFED_TOY (1362)
#define EC_WORD_LIFESTYLE_PARTY (1363)
#define EC_WORD_LIFESTYLE_COMPUTER (1364)
#define EC_WORD_LIFESTYLE_FLOWERS (1365)
#define EC_WORD_LIFESTYLE_HERO (1366)
#define EC_WORD_LIFESTYLE_NAP (1367)
#define EC_WORD_LIFESTYLE_HEROINE (1368)
#define EC_WORD_LIFESTYLE_FASHION (1369)
#define EC_WORD_LIFESTYLE_STUDY (1370)
#define EC_WORD_LIFESTYLE_ADVENTURE (1371)
#define EC_WORD_LIFESTYLE_BOARD (1372)
#define EC_WORD_LIFESTYLE_BALL (1373)
#define EC_WORD_LIFESTYLE_BOOK (1374)
#define EC_WORD_LIFESTYLE_MACHINE (1375)
#define EC_WORD_LIFESTYLE_FESTIVAL (1376)
#define EC_WORD_LIFESTYLE_COMICS (1377)
#define EC_WORD_LIFESTYLE_MAIL (1378)
#define EC_WORD_LIFESTYLE_MESSAGE (1379)
#define EC_WORD_LIFESTYLE_STORY (1380)
#define EC_WORD_LIFESTYLE_PROMISE (1381)
#define EC_WORD_LIFESTYLE_HOLIDAY (1382)
#define EC_WORD_LIFESTYLE_DREAM (1383)
#define EC_WORD_LIFESTYLE_KINDERGARTEN (1384)
#define EC_WORD_LIFESTYLE_PLANS (1385)
#define EC_WORD_LIFESTYLE_LIFE (1386)
#define EC_WORD_LIFESTYLE_RADIO (1387)
#define EC_WORD_LIFESTYLE_CRAZE (1388)
#define EC_WORD_LIFESTYLE_VACATION (1389)
#define EC_WORD_LIFESTYLE_LOOKS (1390)
#define EC_WORD_LIFESTYLE_RENTAL (1391)
#define EC_WORD_LIFESTYLE_WORLD (1392)
#define EC_WORD_FEELINGS_BEAUTY (1393)
#define EC_WORD_FEELINGS_DELIGHT (1394)
#define EC_WORD_FEELINGS_STRANGENESS (1395)
#define EC_WORD_FEELINGS_CLEVERNESS (1396)
#define EC_WORD_FEELINGS_DISAPPOINTED (1397)
#define EC_WORD_FEELINGS_COOLNESS (1398)
#define EC_WORD_FEELINGS_SADNESS (1399)
#define EC_WORD_FEELINGS_CUTENESS (1400)
#define EC_WORD_FEELINGS_ANGER (1401)
#define EC_WORD_FEELINGS_HEALTHY (1402)
#define EC_WORD_FEELINGS_REGRET (1403)
#define EC_WORD_FEELINGS_HAPPINESS (1404)
#define EC_WORD_FEELINGS_DEPRESSED (1405)
#define EC_WORD_FEELINGS_INCREDIBLE (1406)
#define EC_WORD_FEELINGS_LIKES (1407)
#define EC_WORD_FEELINGS_DISLIKE (1408)
#define EC_WORD_FEELINGS_BORED (1409)
#define EC_WORD_FEELINGS_IMPORTANT (1410)
#define EC_WORD_FEELINGS_ALL_RIGHT (1411)
#define EC_WORD_FEELINGS_ADORE (1412)
#define EC_WORD_FEELINGS_TOUGHNESS (1413)
#define EC_WORD_FEELINGS_ENJOYMENT (1414)
#define EC_WORD_FEELINGS_USELESS (1415)
#define EC_WORD_FEELINGS_DROOLING (1416)
#define EC_WORD_FEELINGS_EXCITED (1417)
#define EC_WORD_FEELINGS_SKILLFUL (1418)
#define EC_WORD_FEELINGS_TEARS (1419)
#define EC_WORD_FEELINGS_HATE (1420)
#define EC_WORD_FEELINGS_ROFL (1421)
#define EC_WORD_FEELINGS_HAPPY (1422)
#define EC_WORD_FEELINGS_ENERGETIC (1423)
#define EC_WORD_FEELINGS_SURPRISE (1424)
#define EC_WORD_FEELINGS_NERVOUS (1425)
#define EC_WORD_FEELINGS_WANT (1426)
#define EC_WORD_FEELINGS_SATISFIED (1427)
#define EC_WORD_FEELINGS_RARE (1428)
#define EC_WORD_FEELINGS_MESSED_UP (1429)
#define EC_WORD_FEELINGS_NO_WAY (1430)
#define EC_WORD_FEELINGS_DANGER (1431)
#define EC_WORD_FEELINGS_LOVEY_DOVEY (1432)
#define EC_WORD_FEELINGS_ANTICIPATION (1433)
#define EC_WORD_FEELINGS_SMILE (1434)
#define EC_WORD_FEELINGS_SUBTLE (1435)
#define EC_WORD_FEELINGS_RECOMMEND (1436)
#define EC_WORD_FEELINGS_SIMPLE (1437)
#define EC_WORD_FEELINGS_NICE (1438)
#define EC_WORD_FEELINGS_DIFFICULT (1439)
#define EC_WORD_TOUGH_WORDS_EARTH_TONES (1440)
#define EC_WORD_TOUGH_WORDS_IMPLANT (1441)
#define EC_WORD_TOUGH_WORDS_GOLDEN_RATIO (1442)
#define EC_WORD_TOUGH_WORDS_OMNIBUS (1443)
#define EC_WORD_TOUGH_WORDS_STARBOARD (1444)
#define EC_WORD_TOUGH_WORDS_MONEY_RATE (1445)
#define EC_WORD_TOUGH_WORDS_RESOLUTION (1446)
#define EC_WORD_TOUGH_WORDS_CADENZA (1447)
#define EC_WORD_TOUGH_WORDS_EDUCATION (1448)
#define EC_WORD_TOUGH_WORDS_CUBISM (1449)
#define EC_WORD_TOUGH_WORDS_CROSS_STITCH (1450)
#define EC_WORD_TOUGH_WORDS_ARTERY (1451)
#define EC_WORD_TOUGH_WORDS_BONE_DENSITY (1452)
#define EC_WORD_TOUGH_WORDS_GOMMAGE (1453)
#define EC_WORD_TOUGH_WORDS_STREAMING (1454)
#define EC_WORD_TOUGH_WORDS_CONDUCTIVITY (1455)
#define EC_WORD_TOUGH_WORDS_COPYRIGHT (1456)
#define EC_WORD_TOUGH_WORDS_TWO_STEP (1457)
#define EC_WORD_TOUGH_WORDS_CONTOUR (1458)
#define EC_WORD_TOUGH_WORDS_NEUTRINO (1459)
#define EC_WORD_TOUGH_WORDS_HOWLING (1460)
#define EC_WORD_TOUGH_WORDS_SPREADSHEET (1461)
#define EC_WORD_TOUGH_WORDS_GMT (1462)
#define EC_WORD_TOUGH_WORDS_IRRITABILITY (1463)
#define EC_WORD_TOUGH_WORDS_FRACTALS (1464)
#define EC_WORD_TOUGH_WORDS_FLAMBE (1465)
#define EC_WORD_TOUGH_WORDS_STOCK_PRICES (1466)
#define EC_WORD_TOUGH_WORDS_PH_BALANCE (1467)
#define EC_WORD_TOUGH_WORDS_VECTOR (1468)
#define EC_WORD_TOUGH_WORDS_POLYPHENOL (1469)
#define EC_WORD_TOUGH_WORDS_UBIQUITOUS (1470)
#define EC_WORD_TOUGH_WORDS_REM_SLEEP (1471)
#define EC_WORD_UNION_SINGLE (1472)
#define EC_WORD_UNION_DOUBLE (1473)
#define EC_WORD_UNION_MIX_BATTLE (1474)
#define EC_WORD_UNION_MULTI_BATTLE (1475)
#define EC_WORD_UNION_LEVEL_50 (1476)
#define EC_WORD_UNION_LEVEL_100 (1477)
#define EC_WORD_UNION_COLOSSEUM (1478)
#define EC_WORD_UNION_POKEMON (1479)
#define EC_WORD_UNION_DRAWING (1480)
#define EC_WORD_UNION_RECORD (1481)
#define EC_WORD_UNION_GOTCHA (1482)
#define EC_WORD_UNION_CHAT (1483)
#define EC_WORD_UNION_FRIEND_CODE (1484)
#define EC_WORD_UNION_CONNECTION (1485)
#define EC_WORD_UNION_VOICE_CHAT (1486)
#define EC_WORD_UNION_WI_FI (1487)
#define EC_WORD_UNION_UNDERGROUND (1488)
#define EC_WORD_UNION_UNION (1489)
#define EC_WORD_UNION_POFFIN (1490)
#define EC_WORD_UNION_CONTEST (1491)
#define EC_WORD_UNION_BATTLE_TOWER (1492)
#define EC_WORD_UNION_GTS (1493)
#define EC_WORD_UNION_SECRET_BASE (1494)
#define EC_WORD_NULL (0xFFFF)
#define EC_GROUP_MAX (11)
#define EC_WORD_MASK (0xFFF)
#endif //POKEDIAMOND_CONSTANTS_EASY_CHAT_H

View File

@ -4,6 +4,7 @@
#define SAVE_BAG 3
#define SAVE_DAYCARE 8
#define SAVE_SAFARI_ZONE 27
#define SAVE_EASY_CHAT 34
#define SAVE_BLOCK_NUM 36
#define SAVE_PAGE_MAX 32

37
include/easy_chat.h Normal file
View File

@ -0,0 +1,37 @@
#ifndef POKEDIAMOND_EASY_CHAT_H
#define POKEDIAMOND_EASY_CHAT_H
#include "msgdata.h"
#include "constants/easy_chat.h"
typedef u16 ecword_t;
typedef struct EasyChatManager {
HeapID heapId;
MsgData *msgData[EC_GROUP_MAX];
} EasyChatManager;
typedef struct SaveEasyChat {
u32 greetings;
u32 trendy;
} SaveEasyChat;
EasyChatManager *EasyChatManager_New(HeapID heapId);
void EasyChatManager_Delete(EasyChatManager *easyChatManager);
void EasyChatManager_ReadWordIntoString(EasyChatManager *easyChatManager, u16 ecWord, String *dest);
void GetECWordIntoStringByIndex(u32 ecWord, String *dest);
u16 GetECWordIndexByPair(u32 category, u32 msgNo);
void GetCategoryAndMsgNoByECWordIdx(u32 ecWord, u32 *category, u32 *msgNo);
u32 Save_EasyChat_sizeof(void);
void Save_EasyChat_Init(SaveEasyChat *saveEasyChat);
SaveEasyChat *Save_EasyChat_Get(SaveData *saveData);
BOOL Save_EasyChat_GetTrendySayingFlag(SaveEasyChat *saveEasyChat, u32 flag);
u32 Save_EasyChat_SetRandomTrendySaying(SaveEasyChat *saveEasyChat);
BOOL Save_EasyChat_TrendySayingsUnlockedAllCheck(SaveEasyChat *saveEasyChat);
ecword_t TrendyWordIdxToECWord(u32 word);
BOOL Save_EasyChat_GetGreetingsFlag(SaveEasyChat *saveEasyChat, u32 flag);
void Save_EasyChat_SetGreetingFlag(SaveEasyChat *saveEasyChat, u32 flag);
s32 GetDuplicateWordNum(ecword_t word);
ecword_t RemapDuplicateWord(ecword_t word, s32 target);
#endif //POKEDIAMOND_EASY_CHAT_H

View File

@ -18,7 +18,7 @@ typedef struct String
struct String * String_New(u32 count, HeapID heapId);
BOOL String_Compare(struct String *, struct String *);
void CopyU16ArrayToStringN(struct String *, u16 *, u32); // copy
void StringSetEmpty(struct String *); // set empty
void String_SetEmpty(struct String *); // set empty
struct String * StringDup(struct String *, HeapID heapId);
void String_Delete(struct String * str);
void StringCopy(struct String * dest, struct String * src);

View File

@ -1,34 +0,0 @@
#ifndef POKEDIAMOND_UNK_020139D8_H
#define POKEDIAMOND_UNK_020139D8_H
struct UnkStruct_020139D8
{
HeapID heapId;
struct MsgData * msgDatas[11];
};
typedef struct SaveEasyChat
{
u32 unk_0;
u32 unk_4;
} SaveEasyChat;
struct UnkStruct_020139D8 * EasyChatManager_New(HeapID heapId);
void EasyChatManager_Delete(struct UnkStruct_020139D8 * unk);
void EasyChatManager_ReadWordIntoString(struct UnkStruct_020139D8 * unk, u16 a1, struct String * str);
void GetECWordIntoStringByIndex(u32 a0, struct String * a1);
u16 GetECWordIndexByPair(u16 a0, u16 a1);
void GetCategoryAndMsgNoByECWordIdx(u32 a0, s32 * a1, s32 * a2);
u32 sub_02013B28(void);
void sub_02013B2C(struct SaveEasyChat * unk);
struct SaveEasyChat * Save_EasyChat_Get(struct SaveData * save);
BOOL sub_02013B68(struct SaveEasyChat * unk, u32 a1);
u32 Save_EasyChat_RandomTrendySayingSet(struct SaveEasyChat * unk);
BOOL Save_EasyChat_TrendySayingsUnlockedAllCheck(struct SaveEasyChat * unk);
u16 TrendyWordIdxToECWord(u32 a0);
BOOL sub_02013C0C(struct SaveEasyChat * unk, u32 a1);
void sub_02013C18(struct SaveEasyChat * unk, u32 a1);
s32 sub_02013C28(u16 a0);
u16 sub_02013C6C(u16 a0, s32 a1);
#endif //POKEDIAMOND_UNK_020139D8_H

View File

@ -3,7 +3,7 @@
#include "save.h"
#include "pokedex.h"
#include "unk_020139D8.h"
#include "easy_chat.h"
struct UnkStruct_02085338
{