From 2749948eebe65aa8b55738d820e4a0252dd45c1a Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 16 Aug 2020 05:52:17 -0400 Subject: [PATCH] Clean up contest doc --- data/contest_ai_scripts.s | 6 +- include/constants/contest.h | 27 ----- include/contest.h | 22 ++-- src/contest.c | 201 ++++++++++++++++++----------------- src/contest_effect.c | 40 +++---- src/data/contest_opponents.h | 36 +++---- 6 files changed, 152 insertions(+), 180 deletions(-) diff --git a/data/contest_ai_scripts.s b/data/contest_ai_scripts.s index 4938a8c93..4a0bed817 100644 --- a/data/contest_ai_scripts.s +++ b/data/contest_ai_scripts.s @@ -6,8 +6,6 @@ .section script_data, "aw", %progbits -@ TODO - enum_start enum MON_1 enum MON_2 @@ -52,7 +50,7 @@ gContestAIChecks:: @ 82DE350 @ Unreferenced AI routine to encourage moves that improve condition on the first @ appeal. Additionally, it checks the turn order of the user and the effect -@ type, but the code is buggy and doesnt affect the score. +@ type, but the code is buggy and doesn't affect the score. if_appeal_num_not_eq 0, ContestUnreferenced_80 if_effect_not_eq CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, ContestUnreferenced_80 score +10 @@ -67,7 +65,7 @@ ContestUnreferenced_0D: ContestUnreferenced_end: end -@ Unreferenced AI routine that doesnt make much sense. +@ Unreferenced AI routine that doesn't make much sense. if_appeal_num_eq 0, ContestUnreferenced_0F_1 if_appeal_num_eq 1, ContestUnreferenced_0F_2 if_appeal_num_eq 2, ContestUnreferenced_0F_3 diff --git a/include/constants/contest.h b/include/constants/contest.h index a10354169..5ec4c4f69 100644 --- a/include/constants/contest.h +++ b/include/constants/contest.h @@ -52,33 +52,6 @@ #define CONTEST_AI_CHECK_ORDER (1 << 4) #define CONTEST_AI_CHECK_GOOD_MOVE (1 << 5) #define CONTEST_AI_ERRATIC (1 << 6) -#define CONTEST_AI_DUMMY_1 (1 << 7) -#define CONTEST_AI_DUMMY_2 (1 << 8) -#define CONTEST_AI_DUMMY_3 (1 << 9) -#define CONTEST_AI_DUMMY_4 (1 << 10) -#define CONTEST_AI_DUMMY_5 (1 << 11) -#define CONTEST_AI_DUMMY_6 (1 << 12) -#define CONTEST_AI_DUMMY_7 (1 << 13) -#define CONTEST_AI_DUMMY_8 (1 << 14) -#define CONTEST_AI_DUMMY_9 (1 << 15) -#define CONTEST_AI_DUMMY_10 (1 << 16) -#define CONTEST_AI_DUMMY_11 (1 << 17) -#define CONTEST_AI_DUMMY_12 (1 << 18) -#define CONTEST_AI_DUMMY_13 (1 << 19) -#define CONTEST_AI_DUMMY_14 (1 << 20) -#define CONTEST_AI_DUMMY_15 (1 << 21) -#define CONTEST_AI_DUMMY_16 (1 << 22) -#define CONTEST_AI_DUMMY_17 (1 << 23) -#define CONTEST_AI_DUMMY_18 (1 << 24) -#define CONTEST_AI_DUMMY_19 (1 << 25) -#define CONTEST_AI_DUMMY_20 (1 << 26) -#define CONTEST_AI_DUMMY_21 (1 << 27) -#define CONTEST_AI_DUMMY_22 (1 << 28) -#define CONTEST_AI_DUMMY_23 (1 << 29) -#define CONTEST_AI_DUMMY_24 (1 << 30) -#define CONTEST_AI_DUMMY_25 (1 << 31) -#define CONTEST_AI_ALL (CONTEST_AI_CHECK_BAD_MOVE | CONTEST_AI_CHECK_COMBO | CONTEST_AI_CHECK_BORING | CONTEST_AI_CHECK_EXCITEMENT | CONTEST_AI_CHECK_ORDER | CONTEST_AI_CHECK_GOOD_MOVE | CONTEST_AI_ERRATIC) -#define CONTEST_AI_DUMMIES_1 (CONTEST_AI_DUMMY_1 | CONTEST_AI_DUMMY_2 | CONTEST_AI_DUMMY_3 | CONTEST_AI_DUMMY_4 | CONTEST_AI_DUMMY_5) #define CONTEST_EFFECT_HIGHLY_APPEALING 0 #define CONTEST_EFFECT_USER_MORE_EASILY_STARTLED 1 diff --git a/include/contest.h b/include/contest.h index 834aba402..e4cda6e25 100644 --- a/include/contest.h +++ b/include/contest.h @@ -127,11 +127,11 @@ struct Contest { u8 playerMoveChoice; u8 appealNumber; - u8 unused2[CONTESTANT_COUNT]; - bool16 unk1920A_0:1; // Task active flags? - bool16 unk1920A_1:1; - bool16 unk1920A_2:1; - bool16 unk1920A_3:1; + u8 unk[CONTESTANT_COUNT]; // never read + bool16 unused1:1; + bool16 unused2:1; + bool16 unused3:1; + bool16 unused4:1; bool16 waitForJudgeSpeechBubble:1; bool16 isShowingApplauseMeter:1; bool16 applauseMeterIsMoving:1; @@ -140,10 +140,10 @@ struct Contest bool16 sliderHeartsAnimating:1; // When the slider heart is appearing/disappearing bool16 waitForLink:1; u8 mainTaskId; - u8 unk1920D[4]; + u8 filler1[4]; u8 judgeAttentionTaskId; u8 blendTaskId; - u8 filler19213; + u8 filler2; u8 turnNumber; u8 currentContestant; u8 judgeSpeechBubbleSpriteId; @@ -159,8 +159,8 @@ struct Contest struct ContestantStatus { - s16 appeal1; // move appeal? - s16 appeal2; // final appeal after end of turn, maybe? + s16 baseAppeal; + s16 appeal; s16 pointTotal; u16 currMove; u16 prevMove; @@ -264,8 +264,8 @@ struct ContestTV s16 move; u8 winnerFlags; u8 loserFlags; - u8 madeAppeal:1; - u8 madeExcitingAppeal:1; + bool8 madeAppeal:1; + bool8 madeExcitingAppeal:1; }; struct ContestUnused diff --git a/src/contest.c b/src/contest.c index d734b9eb4..97d9cfda7 100644 --- a/src/contest.c +++ b/src/contest.c @@ -79,7 +79,7 @@ static void Task_ReadyUpdateHeartSliders(u8); static void Task_UpdateHeartSliders(u8); static void Task_WaitForHeartSliders(u8); static void sub_80DA348(u8); -static void sub_80DA38C(u8); +static void Task_WaitPrintRoundResult(u8); static void Task_PrintRoundResultText(u8); static void Task_ReUpdateHeartSliders(u8); static void Task_WaitForHeartSlidersAgain(u8); @@ -267,6 +267,70 @@ enum { SLIDER_HEART_ANIM_APPEAR, }; +// States for Task_DoAppeals +enum { + APPEALSTATE_START_TURN, + APPEALSTATE_WAIT_LINK, + APPEALSTATE_CHECK_SKIP_TURN, + APPEALSTATE_SLIDE_MON_IN, + APPEALSTATE_WAIT_SLIDE_MON, + APPEALSTATE_PRINT_USED_MOVE_MSG, + APPEALSTATE_WAIT_USED_MOVE_MSG, + APPEALSTATE_MOVE_ANIM, + APPEALSTATE_WAIT_MOVE_ANIM, + APPEALSTATE_MOVE_ANIM_MULTITURN, + APPEALSTATE_SLIDE_MON_OUT, + APPEALSTATE_FREE_MON_SPRITE, + APPEALSTATE_UPDATE_MOVE_USERS_HEARTS, + APPEALSTATE_WAIT_MOVE_USERS_HEARTS, + APPEALSTATE_PRINT_COMBO_MSG, + APPEALSTATE_TRY_UPDATE_HEARTS_FROM_COMBO, + APPEALSTATE_WAIT_HEARTS_FROM_COMBO, + APPEALSTATE_CHECK_REPEATED_MOVE, + APPEALSTATE_WAIT_HEARTS_FROM_REPEAT, + APPEALSTATE_UPDATE_HEARTS_FROM_REPEAT, + APPEALSTATE_START_TURN_END_DELAY, + APPEALSTATE_TURN_END_DELAY, + APPEALSTATE_START_NEXT_TURN, + APPEALSTATE_TRY_PRINT_MOVE_RESULT, + APPEALSTATE_WAIT_MOVE_RESULT_MSG, + APPEALSTATE_UPDATE_OPPONENTS, + APPEALSTATE_UPDATE_OPPONENT, + APPEALSTATE_WAIT_OPPONENT_RESPONSE_MSG, + APPEALSTATE_UPDATE_OPPONENT_HEARTS, + APPEALSTATE_WAIT_OPPONENT_HEARTS, + APPEALSTATE_UPDATE_OPPONENT_STATUS, + APPEALSTATE_PRINT_SKIP_TURN_MSG, + APPEALSTATE_WAIT_SKIP_TURN_MSG, + APPEALSTATE_PRINT_TOO_NERVOUS_MSG, + APPEALSTATE_WAIT_TOO_NERVOUS_MSG, + APPEALSTATE_TRY_JUDGE_STAR, + APPEALSTATE_WAIT_JUDGE_STAR, + APPEALSTATE_UPDATE_MOVE_USERS_STARS, + APPEALSTATE_WAIT_MOVE_USERS_STARS, + APPEALSTATE_UPDATE_OPPONENT_STARS, + APPEALSTATE_WAIT_OPPONENT_STARS, + APPEALSTATE_UPDATE_CROWD, + APPEALSTATE_42, // Unused state + APPEALSTATE_WAIT_EXCITEMENT_HEARTS, + APPEALSTATE_44, // Unused state + APPEALSTATE_WAIT_JUDGE_COMBO, + APPEALSTATE_WAIT_JUDGE_REPEATED_MOVE, + APPEALSTATE_TRY_SHOW_NEXT_TURN_GFX, + APPEALSTATE_CHECK_TURN_ORDER_MOD, + APPEALSTATE_WAIT_JUDGE_TURN_ORDER, + APPEALSTATE_UPDATE_MOVE_USERS_STATUS, + APPEALSTATE_TRY_PRINT_SKIP_NEXT_TURN_MSG, + APPEALSTATE_WAIT_SKIP_NEXT_TURN_MSG, + APPEALSTATE_DO_CROWD_UNEXCITED, + APPEALSTATE_DO_CROWD_EXCITED, + APPEALSTATE_SLIDE_APPLAUSE_OUT, + APPEALSTATE_WAIT_SLIDE_APPLAUSE, + APPEALSTATE_PRINT_CROWD_WATCHES_MSG, + APPEALSTATE_PRINT_MON_MOVE_IGNORED_MSG, + APPEALSTATE_WAIT_MON_MOVE_IGNORED_MSG, +}; + // EWRAM vars. EWRAM_DATA struct ContestPokemon gContestMons[CONTESTANT_COUNT] = {0}; EWRAM_DATA s16 gContestMonRound1Points[CONTESTANT_COUNT] = {0}; // "Round 1" points are based on condition @@ -1023,7 +1087,7 @@ static void InitContestResources(void) eContest = (struct Contest){}; for (i = 0; i < CONTESTANT_COUNT; i++) { - eContest.unused2[i] = 0xFF; + eContest.unk[i] = 0xFF; } for (i = 0; i < CONTESTANT_COUNT; i++) { @@ -1163,7 +1227,7 @@ static void Task_StartContestWaitFade(u8 taskId) } } -// If this is a link contest try to start communication +// If this is a link contest try to start appeals communication // Otherwise skip ahead static void Task_TryStartLinkContest(u8 taskId) { @@ -1634,69 +1698,6 @@ static void Task_WaitHideApplauseMeterForAppealStart(u8 taskId) gTasks[taskId].func = Task_AppealSetup; } -enum { - APPEALSTATE_START_TURN, - APPEALSTATE_1, - APPEALSTATE_2, - APPEALSTATE_SLIDE_MON_IN, - APPEALSTATE_WAIT_SLIDE_MON, - APPEALSTATE_PRINT_USED_MOVE_MSG, - APPEALSTATE_WAIT_USED_MOVE_MSG, - APPEALSTATE_MOVE_ANIM, - APPEALSTATE_WAIT_MOVE_ANIM, - APPEALSTATE_MOVE_ANIM_MULTITURN, - APPEALSTATE_SLIDE_MON_OUT, - APPEALSTATE_FREE_MON_SPRITE, - APPEALSTATE_UPDATE_MOVE_USERS_HEARTS, - APPEALSTATE_WAIT_MOVE_USERS_HEARTS, - APPEALSTATE_PRINT_COMBO_MSG, - APPEALSTATE_TRY_UPDATE_HEARTS_FROM_COMBO, - APPEALSTATE_WAIT_HEARTS_FROM_COMBO, - APPEALSTATE_CHECK_REPEATED_MOVE, - APPEALSTATE_WAIT_HEARTS_FROM_REPEAT, - APPEALSTATE_UPDATE_HEARTS_FROM_REPEAT, - APPEALSTATE_START_TURN_END_DELAY, - APPEALSTATE_TURN_END_DELAY, - APPEALSTATE_START_NEXT_TURN, - APPEALSTATE_TRY_PRINT_MOVE_RESULT, - APPEALSTATE_WAIT_MOVE_RESULT_MSG, - APPEALSTATE_UPDATE_OPPONENTS, - APPEALSTATE_UPDATE_OPPONENT, - APPEALSTATE_WAIT_OPPONENT_RESPONSE_MSG, - APPEALSTATE_UPDATE_OPPONENT_HEARTS, - APPEALSTATE_WAIT_OPPONENT_HEARTS, - APPEALSTATE_UPDATE_OPPONENT_STATUS, - APPEALSTATE_PRINT_SKIP_TURN_MSG, - APPEALSTATE_WAIT_SKIP_TURN_MSG, - APPEALSTATE_PRINT_TOO_NERVOUS_MSG, - APPEALSTATE_WAIT_TOO_NERVOUS_MSG, - APPEALSTATE_TRY_JUDGE_STAR, - APPEALSTATE_WAIT_JUDGE_STAR, - APPEALSTATE_UPDATE_MOVE_USERS_STARS, - APPEALSTATE_WAIT_MOVE_USERS_STARS, - APPEALSTATE_UPDATE_OPPONENT_STARS, - APPEALSTATE_WAIT_OPPONENT_STARS, - APPEALSTATE_UPDATE_CROWD, - APPEALSTATE_42, // Unused state - APPEALSTATE_WAIT_EXCITEMENT_HEARTS, - APPEALSTATE_44, // Unused state - APPEALSTATE_WAIT_JUDGE_COMBO, - APPEALSTATE_WAIT_JUDGE_REPEATED_MOVE, - APPEALSTATE_TRY_SHOW_NEXT_TURN_GFX, - APPEALSTATE_CHECK_TURN_ORDER_MOD, - APPEALSTATE_WAIT_JUDGE_TURN_ORDER, - APPEALSTATE_UPDATE_MOVE_USERS_STATUS, - APPEALSTATE_TRY_PRINT_SKIP_NEXT_TURN_MSG, - APPEALSTATE_WAIT_SKIP_NEXT_TURN_MSG, - APPEALSTATE_DO_CROWD_UNEXCITED, - APPEALSTATE_DO_CROWD_EXCITED, - APPEALSTATE_SLIDE_APPLAUSE_OUT, - APPEALSTATE_WAIT_SLIDE_APPLAUSE, - APPEALSTATE_PRINT_CROWD_WATCHES_MSG, - APPEALSTATE_PRINT_MON_MOVE_IGNORED_MSG, - APPEALSTATE_WAIT_MON_MOVE_IGNORED_MSG, -}; - #define tState data[0] #define tMonSpriteId data[2] #define tCounter data[10] @@ -1746,19 +1747,19 @@ static void Task_DoAppeals(u8 taskId) taskId2 = CreateTask(Task_LinkContest_CommunicateAppealsState, 0); SetTaskFuncWithFollowupFunc(taskId2, Task_LinkContest_CommunicateAppealsState, Task_EndWaitForLink); ContestPrintLinkStandby(); - gTasks[taskId].tState = APPEALSTATE_1; + gTasks[taskId].tState = APPEALSTATE_WAIT_LINK; } else { CalculateAppealMoveImpact(eContest.currentContestant); - gTasks[taskId].tState = APPEALSTATE_2; + gTasks[taskId].tState = APPEALSTATE_CHECK_SKIP_TURN; } return; - case APPEALSTATE_1: + case APPEALSTATE_WAIT_LINK: if (!eContest.waitForLink) - gTasks[taskId].tState = APPEALSTATE_2; + gTasks[taskId].tState = APPEALSTATE_CHECK_SKIP_TURN; return; - case APPEALSTATE_2: + case APPEALSTATE_CHECK_SKIP_TURN: SetContestLiveUpdateFlags(contestant); ContestDebugPrintBitStrings(); if (eContestantStatus[contestant].numTurnsSkipped != 0 @@ -1927,7 +1928,7 @@ static void Task_DoAppeals(u8 taskId) gTasks[taskId].tState = APPEALSTATE_UPDATE_MOVE_USERS_HEARTS; return; case APPEALSTATE_UPDATE_MOVE_USERS_HEARTS: - UpdateAppealHearts(0, eContestantStatus[contestant].appeal2, contestant); + UpdateAppealHearts(0, eContestantStatus[contestant].appeal, contestant); gTasks[taskId].tState = APPEALSTATE_WAIT_MOVE_USERS_HEARTS; return; case APPEALSTATE_WAIT_MOVE_USERS_HEARTS: @@ -2018,7 +2019,7 @@ static void Task_DoAppeals(u8 taskId) case APPEALSTATE_UPDATE_OPPONENT_HEARTS: for (i = 0; gTasks[taskId].data[1] != gContestantTurnOrder[i]; i++) ; - UpdateAppealHearts(eContestantStatus[i].appeal2 + eContestantStatus[i].jam, -eContestantStatus[i].jam, i); + UpdateAppealHearts(eContestantStatus[i].appeal + eContestantStatus[i].jam, -eContestantStatus[i].jam, i); gTasks[taskId].tState = APPEALSTATE_WAIT_OPPONENT_HEARTS; return; case APPEALSTATE_WAIT_OPPONENT_HEARTS: @@ -2139,10 +2140,10 @@ static void Task_DoAppeals(u8 taskId) if (!eContestantStatus[contestant].hasJudgesAttention) { UpdateAppealHearts( - eContestantStatus[contestant].appeal2, + eContestantStatus[contestant].appeal, eContestantStatus[contestant].comboAppealBonus, contestant); - eContestantStatus[contestant].appeal2 += eContestantStatus[contestant].comboAppealBonus; + eContestantStatus[contestant].appeal += eContestantStatus[contestant].comboAppealBonus; } gTasks[taskId].tState = APPEALSTATE_WAIT_HEARTS_FROM_COMBO; } @@ -2178,8 +2179,8 @@ static void Task_DoAppeals(u8 taskId) case APPEALSTATE_UPDATE_HEARTS_FROM_REPEAT: if (!Contest_RunTextPrinters()) { - UpdateAppealHearts(eContestantStatus[contestant].appeal2, -eContestantStatus[contestant].repeatJam, contestant); - eContestantStatus[contestant].appeal2 -= eContestantStatus[contestant].repeatJam; + UpdateAppealHearts(eContestantStatus[contestant].appeal, -eContestantStatus[contestant].repeatJam, contestant); + eContestantStatus[contestant].appeal -= eContestantStatus[contestant].repeatJam; gTasks[taskId].tState = APPEALSTATE_WAIT_HEARTS_FROM_REPEAT; } return; @@ -2301,8 +2302,8 @@ static void Task_DoAppeals(u8 taskId) if (gTasks[taskId].data[11]++ > 29) { gTasks[taskId].data[11] = 0; - UpdateAppealHearts(eContestantStatus[contestant].appeal2, eContestExcitement.excitementAppealBonus, contestant); - eContestantStatus[contestant].appeal2 += eContestExcitement.excitementAppealBonus; + UpdateAppealHearts(eContestantStatus[contestant].appeal, eContestExcitement.excitementAppealBonus, contestant); + eContestantStatus[contestant].appeal += eContestExcitement.excitementAppealBonus; gTasks[taskId].tCounter++; } } @@ -2560,10 +2561,10 @@ static void sub_80DA348(u8 taskId) DmaCopy32Defvars(3, eUnknownHeap1A004.unk18204, gPlttBufferUnfaded, PLTT_BUFFER_SIZE * 2); gTasks[taskId].data[0] = 0; gTasks[taskId].data[1] = 2; - gTasks[taskId].func = sub_80DA38C; + gTasks[taskId].func = Task_WaitPrintRoundResult; } -static void sub_80DA38C(u8 taskId) +static void Task_WaitPrintRoundResult(u8 taskId) { if (++gTasks[taskId].data[0] > 2) { @@ -3416,7 +3417,7 @@ static void RankContestants(void) for (i = 0; i < CONTESTANT_COUNT; i++) { - eContestantStatus[i].pointTotal += eContestantStatus[i].appeal2; + eContestantStatus[i].pointTotal += eContestantStatus[i].appeal; arr[i] = eContestantStatus[i].pointTotal; } @@ -3467,13 +3468,13 @@ static void SetAttentionLevels(void) if (eContestantStatus[i].currMove == MOVE_NONE) attentionLevel = 5; - else if (eContestantStatus[i].appeal2 <= 0) + else if (eContestantStatus[i].appeal <= 0) attentionLevel = 0; - else if (eContestantStatus[i].appeal2 < 30) + else if (eContestantStatus[i].appeal < 30) attentionLevel = 1; - else if (eContestantStatus[i].appeal2 < 60) + else if (eContestantStatus[i].appeal < 60) attentionLevel = 2; - else if (eContestantStatus[i].appeal2 < 80) + else if (eContestantStatus[i].appeal < 80) attentionLevel = 3; else attentionLevel = 4; @@ -3496,8 +3497,8 @@ static void ResetContestantStatuses(void) for (i = 0; i < CONTESTANT_COUNT; i++) { - eContestantStatus[i].appeal2 = 0; - eContestantStatus[i].appeal1 = 0; + eContestantStatus[i].appeal = 0; + eContestantStatus[i].baseAppeal = 0; eContestantStatus[i].jamSafetyCount = 0; if (eContestantStatus[i].numTurnsSkipped > 0) eContestantStatus[i].numTurnsSkipped--; @@ -4278,9 +4279,9 @@ static void ContestDebugDoPrint(void) } for (i = 0; i < CONTESTANT_COUNT; i++) { - value = eContestantStatus[i].appeal2; + value = eContestantStatus[i].appeal; txtPtr = text; - if (eContestantStatus[i].appeal2 < 0) + if (eContestantStatus[i].appeal < 0) { value *= -1; txtPtr = StringCopy(txtPtr, gText_OneDash); @@ -4428,8 +4429,8 @@ static void CalculateAppealMoveImpact(u8 contestant) bool8 canUseTurn; s32 i; - eContestantStatus[contestant].appeal2 = 0; - eContestantStatus[contestant].appeal1 = 0; + eContestantStatus[contestant].appeal = 0; + eContestantStatus[contestant].baseAppeal = 0; if (!ContestantCanUseTurn(contestant)) return; @@ -4446,8 +4447,8 @@ static void CalculateAppealMoveImpact(u8 contestant) { eContestantStatus[contestant].moveRepeatCount = 0; } - eContestantStatus[contestant].appeal1 = gContestEffects[effect].appeal; - eContestantStatus[contestant].appeal2 = eContestantStatus[contestant].appeal1; + eContestantStatus[contestant].baseAppeal = gContestEffects[effect].appeal; + eContestantStatus[contestant].appeal = eContestantStatus[contestant].baseAppeal; eContestAppealResults.jam = gContestEffects[effect].jam; eContestAppealResults.jam2 = eContestAppealResults.jam; @@ -4465,11 +4466,11 @@ static void CalculateAppealMoveImpact(u8 contestant) gContestEffectFuncs[effect](); if (eContestantStatus[contestant].conditionMod == 1) - eContestantStatus[contestant].appeal2 += eContestantStatus[contestant].condition - 10; + eContestantStatus[contestant].appeal += eContestantStatus[contestant].condition - 10; else if (eContestantStatus[contestant].appealTripleCondition) - eContestantStatus[contestant].appeal2 += eContestantStatus[contestant].condition * 3; + eContestantStatus[contestant].appeal += eContestantStatus[contestant].condition * 3; else - eContestantStatus[contestant].appeal2 += eContestantStatus[contestant].condition; + eContestantStatus[contestant].appeal += eContestantStatus[contestant].condition; eContestantStatus[contestant].completedCombo = FALSE; eContestantStatus[contestant].usedComboMove = FALSE; @@ -4482,7 +4483,7 @@ static void CalculateAppealMoveImpact(u8 contestant) eContestantStatus[contestant].completedCombo = completedCombo; eContestantStatus[contestant].usedComboMove = TRUE; eContestantStatus[contestant].hasJudgesAttention = FALSE; - eContestantStatus[contestant].comboAppealBonus = eContestantStatus[contestant].appeal1 * eContestantStatus[contestant].completedCombo; + eContestantStatus[contestant].comboAppealBonus = eContestantStatus[contestant].baseAppeal * eContestantStatus[contestant].completedCombo; eContestantStatus[contestant].unk15_3 = TRUE; } else @@ -4504,8 +4505,8 @@ static void CalculateAppealMoveImpact(u8 contestant) if (eContestantStatus[contestant].nervous) { eContestantStatus[contestant].hasJudgesAttention = FALSE; - eContestantStatus[contestant].appeal2 = 0; - eContestantStatus[contestant].appeal1 = 0; + eContestantStatus[contestant].appeal = 0; + eContestantStatus[contestant].baseAppeal = 0; } eContestExcitement.moveExcitement = Contest_GetMoveExcitement(eContestantStatus[contestant].currMove); if (eContestantStatus[contestant].overrideCategoryExcitementMod) diff --git a/src/contest_effect.c b/src/contest_effect.c index cba9b9745..037da5e11 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -520,7 +520,7 @@ static void ContestEffect_BetterIfFirst(void) if (gContestantTurnOrder[eContestAppealResults.contestant] == 0) { u16 move = eContestantStatus[eContestAppealResults.contestant].currMove; - eContestantStatus[eContestAppealResults.contestant].appeal2 += 2 * gContestEffects[gContestMoves[move].effect].appeal; + eContestantStatus[eContestAppealResults.contestant].appeal += 2 * gContestEffects[gContestMoves[move].effect].appeal; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_HUSTLE_STANDOUT); } } @@ -531,7 +531,7 @@ static void ContestEffect_BetterIfLast(void) if (gContestantTurnOrder[eContestAppealResults.contestant] == 3) { u16 move = eContestantStatus[eContestAppealResults.contestant].currMove; - eContestantStatus[eContestAppealResults.contestant].appeal2 += 2 * gContestEffects[gContestMoves[move].effect].appeal; + eContestantStatus[eContestAppealResults.contestant].appeal += 2 * gContestEffects[gContestMoves[move].effect].appeal; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_WORK_HARD_UNNOTICED); } } @@ -545,7 +545,7 @@ static void ContestEffect_AppealAsGoodAsPrevOnes(void) for (i = 0, appealSum = 0; i < CONTESTANT_COUNT; i++) { if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] > eContestAppealResults.turnOrder[i]) - appealSum += eContestantStatus[i].appeal2; + appealSum += eContestantStatus[i].appeal; } if (appealSum < 0) appealSum = 0; @@ -556,10 +556,10 @@ static void ContestEffect_AppealAsGoodAsPrevOnes(void) } else { - eContestantStatus[eContestAppealResults.contestant].appeal2 += appealSum / 2; + eContestantStatus[eContestAppealResults.contestant].appeal += appealSum / 2; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_WORK_BEFORE); } - eContestantStatus[eContestAppealResults.contestant].appeal2 = RoundTowardsZero(eContestantStatus[eContestAppealResults.contestant].appeal2); + eContestantStatus[eContestAppealResults.contestant].appeal = RoundTowardsZero(eContestantStatus[eContestAppealResults.contestant].appeal); } // Makes the appeal as good as the one before it. @@ -573,7 +573,7 @@ static void ContestEffect_AppealAsGoodAsPrevOne(void) for (i = 0; i < CONTESTANT_COUNT; i++) { if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] - 1 == eContestAppealResults.turnOrder[i]) - appeal = eContestantStatus[i].appeal2; + appeal = eContestantStatus[i].appeal; } } if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] == 0 || appeal <= 0) @@ -582,7 +582,7 @@ static void ContestEffect_AppealAsGoodAsPrevOne(void) } else { - eContestantStatus[eContestAppealResults.contestant].appeal2 += appeal; + eContestantStatus[eContestAppealResults.contestant].appeal += appeal; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_WORK_PRECEDING); } } @@ -592,9 +592,9 @@ static void ContestEffect_BetterWhenLater(void) { u8 whichTurn = eContestAppealResults.turnOrder[eContestAppealResults.contestant]; if (whichTurn == 0) - eContestantStatus[eContestAppealResults.contestant].appeal2 = 10; + eContestantStatus[eContestAppealResults.contestant].appeal = 10; else - eContestantStatus[eContestAppealResults.contestant].appeal2 = 20 * whichTurn; + eContestantStatus[eContestAppealResults.contestant].appeal = 20 * whichTurn; if (whichTurn == 0) SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_NOT_SHOWN_WELL); else if (whichTurn == 1) @@ -633,7 +633,7 @@ static void ContestEffect_QualityDependsOnTiming(void) appeal = 80; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_EXCELLENTLY2); } - eContestantStatus[eContestAppealResults.contestant].appeal2 = appeal; + eContestantStatus[eContestAppealResults.contestant].appeal = appeal; } static void ContestEffect_BetterIfSameType(void) @@ -666,7 +666,7 @@ static void ContestEffect_BetterIfSameType(void) move = eContestantStatus[eContestAppealResults.contestant].currMove; if (gContestMoves[move].contestCategory == gContestMoves[eContestantStatus[j].currMove].contestCategory) { - eContestantStatus[eContestAppealResults.contestant].appeal2 += gContestEffects[gContestMoves[move].effect].appeal * 2; + eContestantStatus[eContestAppealResults.contestant].appeal += gContestEffects[gContestMoves[move].effect].appeal * 2; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_SAME_TYPE_GOOD); } } @@ -684,7 +684,7 @@ static void ContestEffect_BetterIfDiffType(void) if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] - 1 == eContestAppealResults.turnOrder[i] && gContestMoves[move].contestCategory != gContestMoves[eContestantStatus[i].currMove].contestCategory) { - eContestantStatus[eContestAppealResults.contestant].appeal2 += gContestEffects[gContestMoves[move].effect].appeal * 2; + eContestantStatus[eContestAppealResults.contestant].appeal += gContestEffects[gContestMoves[move].effect].appeal * 2; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_DIFF_TYPE_GOOD); break; } @@ -703,14 +703,14 @@ static void ContestEffect_AffectedByPrevAppeal(void) { if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] - 1 == eContestAppealResults.turnOrder[i]) { - if (eContestantStatus[eContestAppealResults.contestant].appeal2 > eContestantStatus[i].appeal2) + if (eContestantStatus[eContestAppealResults.contestant].appeal > eContestantStatus[i].appeal) { - eContestantStatus[eContestAppealResults.contestant].appeal2 *= 2; + eContestantStatus[eContestAppealResults.contestant].appeal *= 2; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_STOOD_OUT_AS_MUCH); } - else if (eContestantStatus[eContestAppealResults.contestant].appeal2 < eContestantStatus[i].appeal2) + else if (eContestantStatus[eContestAppealResults.contestant].appeal < eContestantStatus[i].appeal) { - eContestantStatus[eContestAppealResults.contestant].appeal2 = 0; + eContestantStatus[eContestAppealResults.contestant].appeal = 0; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_NOT_AS_WELL); } } @@ -898,9 +898,9 @@ static void ContestEffect_BadlyStartleMonsWithGoodAppeals(void) { if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] > eContestAppealResults.turnOrder[i]) { - if (eContestantStatus[i].appeal2 > 0) + if (eContestantStatus[i].appeal > 0) { - eContestAppealResults.jam = eContestantStatus[i].appeal2 / 2; + eContestAppealResults.jam = eContestantStatus[i].appeal / 2; eContestAppealResults.jam = RoundUp(eContestAppealResults.jam); } else @@ -946,7 +946,7 @@ static void ContestEffect_BetterWhenAudienceExcited(void) appeal = 60; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_EXCELLENTLY2); } - eContestantStatus[eContestAppealResults.contestant].appeal2 = appeal; + eContestantStatus[eContestAppealResults.contestant].appeal = appeal; } // Temporarily stops the crowd from growing excited. @@ -1054,7 +1054,7 @@ static bool8 WasAtLeastOneOpponentJammed(void) static void JamContestant(u8 i, u8 jam) { - eContestantStatus[i].appeal2 -= jam; + eContestantStatus[i].appeal -= jam; eContestantStatus[i].jam += jam; } diff --git a/src/data/contest_opponents.h b/src/data/contest_opponents.h index e77223d95..53868fc84 100644 --- a/src/data/contest_opponents.h +++ b/src/data/contest_opponents.h @@ -183,7 +183,7 @@ const struct ContestPokemon gContestOpponents[] = .nickname = _("POOCHY"), .trainerName = _("JIMMY"), .trainerGfxId = OBJ_EVENT_GFX_BOY_1, - .aiChecks = CONTEST_AI_ALL | CONTEST_AI_DUMMIES_1 | CONTEST_AI_DUMMY_20 | CONTEST_AI_DUMMY_21, + .aiChecks = 0xC000FFF, .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, @@ -211,7 +211,7 @@ const struct ContestPokemon gContestOpponents[] = .nickname = _("MUSILLE"), .trainerName = _("EDITH"), .trainerGfxId = OBJ_EVENT_GFX_GIRL_1, - .aiChecks = CONTEST_AI_ALL | CONTEST_AI_DUMMIES_1 | CONTEST_AI_DUMMY_19 | CONTEST_AI_DUMMY_25, + .aiChecks = 0x82000FFF, .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, @@ -239,7 +239,7 @@ const struct ContestPokemon gContestOpponents[] = .nickname = _("DUSTER"), .trainerName = _("EVAN"), .trainerGfxId = OBJ_EVENT_GFX_LITTLE_BOY, - .aiChecks = CONTEST_AI_ALL | CONTEST_AI_DUMMIES_1 | CONTEST_AI_DUMMY_18 | CONTEST_AI_DUMMY_23, + .aiChecks = 0x21000FFF, .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, @@ -603,7 +603,7 @@ const struct ContestPokemon gContestOpponents[] = .nickname = _("BULBY"), .trainerName = _("AGATHA"), .trainerGfxId = OBJ_EVENT_GFX_WOMAN_2, - .aiChecks = CONTEST_AI_ALL | CONTEST_AI_DUMMY_1 | CONTEST_AI_DUMMY_2 | CONTEST_AI_DUMMY_3 | CONTEST_AI_DUMMY_4 | CONTEST_AI_DUMMY_5 | CONTEST_AI_DUMMY_20 | CONTEST_AI_DUMMY_21, + .aiChecks = 0xC000FFF, .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, @@ -631,7 +631,7 @@ const struct ContestPokemon gContestOpponents[] = .nickname = _("FUTTERBE"), .trainerName = _("BEAU"), .trainerGfxId = OBJ_EVENT_GFX_HEX_MANIAC, - .aiChecks = CONTEST_AI_ALL | CONTEST_AI_DUMMIES_1 | CONTEST_AI_DUMMY_19 | CONTEST_AI_DUMMY_25, + .aiChecks = 0x82000FFF, .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, @@ -659,7 +659,7 @@ const struct ContestPokemon gContestOpponents[] = .nickname = _("PIDEOT"), .trainerName = _("KAY"), .trainerGfxId = OBJ_EVENT_GFX_WOMAN_5, - .aiChecks = CONTEST_AI_ALL | CONTEST_AI_DUMMIES_1 | CONTEST_AI_DUMMY_18 | CONTEST_AI_DUMMY_23, + .aiChecks = 0x21000FFF, .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, @@ -883,7 +883,7 @@ const struct ContestPokemon gContestOpponents[] = .nickname = _("DUODO"), .trainerName = _("BOBBY"), .trainerGfxId = OBJ_EVENT_GFX_RUNNING_TRIATHLETE_M, - .aiChecks = CONTEST_AI_ALL | CONTEST_AI_DUMMIES_1 | CONTEST_AI_DUMMY_19 | CONTEST_AI_DUMMY_25, + .aiChecks = 0x82000FFF, .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, @@ -1275,7 +1275,7 @@ const struct ContestPokemon gContestOpponents[] = .nickname = _("BROWLO"), .trainerName = _("LUKE"), .trainerGfxId = OBJ_EVENT_GFX_FAT_MAN, - .aiChecks = CONTEST_AI_ALL | CONTEST_AI_DUMMY_1 | CONTEST_AI_DUMMY_2 | CONTEST_AI_DUMMY_3 | CONTEST_AI_DUMMY_4 | CONTEST_AI_DUMMY_5 | CONTEST_AI_DUMMY_20 | CONTEST_AI_DUMMY_21, + .aiChecks = 0xC000FFF, .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, @@ -1303,7 +1303,7 @@ const struct ContestPokemon gContestOpponents[] = .nickname = _("FETCHIN"), .trainerName = _("RAUL"), .trainerGfxId = OBJ_EVENT_GFX_MAN_5, - .aiChecks = CONTEST_AI_ALL | CONTEST_AI_DUMMIES_1 | CONTEST_AI_DUMMY_19 | CONTEST_AI_DUMMY_25, + .aiChecks = 0x82000FFF, .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, @@ -1331,7 +1331,7 @@ const struct ContestPokemon gContestOpponents[] = .nickname = _("SEELEY"), .trainerName = _("JADA"), .trainerGfxId = OBJ_EVENT_GFX_WOMAN_2, - .aiChecks = CONTEST_AI_ALL | CONTEST_AI_DUMMIES_1 | CONTEST_AI_DUMMY_18 | CONTEST_AI_DUMMY_23, + .aiChecks = 0x21000FFF, .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, @@ -1555,7 +1555,7 @@ const struct ContestPokemon gContestOpponents[] = .nickname = _("SHIFTY"), .trainerName = _("CLAUDIA"), .trainerGfxId = OBJ_EVENT_GFX_GIRL_1, - .aiChecks = CONTEST_AI_ALL | CONTEST_AI_DUMMIES_1 | CONTEST_AI_DUMMY_19 | CONTEST_AI_DUMMY_25, + .aiChecks = 0x82000FFF, .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, @@ -1947,7 +1947,7 @@ const struct ContestPokemon gContestOpponents[] = .nickname = _("EGGSOR"), .trainerName = _("GRACIE"), .trainerGfxId = OBJ_EVENT_GFX_PICNICKER, - .aiChecks = CONTEST_AI_ALL | CONTEST_AI_DUMMY_1 | CONTEST_AI_DUMMY_2 | CONTEST_AI_DUMMY_3 | CONTEST_AI_DUMMY_4 | CONTEST_AI_DUMMY_5 | CONTEST_AI_DUMMY_20 | CONTEST_AI_DUMMY_21, + .aiChecks = 0xC000FFF, .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, @@ -1975,7 +1975,7 @@ const struct ContestPokemon gContestOpponents[] = .nickname = _("CUBIN"), .trainerName = _("COLTIN"), .trainerGfxId = OBJ_EVENT_GFX_MAN_4, - .aiChecks = CONTEST_AI_ALL | CONTEST_AI_DUMMIES_1 | CONTEST_AI_DUMMY_19 | CONTEST_AI_DUMMY_25, + .aiChecks = 0x82000FFF, .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, @@ -2003,7 +2003,7 @@ const struct ContestPokemon gContestOpponents[] = .nickname = _("HITMON"), .trainerName = _("ELLIE"), .trainerGfxId = OBJ_EVENT_GFX_EXPERT_F, - .aiChecks = CONTEST_AI_ALL | CONTEST_AI_DUMMIES_1 | CONTEST_AI_DUMMY_18 | CONTEST_AI_DUMMY_23, + .aiChecks = 0x21000FFF, .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, @@ -2227,7 +2227,7 @@ const struct ContestPokemon gContestOpponents[] = .nickname = _("LOUDERD"), .trainerName = _("RALPH"), .trainerGfxId = OBJ_EVENT_GFX_EXPERT_M, - .aiChecks = CONTEST_AI_ALL | CONTEST_AI_DUMMIES_1 | CONTEST_AI_DUMMY_19 | CONTEST_AI_DUMMY_25, + .aiChecks = 0x82000FFF, .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, @@ -2619,7 +2619,7 @@ const struct ContestPokemon gContestOpponents[] = .nickname = _("GAREN"), .trainerName = _("CAMILE"), .trainerGfxId = OBJ_EVENT_GFX_HEX_MANIAC, - .aiChecks = CONTEST_AI_ALL | CONTEST_AI_DUMMY_1 | CONTEST_AI_DUMMY_2 | CONTEST_AI_DUMMY_3 | CONTEST_AI_DUMMY_4 | CONTEST_AI_DUMMY_5 | CONTEST_AI_DUMMY_20 | CONTEST_AI_DUMMY_21, + .aiChecks = 0xC000FFF, .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, @@ -2647,7 +2647,7 @@ const struct ContestPokemon gContestOpponents[] = .nickname = _("GONPOR"), .trainerName = _("MARTIN"), .trainerGfxId = OBJ_EVENT_GFX_SCIENTIST_1, - .aiChecks = CONTEST_AI_ALL | CONTEST_AI_DUMMIES_1 | CONTEST_AI_DUMMY_19 | CONTEST_AI_DUMMY_25, + .aiChecks = 0x82000FFF, .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, @@ -2675,7 +2675,7 @@ const struct ContestPokemon gContestOpponents[] = .nickname = _("DRITE"), .trainerName = _("SERGIO"), .trainerGfxId = OBJ_EVENT_GFX_BOY_1, - .aiChecks = CONTEST_AI_ALL | CONTEST_AI_DUMMIES_1 | CONTEST_AI_DUMMY_18 | CONTEST_AI_DUMMY_23, + .aiChecks = 0x21000FFF, .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE,