summaryrefslogtreecommitdiff
path: root/src/contest.c
diff options
context:
space:
mode:
authorKurausukun <lord.uber1@gmail.com>2020-12-10 23:30:52 -0500
committerKurausukun <lord.uber1@gmail.com>2020-12-10 23:30:52 -0500
commit58976ebaa8d73d174940f622ec36f22bcd2fd8a2 (patch)
treec27ab24ed83fdb16654b5814d681af487b119601 /src/contest.c
parent32ae13f9b66ab1b01146e5746e9350f97f055526 (diff)
parent8d29f65c6c7f34aa53ae2e7ae3e4f34a95025602 (diff)
Merge remote-tracking branch 'upstream/master' into berry_crush
Diffstat (limited to 'src/contest.c')
-rw-r--r--src/contest.c80
1 files changed, 42 insertions, 38 deletions
diff --git a/src/contest.c b/src/contest.c
index 61a159bc4..40a0eac66 100644
--- a/src/contest.c
+++ b/src/contest.c
@@ -42,7 +42,6 @@
#include "constants/moves.h"
#include "constants/rgb.h"
#include "constants/songs.h"
-#include "constants/species.h"
#include "constants/tv.h"
// This file's functions.
@@ -951,39 +950,39 @@ const struct SpriteTemplate sSpriteTemplates_ContestantsTurnBlinkEffect[CONTESTA
static const s8 gContestExcitementTable[CONTEST_CATEGORIES_COUNT][CONTEST_CATEGORIES_COUNT] =
{
- [CONTEST_CATEGORY_COOL] = {
- [CONTEST_CATEGORY_COOL] = +1,
- [CONTEST_CATEGORY_BEAUTY] = 0,
- [CONTEST_CATEGORY_CUTE] = -1,
- [CONTEST_CATEGORY_SMART] = -1,
+ [CONTEST_CATEGORY_COOL] = {
+ [CONTEST_CATEGORY_COOL] = +1,
+ [CONTEST_CATEGORY_BEAUTY] = 0,
+ [CONTEST_CATEGORY_CUTE] = -1,
+ [CONTEST_CATEGORY_SMART] = -1,
[CONTEST_CATEGORY_TOUGH] = 0
},
- [CONTEST_CATEGORY_BEAUTY] = {
- [CONTEST_CATEGORY_COOL] = 0,
- [CONTEST_CATEGORY_BEAUTY] = +1,
- [CONTEST_CATEGORY_CUTE] = 0,
- [CONTEST_CATEGORY_SMART] = -1,
+ [CONTEST_CATEGORY_BEAUTY] = {
+ [CONTEST_CATEGORY_COOL] = 0,
+ [CONTEST_CATEGORY_BEAUTY] = +1,
+ [CONTEST_CATEGORY_CUTE] = 0,
+ [CONTEST_CATEGORY_SMART] = -1,
[CONTEST_CATEGORY_TOUGH] = -1
},
[CONTEST_CATEGORY_CUTE] = {
- [CONTEST_CATEGORY_COOL] = -1,
- [CONTEST_CATEGORY_BEAUTY] = 0,
- [CONTEST_CATEGORY_CUTE] = +1,
- [CONTEST_CATEGORY_SMART] = 0,
+ [CONTEST_CATEGORY_COOL] = -1,
+ [CONTEST_CATEGORY_BEAUTY] = 0,
+ [CONTEST_CATEGORY_CUTE] = +1,
+ [CONTEST_CATEGORY_SMART] = 0,
[CONTEST_CATEGORY_TOUGH] = -1
},
[CONTEST_CATEGORY_SMART] = {
- [CONTEST_CATEGORY_COOL] = -1,
- [CONTEST_CATEGORY_BEAUTY] = -1,
- [CONTEST_CATEGORY_CUTE] = 0,
- [CONTEST_CATEGORY_SMART] = +1,
+ [CONTEST_CATEGORY_COOL] = -1,
+ [CONTEST_CATEGORY_BEAUTY] = -1,
+ [CONTEST_CATEGORY_CUTE] = 0,
+ [CONTEST_CATEGORY_SMART] = +1,
[CONTEST_CATEGORY_TOUGH] = 0
},
- [CONTEST_CATEGORY_TOUGH] = {
- [CONTEST_CATEGORY_COOL] = 0,
- [CONTEST_CATEGORY_BEAUTY] = -1,
- [CONTEST_CATEGORY_CUTE] = -1,
- [CONTEST_CATEGORY_SMART] = 0,
+ [CONTEST_CATEGORY_TOUGH] = {
+ [CONTEST_CATEGORY_COOL] = 0,
+ [CONTEST_CATEGORY_BEAUTY] = -1,
+ [CONTEST_CATEGORY_CUTE] = -1,
+ [CONTEST_CATEGORY_SMART] = 0,
[CONTEST_CATEGORY_TOUGH] = +1
}
};
@@ -3408,7 +3407,8 @@ static void GetAllChosenMoves(void)
static void RankContestants(void)
{
- s32 i, j;
+ s32 i;
+ s32 j;
s16 arr[CONTESTANT_COUNT];
for (i = 0; i < CONTESTANT_COUNT; i++)
@@ -3483,7 +3483,8 @@ static bool8 ContestantCanUseTurn(u8 contestant)
{
if (eContestantStatus[contestant].numTurnsSkipped != 0 || eContestantStatus[contestant].noMoreTurns)
return FALSE;
- return TRUE;
+ else
+ return TRUE;
}
static void SetContestantStatusesForNextRound(void)
@@ -3537,7 +3538,8 @@ bool8 Contest_IsMonsTurnDisabled(u8 contestant)
{
if (eContestantStatus[contestant].numTurnsSkipped != 0 || eContestantStatus[contestant].noMoreTurns)
return TRUE;
- return FALSE;
+ else
+ return FALSE;
}
static void CalculateTotalPointsForContestant(u8 contestant)
@@ -4480,14 +4482,17 @@ static void CalculateAppealMoveImpact(u8 contestant)
eContestantStatus[contestant].comboAppealBonus = eContestantStatus[contestant].baseAppeal * eContestantStatus[contestant].completedCombo;
eContestantStatus[contestant].completedComboFlag = TRUE; // Redundant with completedCombo, used by AI
}
- else if (gContestMoves[eContestantStatus[contestant].currMove].comboStarterId != 0)
- {
- eContestantStatus[contestant].hasJudgesAttention = TRUE;
- eContestantStatus[contestant].usedComboMove = TRUE;
- }
else
{
- eContestantStatus[contestant].hasJudgesAttention = FALSE;
+ if (gContestMoves[eContestantStatus[contestant].currMove].comboStarterId != 0)
+ {
+ eContestantStatus[contestant].hasJudgesAttention = TRUE;
+ eContestantStatus[contestant].usedComboMove = TRUE;
+ }
+ else
+ {
+ eContestantStatus[contestant].hasJudgesAttention = FALSE;
+ }
}
}
if (eContestantStatus[contestant].repeatedMove)
@@ -5010,7 +5015,7 @@ static void ShowHideNextTurnGfx(bool8 show)
{
if (eContestantStatus[i].turnOrderMod != 0 && show)
{
- CpuCopy32(GetTurnOrderNumberGfx(i), (void *)(VRAM + 0x10000 + (gSprites[eContestGfxState[i].nextTurnSpriteId].oam.tileNum + 6) * 32), 32);
+ CpuCopy32(GetTurnOrderNumberGfx(i), (void *)(OBJ_VRAM0 + (gSprites[eContestGfxState[i].nextTurnSpriteId].oam.tileNum + 6) * 32), 32);
gSprites[eContestGfxState[i].nextTurnSpriteId].pos1.y = sNextTurnSpriteYPositions[gContestantTurnOrder[i]];
gSprites[eContestGfxState[i].nextTurnSpriteId].invisible = FALSE;
}
@@ -5411,7 +5416,7 @@ static void Contest_PrintTextToBg0WindowStd(u32 windowId, const u8 *b)
printerTemplate.currentY = 1;
printerTemplate.letterSpacing = 0;
printerTemplate.lineSpacing = 0;
- printerTemplate.style = 0;
+ printerTemplate.unk = 0;
printerTemplate.fgColor = 15;
printerTemplate.bgColor = 0;
printerTemplate.shadowColor = 8;
@@ -5434,7 +5439,7 @@ void Contest_PrintTextToBg0WindowAt(u32 windowId, u8 *currChar, s32 x, s32 y, s3
printerTemplate.currentY = y;
printerTemplate.letterSpacing = 0;
printerTemplate.lineSpacing = 0;
- printerTemplate.style = 0;
+ printerTemplate.unk = 0;
printerTemplate.fgColor = 15;
printerTemplate.bgColor = 0;
printerTemplate.shadowColor = 8;
@@ -5458,7 +5463,7 @@ static void Contest_StartTextPrinter(const u8 *currChar, bool32 b)
printerTemplate.currentY = 1;
printerTemplate.letterSpacing = 0;
printerTemplate.lineSpacing = 0;
- printerTemplate.style = 0;
+ printerTemplate.unk = 0;
printerTemplate.fgColor = 1;
printerTemplate.bgColor = 0;
printerTemplate.shadowColor = 8;
@@ -6093,4 +6098,3 @@ void StripPlayerAndMonNamesForLinkContest(struct ContestPokemon *mon, s32 langua
}
}
-