General cleanup of the second half of contest.c

This commit is contained in:
Phlosioneer
2019-04-03 20:43:23 -04:00
parent 3a2ea40188
commit 3b3b2dd031
5 changed files with 246 additions and 234 deletions

View File

@@ -633,7 +633,7 @@ gText_0827E6C4:: @ 827E6C4
.string "{STR_VAR_1} was\n"
.string "unaffected.{PAUSE 0x0F}{PAUSE 0x0F}{PAUSE 0x0F}{PAUSE 0x0F}$"
gText_0827E6E3:: @ 827E6E3
gText_RepeatedAppeal:: @ 827E6E3
.string "{STR_VAR_1} disappointed\n"
.string "by repeating an appeal.{PAUSE 0x0F}{PAUSE 0x0F}{PAUSE 0x0F}{PAUSE 0x0F}$"

View File

@@ -5,6 +5,7 @@
#define CONTESTANT_COUNT 4
#define APPLAUSE_METER_SIZE 5
#define CONTEST_TURN_COUNT 5
#define CONTEST_DEBUG_MODE_OFF 0
// Prints the totalPoints value for each contestant.
@@ -298,9 +299,9 @@ struct Contest
/*0x13*/ s8 applauseLevel;
/*0x19218*/ u8 prevTurnOrder[CONTESTANT_COUNT];
/*0x1921C*/ u32 unk1921C; // saved RNG value?
u16 unk19220[5][4]; // move history?
u8 unk19248[5][4]; // excitement history
u8 applauseMeterSpriteId; // sprite ID
u16 moveHistory[CONTEST_TURN_COUNT][CONTESTANT_COUNT];
u8 excitementHistory[CONTEST_TURN_COUNT][CONTESTANT_COUNT];
u8 applauseMeterSpriteId;
/*0x1925D*/ u8 contestSetupState;
/*0x1925E*/ u8 unk1925E;
};
@@ -483,7 +484,7 @@ u8 sub_80DAE0C(struct Pokemon *pkmn);
void sub_80DB09C(u8 contestCategory);
bool8 IsSpeciesNotUnown(u16 species);
bool8 Contest_IsMonsTurnDisabled(u8 a);
void sub_80DBED4(void);
void SaveLinkContestResults(void);
void SortContestants(bool8 a);
void SetContestantEffectStringID(u8 a, u8 b);
void SetContestantEffectStringID2(u8 a, u8 b);

File diff suppressed because it is too large Load Diff

View File

@@ -1402,7 +1402,7 @@ static void ContestAICmd_unk_63(void)
{
u8 var = sub_81563B0(gAIScriptPtr[1]);
u8 var2 = gAIScriptPtr[2];
u16 move = eContest.unk19220[var2][var];
u16 move = eContest.moveHistory[var2][var];
eContestAI.scriptResult = gContestMoves[move].effect;
gAIScriptPtr += 3;
@@ -1452,7 +1452,7 @@ static void ContestAICmd_unk_68(void)
{
u8 var = sub_81563B0(gAIScriptPtr[1]);
u8 var2 = gAIScriptPtr[2];
s8 result = eContest.unk19248[var2][var];
s8 result = eContest.excitementHistory[var2][var];
eContestAI.scriptResult = result;
gAIScriptPtr += 3;
@@ -1502,7 +1502,7 @@ static void ContestAICmd_unk_6D(void)
{
u8 var = sub_81563B0(gAIScriptPtr[1]);
u8 var2 = gAIScriptPtr[2];
u16 move = eContest.unk19220[var2][var];
u16 move = eContest.moveHistory[var2][var];
eContestAI.scriptResult = gContestEffects[gContestMoves[move].effect].effectType;
gAIScriptPtr += 3;

View File

@@ -356,7 +356,7 @@ static void sub_80F5CE4(u8 taskId)
switch (gTasks[taskId].data[0])
{
case 0:
sub_80DBED4();
SaveLinkContestResults();
if (gContestFinalStandings[gContestPlayerMonIndex] == 0)
{
IncrementGameStat(GAME_STAT_WON_LINK_CONTEST);