diff options
Diffstat (limited to 'include/contest.h')
-rw-r--r-- | include/contest.h | 228 |
1 files changed, 122 insertions, 106 deletions
diff --git a/include/contest.h b/include/contest.h index bf2613fe3..ff1492e81 100644 --- a/include/contest.h +++ b/include/contest.h @@ -13,6 +13,38 @@ enum enum { + CONTEST_WINNER_ARTIST, + CONTEST_WINNER_NORMAL, + CONTEST_WINNER_SUPER, + CONTEST_WINNER_HYPER_1, + CONTEST_WINNER_HYPER_2, + CONTEST_WINNER_HYPER_3, + CONTEST_WINNER_MASTER_1, + CONTEST_WINNER_MASTER_2, + CONTEST_WINNER_MASTER_3, + NUM_CONTEST_HALL_WINNERS = CONTEST_WINNER_MASTER_3, + MUSEUM_CONTEST_WINNERS_START = CONTEST_WINNER_MASTER_3, + CONTEST_WINNER_MUSEUM_COOL, + CONTEST_WINNER_MUSEUM_BEAUTY, + CONTEST_WINNER_MUSEUM_CUTE, + CONTEST_WINNER_MUSEUM_SMART, + CONTEST_WINNER_MUSEUM_TOUGH, +}; + +enum +{ + CONTEST_RANK_NORMAL, + CONTEST_RANK_SUPER, + CONTEST_RANK_HYPER, + CONTEST_RANK_MASTER, + CONTEST_RANK_LINK +}; + +#define CONTEST_SAVE_FOR_MUSEUM ((u8)-1) +#define CONTEST_SAVE_FOR_ARTIST ((u8)-2) + +enum +{ CONTEST_EFFECT_HIGHLY_APPEALING, CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, CONTEST_EFFECT_GREAT_APPEAL_BUT_NO_MORE_MOVES, @@ -263,130 +295,127 @@ void CB2_StartContest(void); void Contest_CreatePlayerMon(u8); void Contest_InitAllPokemon(u8, u8); u8 CanMonParticipateInContest(struct Pokemon *party); -u16 InitContestMonConditionI(u8, u8); -void InitContestMonConditions(u8); +u16 CalculateContestantRound1Points(u8, u8); +void CalculateRound1Points(u8); u8 IsSpeciesNotUnown(u16); -void sub_80AF668(void); -void sub_80B0F28(u8); +void CalculateFinalScores(void); +void SortContestants(u8); bool8 Contest_SaveWinner(u8); -u8 sub_80B2C4C(u8, u8); +u8 GetContestWinnerSaveIdx(u8, u8); void Contest_ResetWinners(void); s8 Contest_GetMoveExcitement(u16); // Contest Shared EWRAM -struct Shared18000 +struct ContestTempSave { - /*0x18000*/ u8 unk18000; - /*0x18001*/ u8 filler18001[3]; - /*0x18004*/ u16 unk18004[16][16]; - /*0x18204*/ u16 unk18204[0x200]; - /*0x18604*/ u16 unk18604[0x200]; - /*0x18A04*/ u8 unk18A04[0x800]; + /*0x18004*/ u16 cachedWindowPalettes[16][16]; + /*0x18204*/ u16 cachedPlttBufferUnfaded[0x200]; + /*0x18604*/ u16 cachedPlttBufferFaded[0x200]; + /*0x18A04*/ u8 savedJunk[0x800]; }; struct Contest { /*0x19204*/ u8 playerMoveChoice; - /*0x19205*/ u8 turnNumber; + /*0x19205*/ u8 appealNumber; /*0x19206*/ u8 unk19206[4]; // seems to only be used by an unref function - /*0x1920A*/ u16 unk1920A_0:1; // Task active flags? - u16 unk1920A_1:1; - u16 unk1920A_2:1; - u16 unk1920A_3:1; - u16 unk1920A_4:1; - u16 unk1920A_5:1; - u16 unk1920A_6:1; - u16 unk1920A_7:1; - /*0x1920B*/ u16 unk1920B_0:1; - u16 unk1920B_1:1; - u16 unk1920B_2:1; + /*0x1920A*/ bool16 unk1920A_0:1; // Task active flags? + bool16 unk1920A_1:1; + bool16 unk1920A_2:1; + bool16 unk1920A_3:1; + bool16 waitForJudgeSpeechBubble:1; + bool16 isShowingApplauseMeter:1; + bool16 applauseMeterIsMoving:1; + bool16 animatingAudience:1; + /*0x1920B*/ bool16 waitForAudienceBlend:1; + bool16 sliderHeartsAnimating:1; + bool16 waitForLink:1; /*0x1920C*/ u8 mainTaskId; /*0x1920D*/ u8 unk1920D[4]; - /*0x19211*/ u8 unk19211; - /*0x19212*/ u8 unk19212; + /*0x19211*/ u8 judgeAttentionTaskId; + /*0x19212*/ u8 blendTaskId; /*0x19213*/ u8 filler19213; - /*0x19214*/ u8 unk19214; - /*0x19215*/ u8 unk19215; - /*0x19216*/ u8 unk19216; // sprite ID + /*0x19214*/ u8 turnNumber; + /*0x19215*/ u8 currentContestant; + /*0x19216*/ u8 judgeSpeechBubbleSpriteId; /*0x19217*/ s8 applauseLevel; - /*0x19218*/ u8 unk19218[4]; - /*0x1921C*/ u32 unk1921C; // saved RNG value? - u16 unk19220[5][4]; // move history? - u8 unk19248[5][4]; // excitement history + /*0x19218*/ u8 prevTurnOrder[4]; + /*0x1921C*/ u32 unusedRng; // saved RNG value? + u16 moveHistory[5][4]; // move history? + u8 excitementHistory[5][4]; // excitement history u8 applauseMeterSpriteId; // sprite ID - /*0x1925D*/ u8 unk1925D; - /*0x1925E*/ u8 unk1925E; + /*0x1925D*/ u8 contestSetupState; + /*0x1925E*/ u8 moveAnimTurnCount; }; struct ContestantStatus { - /*0x00*/ s16 appeal1; // move appeal? - /*0x02*/ s16 appeal2; // final appeal after end of turn, maybe? - /*0x04*/ s16 unk4; + /*0x00*/ s16 baseAppeal; + /*0x02*/ s16 appeal; + /*0x04*/ s16 pointTotal; /*0x06*/ u16 currMove; /*0x08*/ u16 prevMove; /*0x0A*/ u8 moveCategory; - /*0x0B*/ u8 unkB_0:2; - u8 unkB_2:2; + /*0x0B*/ u8 ranking:2; + u8 unkB_2:2; // unused u8 moveRepeatCount:3; - u8 noMoreTurns:1; // used a one-time move? - /*0x0C*/ u8 nervous:1; + bool8 noMoreTurns:1; // used a one-time move? + /*0x0C*/ bool8 nervous:1; u8 numTurnsSkipped:2; /*0x0D*/ s8 condition; /*0x0E*/ u8 jam; /*0x0F*/ u8 jamReduction; // Flags set by move effect - /*0x10*/ u8 resistant:1; - u8 immune:1; - u8 moreEasilyStartled:1; - u8 usedRepeatableMove:1; + /*0x10*/ bool8 resistant:1; + bool8 immune:1; + bool8 moreEasilyStartled:1; + bool8 usedRepeatableMove:1; u8 conditionMod:2; // 1: just raised condition; 2: appeal greatly improved by condition u8 turnOrderMod:2; // 1: defined; 2: random /*0x11*/ u8 turnOrderModAction:2; // 1: made first; 2: made last; 3: made random - u8 turnSkipped:1; - u8 exploded:1; - u8 overrideCategoryExcitementMod:1; - u8 appealTripleCondition:1; + bool8 turnSkipped:1; + bool8 exploded:1; + bool8 overrideCategoryExcitementMod:1; + bool8 appealTripleCondition:1; /*0x12*/ u8 jamSafetyCount; /*0x13*/ u8 effectStringId; // status action? /*0x14*/ u8 effectStringId2; - /*0x15*/ u8 disappointedRepeat:1; - u8 unk15_1:1; - u8 unk15_2:1; - u8 unk15_3:1; - u8 hasJudgesAttention:1; - u8 judgesAttentionWasRemoved:1; - u8 unk15_6:1; - /*0x16*/ u8 unk16; - /*0x17*/ u8 unk17; - /*0x18*/ u8 unk18; + /*0x15*/ bool8 repeatedMove:1; + bool8 unk15_1:1; // unused + bool8 repeatedPrevMove:1; + bool8 completedComboFlag:1; + bool8 hasJudgesAttention:1; + bool8 judgesAttentionWasRemoved:1; + bool8 usedComboMove:1; + /*0x16*/ u8 completedCombo; + /*0x17*/ u8 comboAppealBonus; + /*0x18*/ u8 repeatJam; /*0x19*/ u8 nextTurnOrder; // turn position /*0x1A*/ u8 attentionLevel; // How much the Pokemon "stood out" - /*0x1B*/ u8 unk1B; + /*0x1B*/ u8 contestantAnimTarget; }; -// possibly the same as UnknownContestStruct3? -struct UnknownContestStruct4 +struct ContestGfxState { - u8 unk0; // sprite ID - u8 unk1; // sprite ID - u8 unk2_0:1; - u8 unk2_1:1; - u8 unk2_2:1; + u8 sliderHeartSpriteId; + u8 nextTurnSpriteId; + bool8 sliderUpdating:1; + bool8 boxBlinking:1; + bool8 updatingAppealHearts:1; }; -struct UnknownContestStruct5 +struct ContestExcitement { - s8 bits_0; // current move excitement? - u8 excitementFrozen:1; + s8 moveExcitement; + bool8 excitementFrozen:1; u8 excitementFreezer:3; - s8 unk2; + s8 excitementAppealBonus; }; -struct UnknownContestStruct7 +struct ContestAppealMoveResults { u8 turnOrder[4]; s16 jam; @@ -396,49 +425,36 @@ struct UnknownContestStruct7 u8 contestant; }; -struct UnknownContestStruct8 +struct ContestMoveAnim { - u16 unk0; - u16 unk2; - u8 unk4_0:1; - u8 unk5; - u32 unk8; - u32 unkC; + u16 species; + u16 targetSpecies; + bool8 hasTargetAnim :1; + u8 contestant; + u32 personality; + u32 otId; u32 unk10; }; -struct UnknownContestStruct6 +struct ContestFinalStandings { - s32 unk0; - s32 unk4; - s32 unk8; - s32 unkC; + s32 totalPoints; + s32 round1Points; + s32 random; + s32 contestant; }; -// TODO: Please move these to ewram.h once the defines are settled down and figured out completely. -#define shared15800 (gSharedMem + 0x15800) -#define shared15DE0 (*(struct ContestWinner *)(gSharedMem + 0x15DE0)) -#define shared16800 (gSharedMem + 0x16800) -#define shared18000 (*(struct Shared18000 *)(gSharedMem + 0x18000)) -#define shared18004 ((u16 *)(gSharedMem + 0x18004)) -#define sContest (*(struct Contest *)(gSharedMem + 0x19204)) -#define sContestantStatus ((struct ContestantStatus *)(gSharedMem + 0x19260)) -#define shared192E4 (gSharedMem + 0x192E4) -#define shared19328 (*(struct UnknownContestStruct5 *)(gSharedMem + 0x19328)) -#define shared19338 ((struct UnknownContestStruct4 *)(gSharedMem + 0x19338)) -#define shared19348 (*(struct UnknownContestStruct8 *)(gSharedMem + 0x19348)) - extern u8 gContestPlayerMonIndex; extern u8 gIsLinkContest; extern u32 gContestRngValue; -extern u8 gUnknown_02038696[4]; -extern s16 gContestMonConditions[4]; -extern s16 gUnknown_02038678[4]; -extern s16 gUnknown_02038680[4]; -extern s16 gUnknown_02038688[4]; +extern u8 gContestantTurnOrder[4]; +extern s16 gContestMonRound1Points[4]; +extern s16 gContestMonTotalPoints[4]; +extern s16 gContestMonAppealPointTotals[4]; +extern s16 gContestMonRound2Points[4]; extern u8 gContestFinalStandings[4]; -extern u8 gUnknown_02038696[4]; -extern u8 gUnknown_0203869B; +extern u8 gContestantTurnOrder[4]; +extern u8 gContestLinkLeaderIndex; extern u16 gSpecialVar_ContestRank; extern u16 gSpecialVar_ContestCategory; extern u8 gContestMonPartyIndex; @@ -447,7 +463,7 @@ void SetContestantEffectStringID(u8 a, u8 b); void SetContestantEffectStringID2(u8 a, u8 b); void MakeContestantNervous(u8 p); bool8 Contest_IsMonsTurnDisabled(u8 a); -bool8 sub_80B214C(u8 a); +bool8 IsContestantAllowedToCombo(u8 contestant); void SetStartledString(u8 a, u8 b); #endif // GUARD_CONTEST_H |