mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
Merge branch 'master' into trailingSpaces
This commit is contained in:
commit
a6ab2eb883
BIN
graphics/battle_interface/healthbox_doubles_frameend.png
Normal file
BIN
graphics/battle_interface/healthbox_doubles_frameend.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.5 KiB |
BIN
graphics/battle_interface/healthbox_doubles_frameend_bar.png
Normal file
BIN
graphics/battle_interface/healthbox_doubles_frameend_bar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 84 B |
Binary file not shown.
Before Width: | Height: | Size: 92 B |
@ -86,6 +86,7 @@
|
||||
#define EASY_CHAT_BATTLE_WORDS_COUNT 6
|
||||
#define MOVE_NAME_LENGTH 12
|
||||
#define NUM_QUESTIONNAIRE_WORDS 4
|
||||
#define QUIZ_QUESTION_LEN 9
|
||||
|
||||
#define MALE 0
|
||||
#define FEMALE 1
|
||||
|
@ -21,8 +21,6 @@
|
||||
#define QUIZ_AUTHOR_NAME_PLAYER 1
|
||||
#define QUIZ_AUTHOR_NAME_OTHER_PLAYER 2
|
||||
|
||||
#define QUIZ_QUESTION_LEN 9
|
||||
|
||||
// Constants for how many good Pokéblocks the Contest Lady was given
|
||||
// This determines how her performance is described when her TV show comes on
|
||||
#define CONTEST_LADY_NORMAL 0
|
||||
|
@ -761,7 +761,7 @@ struct LilycoveLadyQuiz
|
||||
{
|
||||
/*0x000*/ u8 id;
|
||||
/*0x001*/ u8 state;
|
||||
/*0x002*/ u16 question[9];
|
||||
/*0x002*/ u16 question[QUIZ_QUESTION_LEN];
|
||||
/*0x014*/ u16 correctAnswer;
|
||||
/*0x016*/ u16 playerAnswer;
|
||||
/*0x018*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
|
||||
|
@ -103,11 +103,11 @@ enum
|
||||
HEALTHBOX_GFX_63, //hp bar red [7 pixels]
|
||||
HEALTHBOX_GFX_64, //hp bar red [8 pixels]
|
||||
HEALTHBOX_GFX_65, //hp bar frame end
|
||||
HEALTHBOX_GFX_66, //status ball [full]
|
||||
HEALTHBOX_GFX_67, //status ball [empty]
|
||||
HEALTHBOX_GFX_68, //status ball [fainted]
|
||||
HEALTHBOX_GFX_69, //status ball [statused]
|
||||
HEALTHBOX_GFX_70, //status ball [unused extra]
|
||||
HEALTHBOX_GFX_STATUS_BALL, // Full
|
||||
HEALTHBOX_GFX_STATUS_BALL_EMPTY,
|
||||
HEALTHBOX_GFX_STATUS_BALL_FAINTED,
|
||||
HEALTHBOX_GFX_STATUS_BALL_STATUSED,
|
||||
HEALTHBOX_GFX_STATUS_BALL_CAUGHT,
|
||||
HEALTHBOX_GFX_STATUS_PSN_BATTLER1, //status2 "PSN"
|
||||
HEALTHBOX_GFX_72,
|
||||
HEALTHBOX_GFX_73,
|
||||
@ -153,8 +153,8 @@ enum
|
||||
HEALTHBOX_GFX_STATUS_BRN_BATTLER3, //status4 "BRN"
|
||||
HEALTHBOX_GFX_114,
|
||||
HEALTHBOX_GFX_115,
|
||||
HEALTHBOX_GFX_116, //unknown_D12FEC
|
||||
HEALTHBOX_GFX_117, //unknown_D1300C
|
||||
HEALTHBOX_GFX_FRAME_END,
|
||||
HEALTHBOX_GFX_FRAME_END_BAR,
|
||||
};
|
||||
|
||||
// strings
|
||||
@ -636,7 +636,7 @@ static const struct SpritePalette sStatusSummaryBallsSpritePal =
|
||||
|
||||
static const struct SpriteSheet sStatusSummaryBallsSpriteSheet =
|
||||
{
|
||||
gBattleInterface_BallDisplayGfx, 0x80, TAG_STATUS_SUMMARY_BALLS_TILE
|
||||
&gHealthboxElementsGfxTable[HEALTHBOX_GFX_STATUS_BALL], 0x80, TAG_STATUS_SUMMARY_BALLS_TILE
|
||||
};
|
||||
|
||||
// unused oam data
|
||||
@ -1225,7 +1225,7 @@ static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8
|
||||
windowTileData = AddTextPrinterAndCreateWindowOnHealthbox(text, 0, 5, 0, &windowId);
|
||||
HpTextIntoHealthboxObject((void*)(OBJ_VRAM0) + spriteTileNum + 0xC0, windowTileData, 2);
|
||||
RemoveWindowOnHealthbox(windowId);
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_116),
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_FRAME_END),
|
||||
(void*)(OBJ_VRAM0 + 0x680) + (gSprites[healthboxSpriteId].oam.tileNum * TILE_SIZE_4BPP),
|
||||
0x20);
|
||||
}
|
||||
@ -1291,7 +1291,7 @@ static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8
|
||||
{
|
||||
if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) // Impossible to reach part, because the battlerId is from the opponent's side.
|
||||
{
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_116),
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_FRAME_END),
|
||||
(void*)(OBJ_VRAM0) + ((gSprites[healthboxSpriteId].oam.tileNum + 52) * TILE_SIZE_4BPP),
|
||||
0x20);
|
||||
}
|
||||
@ -1399,7 +1399,7 @@ void SwapHpBarsWithHpText(void)
|
||||
{
|
||||
UpdateStatusIconInHealthbox(gHealthboxSpriteIds[i]);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[i], &gPlayerParty[gBattlerPartyIndexes[i]], HEALTHBOX_HEALTH_BAR);
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_117), (void*)(OBJ_VRAM0 + 0x680 + gSprites[gHealthboxSpriteIds[i]].oam.tileNum * TILE_SIZE_4BPP), 32);
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_FRAME_END_BAR), (void*)(OBJ_VRAM0 + 0x680 + gSprites[gHealthboxSpriteIds[i]].oam.tileNum * TILE_SIZE_4BPP), 32);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1962,7 +1962,7 @@ static void TryAddPokeballIconToHealthbox(u8 healthboxSpriteId, bool8 noStatus)
|
||||
healthBarSpriteId = gSprites[healthboxSpriteId].hMain_HealthBarSpriteId;
|
||||
|
||||
if (noStatus)
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_70), (void*)(OBJ_VRAM0 + (gSprites[healthBarSpriteId].oam.tileNum + 8) * TILE_SIZE_4BPP), 32);
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_STATUS_BALL_CAUGHT), (void*)(OBJ_VRAM0 + (gSprites[healthBarSpriteId].oam.tileNum + 8) * TILE_SIZE_4BPP), 32);
|
||||
else
|
||||
CpuFill32(0, (void*)(OBJ_VRAM0 + (gSprites[healthBarSpriteId].oam.tileNum + 8) * TILE_SIZE_4BPP), 32);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ static const u16 sLilycoveLadyGfxId[] =
|
||||
};
|
||||
|
||||
// Quiz Lady data
|
||||
static const u16 sQuizLadyQuestion1[] =
|
||||
static const u16 sQuizLadyQuestion1[QUIZ_QUESTION_LEN] =
|
||||
{
|
||||
EC_WORD_WHICH,
|
||||
EC_WORD_STORES,
|
||||
@ -33,7 +33,7 @@ static const u16 sQuizLadyQuestion1[] =
|
||||
EC_WORD_POKENAV
|
||||
};
|
||||
|
||||
static const u16 sQuizLadyQuestion2[] =
|
||||
static const u16 sQuizLadyQuestion2[QUIZ_QUESTION_LEN] =
|
||||
{
|
||||
EC_WORD_WHICH,
|
||||
EC_WORD_ISN_T,
|
||||
@ -46,7 +46,7 @@ static const u16 sQuizLadyQuestion2[] =
|
||||
EC_WORD_DARK
|
||||
};
|
||||
|
||||
static const u16 sQuizLadyQuestion3[] =
|
||||
static const u16 sQuizLadyQuestion3[QUIZ_QUESTION_LEN] =
|
||||
{
|
||||
EC_WORD_HOW,
|
||||
EC_WORD_DO,
|
||||
@ -59,7 +59,7 @@ static const u16 sQuizLadyQuestion3[] =
|
||||
EC_WORD_CUTE_CHARM
|
||||
};
|
||||
|
||||
static const u16 sQuizLadyQuestion4[] =
|
||||
static const u16 sQuizLadyQuestion4[QUIZ_QUESTION_LEN] =
|
||||
{
|
||||
EC_WORD_WHICH,
|
||||
EC_WORD_IS,
|
||||
@ -72,7 +72,7 @@ static const u16 sQuizLadyQuestion4[] =
|
||||
EC_WORD_MACHINE
|
||||
};
|
||||
|
||||
static const u16 sQuizLadyQuestion5[] =
|
||||
static const u16 sQuizLadyQuestion5[QUIZ_QUESTION_LEN] =
|
||||
{
|
||||
EC_WORD_WHICH,
|
||||
EC_WORD_ITEM,
|
||||
@ -85,7 +85,7 @@ static const u16 sQuizLadyQuestion5[] =
|
||||
EC_WORD_PHONE
|
||||
};
|
||||
|
||||
static const u16 sQuizLadyQuestion6[] =
|
||||
static const u16 sQuizLadyQuestion6[QUIZ_QUESTION_LEN] =
|
||||
{
|
||||
EC_WORD_WHICH,
|
||||
EC_WORD_WILL,
|
||||
@ -98,7 +98,7 @@ static const u16 sQuizLadyQuestion6[] =
|
||||
EC_WORD_SWIFT_SWIM
|
||||
};
|
||||
|
||||
static const u16 sQuizLadyQuestion7[] =
|
||||
static const u16 sQuizLadyQuestion7[QUIZ_QUESTION_LEN] =
|
||||
{
|
||||
EC_WORD_WHICH,
|
||||
EC_WORD_OF,
|
||||
@ -111,7 +111,7 @@ static const u16 sQuizLadyQuestion7[] =
|
||||
EC_WORD_ROCK
|
||||
};
|
||||
|
||||
static const u16 sQuizLadyQuestion8[] =
|
||||
static const u16 sQuizLadyQuestion8[QUIZ_QUESTION_LEN] =
|
||||
{
|
||||
EC_WORD_WHICH,
|
||||
EC_WORD_WILL,
|
||||
@ -124,7 +124,7 @@ static const u16 sQuizLadyQuestion8[] =
|
||||
EC_WORD_WONDER_GUARD
|
||||
};
|
||||
|
||||
static const u16 sQuizLadyQuestion9[] =
|
||||
static const u16 sQuizLadyQuestion9[QUIZ_QUESTION_LEN] =
|
||||
{
|
||||
EC_WORD_WHICH,
|
||||
EC_WORD_WILL,
|
||||
@ -137,7 +137,7 @@ static const u16 sQuizLadyQuestion9[] =
|
||||
EC_WORD_SHED_SKIN
|
||||
};
|
||||
|
||||
static const u16 sQuizLadyQuestion10[] =
|
||||
static const u16 sQuizLadyQuestion10[QUIZ_QUESTION_LEN] =
|
||||
{
|
||||
EC_WORD_WHICH,
|
||||
EC_WORD_GOES,
|
||||
@ -150,7 +150,7 @@ static const u16 sQuizLadyQuestion10[] =
|
||||
EC_WORD_POKENAV
|
||||
};
|
||||
|
||||
static const u16 sQuizLadyQuestion11[] =
|
||||
static const u16 sQuizLadyQuestion11[QUIZ_QUESTION_LEN] =
|
||||
{
|
||||
EC_WORD_WHICH,
|
||||
EC_WORD_STORES,
|
||||
@ -163,7 +163,7 @@ static const u16 sQuizLadyQuestion11[] =
|
||||
EC_WORD_TELEVISION
|
||||
};
|
||||
|
||||
static const u16 sQuizLadyQuestion12[] =
|
||||
static const u16 sQuizLadyQuestion12[QUIZ_QUESTION_LEN] =
|
||||
{
|
||||
EC_WORD_WHICH,
|
||||
EC_WORD_MACHINE,
|
||||
@ -176,7 +176,7 @@ static const u16 sQuizLadyQuestion12[] =
|
||||
EC_WORD_TELEVISION
|
||||
};
|
||||
|
||||
static const u16 sQuizLadyQuestion13[] =
|
||||
static const u16 sQuizLadyQuestion13[QUIZ_QUESTION_LEN] =
|
||||
{
|
||||
EC_WORD_A,
|
||||
EC_WORD_POKEMON,
|
||||
@ -189,7 +189,7 @@ static const u16 sQuizLadyQuestion13[] =
|
||||
EC_WORD_LETTER
|
||||
};
|
||||
|
||||
static const u16 sQuizLadyQuestion14[] =
|
||||
static const u16 sQuizLadyQuestion14[QUIZ_QUESTION_LEN] =
|
||||
{
|
||||
EC_WORD_STEEL,
|
||||
EC_WORD_IS,
|
||||
@ -202,7 +202,7 @@ static const u16 sQuizLadyQuestion14[] =
|
||||
EC_EMPTY_WORD
|
||||
};
|
||||
|
||||
static const u16 sQuizLadyQuestion15[] =
|
||||
static const u16 sQuizLadyQuestion15[QUIZ_QUESTION_LEN] =
|
||||
{
|
||||
EC_WORD_DARK,
|
||||
EC_WORD_IS,
|
||||
@ -215,7 +215,7 @@ static const u16 sQuizLadyQuestion15[] =
|
||||
EC_EMPTY_WORD
|
||||
};
|
||||
|
||||
static const u16 sQuizLadyQuestion16[] =
|
||||
static const u16 sQuizLadyQuestion16[QUIZ_QUESTION_LEN] =
|
||||
{
|
||||
EC_WORD_GHOST,
|
||||
EC_WORD_IS,
|
||||
|
@ -355,7 +355,6 @@ const u16 gBattleInterface_BallStatusBarPal[] = INCBIN_U16("graphics/battle_inte
|
||||
|
||||
const u16 gBattleInterface_BallDisplayPal[] = INCBIN_U16("graphics/battle_interface/ball_display.gbapal");
|
||||
|
||||
//Originally an array?
|
||||
const u8 gHealthboxElementsGfxTable[] = INCBIN_U8("graphics/battle_interface/hpbar.4bpp",
|
||||
"graphics/battle_interface/expbar.4bpp",
|
||||
"graphics/battle_interface/status_psn.4bpp",
|
||||
@ -365,17 +364,14 @@ const u8 gHealthboxElementsGfxTable[] = INCBIN_U8("graphics/battle_interface/hpb
|
||||
"graphics/battle_interface/status_brn.4bpp",
|
||||
"graphics/battle_interface/misc.4bpp",
|
||||
"graphics/battle_interface/hpbar_anim.4bpp",
|
||||
"graphics/battle_interface/misc_frameend.4bpp");
|
||||
|
||||
const u8 gBattleInterface_BallDisplayGfx[] = INCBIN_U8("graphics/battle_interface/ball_display.4bpp");
|
||||
|
||||
//Originally an array?
|
||||
const u8 gUnknown_08C1249C[] = INCBIN_U8("graphics/battle_interface/ball_display_unused_extra.4bpp");
|
||||
const u8 gBattleInterfaceGfx_Status2[] = INCBIN_U8("graphics/battle_interface/status2.4bpp"); // these three duplicate sets of graphics are for the opponent pokemon
|
||||
const u8 gBattleInterfaceGfx_Status3[] = INCBIN_U8("graphics/battle_interface/status3.4bpp"); // and are also for use in double battles. they use dynamic palettes so
|
||||
const u8 gBattleInterfaceGfx_Status4[] = INCBIN_U8("graphics/battle_interface/status4.4bpp"); // coloring them is an extreme headache and wont be done for now
|
||||
const u8 gUnknown_D12FEC[] = INCBIN_U8("graphics/unknown/unknown_D12FEC.4bpp");
|
||||
const u8 gUnknown_D1300C[] = INCBIN_U8("graphics/unknown/unknown_D1300C.4bpp");
|
||||
"graphics/battle_interface/misc_frameend.4bpp",
|
||||
"graphics/battle_interface/ball_display.4bpp",
|
||||
"graphics/battle_interface/ball_display_unused_extra.4bpp",
|
||||
"graphics/battle_interface/status2.4bpp", // these three duplicate sets of graphics are for the opponent pokemon
|
||||
"graphics/battle_interface/status3.4bpp", // and are also for use in double battles. they use dynamic palettes so
|
||||
"graphics/battle_interface/status4.4bpp", // coloring them is an extreme headache and wont be done for now
|
||||
"graphics/battle_interface/healthbox_doubles_frameend.4bpp",
|
||||
"graphics/battle_interface/healthbox_doubles_frameend_bar.4bpp");
|
||||
const u32 gBattleInterfaceGfx_UnusedWindow3[] = INCBIN_U32("graphics/battle_interface/unused_window3.4bpp.lz");
|
||||
const u32 gBattleInterfaceGfx_UnusedWindow4[] = INCBIN_U32("graphics/battle_interface/unused_window4.4bpp.lz");
|
||||
|
||||
|
@ -119,10 +119,10 @@ void Script_GetLilycoveLadyId(void)
|
||||
|
||||
static u8 GetNumAcceptedItems(const u16 *itemsArray)
|
||||
{
|
||||
u8 items;
|
||||
u8 numItems;
|
||||
|
||||
for (items = 0; *itemsArray != ITEM_NONE; items ++, itemsArray ++);
|
||||
return items;
|
||||
for (numItems = 0; *itemsArray != ITEM_NONE; numItems++, itemsArray++);
|
||||
return numItems;
|
||||
}
|
||||
|
||||
static void FavorLadyPickFavorAndBestItem(void)
|
||||
@ -160,18 +160,12 @@ u8 GetFavorLadyState(void)
|
||||
{
|
||||
sFavorLadyPtr = &gSaveBlock1Ptr->lilycoveLady.favor;
|
||||
if (sFavorLadyPtr->state == LILYCOVE_LADY_STATE_PRIZE)
|
||||
{
|
||||
return LILYCOVE_LADY_STATE_PRIZE;
|
||||
}
|
||||
else if (sFavorLadyPtr->state == LILYCOVE_LADY_STATE_COMPLETED)
|
||||
{
|
||||
return LILYCOVE_LADY_STATE_COMPLETED;
|
||||
}
|
||||
else
|
||||
{
|
||||
return LILYCOVE_LADY_STATE_READY;
|
||||
}
|
||||
}
|
||||
|
||||
static const u8 *GetFavorLadyRequest(u8 idx)
|
||||
{
|
||||
@ -209,7 +203,7 @@ void BufferFavorLadyItemName(void)
|
||||
|
||||
static void SetFavorLadyPlayerName(const u8 *src, u8 *dest)
|
||||
{
|
||||
memset(dest, 0xFF, 8);
|
||||
memset(dest, EOS, PLAYER_NAME_LENGTH + 1);
|
||||
StringCopy7(dest, src);
|
||||
}
|
||||
|
||||
@ -254,9 +248,7 @@ static bool8 DoesFavorLadyLikeItem(u16 itemId)
|
||||
sFavorLadyPtr->numItemsGiven++;
|
||||
sFavorLadyPtr->likedItem = TRUE;
|
||||
if (sFavorLadyPtr->bestItem == itemId)
|
||||
{
|
||||
sFavorLadyPtr->numItemsGiven = LILYCOVE_LADY_GIFT_THRESHOLD;
|
||||
}
|
||||
break;
|
||||
}
|
||||
sFavorLadyPtr->likedItem = FALSE;
|
||||
@ -312,9 +304,7 @@ static void QuizLadyPickQuestion(void)
|
||||
|
||||
questionId = Random() % ARRAY_COUNT(sQuizLadyQuizQuestions);
|
||||
for (i = 0; i < QUIZ_QUESTION_LEN; i ++)
|
||||
{
|
||||
sQuizLadyPtr->question[i] = sQuizLadyQuizQuestions[questionId][i];
|
||||
}
|
||||
sQuizLadyPtr->correctAnswer = sQuizLadyQuizAnswers[questionId];
|
||||
sQuizLadyPtr->prize = sQuizLadyPrizes[questionId];
|
||||
sQuizLadyPtr->questionId = questionId;
|
||||
@ -328,16 +318,16 @@ static void InitLilycoveQuizLady(void)
|
||||
sQuizLadyPtr = &gSaveBlock1Ptr->lilycoveLady.quiz;
|
||||
sQuizLadyPtr->id = LILYCOVE_LADY_QUIZ;
|
||||
sQuizLadyPtr->state = LILYCOVE_LADY_STATE_READY;
|
||||
|
||||
for (i = 0; i < QUIZ_QUESTION_LEN; i ++)
|
||||
{
|
||||
sQuizLadyPtr->question[i] = -1;
|
||||
}
|
||||
sQuizLadyPtr->correctAnswer = -1;
|
||||
sQuizLadyPtr->playerAnswer = -1;
|
||||
sQuizLadyPtr->question[i] = EC_EMPTY_WORD;
|
||||
|
||||
sQuizLadyPtr->correctAnswer = EC_EMPTY_WORD;
|
||||
sQuizLadyPtr->playerAnswer = EC_EMPTY_WORD;
|
||||
|
||||
for (i = 0; i < TRAINER_ID_LENGTH; i ++)
|
||||
{
|
||||
sQuizLadyPtr->playerTrainerId[i] = 0;
|
||||
}
|
||||
|
||||
sQuizLadyPtr->prize = ITEM_NONE;
|
||||
sQuizLadyPtr->waitingForChallenger = FALSE;
|
||||
sQuizLadyPtr->prevQuestionId = ARRAY_COUNT(sQuizLadyQuizQuestions);
|
||||
@ -351,48 +341,37 @@ static void ResetQuizLadyForRecordMix(void)
|
||||
sQuizLadyPtr->id = LILYCOVE_LADY_QUIZ;
|
||||
sQuizLadyPtr->state = LILYCOVE_LADY_STATE_READY;
|
||||
sQuizLadyPtr->waitingForChallenger = FALSE;
|
||||
sQuizLadyPtr->playerAnswer = -1;
|
||||
sQuizLadyPtr->playerAnswer = EC_EMPTY_WORD;
|
||||
}
|
||||
|
||||
u8 GetQuizLadyState(void)
|
||||
{
|
||||
sQuizLadyPtr = &gSaveBlock1Ptr->lilycoveLady.quiz;
|
||||
if (sQuizLadyPtr->state == LILYCOVE_LADY_STATE_PRIZE)
|
||||
{
|
||||
return LILYCOVE_LADY_STATE_PRIZE;
|
||||
}
|
||||
else if (sQuizLadyPtr->state == LILYCOVE_LADY_STATE_COMPLETED)
|
||||
{
|
||||
return LILYCOVE_LADY_STATE_COMPLETED;
|
||||
}
|
||||
else
|
||||
{
|
||||
return LILYCOVE_LADY_STATE_READY;
|
||||
}
|
||||
}
|
||||
|
||||
u8 GetQuizAuthor(void)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
s32 i, j;
|
||||
u8 authorNameId;
|
||||
struct LilycoveLadyQuiz *quiz;
|
||||
struct LilycoveLadyQuiz *quiz = &gSaveBlock1Ptr->lilycoveLady.quiz;
|
||||
|
||||
quiz = &gSaveBlock1Ptr->lilycoveLady.quiz;
|
||||
if (IsEasyChatAnswerUnlocked(quiz->correctAnswer) == FALSE)
|
||||
{
|
||||
i = quiz->questionId;
|
||||
do
|
||||
{
|
||||
if (++ i >= (int)(ARRAY_COUNT(sQuizLadyQuizQuestions)))
|
||||
{
|
||||
if (++i >= (int)ARRAY_COUNT(sQuizLadyQuizQuestions))
|
||||
i = 0;
|
||||
}
|
||||
} while (IsEasyChatAnswerUnlocked(sQuizLadyQuizAnswers[i]) == FALSE);
|
||||
|
||||
for (j = 0; j < QUIZ_QUESTION_LEN; j++)
|
||||
{
|
||||
quiz->question[j] = sQuizLadyQuizQuestions[i][j];
|
||||
}
|
||||
quiz->correctAnswer = sQuizLadyQuizAnswers[i];
|
||||
quiz->prize = sQuizLadyPrizes[i];
|
||||
quiz->questionId = i;
|
||||
@ -400,18 +379,12 @@ u8 GetQuizAuthor(void)
|
||||
}
|
||||
authorNameId = BufferQuizAuthorName();
|
||||
if (authorNameId == QUIZ_AUTHOR_NAME_LADY)
|
||||
{
|
||||
return QUIZ_AUTHOR_LADY;
|
||||
}
|
||||
else if (authorNameId == QUIZ_AUTHOR_NAME_OTHER_PLAYER || IsQuizTrainerIdNotPlayer())
|
||||
{
|
||||
return QUIZ_AUTHOR_OTHER_PLAYER;
|
||||
}
|
||||
else
|
||||
{
|
||||
return QUIZ_AUTHOR_PLAYER;
|
||||
}
|
||||
}
|
||||
|
||||
static u8 BufferQuizAuthorName(void)
|
||||
{
|
||||
@ -532,7 +505,7 @@ void SetQuizLadyState_GivePrize(void)
|
||||
void ClearQuizLadyPlayerAnswer(void)
|
||||
{
|
||||
sQuizLadyPtr = &gSaveBlock1Ptr->lilycoveLady.quiz;
|
||||
sQuizLadyPtr->playerAnswer = -1;
|
||||
sQuizLadyPtr->playerAnswer = EC_EMPTY_WORD;
|
||||
}
|
||||
|
||||
void Script_QuizLadyOpenBagMenu(void)
|
||||
@ -544,13 +517,9 @@ void QuizLadyPickNewQuestion(void)
|
||||
{
|
||||
sQuizLadyPtr = &gSaveBlock1Ptr->lilycoveLady.quiz;
|
||||
if (BufferQuizAuthorNameAndCheckIfLady())
|
||||
{
|
||||
sQuizLadyPtr->prevQuestionId = sQuizLadyPtr->questionId;
|
||||
}
|
||||
else
|
||||
{
|
||||
sQuizLadyPtr->prevQuestionId = ARRAY_COUNT(sQuizLadyQuizQuestions);
|
||||
}
|
||||
QuizLadyPickQuestion();
|
||||
}
|
||||
|
||||
@ -560,10 +529,8 @@ void ClearQuizLadyQuestionAndAnswer(void)
|
||||
|
||||
sQuizLadyPtr = &gSaveBlock1Ptr->lilycoveLady.quiz;
|
||||
for (i = 0; i < QUIZ_QUESTION_LEN; i++)
|
||||
{
|
||||
sQuizLadyPtr->question[i] = -1;
|
||||
}
|
||||
sQuizLadyPtr->correctAnswer = -1;
|
||||
sQuizLadyPtr->question[i] = EC_EMPTY_WORD;
|
||||
sQuizLadyPtr->correctAnswer = EC_EMPTY_WORD;
|
||||
}
|
||||
|
||||
void QuizLadySetCustomQuestion(void)
|
||||
@ -584,9 +551,7 @@ void QuizLadyRecordCustomQuizData(void)
|
||||
sQuizLadyPtr = &gSaveBlock1Ptr->lilycoveLady.quiz;
|
||||
sQuizLadyPtr->prize = gSpecialVar_ItemId;
|
||||
for (i = 0; i < TRAINER_ID_LENGTH; i++)
|
||||
{
|
||||
sQuizLadyPtr->playerTrainerId[i] = gSaveBlock2Ptr->playerTrainerId[i];
|
||||
}
|
||||
StringCopy7(sQuizLadyPtr->playerName, gSaveBlock2Ptr->playerName);
|
||||
sQuizLadyPtr->language = gGameLanguage;
|
||||
}
|
||||
@ -620,15 +585,12 @@ void QuizLadyClearQuestionForRecordMix(const LilycoveLady *lilycoveLady)
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (lilycoveLady->quiz.prevQuestionId != sQuizLadyPtr->questionId)
|
||||
{
|
||||
break;
|
||||
}
|
||||
sQuizLadyPtr->questionId = Random() % ARRAY_COUNT(sQuizLadyQuizQuestions);
|
||||
}
|
||||
if (lilycoveLady->quiz.prevQuestionId == sQuizLadyPtr->questionId)
|
||||
{
|
||||
sQuizLadyPtr->questionId = (sQuizLadyPtr->questionId + 1) % (int)(ARRAY_COUNT(sQuizLadyQuizQuestions));
|
||||
}
|
||||
sQuizLadyPtr->questionId = (sQuizLadyPtr->questionId + 1) % (int)ARRAY_COUNT(sQuizLadyQuizQuestions);
|
||||
|
||||
sQuizLadyPtr->prevQuestionId = lilycoveLady->quiz.prevQuestionId;
|
||||
}
|
||||
}
|
||||
@ -656,12 +618,11 @@ static void ResetContestLadyForRecordMix(void)
|
||||
sContestLadyPtr = &gSaveBlock1Ptr->lilycoveLady.contest;
|
||||
sContestLadyPtr->id = LILYCOVE_LADY_CONTEST;
|
||||
sContestLadyPtr->givenPokeblock = FALSE;
|
||||
|
||||
if (sContestLadyPtr->numGoodPokeblocksGiven == LILYCOVE_LADY_GIFT_THRESHOLD
|
||||
|| sContestLadyPtr->numOtherPokeblocksGiven == LILYCOVE_LADY_GIFT_THRESHOLD)
|
||||
{
|
||||
ResetContestLadyContestData();
|
||||
}
|
||||
}
|
||||
|
||||
static void ContestLadySavePlayerNameIfHighSheen(u8 sheen)
|
||||
{
|
||||
@ -731,18 +692,18 @@ bool8 GivePokeblockToContestLady(struct Pokeblock *pokeblock)
|
||||
return correctFlavor;
|
||||
}
|
||||
|
||||
static void BufferContestLadyCategoryAndMonName(u8 *dest1, u8 *dest2)
|
||||
static void BufferContestLadyCategoryAndMonName(u8 *category, u8 *nickname)
|
||||
{
|
||||
sContestLadyPtr = &gSaveBlock1Ptr->lilycoveLady.contest;
|
||||
StringCopy(dest1, sContestLadyCategoryNames[sContestLadyPtr->category]);
|
||||
StringCopy10(dest2, sContestLadyMonNames[sContestLadyPtr->category]);
|
||||
StringCopy(category, sContestLadyCategoryNames[sContestLadyPtr->category]);
|
||||
StringCopy10(nickname, sContestLadyMonNames[sContestLadyPtr->category]);
|
||||
}
|
||||
|
||||
void BufferContestLadyMonName(u8 *dest1, u8 *dest2)
|
||||
void BufferContestLadyMonName(u8 *category, u8 *nickname)
|
||||
{
|
||||
sContestLadyPtr = &gSaveBlock1Ptr->lilycoveLady.contest;
|
||||
*dest1 = sContestLadyPtr->category;
|
||||
StringCopy(dest2, sContestLadyMonNames[sContestLadyPtr->category]);
|
||||
*category = sContestLadyPtr->category;
|
||||
StringCopy(nickname, sContestLadyMonNames[sContestLadyPtr->category]);
|
||||
}
|
||||
|
||||
void BufferContestLadyPlayerName(u8 *dest)
|
||||
@ -779,9 +740,7 @@ bool8 HasPlayerGivenContestLadyPokeblock(void)
|
||||
{
|
||||
sContestLadyPtr = &gSaveBlock1Ptr->lilycoveLady.contest;
|
||||
if (sContestLadyPtr->givenPokeblock == TRUE)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -792,9 +751,8 @@ bool8 ShouldContestLadyShowGoOnAir(void)
|
||||
sContestLadyPtr = &gSaveBlock1Ptr->lilycoveLady.contest;
|
||||
if (sContestLadyPtr->numGoodPokeblocksGiven >= LILYCOVE_LADY_GIFT_THRESHOLD
|
||||
|| sContestLadyPtr->numOtherPokeblocksGiven >= LILYCOVE_LADY_GIFT_THRESHOLD)
|
||||
{
|
||||
putOnAir = TRUE;
|
||||
}
|
||||
|
||||
return putOnAir;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user