Document misc contest

This commit is contained in:
GriffinR 2020-08-15 14:33:08 -04:00
parent c42c1ab8c1
commit 9f4525666d
6 changed files with 393 additions and 389 deletions

View File

@ -9,9 +9,9 @@ enum
CONTEST_DEBUG_MODE_OFF,
// Prints the totalPoints value for each contestant.
CONTEST_DEBUG_MODE_PRINT_POINT_TOTAL,
// Prints the ContestResourcesField1C::unk_C value as a bitstring for each contestant.
// Prints the ContestTV::unk_C value as a bitstring for each contestant.
CONTEST_DEBUG_MODE_PRINT_UNK_C,
// Prints the ContestResourcesField1C::unk_D value as a bitstring for each contestant.
// Prints the ContestTV::unk_D value as a bitstring for each contestant.
CONTEST_DEBUG_MODE_PRINT_UNK_D
};
@ -90,29 +90,29 @@ enum {
struct ContestPokemon
{
/*0x00*/ u16 species;
/*0x02*/ u8 nickname[POKEMON_NAME_LENGTH + 1];
/*0x0D*/ u8 trainerName[PLAYER_NAME_LENGTH + 1];
/*0x15*/ u8 trainerGfxId;
/*0x18*/ u32 aiChecks;
/*0x1C*/ u8 whichRank:2; // 0x1 0x2
u8 aiPool_Cool:1; // 0x4
u8 aiPool_Beauty:1; // 0x8
u8 aiPool_Cute:1; // 0x10
u8 aiPool_Smart:1; // 0x20
u8 aiPool_Tough:1; // 0x40
/*0x1E*/ u16 moves[MAX_MON_MOVES]; // moves
/*0x26*/ u8 cool; // cool
/*0x27*/ u8 beauty; // beauty
/*0x28*/ u8 cute; // cute
/*0x29*/ u8 smart; // smart
/*0x2A*/ u8 tough; // tough
/*0x2B*/ u8 sheen; // sheen
u16 species;
u8 nickname[POKEMON_NAME_LENGTH + 1];
u8 trainerName[PLAYER_NAME_LENGTH + 1];
u8 trainerGfxId;
u32 aiChecks;
u8 whichRank:2;
u8 aiPool_Cool:1;
u8 aiPool_Beauty:1;
u8 aiPool_Cute:1;
u8 aiPool_Smart:1;
u8 aiPool_Tough:1;
u16 moves[MAX_MON_MOVES];
u8 cool;
u8 beauty;
u8 cute;
u8 smart;
u8 tough;
u8 sheen;
u8 highestRank;
bool8 gameCleared;
/*0x2C*/ u8 unk2C[10];
/*0x38*/ u32 personality; // personality
/*0x3C*/ u32 otId; // otId
u8 unk2C[10];
u32 personality;
u32 otId;
};
struct Shared1A004
@ -210,14 +210,14 @@ struct ContestantStatus
bool8 judgesAttentionWasRemoved:1;
bool8 usedComboMove:1;
bool8 completedCombo;
u8 unk17;
u8 comboAppealBonus;
u8 unk18;
u8 nextTurnOrder; // turn position
u8 attentionLevel; // How much the Pokemon "stood out"
u8 contestantAnimTarget;
};
struct UnknownContestStruct7
struct ContestAppealMoveResults
{
u8 turnOrder[CONTESTANT_COUNT];
s16 jam;
@ -244,15 +244,15 @@ struct ContestAIInfo
/*0x41*/ u8 contestantId;
};
struct UnknownContestStruct5
struct ContestExcitement
{
s8 moveExcitement;
u8 excitementFrozen:1;
u8 excitementFreezer:3;
s8 unk2;
u8 frozen:1;
u8 freezer:3;
s8 excitementAppealBonus;
};
struct UnknownContestStruct4
struct ContestGraphicsState
{
u8 sliderHeartSpriteId;
u8 nextTurnSpriteId;
@ -269,7 +269,7 @@ struct ContestFinalStandings
s32 contestant;
};
struct ContestResourcesField1C
struct ContestTV
{
u16 unk0[5];
s16 unkA;
@ -279,22 +279,22 @@ struct ContestResourcesField1C
u8 unkE_2:1;
};
struct ContestResourcesField20
struct ContestUnused
{
u8 filler_00[0x0C];
u8 filler[12];
};
struct ContestResources
{
struct Contest *contest;
struct ContestantStatus *status;
struct UnknownContestStruct7 *field_8;
struct ContestAppealMoveResults *appealResults;
struct ContestAIInfo *aiData;
struct UnknownContestStruct5 *field_10;
struct UnknownContestStruct4 *field_14;
struct ContestExcitement *excitement;
struct ContestGraphicsState *gfxState;
struct ContestMoveAnimData *moveAnim;
struct ContestResourcesField1C * field_1c;
struct ContestResourcesField20 * field_20;
struct ContestTV *tv;
struct ContestUnused * unused;
u8 * contestBgTilemaps[CONTESTANT_COUNT];
void * boxBlinkTiles1;
void * boxBlinkTiles2;
@ -303,10 +303,10 @@ struct ContestResources
#define eContest (*gContestResources->contest)
#define eContestantStatus (gContestResources->status)
#define eContestResources8 (*gContestResources->field_8)
#define eContestAppealResults (*gContestResources->appealResults)
#define eContestAI (*gContestResources->aiData)
#define eContestResources10 (*gContestResources->field_10)
#define eContestResources14 (*gContestResources->field_14)
#define eContestExcitement (*gContestResources->excitement)
#define eContestGfxState (gContestResources->gfxState)
#define eUnzippedContestAudience_Gfx (gHeap + 0x18000)
#define eContestAudienceFrame2_Gfx (gHeap + 0x19000)
#define eContestDebugMode (gHeap[0x1a000])

View File

@ -1,7 +1,7 @@
#ifndef GUARD_CONTEST_LINK_H
#define GUARD_CONTEST_LINK_H
void sub_80FCC88(u8);
void Task_LinkContest_CommunicateAppealsState(u8);
void Task_LinkContest_CommunicateFinalStandings(u8);
void Task_LinkContest_Init(u8);
void Task_LinkContest_CommunicateMonsRS(u8);

View File

@ -1027,10 +1027,10 @@ static void InitContestResources(void)
eContestantStatus[i].effectStringId = CONTEST_STRING_NONE;
eContestantStatus[i].effectStringId2 = CONTEST_STRING_NONE;
}
eContestResources8 = (struct UnknownContestStruct7){};
eContestAppealResults = (struct ContestAppealMoveResults){};
eContestAI = (struct ContestAIInfo){};
*gContestResources->field_10 = (struct UnknownContestStruct5){};
memset(gContestResources->field_14, 0, CONTESTANT_COUNT * sizeof(struct UnknownContestStruct4));
*gContestResources->excitement = (struct ContestExcitement){};
memset(eContestGfxState, 0, CONTESTANT_COUNT * sizeof(struct ContestGraphicsState));
if (!(gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK))
SortContestants(FALSE);
@ -1043,7 +1043,7 @@ static void InitContestResources(void)
// Calling this here while all the nextTurnOrder values are 0xFF will actually
// just reverse the turn order.
ApplyNextTurnOrder();
memset(gContestResources->field_1c, 0, sizeof(*gContestResources->field_1c) * CONTESTANT_COUNT);
memset(gContestResources->tv, 0, sizeof(*gContestResources->tv) * CONTESTANT_COUNT);
}
static void AllocContestResources(void)
@ -1051,13 +1051,13 @@ static void AllocContestResources(void)
gContestResources = AllocZeroed(sizeof(struct ContestResources));
gContestResources->contest = AllocZeroed(sizeof(struct Contest));
gContestResources->status = AllocZeroed(sizeof(struct ContestantStatus) * CONTESTANT_COUNT);
gContestResources->field_8 = AllocZeroed(sizeof(struct UnknownContestStruct7));
gContestResources->appealResults = AllocZeroed(sizeof(struct ContestAppealMoveResults));
gContestResources->aiData = AllocZeroed(sizeof(struct ContestAIInfo));
gContestResources->field_10 = AllocZeroed(sizeof(struct UnknownContestStruct5) * CONTESTANT_COUNT);
gContestResources->field_14 = AllocZeroed(sizeof(struct UnknownContestStruct4) * CONTESTANT_COUNT);
gContestResources->excitement = AllocZeroed(sizeof(struct ContestExcitement) * CONTESTANT_COUNT);
gContestResources->gfxState = AllocZeroed(sizeof(struct ContestGraphicsState) * CONTESTANT_COUNT);
gContestResources->moveAnim = AllocZeroed(sizeof(struct ContestMoveAnimData));
gContestResources->field_1c = AllocZeroed(sizeof(struct ContestResourcesField1C) * CONTESTANT_COUNT);
gContestResources->field_20 = AllocZeroed(sizeof(struct ContestResourcesField20));
gContestResources->tv = AllocZeroed(sizeof(struct ContestTV) * CONTESTANT_COUNT);
gContestResources->unused = AllocZeroed(sizeof(struct ContestUnused));
gContestResources->contestBgTilemaps[0] = AllocZeroed(0x1000);
gContestResources->contestBgTilemaps[1] = AllocZeroed(0x1000);
gContestResources->contestBgTilemaps[2] = AllocZeroed(0x1000);
@ -1073,13 +1073,13 @@ static void FreeContestResources(void)
{
FREE_AND_SET_NULL(gContestResources->contest);
FREE_AND_SET_NULL(gContestResources->status);
FREE_AND_SET_NULL(gContestResources->field_8);
FREE_AND_SET_NULL(gContestResources->appealResults);
FREE_AND_SET_NULL(gContestResources->aiData);
FREE_AND_SET_NULL(gContestResources->field_10);
FREE_AND_SET_NULL(gContestResources->field_14);
FREE_AND_SET_NULL(gContestResources->excitement);
FREE_AND_SET_NULL(gContestResources->gfxState);
FREE_AND_SET_NULL(gContestResources->moveAnim);
FREE_AND_SET_NULL(gContestResources->field_1c);
FREE_AND_SET_NULL(gContestResources->field_20);
FREE_AND_SET_NULL(gContestResources->tv);
FREE_AND_SET_NULL(gContestResources->unused);
FREE_AND_SET_NULL(gContestResources->contestBgTilemaps[0]);
FREE_AND_SET_NULL(gContestResources->contestBgTilemaps[1]);
FREE_AND_SET_NULL(gContestResources->contestBgTilemaps[2]);
@ -1724,7 +1724,7 @@ static void Task_DoAppeals(u8 taskId)
{
case APPEALSTATE_START_TURN:
ContestDebugDoPrint();
for (i = 0; eContest.turnNumber != gContestResources->field_8->turnOrder[i]; i++)
for (i = 0; eContest.turnNumber != eContestAppealResults.turnOrder[i]; i++)
;
eContest.currentContestant = i;
contestant = eContest.currentContestant;
@ -1735,8 +1735,8 @@ static void Task_DoAppeals(u8 taskId)
eContest.waitForLink = TRUE;
if (IsPlayerLinkLeader())
CalculateAppealMoveImpact(eContest.currentContestant);
taskId2 = CreateTask(sub_80FCC88, 0);
SetTaskFuncWithFollowupFunc(taskId2, sub_80FCC88, Task_EndWaitForLink);
taskId2 = CreateTask(Task_LinkContest_CommunicateAppealsState, 0);
SetTaskFuncWithFollowupFunc(taskId2, Task_LinkContest_CommunicateAppealsState, Task_EndWaitForLink);
ContestPrintLinkStandby();
gTasks[taskId].tState = APPEALSTATE_1;
}
@ -1787,7 +1787,7 @@ static void Task_DoAppeals(u8 taskId)
if (gSprites[spriteId].callback == SpriteCallbackDummy)
{
// Once mon has slid in, also wait for box to finish blinking
if (!gContestResources->field_14[contestant].boxBlinking)
if (!eContestGfxState[contestant].boxBlinking)
gTasks[taskId].tState = APPEALSTATE_PRINT_USED_MOVE_MSG;
}
return;
@ -1923,7 +1923,7 @@ static void Task_DoAppeals(u8 taskId)
gTasks[taskId].tState = APPEALSTATE_WAIT_MOVE_USERS_HEARTS;
return;
case APPEALSTATE_WAIT_MOVE_USERS_HEARTS:
if (!gContestResources->field_14[eContest.currentContestant].updatingAppealHearts)
if (!eContestGfxState[eContest.currentContestant].updatingAppealHearts)
gTasks[taskId].tState = APPEALSTATE_TRY_JUDGE_STAR;
return;
case APPEALSTATE_TRY_JUDGE_STAR:
@ -2016,7 +2016,7 @@ static void Task_DoAppeals(u8 taskId)
case APPEALSTATE_WAIT_OPPONENT_HEARTS:
for (i = 0; gTasks[taskId].data[1] != gContestantTurnOrder[i]; i++)
;
if (!gContestResources->field_14[i].updatingAppealHearts)
if (!eContestGfxState[i].updatingAppealHearts)
gTasks[taskId].tState = APPEALSTATE_UPDATE_OPPONENT_STARS;
return;
case APPEALSTATE_UPDATE_OPPONENT_STARS:
@ -2132,16 +2132,16 @@ static void Task_DoAppeals(u8 taskId)
{
UpdateAppealHearts(
eContestantStatus[contestant].appeal2,
eContestantStatus[contestant].unk17,
eContestantStatus[contestant].comboAppealBonus,
contestant);
eContestantStatus[contestant].appeal2 += eContestantStatus[contestant].unk17;
eContestantStatus[contestant].appeal2 += eContestantStatus[contestant].comboAppealBonus;
}
gTasks[taskId].tState = APPEALSTATE_WAIT_HEARTS_FROM_COMBO;
}
}
return;
case APPEALSTATE_WAIT_HEARTS_FROM_COMBO:
if (!gContestResources->field_14[contestant].updatingAppealHearts)
if (!eContestGfxState[contestant].updatingAppealHearts)
{
gTasks[taskId].tCounter = 0;
gTasks[taskId].tState = APPEALSTATE_CHECK_REPEATED_MOVE;
@ -2177,7 +2177,7 @@ static void Task_DoAppeals(u8 taskId)
return;
case APPEALSTATE_WAIT_HEARTS_FROM_REPEAT:
ContestDebugDoPrint();
if (!gContestResources->field_14[contestant].updatingAppealHearts)
if (!eContestGfxState[contestant].updatingAppealHearts)
{
gTasks[taskId].tCounter = 0;
ContestClearGeneralTextWindow();
@ -2185,13 +2185,13 @@ static void Task_DoAppeals(u8 taskId)
}
return;
case APPEALSTATE_UPDATE_CROWD:
if (gContestResources->field_10->excitementFrozen && contestant != gContestResources->field_10->excitementFreezer)
if (eContestExcitement.frozen && contestant != eContestExcitement.freezer)
{
gTasks[taskId].tState = APPEALSTATE_PRINT_CROWD_WATCHES_MSG;
}
else
{
r3 = gContestResources->field_10->moveExcitement; // Can't get this to use local variable. Should be "moveExcitement"
r3 = eContestExcitement.moveExcitement; // Can't get this to use local variable. Should be "moveExcitement"
if (eContestantStatus[contestant].overrideCategoryExcitementMod)
{
r3 = 1;
@ -2293,14 +2293,14 @@ static void Task_DoAppeals(u8 taskId)
if (gTasks[taskId].data[11]++ > 29)
{
gTasks[taskId].data[11] = 0;
UpdateAppealHearts(eContestantStatus[contestant].appeal2, gContestResources->field_10->unk2, contestant);
eContestantStatus[contestant].appeal2 += gContestResources->field_10->unk2;
UpdateAppealHearts(eContestantStatus[contestant].appeal2, eContestExcitement.excitementAppealBonus, contestant);
eContestantStatus[contestant].appeal2 += eContestExcitement.excitementAppealBonus;
gTasks[taskId].tCounter++;
}
}
break;
case 3:
if (!gContestResources->field_14[contestant].updatingAppealHearts)
if (!eContestGfxState[contestant].updatingAppealHearts)
{
if (!eContest.animatingAudience)
{
@ -2320,7 +2320,7 @@ static void Task_DoAppeals(u8 taskId)
}
return;
case APPEALSTATE_WAIT_EXCITEMENT_HEARTS:
if (!gContestResources->field_14[contestant].updatingAppealHearts)
if (!eContestGfxState[contestant].updatingAppealHearts)
{
ContestClearGeneralTextWindow();
gTasks[taskId].tState = APPEALSTATE_SLIDE_APPLAUSE_OUT;
@ -2328,7 +2328,7 @@ static void Task_DoAppeals(u8 taskId)
return;
case APPEALSTATE_PRINT_CROWD_WATCHES_MSG:
ContestClearGeneralTextWindow();
StringCopy(gStringVar3, gContestMons[gContestResources->field_10->excitementFreezer].nickname);
StringCopy(gStringVar3, gContestMons[eContestExcitement.freezer].nickname);
StringCopy(gStringVar1, gContestMons[contestant].nickname);
StringCopy(gStringVar2, gMoveNames[eContestantStatus[contestant].currMove]);
StringExpandPlaceholders(gStringVar4, gText_CrowdContinuesToWatchMon);
@ -2479,8 +2479,8 @@ static void Task_FinishRoundOfAppeals(u8 taskId)
RankContestants();
SetAttentionLevels();
}
taskId2 = CreateTask(sub_80FCC88, 0);
SetTaskFuncWithFollowupFunc(taskId2, sub_80FCC88, Task_EndWaitForLink);
taskId2 = CreateTask(Task_LinkContest_CommunicateAppealsState, 0);
SetTaskFuncWithFollowupFunc(taskId2, Task_LinkContest_CommunicateAppealsState, Task_EndWaitForLink);
ContestPrintLinkStandby();
gTasks[taskId].data[0] = 1;
}
@ -3526,7 +3526,7 @@ static void ResetContestantStatuses(void)
eContest.excitementHistory[eContest.appealNumber][i] = Contest_GetMoveExcitement(eContestantStatus[i].currMove);
eContestantStatus[i].currMove = MOVE_NONE;
}
eContestResources10.excitementFrozen = 0;
eContestExcitement.frozen = FALSE;
}
bool8 Contest_IsMonsTurnDisabled(u8 contestant)
@ -3702,16 +3702,16 @@ static s8 GetNumHeartsFromAppealPoints(s16 appeal)
#define tContestant data[3]
#define tDelayTimer data[10]
static u8 UpdateAppealHearts(s16 startAppeal, s16 endAppeal, u8 contestant)
static u8 UpdateAppealHearts(s16 startAppeal, s16 appealDelta, u8 contestant)
{
u8 taskId;
s8 startHearts;
s8 heartsDelta;
gContestResources->field_14[contestant].updatingAppealHearts = TRUE;
eContestGfxState[contestant].updatingAppealHearts = TRUE;
taskId = CreateTask(Task_UpdateAppealHearts, 20);
startHearts = GetNumHeartsFromAppealPoints(startAppeal);
heartsDelta = GetNumHeartsFromAppealPoints(startAppeal + endAppeal) - startHearts;
heartsDelta = GetNumHeartsFromAppealPoints(startAppeal + appealDelta) - startHearts;
GetAppealHeartTileOffset(contestant); // unused return value
gTasks[taskId].tNumHearts = abs(startHearts);
gTasks[taskId].tHeartsDelta = heartsDelta;
@ -3741,7 +3741,7 @@ static void Task_UpdateAppealHearts(u8 taskId)
{
// No more hearts to add/remove, end
DestroyTask(taskId);
gContestResources->field_14[contestant].updatingAppealHearts = FALSE;
eContestGfxState[contestant].updatingAppealHearts = FALSE;
return;
}
else if (startHearts == 0)
@ -3834,7 +3834,7 @@ static void CreateSliderHeartSprites(void)
{
u8 y = sSliderHeartYPositions[gContestantTurnOrder[i]];
gContestResources->field_14[i].sliderHeartSpriteId = CreateSprite(&sSpriteTemplate_SliderHeart, 180, y, 1);
eContestGfxState[i].sliderHeartSpriteId = CreateSprite(&sSpriteTemplate_SliderHeart, 180, y, 1);
}
}
@ -3847,8 +3847,8 @@ static void UpdateHeartSlider(u8 contestant)
u8 spriteId;
s16 slideTarget;
gContestResources->field_14[contestant].sliderUpdating = TRUE;
spriteId = gContestResources->field_14[contestant].sliderHeartSpriteId;
eContestGfxState[contestant].sliderUpdating = TRUE;
spriteId = eContestGfxState[contestant].sliderHeartSpriteId;
slideTarget = eContestantStatus[contestant].pointTotal / 10 * 2;
if (slideTarget > 56)
slideTarget = 56;
@ -3878,7 +3878,7 @@ static bool8 SlidersDoneUpdating(void)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
if (gContestResources->field_14[i].sliderUpdating)
if (eContestGfxState[i].sliderUpdating)
break;
}
if (i == CONTESTANT_COUNT)
@ -3891,7 +3891,7 @@ static void SpriteCB_UpdateHeartSlider(struct Sprite *sprite)
{
if (sprite->pos2.x == sprite->sTargetX)
{
gContestResources->field_14[sprite->sContestant].sliderUpdating = FALSE;
eContestGfxState[sprite->sContestant].sliderUpdating = FALSE;
sprite->callback = SpriteCallbackDummy;
}
else
@ -3910,7 +3910,7 @@ static void UpdateSliderHeartSpriteYPositions(void)
s32 i;
for (i = 0; i < CONTESTANT_COUNT; i++)
gSprites[gContestResources->field_14[i].sliderHeartSpriteId].pos1.y = sSliderHeartYPositions[gContestantTurnOrder[i]];
gSprites[eContestGfxState[i].sliderHeartSpriteId].pos1.y = sSliderHeartYPositions[gContestantTurnOrder[i]];
}
// Used to hide (or subsequently reshow) the bottom two slider hearts that get hidden by text windows by moving them offscreen
@ -3924,9 +3924,9 @@ static void SetBottomSliderHeartsInvisibility(bool8 invisible)
if (gContestantTurnOrder[i] > 1)
{
if (!invisible)
gSprites[gContestResources->field_14[i].sliderHeartSpriteId].pos1.x = 180;
gSprites[eContestGfxState[i].sliderHeartSpriteId].pos1.x = 180;
else
gSprites[gContestResources->field_14[i].sliderHeartSpriteId].pos1.x = 256;
gSprites[eContestGfxState[i].sliderHeartSpriteId].pos1.x = 256;
}
}
}
@ -3939,12 +3939,12 @@ static void CreateNextTurnSprites(void)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
LoadCompressedSpriteSheet(&sSpriteSheet_NextTurn[i]);
gContestResources->field_14[i].nextTurnSpriteId = CreateSprite(&sSpriteTemplates_NextTurn[i],
eContestGfxState[i].nextTurnSpriteId = CreateSprite(&sSpriteTemplates_NextTurn[i],
204,
sNextTurnSpriteYPositions[gContestantTurnOrder[i]],
0);
SetSubspriteTables(&gSprites[gContestResources->field_14[i].nextTurnSpriteId], sSubspriteTable_NextTurn);
gSprites[gContestResources->field_14[i].nextTurnSpriteId].invisible = TRUE;
SetSubspriteTables(&gSprites[eContestGfxState[i].nextTurnSpriteId], sSubspriteTable_NextTurn);
gSprites[eContestGfxState[i].nextTurnSpriteId].invisible = TRUE;
}
}
@ -4174,7 +4174,7 @@ static void BlinkContestantBox(u8 spriteId, bool8 b)
u8 spriteId2;
SetBlendForContestantBoxBlink();
gContestResources->field_14[gSprites[spriteId].data[1]].boxBlinking = TRUE;
eContestGfxState[gSprites[spriteId].data[1]].boxBlinking = TRUE;
spriteId2 = gSprites[spriteId].data[0];
StartSpriteAffineAnim(&gSprites[spriteId], 1);
StartSpriteAffineAnim(&gSprites[spriteId2], 1);
@ -4203,7 +4203,7 @@ static void SpriteCB_BlinkContestantBox(struct Sprite *sprite)
static void SpriteCB_EndBlinkContestantBox(struct Sprite *sprite)
{
gContestResources->field_14[sprite->data[1]].boxBlinking = FALSE;
eContestGfxState[sprite->data[1]].boxBlinking = FALSE;
DestroyContestantBoxBlinkSprites(sprite->data[0]);
ResetBlendForContestantBoxBlink();
}
@ -4435,14 +4435,14 @@ static void CalculateAppealMoveImpact(u8 contestant)
}
eContestantStatus[contestant].appeal1 = gContestEffects[effect].appeal;
eContestantStatus[contestant].appeal2 = eContestantStatus[contestant].appeal1;
eContestResources8.jam = gContestEffects[effect].jam;
eContestResources8.jam2 = eContestResources8.jam;
eContestAppealResults.jam = gContestEffects[effect].jam;
eContestAppealResults.jam2 = eContestAppealResults.jam;
eContestResources8.contestant = contestant;
eContestAppealResults.contestant = contestant;
for (i = 0; i < CONTESTANT_COUNT; i++)
{
eContestantStatus[i].jam = 0;
eContestResources8.unnervedPokes[i] = 0;
eContestAppealResults.unnervedPokes[i] = 0;
}
if (eContestantStatus[contestant].hasJudgesAttention
@ -4469,7 +4469,7 @@ static void CalculateAppealMoveImpact(u8 contestant)
eContestantStatus[contestant].completedCombo = completedCombo;
eContestantStatus[contestant].usedComboMove = TRUE;
eContestantStatus[contestant].hasJudgesAttention = FALSE;
eContestantStatus[contestant].unk17 = eContestantStatus[contestant].appeal1 * eContestantStatus[contestant].completedCombo;
eContestantStatus[contestant].comboAppealBonus = eContestantStatus[contestant].appeal1 * eContestantStatus[contestant].completedCombo;
eContestantStatus[contestant].unk15_3 = TRUE;
}
else
@ -4494,20 +4494,20 @@ static void CalculateAppealMoveImpact(u8 contestant)
eContestantStatus[contestant].appeal2 = 0;
eContestantStatus[contestant].appeal1 = 0;
}
eContestResources10.moveExcitement = Contest_GetMoveExcitement(eContestantStatus[contestant].currMove);
eContestExcitement.moveExcitement = Contest_GetMoveExcitement(eContestantStatus[contestant].currMove);
if (eContestantStatus[contestant].overrideCategoryExcitementMod)
eContestResources10.moveExcitement = 1;
eContestExcitement.moveExcitement = 1;
if (eContestResources10.moveExcitement > 0)
if (eContestExcitement.moveExcitement > 0)
{
if (eContest.applauseLevel + eContestResources10.moveExcitement > 4)
eContestResources10.unk2 = 60;
if (eContest.applauseLevel + eContestExcitement.moveExcitement > 4)
eContestExcitement.excitementAppealBonus = 60;
else
eContestResources10.unk2 = 10;
eContestExcitement.excitementAppealBonus = 10;
}
else
{
eContestResources10.unk2 = 0;
eContestExcitement.excitementAppealBonus = 0;
}
// Transform and Role Play require a visible target mon
@ -4554,13 +4554,13 @@ static void PrintAppealMoveResultText(u8 contestant, u8 stringId)
{
StringCopy(gStringVar1, gContestMons[contestant].nickname);
StringCopy(gStringVar2, gMoveNames[eContestantStatus[contestant].currMove]);
if (gContestMoves[eContestantStatus[eContestResources8.contestant].currMove].contestCategory == CONTEST_CATEGORY_COOL)
if (gContestMoves[eContestantStatus[eContestAppealResults.contestant].currMove].contestCategory == CONTEST_CATEGORY_COOL)
StringCopy(gStringVar3, gText_Contest_Shyness);
else if (gContestMoves[eContestantStatus[eContestResources8.contestant].currMove].contestCategory == CONTEST_CATEGORY_BEAUTY)
else if (gContestMoves[eContestantStatus[eContestAppealResults.contestant].currMove].contestCategory == CONTEST_CATEGORY_BEAUTY)
StringCopy(gStringVar3, gText_Contest_Anxiety);
else if (gContestMoves[eContestantStatus[eContestResources8.contestant].currMove].contestCategory == CONTEST_CATEGORY_CUTE)
else if (gContestMoves[eContestantStatus[eContestAppealResults.contestant].currMove].contestCategory == CONTEST_CATEGORY_CUTE)
StringCopy(gStringVar3, gText_Contest_Laziness);
else if (gContestMoves[eContestantStatus[eContestResources8.contestant].currMove].contestCategory == CONTEST_CATEGORY_SMART)
else if (gContestMoves[eContestantStatus[eContestAppealResults.contestant].currMove].contestCategory == CONTEST_CATEGORY_SMART)
StringCopy(gStringVar3, gText_Contest_Hesitancy);
else
StringCopy(gStringVar3, gText_Contest_Fear);
@ -4646,7 +4646,7 @@ static void ApplyNextTurnOrder(void)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
eContestResources8.turnOrder[i] = newTurnOrder[i];
eContestAppealResults.turnOrder[i] = newTurnOrder[i];
eContestantStatus[i].nextTurnOrder = 0xFF;
eContestantStatus[i].turnOrderMod = 0;
gContestantTurnOrder[i] = newTurnOrder[i];
@ -5005,13 +5005,13 @@ static void ShowHideNextTurnGfx(bool8 show)
{
if (eContestantStatus[i].turnOrderMod != 0 && show)
{
CpuCopy32(GetTurnOrderNumberGfx(i), (void *)(VRAM + 0x10000 + (gSprites[gContestResources->field_14[i].nextTurnSpriteId].oam.tileNum + 6) * 32), 32);
gSprites[gContestResources->field_14[i].nextTurnSpriteId].pos1.y = sNextTurnSpriteYPositions[gContestantTurnOrder[i]];
gSprites[gContestResources->field_14[i].nextTurnSpriteId].invisible = FALSE;
CpuCopy32(GetTurnOrderNumberGfx(i), (void *)(VRAM + 0x10000 + (gSprites[eContestGfxState[i].nextTurnSpriteId].oam.tileNum + 6) * 32), 32);
gSprites[eContestGfxState[i].nextTurnSpriteId].pos1.y = sNextTurnSpriteYPositions[gContestantTurnOrder[i]];
gSprites[eContestGfxState[i].nextTurnSpriteId].invisible = FALSE;
}
else
{
gSprites[gContestResources->field_14[i].nextTurnSpriteId].invisible = TRUE;
gSprites[eContestGfxState[i].nextTurnSpriteId].invisible = TRUE;
}
}
}
@ -5029,7 +5029,7 @@ static void DrawUnnervedSymbols(void)
s32 i = 0;
for (i = 0; i < CONTESTANT_COUNT; i++)
{
if (eContestResources8.unnervedPokes[i] != 0 && !Contest_IsMonsTurnDisabled(i))
if (eContestAppealResults.unnervedPokes[i] != 0 && !Contest_IsMonsTurnDisabled(i))
{
u32 contestantOffset = gContestantTurnOrder[i] * 5 + 2;
u16 symbolOffset = GetStatusSymbolTileOffset(STAT_SYMBOL_SWIRL);
@ -5083,8 +5083,8 @@ static void SetBgForCurtainDrop(void)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
gSprites[gContestResources->field_14[i].sliderHeartSpriteId].oam.priority = 1;
gSprites[gContestResources->field_14[i].nextTurnSpriteId].oam.priority = 1;
gSprites[eContestGfxState[i].sliderHeartSpriteId].oam.priority = 1;
gSprites[eContestGfxState[i].nextTurnSpriteId].oam.priority = 1;
}
}
@ -5109,8 +5109,8 @@ static void UpdateContestantBoxOrder(void)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
gSprites[gContestResources->field_14[i].sliderHeartSpriteId].oam.priority = 0;
gSprites[gContestResources->field_14[i].nextTurnSpriteId].oam.priority = 0;
gSprites[eContestGfxState[i].sliderHeartSpriteId].oam.priority = 0;
gSprites[eContestGfxState[i].nextTurnSpriteId].oam.priority = 0;
}
}
@ -5160,8 +5160,8 @@ static void Task_ResetForNextRound(u8 taskId)
eContest.waitForLink = TRUE;
if (IsPlayerLinkLeader())
ResetContestantStatuses();
taskId2 = CreateTask(sub_80FCC88, 0);
SetTaskFuncWithFollowupFunc(taskId2, sub_80FCC88, Task_EndWaitForLink);
taskId2 = CreateTask(Task_LinkContest_CommunicateAppealsState, 0);
SetTaskFuncWithFollowupFunc(taskId2, Task_LinkContest_CommunicateAppealsState, Task_EndWaitForLink);
ContestPrintLinkStandby();
gTasks[taskId].data[0] = 2;
}
@ -5244,13 +5244,13 @@ static void AnimateSliderHearts(u8 animId)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
gSprites[gContestResources->field_14[i].sliderHeartSpriteId].oam.matrixNum = AllocOamMatrix();
gSprites[gContestResources->field_14[i].sliderHeartSpriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL;
StartSpriteAffineAnim(&gSprites[gContestResources->field_14[i].sliderHeartSpriteId], animId);
gSprites[eContestGfxState[i].sliderHeartSpriteId].oam.matrixNum = AllocOamMatrix();
gSprites[eContestGfxState[i].sliderHeartSpriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL;
StartSpriteAffineAnim(&gSprites[eContestGfxState[i].sliderHeartSpriteId], animId);
if (animId == SLIDER_HEART_ANIM_APPEAR)
{
AnimateSprite(&gSprites[gContestResources->field_14[i].sliderHeartSpriteId]);
gSprites[gContestResources->field_14[i].sliderHeartSpriteId].invisible = FALSE;
AnimateSprite(&gSprites[eContestGfxState[i].sliderHeartSpriteId]);
gSprites[eContestGfxState[i].sliderHeartSpriteId].invisible = FALSE;
}
}
taskId = CreateTask(Task_WaitForSliderHeartAnim, 5);
@ -5262,15 +5262,15 @@ static void Task_WaitForSliderHeartAnim(u8 taskId)
{
s32 i;
if (gSprites[gContestResources->field_14[0].sliderHeartSpriteId].affineAnimEnded)
if (gSprites[eContestGfxState[0].sliderHeartSpriteId].affineAnimEnded)
{
if ((u8)gTasks[taskId].tAnimId == SLIDER_HEART_ANIM_DISAPPEAR)
{
for (i = 0; i < CONTESTANT_COUNT; i++)
gSprites[gContestResources->field_14[i].sliderHeartSpriteId].invisible = TRUE;
gSprites[eContestGfxState[i].sliderHeartSpriteId].invisible = TRUE;
}
for (i = 0; i < CONTESTANT_COUNT; i++)
FreeSpriteOamMatrix(&gSprites[gContestResources->field_14[i].sliderHeartSpriteId]);
FreeSpriteOamMatrix(&gSprites[eContestGfxState[i].sliderHeartSpriteId]);
eContest.sliderHeartsAnimating = FALSE;
DestroyTask(taskId);
}
@ -5615,59 +5615,59 @@ static void sub_80DF080(u8 contestant)
{
s32 i;
if (!gContestResources->field_10->excitementFrozen
&& gContestResources->field_10->moveExcitement > 0
if (!eContestExcitement.frozen
&& eContestExcitement.moveExcitement > 0
&& !eContestantStatus[contestant].repeatedMove)
{
gContestResources->field_1c[contestant].unkC |= 1;
gContestResources->field_1c[contestant].unkE_2 = 1;
gContestResources->tv[contestant].unkC |= 1;
gContestResources->tv[contestant].unkE_2 = 1;
}
if (eContestantStatus[contestant].nervous)
gContestResources->field_1c[contestant].unkC |= 2;
gContestResources->tv[contestant].unkC |= 2;
if (!gContestResources->field_10->excitementFrozen
&& gContestResources->field_10->moveExcitement != 0
&& gContestResources->field_10->unk2 == 60)
if (!eContestExcitement.frozen
&& eContestExcitement.moveExcitement != 0
&& eContestExcitement.excitementAppealBonus == 60)
{
gContestResources->field_1c[contestant].unkC |= 4;
gContestResources->tv[contestant].unkC |= 4;
}
if (eContestantStatus[contestant].usedComboMove
&& eContestantStatus[contestant].completedCombo)
{
gContestResources->field_1c[contestant].unkC |= 8;
gContestResources->tv[contestant].unkC |= 8;
}
for (i = 0; i < CONTESTANT_COUNT; i++)
{
if (i != contestant && eContestantStatus[i].jam != 0)
{
gContestResources->field_1c[contestant].unkC |= 0x10;
gContestResources->field_1c[i].unkC |= 0x40;
gContestResources->tv[contestant].unkC |= 0x10;
gContestResources->tv[i].unkC |= 0x40;
}
}
if (eContestantStatus[contestant].numTurnsSkipped != 0
|| eContestantStatus[contestant].noMoreTurns)
{
gContestResources->field_1c[contestant].unkC |= 0x20;
gContestResources->tv[contestant].unkC |= 0x20;
}
else if (!eContestantStatus[contestant].nervous)
{
gContestResources->field_1c[contestant].unkC |= 0x80;
gContestResources->field_1c[contestant].unkE_1 = 1;
gContestResources->field_1c[contestant].unk0[eContest.appealNumber] = eContestantStatus[contestant].currMove;
gContestResources->tv[contestant].unkC |= 0x80;
gContestResources->tv[contestant].unkE_1 = 1;
gContestResources->tv[contestant].unk0[eContest.appealNumber] = eContestantStatus[contestant].currMove;
}
if (eContestantStatus[contestant].repeatedMove)
gContestResources->field_1c[contestant].unkD |= 2;
gContestResources->tv[contestant].unkD |= 2;
if (eContest.applauseLevel == 4
&& !gContestResources->field_10->excitementFrozen
&& gContestResources->field_10->moveExcitement < 0)
&& !eContestExcitement.frozen
&& eContestExcitement.moveExcitement < 0)
{
gContestResources->field_1c[contestant].unkD |= 0x20;
gContestResources->tv[contestant].unkD |= 0x20;
}
}
@ -5694,14 +5694,14 @@ static void sub_80DF250(void)
r1 = i;
}
gContestResources->field_1c[r1].unkD |= 1;
gContestResources->tv[r1].unkD |= 1;
for (i = 0; i < CONTESTANT_COUNT; i++)
{
if (i != var_38 && gContestMonTotalPoints[var_38] - gContestMonTotalPoints[i] <= 50)
gContestResources->field_1c[i].unkD |= 4;
gContestResources->tv[i].unkD |= 4;
if (!gContestResources->field_1c[i].unkE_2)
gContestResources->field_1c[i].unkD |= 8;
if (!gContestResources->tv[i].unkE_2)
gContestResources->tv[i].unkD |= 8;
for (j = 0; j < CONTESTANT_COUNT; j++)
{
@ -5709,7 +5709,7 @@ static void sub_80DF250(void)
break;
}
if (j == 4 && gContestFinalStandings[i] != 0)
gContestResources->field_1c[i].unkD |= 0x10;
gContestResources->tv[i].unkD |= 0x10;
r12 = FALSE;
r8 = FALSE;
@ -5721,10 +5721,10 @@ static void sub_80DF250(void)
r8 = TRUE;
}
if (!r12 && !r8)
gContestResources->field_1c[i].unkD |= 0x40;
gContestResources->tv[i].unkD |= 0x40;
if (!gContestResources->field_1c[i].unkE_1)
gContestResources->field_1c[i].unkD |= 0x80;
if (!gContestResources->tv[i].unkE_1)
gContestResources->tv[i].unkD |= 0x80;
}
for (i = 0; i < 5; i++)
@ -5737,15 +5737,15 @@ static void sub_80DF250(void)
for (i = 0; i < 5; i++)
{
if (gContestResources->field_1c[var_38].unk0[i] != 0)
if (gContestResources->tv[var_38].unk0[i] != 0)
{
for (j = 0; j < 5; j++)
{
if (gContestResources->field_1c[var_38].unk0[i] != sp0[j])
if (gContestResources->tv[var_38].unk0[i] != sp0[j])
{
if (sp0[j] == 0)
{
sp0[j] = gContestResources->field_1c[var_38].unk0[i];
sp0[j] = gContestResources->tv[var_38].unk0[i];
spC[j]++;
}
}
@ -5775,7 +5775,7 @@ static void sub_80DF250(void)
}
}
gContestResources->field_1c[var_38].unkA = sp14[Random() % count];
gContestResources->tv[var_38].unkA = sp14[Random() % count];
}
static void sub_80DF4F8(void)
@ -5812,7 +5812,7 @@ static void sub_80DF4F8(void)
r10++;
}
bits = gContestResources->field_1c[r7].unkC;
bits = gContestResources->tv[r7].unkC;
count = 0;
for (i = 0; i < 8; bits >>= 1, i++)
{
@ -5821,7 +5821,7 @@ static void sub_80DF4F8(void)
}
r5 = Random() % count;
bits = gContestResources->field_1c[r7].unkC;
bits = gContestResources->tv[r7].unkC;
count = 0;
r2 = 0;
for (i = 0; i < 8; bits >>= 1, r2++, i++)
@ -5837,13 +5837,13 @@ static void sub_80DF4F8(void)
if (r7 == 0)
{
sp0[0] = 1;
r4 = gContestResources->field_1c[1].unkD;
r4 = gContestResources->tv[1].unkD;
i = 2;
}
else
{
sp0[0] = 0;
r4 = gContestResources->field_1c[0].unkD;
r4 = gContestResources->tv[0].unkD;
i = 1;
}
@ -5852,13 +5852,13 @@ static void sub_80DF4F8(void)
{
if (i != r7)
{
if (r4 < gContestResources->field_1c[i].unkD)
if (r4 < gContestResources->tv[i].unkD)
{
sp0[0] = i;
r4 = gContestResources->field_1c[i].unkD;
r4 = gContestResources->tv[i].unkD;
r5 = 1;
}
else if (r4 == gContestResources->field_1c[i].unkD)
else if (r4 == gContestResources->tv[i].unkD)
{
sp0[r5] = i;
r5++;
@ -5870,7 +5870,7 @@ static void sub_80DF4F8(void)
r2 = 0x80;
for (i = 0; i < 8; r2 >>= 1, i++)
{
r4 = gContestResources->field_1c[r6].unkD & r2;
r4 = gContestResources->tv[r6].unkD & r2;
if (r4)
break;
}
@ -5878,7 +5878,7 @@ static void sub_80DF4F8(void)
ContestLiveUpdates_BeforeInterview_1(r9);
ContestLiveUpdates_BeforeInterview_2(r10);
ContestLiveUpdates_BeforeInterview_3(var);
ContestLiveUpdates_BeforeInterview_4(gContestResources->field_1c[r7].unkA);
ContestLiveUpdates_BeforeInterview_4(gContestResources->tv[r7].unkA);
ContestLiveUpdates_BeforeInterview_5(r4, r6);
}
@ -5932,7 +5932,7 @@ static void ContestDebugPrintBitStrings(void)
{
txtPtr = StringCopy(text1, gText_CDot);
Contest_PrintTextToBg0WindowAt(gContestantTurnOrder[i], text1, 5, 1, 7);
bits = gContestResources->field_1c[i].unkC;
bits = gContestResources->tv[i].unkC;
for (j = 7; j > -1; j--) // Weird loop.
{
txtPtr = ConvertIntToDecimalStringN(txtPtr, bits & 1, STR_CONV_MODE_LEFT_ALIGN, 1);
@ -5952,7 +5952,7 @@ static void ContestDebugPrintBitStrings(void)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
StringCopy(text1, gText_BDot);
bits = gContestResources->field_1c[i].unkD;
bits = gContestResources->tv[i].unkD;
txtPtr = &text1[2];
for (j = 7; j > -1; j--) // Weird loop.
{

View File

@ -384,7 +384,7 @@ static u8 GetContestantIdByTurn(u8 turn)
int i;
for (i = 0; i < CONTESTANT_COUNT; i++)
if (eContestResources8.turnOrder[i] == turn)
if (eContestAppealResults.turnOrder[i] == turn)
break;
return i;
@ -498,7 +498,7 @@ static void ContestAICmd_if_excitement_not_eq(void)
static void ContestAICmd_get_user_order(void)
{
eContestAI.scriptResult = eContestResources8.turnOrder[eContestAI.contestantId];
eContestAI.scriptResult = eContestAppealResults.turnOrder[eContestAI.contestantId];
gAIScriptPtr += 1;
}

View File

@ -82,98 +82,98 @@ static void ContestEffect_HighlyAppealing(void)
// After this move, the user is more easily startled.
static void ContestEffect_UserMoreEasilyStartled(void)
{
eContestantStatus[eContestResources8.contestant].moreEasilyStartled = TRUE;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_MORE_CONSCIOUS);
eContestantStatus[eContestAppealResults.contestant].moreEasilyStartled = TRUE;
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_MORE_CONSCIOUS);
}
// Makes a great appeal, but allows no more to the end.
static void ContestEffect_GreatAppealButNoMoreMoves(void)
{
eContestantStatus[eContestResources8.contestant].exploded = TRUE;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_NO_APPEAL);
eContestantStatus[eContestAppealResults.contestant].exploded = TRUE;
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_NO_APPEAL);
}
// Can be used repeatedly without boring the JUDGE.
static void ContestEffect_RepetitionNotBoring(void)
{
eContestantStatus[eContestResources8.contestant].usedRepeatableMove = TRUE;
eContestantStatus[eContestResources8.contestant].repeatedMove = FALSE;
eContestantStatus[eContestResources8.contestant].moveRepeatCount = 0;
eContestantStatus[eContestAppealResults.contestant].usedRepeatableMove = TRUE;
eContestantStatus[eContestAppealResults.contestant].repeatedMove = FALSE;
eContestantStatus[eContestAppealResults.contestant].moveRepeatCount = 0;
}
// Can avoid being startled by others once.
static void ContestEffect_AvoidStartleOnce(void)
{
eContestantStatus[eContestResources8.contestant].jamSafetyCount = 1;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_SETTLE_DOWN);
eContestantStatus[eContestAppealResults.contestant].jamSafetyCount = 1;
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_SETTLE_DOWN);
}
// Can avoid being startled by others.
static void ContestEffect_AvoidStartle(void)
{
eContestantStatus[eContestResources8.contestant].immune = TRUE;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_OBLIVIOUS_TO_OTHERS);
eContestantStatus[eContestAppealResults.contestant].immune = TRUE;
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_OBLIVIOUS_TO_OTHERS);
}
// Can avoid being startled by others a little.
static void ContestEffect_AvoidStartleSlightly(void)
{
eContestantStatus[eContestResources8.contestant].jamReduction = 20;
SetContestantEffectStringID(eContestResources8.contestant,CONTEST_STRING_LESS_AWARE);
eContestantStatus[eContestAppealResults.contestant].jamReduction = 20;
SetContestantEffectStringID(eContestAppealResults.contestant,CONTEST_STRING_LESS_AWARE);
}
// After this move, the user is less likely to be startled.
static void ContestEffect_UserLessEasilyStartled(void)
{
eContestantStatus[eContestResources8.contestant].resistant = TRUE;
SetContestantEffectStringID(eContestResources8.contestant,CONTEST_STRING_STOPPED_CARING);
eContestantStatus[eContestAppealResults.contestant].resistant = TRUE;
SetContestantEffectStringID(eContestAppealResults.contestant,CONTEST_STRING_STOPPED_CARING);
}
// Slightly startles the POKéMON in front.
static void ContestEffect_StartleFrontMon(void)
{
u8 idx = 0;
u8 a = eContestResources8.contestant;
u8 a = eContestAppealResults.contestant;
if (eContestResources8.turnOrder[a] != 0) {
if (eContestAppealResults.turnOrder[a] != 0) {
int i;
for (i = 0; i < CONTESTANT_COUNT; i++)
{
if (eContestResources8.turnOrder[a] - 1 == eContestResources8.turnOrder[i])
if (eContestAppealResults.turnOrder[a] - 1 == eContestAppealResults.turnOrder[i])
break;
}
eContestResources8.jamQueue[0] = i;
eContestResources8.jamQueue[1] = 0xFF;
eContestAppealResults.jamQueue[0] = i;
eContestAppealResults.jamQueue[1] = 0xFF;
idx = WasAtLeastOneOpponentJammed();
}
if (idx == 0)
SetContestantEffectStringID2(eContestResources8.contestant, CONTEST_STRING_MESSED_UP2);
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
SetContestantEffectStringID2(eContestAppealResults.contestant, CONTEST_STRING_MESSED_UP2);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
}
// Slightly startles those that have made appeals.
static void ContestEffect_StartlePrevMons(void)
{
u8 idx = 0;
u8 contestant = eContestResources8.contestant;
u8 contestant = eContestAppealResults.contestant;
if (eContestResources8.turnOrder[contestant] != 0)
if (eContestAppealResults.turnOrder[contestant] != 0)
{
int i, j;
for (i = 0, j = 0; i < CONTESTANT_COUNT; i++)
{
if (eContestResources8.turnOrder[contestant] > eContestResources8.turnOrder[i])
eContestResources8.jamQueue[j++] = i;
if (eContestAppealResults.turnOrder[contestant] > eContestAppealResults.turnOrder[i])
eContestAppealResults.jamQueue[j++] = i;
}
eContestResources8.jamQueue[j] = 0xFF;
eContestAppealResults.jamQueue[j] = 0xFF;
idx = WasAtLeastOneOpponentJammed();
}
if (idx == 0)
SetContestantEffectStringID2(eContestResources8.contestant, CONTEST_STRING_MESSED_UP2);
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
SetContestantEffectStringID2(eContestAppealResults.contestant, CONTEST_STRING_MESSED_UP2);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
}
// Startles the POKéMON that appealed before the user.
@ -189,7 +189,7 @@ static void ContestEffect_StartlePrevMon2(void)
else
jam = 60;
eContestResources8.jam = jam;
eContestAppealResults.jam = jam;
ContestEffect_StartleFrontMon();
}
@ -197,8 +197,8 @@ static void ContestEffect_StartlePrevMon2(void)
static void ContestEffect_StartlePrevMons2(void)
{
u8 numStartled = 0;
u8 contestant = eContestResources8.contestant;
u8 turnOrder = eContestResources8.turnOrder[contestant];
u8 contestant = eContestAppealResults.contestant;
u8 turnOrder = eContestAppealResults.turnOrder[contestant];
if (turnOrder != 0)
{
@ -206,12 +206,12 @@ static void ContestEffect_StartlePrevMons2(void)
for (i = 0; i < 4; i++)
{
if (eContestResources8.turnOrder[contestant] > eContestResources8.turnOrder[i])
if (eContestAppealResults.turnOrder[contestant] > eContestAppealResults.turnOrder[i])
{
u8 rval, jam;
eContestResources8.jamQueue[0] = i;
eContestResources8.jamQueue[1] = 0xFF;
eContestAppealResults.jamQueue[0] = i;
eContestAppealResults.jamQueue[1] = 0xFF;
rval = Random() % 10;
if (rval == 0)
@ -227,31 +227,31 @@ static void ContestEffect_StartlePrevMons2(void)
else
jam = 60;
eContestResources8.jam = jam;
eContestAppealResults.jam = jam;
if (WasAtLeastOneOpponentJammed())
numStartled++;
}
}
}
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
if (numStartled == 0)
SetContestantEffectStringID2(eContestResources8.contestant, CONTEST_STRING_MESSED_UP2);
SetContestantEffectStringID2(eContestAppealResults.contestant, CONTEST_STRING_MESSED_UP2);
}
// Shifts the JUDGE's attention from others.
static void ContestEffect_ShiftJudgeAttention(void)
{
bool32 hitAny = FALSE;
u8 contestant = eContestResources8.contestant;
u8 contestant = eContestAppealResults.contestant;
if (eContestResources8.turnOrder[eContestResources8.contestant] != 0)
if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] != 0)
{
int i;
for (i = 0; i < 4; i++)
{
if (eContestResources8.turnOrder[contestant] > eContestResources8.turnOrder[i] &&
if (eContestAppealResults.turnOrder[contestant] > eContestAppealResults.turnOrder[i] &&
eContestantStatus[i].hasJudgesAttention &&
CanUnnerveContestant(i))
{
@ -262,10 +262,10 @@ static void ContestEffect_ShiftJudgeAttention(void)
}
}
}
SetContestantEffectStringID(eContestResources8.contestant,CONTEST_STRING_DAZZLE_ATTEMPT);
SetContestantEffectStringID(eContestAppealResults.contestant,CONTEST_STRING_DAZZLE_ATTEMPT);
if (!hitAny)
{
SetContestantEffectStringID2(eContestResources8.contestant, CONTEST_STRING_MESSED_UP2);
SetContestantEffectStringID2(eContestAppealResults.contestant, CONTEST_STRING_MESSED_UP2);
}
}
@ -273,81 +273,81 @@ static void ContestEffect_ShiftJudgeAttention(void)
static void ContestEffect_StartleMonWithJudgesAttention(void)
{
u8 numStartled = 0;
u8 contestant = eContestResources8.contestant;
u8 contestant = eContestAppealResults.contestant;
if (eContestResources8.turnOrder[eContestResources8.contestant] != 0)
if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] != 0)
{
int i;
for (i = 0; i < 4; i++)
{
if (eContestResources8.turnOrder[contestant] > eContestResources8.turnOrder[i])
if (eContestAppealResults.turnOrder[contestant] > eContestAppealResults.turnOrder[i])
{
if (eContestantStatus[i].hasJudgesAttention)
eContestResources8.jam = 50;
eContestAppealResults.jam = 50;
else
eContestResources8.jam = 10;
eContestResources8.jamQueue[0] = i;
eContestResources8.jamQueue[1] = 0xFF;
eContestAppealResults.jam = 10;
eContestAppealResults.jamQueue[0] = i;
eContestAppealResults.jamQueue[1] = 0xFF;
if (WasAtLeastOneOpponentJammed())
numStartled++;
}
}
}
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
if (numStartled == 0)
SetContestantEffectStringID2(eContestResources8.contestant, CONTEST_STRING_MESSED_UP2);
SetContestantEffectStringID2(eContestAppealResults.contestant, CONTEST_STRING_MESSED_UP2);
}
// Jams the others, and misses one turn of appeals.
static void ContestEffect_JamsOthersButMissOneTurn(void)
{
eContestantStatus[eContestResources8.contestant].turnSkipped = TRUE;
eContestantStatus[eContestAppealResults.contestant].turnSkipped = TRUE;
ContestEffect_StartlePrevMons();
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
}
// Startles POKéMON that made a same-type appeal.
static void ContestEffect_StartleMonsSameTypeAppeal(void)
{
u16 move = eContestantStatus[eContestResources8.contestant].currMove;
u16 move = eContestantStatus[eContestAppealResults.contestant].currMove;
JamByMoveCategory(gContestMoves[move].contestCategory);
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
}
// Badly startles POKéMON that made COOL appeals.
static void ContestEffect_StartleMonsCoolAppeal(void)
{
JamByMoveCategory(CONTEST_CATEGORY_COOL);
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
}
// Badly startles POKéMON that made BEAUTY appeals.
static void ContestEffect_StartleMonsBeautyAppeal(void)
{
JamByMoveCategory(CONTEST_CATEGORY_BEAUTY);
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
}
// Badly startles POKéMON that made CUTE appeals.
static void ContestEffect_StartleMonsCuteAppeal(void)
{
JamByMoveCategory(CONTEST_CATEGORY_CUTE);
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
}
// Badly startles POKéMON that made SMART appeals.
static void ContestEffect_StartleMonsSmartAppeal(void)
{
JamByMoveCategory(CONTEST_CATEGORY_SMART);
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
}
// Badly startles POKéMON that made TOUGH appeals.
static void ContestEffect_StartleMonsToughAppeal(void)
{
JamByMoveCategory(CONTEST_CATEGORY_TOUGH);
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
}
// Makes one POKéMON after the user nervous.
@ -355,13 +355,13 @@ static void ContestEffect_MakeFollowingMonNervous(void)
{
bool32 hitAny = FALSE;
if (eContestResources8.turnOrder[eContestResources8.contestant] != 3)
if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] != 3)
{
int i;
for (i = 0; i < 4; i++)
{
if (eContestResources8.turnOrder[eContestResources8.contestant] + 1 == eContestResources8.turnOrder[i])
if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] + 1 == eContestAppealResults.turnOrder[i])
{
if (CanUnnerveContestant(i))
{
@ -377,9 +377,9 @@ static void ContestEffect_MakeFollowingMonNervous(void)
}
}
}
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_UNNERVE_ATTEMPT);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_UNNERVE_ATTEMPT);
if (!hitAny)
SetContestantEffectStringID2(eContestResources8.contestant, CONTEST_STRING_MESSED_UP2);
SetContestantEffectStringID2(eContestAppealResults.contestant, CONTEST_STRING_MESSED_UP2);
}
// Makes all POKéMON after the user nervous.
@ -396,7 +396,7 @@ static void ContestEffect_MakeFollowingMonsNervous(void)
memset(contestantIds, 0xFF, ARRAY_COUNT(contestantIds));
for (i = 0, numAfter = 0; i < CONTESTANT_COUNT; i++)
{
if (eContestResources8.turnOrder[eContestResources8.contestant] < eContestResources8.turnOrder[i] &&
if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] < eContestAppealResults.turnOrder[i] &&
!eContestantStatus[i].nervous && !Contest_IsMonsTurnDisabled(i))
contestantIds[numAfter++] = i;
}
@ -457,12 +457,12 @@ static void ContestEffect_MakeFollowingMonsNervous(void)
SetContestantEffectStringID(contestantIds[i], CONTEST_STRING_UNAFFECTED);
numUnnerved++;
}
eContestResources8.unnervedPokes[contestantIds[i]] = 1;
eContestAppealResults.unnervedPokes[contestantIds[i]] = 1;
}
}
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_UNNERVE_WAITING);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_UNNERVE_WAITING);
if (numUnnerved == 0)
SetContestantEffectStringID2(eContestResources8.contestant, CONTEST_STRING_MESSED_UP2);
SetContestantEffectStringID2(eContestAppealResults.contestant, CONTEST_STRING_MESSED_UP2);
}
// Worsens the condition of those that made appeals.
@ -473,7 +473,7 @@ static void ContestEffect_WorsenConditionOfPrevMons(void)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
if (eContestResources8.turnOrder[eContestResources8.contestant] > eContestResources8.turnOrder[i] &&
if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] > eContestAppealResults.turnOrder[i] &&
eContestantStatus[i].condition > 0 &&
CanUnnerveContestant(i))
{
@ -484,9 +484,9 @@ static void ContestEffect_WorsenConditionOfPrevMons(void)
}
}
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_TAUNT_WELL);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_TAUNT_WELL);
if (numHit == 0)
SetContestantEffectStringID2(eContestResources8.contestant, CONTEST_STRING_IGNORED);
SetContestantEffectStringID2(eContestAppealResults.contestant, CONTEST_STRING_IGNORED);
}
// Badly startles POKéMON in good condition.
@ -497,42 +497,42 @@ static void ContestEffect_BadlyStartlesMonsInGoodCondition(void)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
if (eContestResources8.turnOrder[eContestResources8.contestant] > eContestResources8.turnOrder[i])
if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] > eContestAppealResults.turnOrder[i])
{
if (eContestantStatus[i].condition > 0)
eContestResources8.jam = 40;
eContestAppealResults.jam = 40;
else
eContestResources8.jam = 10;
eContestResources8.jamQueue[0] = i;
eContestResources8.jamQueue[1] = 0xFF;
eContestAppealResults.jam = 10;
eContestAppealResults.jamQueue[0] = i;
eContestAppealResults.jamQueue[1] = 0xFF;
if (WasAtLeastOneOpponentJammed())
numHit++;
}
}
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_JAM_WELL);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_JAM_WELL);
if (numHit == 0)
SetContestantEffectStringID2(eContestResources8.contestant, CONTEST_STRING_IGNORED);
SetContestantEffectStringID2(eContestAppealResults.contestant, CONTEST_STRING_IGNORED);
}
// The appeal works great if performed first.
static void ContestEffect_BetterIfFirst(void)
{
if (gContestantTurnOrder[eContestResources8.contestant] == 0)
if (gContestantTurnOrder[eContestAppealResults.contestant] == 0)
{
u16 move = eContestantStatus[eContestResources8.contestant].currMove;
eContestantStatus[eContestResources8.contestant].appeal2 += 2 * gContestEffects[gContestMoves[move].effect].appeal;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_HUSTLE_STANDOUT);
u16 move = eContestantStatus[eContestAppealResults.contestant].currMove;
eContestantStatus[eContestAppealResults.contestant].appeal2 += 2 * gContestEffects[gContestMoves[move].effect].appeal;
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_HUSTLE_STANDOUT);
}
}
// The appeal works great if performed last.
static void ContestEffect_BetterIfLast(void)
{
if (gContestantTurnOrder[eContestResources8.contestant] == 3)
if (gContestantTurnOrder[eContestAppealResults.contestant] == 3)
{
u16 move = eContestantStatus[eContestResources8.contestant].currMove;
eContestantStatus[eContestResources8.contestant].appeal2 += 2 * gContestEffects[gContestMoves[move].effect].appeal;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_WORK_HARD_UNNOTICED);
u16 move = eContestantStatus[eContestAppealResults.contestant].currMove;
eContestantStatus[eContestAppealResults.contestant].appeal2 += 2 * gContestEffects[gContestMoves[move].effect].appeal;
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_WORK_HARD_UNNOTICED);
}
}
@ -544,22 +544,22 @@ static void ContestEffect_AppealAsGoodAsPrevOnes(void)
for (i = 0, appealSum = 0; i < CONTESTANT_COUNT; i++)
{
if (eContestResources8.turnOrder[eContestResources8.contestant] > eContestResources8.turnOrder[i])
if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] > eContestAppealResults.turnOrder[i])
appealSum += eContestantStatus[i].appeal2;
}
if (appealSum < 0)
appealSum = 0;
if (eContestResources8.turnOrder[eContestResources8.contestant] == 0 || appealSum == 0)
if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] == 0 || appealSum == 0)
{
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_APPEAL_NOT_WELL);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_NOT_WELL);
}
else
{
eContestantStatus[eContestResources8.contestant].appeal2 += appealSum / 2;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_WORK_BEFORE);
eContestantStatus[eContestAppealResults.contestant].appeal2 += appealSum / 2;
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_WORK_BEFORE);
}
eContestantStatus[eContestResources8.contestant].appeal2 = RoundTowardsZero(eContestantStatus[eContestResources8.contestant].appeal2);
eContestantStatus[eContestAppealResults.contestant].appeal2 = RoundTowardsZero(eContestantStatus[eContestAppealResults.contestant].appeal2);
}
// Makes the appeal as good as the one before it.
@ -567,42 +567,42 @@ static void ContestEffect_AppealAsGoodAsPrevOne(void)
{
s16 appeal = 0;
if (eContestResources8.turnOrder[eContestResources8.contestant] != 0)
if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] != 0)
{
int i;
for (i = 0; i < CONTESTANT_COUNT; i++)
{
if (eContestResources8.turnOrder[eContestResources8.contestant] - 1 == eContestResources8.turnOrder[i])
if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] - 1 == eContestAppealResults.turnOrder[i])
appeal = eContestantStatus[i].appeal2;
}
}
if (eContestResources8.turnOrder[eContestResources8.contestant] == 0 || appeal <= 0)
if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] == 0 || appeal <= 0)
{
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_APPEAL_NOT_WELL2);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_NOT_WELL2);
}
else
{
eContestantStatus[eContestResources8.contestant].appeal2 += appeal;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_WORK_PRECEDING);
eContestantStatus[eContestAppealResults.contestant].appeal2 += appeal;
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_WORK_PRECEDING);
}
}
// The appeal works better the later it is performed.
static void ContestEffect_BetterWhenLater(void)
{
u8 whichTurn = eContestResources8.turnOrder[eContestResources8.contestant];
u8 whichTurn = eContestAppealResults.turnOrder[eContestAppealResults.contestant];
if (whichTurn == 0)
eContestantStatus[eContestResources8.contestant].appeal2 = 10;
eContestantStatus[eContestAppealResults.contestant].appeal2 = 10;
else
eContestantStatus[eContestResources8.contestant].appeal2 = 20 * whichTurn;
eContestantStatus[eContestAppealResults.contestant].appeal2 = 20 * whichTurn;
if (whichTurn == 0)
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_APPEAL_NOT_SHOWN_WELL);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_NOT_SHOWN_WELL);
else if (whichTurn == 1)
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_APPEAL_SLIGHTLY_WELL);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_SLIGHTLY_WELL);
else if (whichTurn == 2)
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_APPEAL_PRETTY_WELL);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_PRETTY_WELL);
else
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_APPEAL_EXCELLENTLY);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_EXCELLENTLY);
}
// The appeal's quality varies depending on its timing.
@ -614,31 +614,31 @@ static void ContestEffect_QualityDependsOnTiming(void)
if (rval < 3)
{
appeal = 10;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_APPEAL_NOT_VERY_WELL);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_NOT_VERY_WELL);
} else if (rval < 6)
{
appeal = 20;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_APPEAL_SLIGHTLY_WELL2);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_SLIGHTLY_WELL2);
} else if (rval < 8)
{
appeal = 40;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_APPEAL_PRETTY_WELL2);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_PRETTY_WELL2);
} else if (rval < 9)
{
appeal = 60;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_APPEAL_VERY_WELL);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_VERY_WELL);
}
else
{
appeal = 80;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_APPEAL_EXCELLENTLY2);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_EXCELLENTLY2);
}
eContestantStatus[eContestResources8.contestant].appeal2 = appeal;
eContestantStatus[eContestAppealResults.contestant].appeal2 = appeal;
}
static void ContestEffect_BetterIfSameType(void)
{
s8 turnOrder = eContestResources8.turnOrder[eContestResources8.contestant];
s8 turnOrder = eContestAppealResults.turnOrder[eContestAppealResults.contestant];
s8 i = turnOrder - 1, j;
u16 move;
@ -649,7 +649,7 @@ static void ContestEffect_BetterIfSameType(void)
{
for (j = 0; j < CONTESTANT_COUNT; j++)
{
if (eContestResources8.turnOrder[j] == i)
if (eContestAppealResults.turnOrder[j] == i)
break;
}
if (eContestantStatus[j].noMoreTurns || eContestantStatus[j].nervous || eContestantStatus[j].numTurnsSkipped)
@ -663,29 +663,29 @@ static void ContestEffect_BetterIfSameType(void)
}
}
move = eContestantStatus[eContestResources8.contestant].currMove;
move = eContestantStatus[eContestAppealResults.contestant].currMove;
if (gContestMoves[move].contestCategory == gContestMoves[eContestantStatus[j].currMove].contestCategory)
{
eContestantStatus[eContestResources8.contestant].appeal2 += gContestEffects[gContestMoves[move].effect].appeal * 2;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_SAME_TYPE_GOOD);
eContestantStatus[eContestAppealResults.contestant].appeal2 += gContestEffects[gContestMoves[move].effect].appeal * 2;
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_SAME_TYPE_GOOD);
}
}
// Works well if different in type than the one before.
static void ContestEffect_BetterIfDiffType(void)
{
if (eContestResources8.turnOrder[eContestResources8.contestant] != 0)
if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] != 0)
{
u16 move = eContestantStatus[eContestResources8.contestant].currMove;
u16 move = eContestantStatus[eContestAppealResults.contestant].currMove;
int i;
for (i = 0; i < CONTESTANT_COUNT; i++)
{
if (eContestResources8.turnOrder[eContestResources8.contestant] - 1 == eContestResources8.turnOrder[i] &&
if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] - 1 == eContestAppealResults.turnOrder[i] &&
gContestMoves[move].contestCategory != gContestMoves[eContestantStatus[i].currMove].contestCategory)
{
eContestantStatus[eContestResources8.contestant].appeal2 += gContestEffects[gContestMoves[move].effect].appeal * 2;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_DIFF_TYPE_GOOD);
eContestantStatus[eContestAppealResults.contestant].appeal2 += gContestEffects[gContestMoves[move].effect].appeal * 2;
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_DIFF_TYPE_GOOD);
break;
}
}
@ -695,23 +695,23 @@ static void ContestEffect_BetterIfDiffType(void)
// Affected by how well the appeal in front goes.
static void ContestEffect_AffectedByPrevAppeal(void)
{
if (eContestResources8.turnOrder[eContestResources8.contestant] != 0)
if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] != 0)
{
int i;
for (i = 0; i < CONTESTANT_COUNT; i++)
{
if (eContestResources8.turnOrder[eContestResources8.contestant] - 1 == eContestResources8.turnOrder[i])
if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] - 1 == eContestAppealResults.turnOrder[i])
{
if (eContestantStatus[eContestResources8.contestant].appeal2 > eContestantStatus[i].appeal2)
if (eContestantStatus[eContestAppealResults.contestant].appeal2 > eContestantStatus[i].appeal2)
{
eContestantStatus[eContestResources8.contestant].appeal2 *= 2;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_STOOD_OUT_AS_MUCH);
eContestantStatus[eContestAppealResults.contestant].appeal2 *= 2;
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_STOOD_OUT_AS_MUCH);
}
else if (eContestantStatus[eContestResources8.contestant].appeal2 < eContestantStatus[i].appeal2)
else if (eContestantStatus[eContestAppealResults.contestant].appeal2 < eContestantStatus[i].appeal2)
{
eContestantStatus[eContestResources8.contestant].appeal2 = 0;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_NOT_AS_WELL);
eContestantStatus[eContestAppealResults.contestant].appeal2 = 0;
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_NOT_AS_WELL);
}
}
}
@ -721,26 +721,26 @@ static void ContestEffect_AffectedByPrevAppeal(void)
// Ups the user's condition. Helps prevent nervousness.
static void ContestEffect_ImproveConditionPreventNervousness(void)
{
if (eContestantStatus[eContestResources8.contestant].condition < 30)
if (eContestantStatus[eContestAppealResults.contestant].condition < 30)
{
eContestantStatus[eContestResources8.contestant].condition += 10;
eContestantStatus[eContestResources8.contestant].conditionMod = 1;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_CONDITION_ROSE);
eContestantStatus[eContestAppealResults.contestant].condition += 10;
eContestantStatus[eContestAppealResults.contestant].conditionMod = 1;
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_CONDITION_ROSE);
}
else
{
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_NO_CONDITION_IMPROVE);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_NO_CONDITION_IMPROVE);
}
}
// The appeal works well if the user's condition is good.
static void ContestEffect_BetterWithGoodCondition(void)
{
eContestantStatus[eContestResources8.contestant].appealTripleCondition = TRUE;
if (eContestantStatus[eContestResources8.contestant].condition != 0)
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_HOT_STATUS);
eContestantStatus[eContestAppealResults.contestant].appealTripleCondition = TRUE;
if (eContestantStatus[eContestAppealResults.contestant].condition != 0)
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_HOT_STATUS);
else
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_BAD_CONDITION_WEAK_APPEAL);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_BAD_CONDITION_WEAK_APPEAL);
}
// The next appeal can be made earlier next turn.
@ -755,13 +755,13 @@ static void ContestEffect_NextAppealEarlier(void)
for (i = 0; i < CONTESTANT_COUNT; i++)
turnOrder[i] = eContestantStatus[i].nextTurnOrder;
turnOrder[eContestResources8.contestant] = 0xFF;
turnOrder[eContestAppealResults.contestant] = 0xFF;
for (i = 0; i < CONTESTANT_COUNT; i++)
{
for (j = 0; j < CONTESTANT_COUNT; j++)
{
if (j != eContestResources8.contestant &&
if (j != eContestAppealResults.contestant &&
i == turnOrder[j] &&
turnOrder[j] == eContestantStatus[j].nextTurnOrder)
{
@ -773,15 +773,15 @@ static void ContestEffect_NextAppealEarlier(void)
break;
}
turnOrder[eContestResources8.contestant] = 0;
eContestantStatus[eContestResources8.contestant].turnOrderMod = 1;
turnOrder[eContestAppealResults.contestant] = 0;
eContestantStatus[eContestAppealResults.contestant].turnOrderMod = 1;
for (i = 0; i < CONTESTANT_COUNT; i++)
{
eContestantStatus[i].nextTurnOrder = turnOrder[i];
}
eContestantStatus[eContestResources8.contestant].turnOrderModAction = 1;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_MOVE_UP_LINE);
eContestantStatus[eContestAppealResults.contestant].turnOrderModAction = 1;
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_MOVE_UP_LINE);
}
}
@ -797,13 +797,13 @@ static void ContestEffect_NextAppealLater(void)
for (i = 0; i < CONTESTANT_COUNT; i++)
turnOrder[i] = eContestantStatus[i].nextTurnOrder;
turnOrder[eContestResources8.contestant] = 0xFF;
turnOrder[eContestAppealResults.contestant] = 0xFF;
for (i = CONTESTANT_COUNT - 1; i > -1; i--)
{
for (j = 0; j < CONTESTANT_COUNT; j++)
{
if (j != eContestResources8.contestant &&
if (j != eContestAppealResults.contestant &&
i == turnOrder[j] &&
turnOrder[j] == eContestantStatus[j].nextTurnOrder)
{
@ -815,15 +815,15 @@ static void ContestEffect_NextAppealLater(void)
break;
}
turnOrder[eContestResources8.contestant] = CONTESTANT_COUNT - 1;
eContestantStatus[eContestResources8.contestant].turnOrderMod = 1;
turnOrder[eContestAppealResults.contestant] = CONTESTANT_COUNT - 1;
eContestantStatus[eContestAppealResults.contestant].turnOrderMod = 1;
for (i = 0; i < CONTESTANT_COUNT; i++)
{
eContestantStatus[i].nextTurnOrder = turnOrder[i];
}
eContestantStatus[eContestResources8.contestant].turnOrderModAction = 2;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_MOVE_BACK_LINE);
eContestantStatus[eContestAppealResults.contestant].turnOrderModAction = 2;
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_MOVE_BACK_LINE);
}
}
@ -874,17 +874,17 @@ static void ContestEffect_ScrambleNextTurnOrder(void)
eContestantStatus[i].nextTurnOrder = turnOrder[i];
eContestantStatus[i].turnOrderMod = 2;
}
eContestantStatus[eContestResources8.contestant].turnOrderModAction = 3;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_SCRAMBLE_ORDER);
eContestantStatus[eContestAppealResults.contestant].turnOrderModAction = 3;
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_SCRAMBLE_ORDER);
}
}
// An appeal that excites the audience in any CONTEST.
static void ContestEffect_ExciteAudienceInAnyContest(void)
{
if (gContestMoves[eContestantStatus[eContestResources8.contestant].currMove].contestCategory != gSpecialVar_ContestCategory)
if (gContestMoves[eContestantStatus[eContestAppealResults.contestant].currMove].contestCategory != gSpecialVar_ContestCategory)
{
eContestantStatus[eContestResources8.contestant].overrideCategoryExcitementMod = TRUE;
eContestantStatus[eContestAppealResults.contestant].overrideCategoryExcitementMod = TRUE;
}
}
@ -896,24 +896,24 @@ static void ContestEffect_BadlyStartleMonsWithGoodAppeals(void)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
if (eContestResources8.turnOrder[eContestResources8.contestant] > eContestResources8.turnOrder[i])
if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] > eContestAppealResults.turnOrder[i])
{
if (eContestantStatus[i].appeal2 > 0)
{
eContestResources8.jam = eContestantStatus[i].appeal2 / 2;
eContestResources8.jam = RoundUp(eContestResources8.jam);
eContestAppealResults.jam = eContestantStatus[i].appeal2 / 2;
eContestAppealResults.jam = RoundUp(eContestAppealResults.jam);
}
else
eContestResources8.jam = 10;
eContestResources8.jamQueue[0] = i;
eContestResources8.jamQueue[1] = 0xFF;
eContestAppealResults.jam = 10;
eContestAppealResults.jamQueue[0] = i;
eContestAppealResults.jamQueue[1] = 0xFF;
if (WasAtLeastOneOpponentJammed())
numJammed++;
}
}
if (numJammed == 0)
SetContestantEffectStringID2(eContestResources8.contestant, CONTEST_STRING_MESSED_UP2);
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
SetContestantEffectStringID2(eContestAppealResults.contestant, CONTEST_STRING_MESSED_UP2);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTEMPT_STARTLE);
}
// The appeal works best the more the crowd is excited.
@ -924,39 +924,39 @@ static void ContestEffect_BetterWhenAudienceExcited(void)
if (eContest.applauseLevel == 0)
{
appeal = 10;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_APPEAL_NOT_VERY_WELL);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_NOT_VERY_WELL);
}
else if (eContest.applauseLevel == 1)
{
appeal = 20;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_APPEAL_SLIGHTLY_WELL2);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_SLIGHTLY_WELL2);
}
else if (eContest.applauseLevel == 2)
{
appeal = 30;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_APPEAL_PRETTY_WELL2);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_PRETTY_WELL2);
}
else if (eContest.applauseLevel == 3)
{
appeal = 50;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_APPEAL_VERY_WELL);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_VERY_WELL);
}
else
{
appeal = 60;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_APPEAL_EXCELLENTLY2);
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_EXCELLENTLY2);
}
eContestantStatus[eContestResources8.contestant].appeal2 = appeal;
eContestantStatus[eContestAppealResults.contestant].appeal2 = appeal;
}
// Temporarily stops the crowd from growing excited.
static void ContestEffect_DontExciteAudience(void)
{
if (!eContestResources10.excitementFrozen)
if (!eContestExcitement.frozen)
{
eContestResources10.excitementFrozen = TRUE;
eContestResources10.excitementFreezer = eContestResources8.contestant;
SetContestantEffectStringID(eContestResources8.contestant, CONTEST_STRING_ATTRACTED_ATTENTION);
eContestExcitement.frozen = TRUE;
eContestExcitement.freezer = eContestAppealResults.contestant;
SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_ATTRACTED_ATTENTION);
}
}
@ -967,26 +967,26 @@ static void JamByMoveCategory(u8 category)
for (i = 0; i < CONTESTANT_COUNT; i++)
{
if (eContestResources8.turnOrder[eContestResources8.contestant] > eContestResources8.turnOrder[i])
if (eContestAppealResults.turnOrder[eContestAppealResults.contestant] > eContestAppealResults.turnOrder[i])
{
if (category == gContestMoves[eContestantStatus[i].currMove].contestCategory)
eContestResources8.jam = 40;
eContestAppealResults.jam = 40;
else
eContestResources8.jam = 10;
eContestResources8.jamQueue[0] = i;
eContestResources8.jamQueue[1] = 0xFF;
eContestAppealResults.jam = 10;
eContestAppealResults.jamQueue[0] = i;
eContestAppealResults.jamQueue[1] = 0xFF;
if (WasAtLeastOneOpponentJammed())
numJammed++;
}
}
if (numJammed == 0)
SetContestantEffectStringID2(eContestResources8.contestant, CONTEST_STRING_MESSED_UP2);
SetContestantEffectStringID2(eContestAppealResults.contestant, CONTEST_STRING_MESSED_UP2);
}
static bool8 CanUnnerveContestant(u8 i)
{
eContestResources8.unnervedPokes[i] = 1;
eContestAppealResults.unnervedPokes[i] = 1;
if (eContestantStatus[i].immune)
{
SetContestantEffectStringID(i, CONTEST_STRING_AVOID_SEEING);
@ -1013,32 +1013,32 @@ static bool8 WasAtLeastOneOpponentJammed(void)
s16 jamBuffer[CONTESTANT_COUNT] = {0};
int i;
for (i = 0; eContestResources8.jamQueue[i] != 0xFF; i++)
for (i = 0; eContestAppealResults.jamQueue[i] != 0xFF; i++)
{
u8 contestant = eContestResources8.jamQueue[i];
u8 contestant = eContestAppealResults.jamQueue[i];
if (CanUnnerveContestant(contestant))
{
eContestResources8.jam2 = eContestResources8.jam;
eContestAppealResults.jam2 = eContestAppealResults.jam;
if (eContestantStatus[contestant].moreEasilyStartled)
eContestResources8.jam2 *= 2;
eContestAppealResults.jam2 *= 2;
if (eContestantStatus[contestant].resistant)
{
eContestResources8.jam2 = 10;
eContestAppealResults.jam2 = 10;
SetContestantEffectStringID(contestant, CONTEST_STRING_LITTLE_DISTRACTED);
}
else
{
eContestResources8.jam2 -= eContestantStatus[contestant].jamReduction;
if (eContestResources8.jam2 <= 0)
eContestAppealResults.jam2 -= eContestantStatus[contestant].jamReduction;
if (eContestAppealResults.jam2 <= 0)
{
eContestResources8.jam2 = 0;
eContestAppealResults.jam2 = 0;
SetContestantEffectStringID(contestant, CONTEST_STRING_NOT_FAZED);
}
else
{
JamContestant(contestant, eContestResources8.jam2);
SetStartledString(contestant, eContestResources8.jam2);
jamBuffer[contestant] = eContestResources8.jam2;
JamContestant(contestant, eContestAppealResults.jam2);
SetStartledString(contestant, eContestAppealResults.jam2);
jamBuffer[contestant] = eContestAppealResults.jam2;
}
}
}

View File

@ -12,9 +12,13 @@
static void Task_LinkContest_StartInitFlags(u8);
static void Task_LinkContest_InitFlags(u8);
#define tState data[0]
#define tCategory data[9]
#define tTimer data[11]
#define tState data[0]
#define tDelayTimer data[1]
#define tCategories(i) data[(i) + 1]
#define tLeaderIds(i) data[(i) + 5]
#define tCategory data[9]
#define tTimer data[11]
#define tStandbyState data[12]
bool32 LinkContest_SendBlock(void *src, u16 size)
{
@ -121,7 +125,7 @@ void Task_LinkContest_CommunicateMonsRS(u8 taskId)
{
int i;
if (!LinkContest_TryLinkStandby(&gTasks[taskId].data[12]))
if (!LinkContest_TryLinkStandby(&gTasks[taskId].tStandbyState))
return;
switch (gTasks[taskId].tState)
@ -166,7 +170,7 @@ void Task_LinkContest_CommunicateMonsRS(u8 taskId)
default:
gTasks[taskId].tState = 0;
gTasks[taskId].tTimer = 0;
gTasks[taskId].data[12] = 0;
gTasks[taskId].tStandbyState = 0;
SwitchTaskToFollowupFunc(taskId);
break;
}
@ -206,7 +210,7 @@ void Task_LinkContest_CommunicateCategoryRS(u8 taskId)
{
int i;
if (!LinkContest_TryLinkStandby(&gTasks[taskId].data[12]))
if (!LinkContest_TryLinkStandby(&gTasks[taskId].tStandbyState))
return;
switch (gTasks[taskId].tState)
@ -227,7 +231,7 @@ void Task_LinkContest_CommunicateCategoryRS(u8 taskId)
if (LinkContest_GetBlockReceivedFromAllPlayers())
{
for (i = 0; i < gNumLinkContestPlayers; i++)
gTasks[taskId].data[i + 1] = gBlockRecvBuffer[i][0];
gTasks[taskId].tCategories(i) = gBlockRecvBuffer[i][0];
gTasks[taskId].tState++;
}
@ -242,7 +246,7 @@ void Task_LinkContest_CommunicateCategoryRS(u8 taskId)
default:
gTasks[taskId].tState = 0;
gTasks[taskId].tTimer = 0;
gTasks[taskId].data[12] = 0;
gTasks[taskId].tStandbyState = 0;
SwitchTaskToFollowupFunc(taskId);
break;
}
@ -323,9 +327,9 @@ void Task_LinkContest_CommunicateFinalStandings(u8 taskId)
case 5:
case 8:
case 11:
if (gTasks[taskId].data[1]++ > 10)
if (gTasks[taskId].tDelayTimer++ > 10)
{
gTasks[taskId].data[1] = 0;
gTasks[taskId].tDelayTimer = 0;
gTasks[taskId].tState++;
}
break;
@ -378,7 +382,7 @@ void Task_LinkContest_CommunicateFinalStandings(u8 taskId)
}
}
void sub_80FCC88(u8 taskId)
void Task_LinkContest_CommunicateAppealsState(u8 taskId)
{
switch (gTasks[taskId].tState)
{
@ -400,37 +404,37 @@ void sub_80FCC88(u8 taskId)
case 5:
case 8:
case 11:
if (gTasks[taskId].data[1]++ > 10)
if (gTasks[taskId].tDelayTimer++ > 10)
{
gTasks[taskId].data[1] = 0;
gTasks[taskId].tDelayTimer = 0;
gTasks[taskId].tState++;
}
break;
case 3:
if (IsLinkTaskFinished())
{
if (LinkContest_SendBlock(gContestResources->field_8, sizeof(struct UnknownContestStruct7)) == 1)
if (LinkContest_SendBlock(gContestResources->appealResults, sizeof(struct ContestAppealMoveResults)) == 1)
gTasks[taskId].tState++;
}
break;
case 4:
if (LinkContest_GetBlockReceivedFromAllPlayers())
{
memcpy(gContestResources->field_8, gBlockRecvBuffer[gContestLinkLeaderIndex], sizeof(struct UnknownContestStruct7));
memcpy(gContestResources->appealResults, gBlockRecvBuffer[gContestLinkLeaderIndex], sizeof(struct ContestAppealMoveResults));
gTasks[taskId].tState++;
}
break;
case 6:
if (IsLinkTaskFinished())
{
if (LinkContest_SendBlock(gContestResources->field_10, sizeof(struct UnknownContestStruct5)) == 1)
if (LinkContest_SendBlock(gContestResources->excitement, sizeof(struct ContestExcitement)) == 1)
gTasks[taskId].tState++;
}
break;
case 7:
if (LinkContest_GetBlockReceivedFromAllPlayers())
{
memcpy(gContestResources->field_10, gBlockRecvBuffer[gContestLinkLeaderIndex], sizeof(struct UnknownContestStruct5));
memcpy(gContestResources->excitement, gBlockRecvBuffer[gContestLinkLeaderIndex], sizeof(struct ContestExcitement));
gTasks[taskId].tState++;
}
break;
@ -459,7 +463,7 @@ void Task_LinkContest_CommunicateLeaderIdsRS(u8 taskId)
{
int i;
if (!LinkContest_TryLinkStandby(&gTasks[taskId].data[12]))
if (!LinkContest_TryLinkStandby(&gTasks[taskId].tStandbyState))
return;
switch (gTasks[taskId].tState)
@ -480,7 +484,7 @@ void Task_LinkContest_CommunicateLeaderIdsRS(u8 taskId)
if (LinkContest_GetBlockReceivedFromAllPlayers())
{
for (i = 0; i < CONTESTANT_COUNT; i++)
gTasks[taskId].data[i + 5] = gBlockRecvBuffer[i][0];
gTasks[taskId].tLeaderIds(i) = gBlockRecvBuffer[i][0];
gTasks[taskId].tState++;
}
@ -495,7 +499,7 @@ void Task_LinkContest_CommunicateLeaderIdsRS(u8 taskId)
default:
gTasks[taskId].tState = 0;
gTasks[taskId].tTimer = 0;
gTasks[taskId].data[12] = 0;
gTasks[taskId].tStandbyState = 0;
SwitchTaskToFollowupFunc(taskId);
break;
}
@ -503,7 +507,7 @@ void Task_LinkContest_CommunicateLeaderIdsRS(u8 taskId)
void Task_LinkContest_CommunicateRound1Points(u8 taskId)
{
if (!LinkContest_TryLinkStandby(&gTasks[taskId].data[12]))
if (!LinkContest_TryLinkStandby(&gTasks[taskId].tStandbyState))
return;
switch (gTasks[taskId].tState)
@ -524,7 +528,7 @@ void Task_LinkContest_CommunicateRound1Points(u8 taskId)
break;
default:
gTasks[taskId].tState = 0;
gTasks[taskId].data[12] = 0;
gTasks[taskId].tStandbyState = 0;
SwitchTaskToFollowupFunc(taskId);
break;
}
@ -532,7 +536,7 @@ void Task_LinkContest_CommunicateRound1Points(u8 taskId)
void Task_LinkContest_CommunicateTurnOrder(u8 taskId)
{
if (!LinkContest_TryLinkStandby(&gTasks[taskId].data[12]))
if (!LinkContest_TryLinkStandby(&gTasks[taskId].tStandbyState))
return;
switch (gTasks[taskId].tState)
@ -553,7 +557,7 @@ void Task_LinkContest_CommunicateTurnOrder(u8 taskId)
break;
default:
gTasks[taskId].tState = 0;
gTasks[taskId].data[12] = 0;
gTasks[taskId].tStandbyState = 0;
SwitchTaskToFollowupFunc(taskId);
break;
}