From 52a4428ba624b19569418a9c72f60d3494fb71eb Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 11 Jul 2020 20:25:56 -0400 Subject: Begin new contest documentation --- include/contest.h | 158 +++++++++++++++++++++++++----------------------------- 1 file changed, 74 insertions(+), 84 deletions(-) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index a9b1db9ee..b6818f996 100644 --- a/include/contest.h +++ b/include/contest.h @@ -226,7 +226,9 @@ struct ContestPokemon /*0x29*/ u8 smart; // smart /*0x2A*/ u8 tough; // tough /*0x2B*/ u8 sheen; // sheen - /*0x2C*/ u8 unk2C[12]; + u8 highestRank; + bool8 gameCleared; + /*0x2C*/ u8 unk2C[10]; /*0x38*/ u32 personality; // personality /*0x3C*/ u32 otId; // otId }; @@ -252,85 +254,85 @@ struct ContestStruct_field_18 struct Contest { - /*0x0*/ u8 playerMoveChoice; - /*0x1*/ u8 turnNumber; - /*0x2*/ u8 unused2[CONTESTANT_COUNT]; - /*0x6*/ u16 unk1920A_0:1; // Task active flags? - u16 unk1920A_1:1; - u16 unk1920A_2:1; - u16 unk1920A_3:1; - u16 unk1920A_4:1; - u16 isShowingApplauseMeter:1; - u16 applauseMeterIsMoving:1; - u16 unk1920A_7:1; - /*0x7*/ u16 unk1920B_0:1; - u16 unk1920B_1:1; - u16 unk1920B_2:1; - /*0x8*/ u8 mainTaskId; - /*0x9*/ u8 unk1920D[4]; - /*0xD*/ u8 unk19211; - /*0xE*/ u8 unk19212; - /*0xF*/ u8 filler19213; - /*0x10*/ u8 unk19214; - /*0x11*/ u8 unk19215; - /*0x12*/ u8 unk19216; // sprite ID - /*0x13*/ s8 applauseLevel; - /*0x19218*/ u8 prevTurnOrder[CONTESTANT_COUNT]; - /*0x1921C*/ u32 unk1921C; // saved RNG value? + u8 playerMoveChoice; + u8 turnNumber; + u8 unused2[CONTESTANT_COUNT]; + bool16 unk1920A_0:1; // Task active flags? + bool16 unk1920A_1:1; + bool16 unk1920A_2:1; + bool16 unk1920A_3:1; + bool16 unk1920A_4:1; + bool16 isShowingApplauseMeter:1; + bool16 applauseMeterIsMoving:1; + bool16 unk1920A_7:1; + bool16 unk1920B_0:1; + bool16 sliderHeartsAnimating:1; // When the slider heart is appearing/disappearing + bool16 unk1920B_2:1; + u8 mainTaskId; + u8 unk1920D[4]; + u8 unk19211; + u8 unk19212; + u8 filler19213; + u8 unk19214; + u8 unk19215; + u8 unk19216; // sprite ID + s8 applauseLevel; + u8 prevTurnOrder[CONTESTANT_COUNT]; + u32 unk1921C; // saved RNG value? u16 moveHistory[CONTEST_TURN_COUNT][CONTESTANT_COUNT]; u8 excitementHistory[CONTEST_TURN_COUNT][CONTESTANT_COUNT]; u8 applauseMeterSpriteId; - /*0x1925D*/ u8 contestSetupState; - /*0x1925E*/ u8 unk1925E; + u8 contestSetupState; + u8 unk1925E; }; struct ContestantStatus { - /*0x00*/ s16 appeal1; // move appeal? - /*0x02*/ s16 appeal2; // final appeal after end of turn, maybe? - /*0x04*/ s16 pointTotal; - /*0x06*/ u16 currMove; - /*0x08*/ u16 prevMove; - /*0x0A*/ u8 moveCategory; - /*0x0B*/ u8 ranking:2; + s16 appeal1; // move appeal? + s16 appeal2; // final appeal after end of turn, maybe? + s16 pointTotal; + u16 currMove; + u16 prevMove; + u8 moveCategory; + u8 ranking:2; u8 unkB_2:2; u8 moveRepeatCount:3; - u8 noMoreTurns:1; // used a one-time move? - /*0x0C*/ u8 nervous:1; + bool8 noMoreTurns:1; // used a one-time move? + bool8 nervous:1; u8 numTurnsSkipped:2; - /*0x0D*/ s8 condition; - /*0x0E*/ u8 jam; - /*0x0F*/ u8 jamReduction; + s8 condition; + u8 jam; + u8 jamReduction; // Flags set by move effect - /*0x10*/ u8 resistant:1; - u8 immune:1; - u8 moreEasilyStartled:1; - u8 usedRepeatableMove:1; + 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; + u8 turnOrderModAction:2; // 1: made first; 2: made last; 3: made random + 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; - /*0x19*/ u8 nextTurnOrder; // turn position - /*0x1A*/ u8 attentionLevel; // How much the Pokemon "stood out" - /*0x1B*/ u8 unk1B; + u8 jamSafetyCount; + u8 effectStringId; // status action? + u8 effectStringId2; + bool8 repeatedMove:1; + bool8 unused:1; + bool8 repeatedPrevMove:1; // never read + bool8 unk15_3:1; + bool8 hasJudgesAttention:1; + bool8 judgesAttentionWasRemoved:1; + bool8 unk15_6:1; + u8 unk16; + u8 unk17; + u8 unk18; + u8 nextTurnOrder; // turn position + u8 attentionLevel; // How much the Pokemon "stood out" + u8 unk1B; }; struct UnknownContestStruct7 @@ -348,9 +350,9 @@ struct ContestAIInfo /*0x00*/ u8 aiState; /*0x02*/ u16 nextMove; /*0x04*/ u8 nextMoveIndex; - /*0x05*/ u8 unk5[4]; + /*0x05*/ u8 moveScores[MAX_MON_MOVES]; /*0x09*/ u8 aiAction; - /*0x0A*/ u8 fillerA[0x6]; // TODO: don't know what's here + /*0x0A*/ u8 filler[6]; /*0x10*/ u8 currentAICheck; /*0x14*/ u32 aiChecks; /*0x18*/ s16 scriptResult; @@ -370,9 +372,9 @@ struct UnknownContestStruct5 struct UnknownContestStruct4 { - u8 unk0; // sprite ID - u8 unk1; // sprite ID - u8 unk2_0:1; + u8 sliderHeartSpriteId; + u8 nextTurnSpriteId; + u8 sliderUpdating:1; u8 unk2_1:1; u8 unk2_2:1; }; @@ -454,7 +456,7 @@ extern u32 gContestRngValue; void ResetLinkContestBoolean(void); void LoadContestBgAfterMoveAnim(void); void CB2_StartContest(void); -void sub_80DA8C8(u8 partyIndex); +void CreateContestMonFromParty(u8 partyIndex); void sub_80DAB8C(u8 contestType, u8 rank); void sub_80DACBC(u8 contestType, u8 rank, bool32 isPostgame); u8 GetContestEntryEligibility(struct Pokemon *pkmn); @@ -474,18 +476,6 @@ void ResetContestLinkResults(void); bool8 sub_80DEDA8(u8 a); u8 sub_80DEFA8(u8 a, u8 b); void ClearContestWinnerPicsInContestHall(void); -void sub_80DFA08(struct ContestPokemon *mon, s32 language); - -// contest link -void sub_81D9DE4(u8 taskId); -void sub_80FCF40(u8); -void sub_80FCFD0(u8); -void sub_80F8714(u8); -bool32 sub_80FC670(s16 *); -bool32 sub_80FC4F4(void *, u16); -bool8 sub_80FC55C(void); -bool8 sub_80FC530(u8); -u8 sub_80F86E0(u8 *); -void sub_80FC9F8(u8 taskId); +void StripPlayerAndMonNamesForLinkContest(struct ContestPokemon *mon, s32 language); #endif //GUARD_CONTEST_H -- cgit v1.2.3 From aca50c87beaa88f66ca2a8602c23411fd20b0884 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 24 Jul 2020 00:14:53 -0400 Subject: Continue new contest documentation --- include/contest.h | 136 ++++-------------------------------------------------- 1 file changed, 9 insertions(+), 127 deletions(-) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index b6818f996..1cad71705 100644 --- a/include/contest.h +++ b/include/contest.h @@ -15,124 +15,6 @@ enum CONTEST_DEBUG_MODE_PRINT_UNK_D }; -enum -{ - CONTEST_EFFECT_HIGHLY_APPEALING, - CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, - CONTEST_EFFECT_GREAT_APPEAL_BUT_NO_MORE_MOVES, - CONTEST_EFFECT_REPETITION_NOT_BORING, - CONTEST_EFFECT_AVOID_STARTLE_ONCE, - CONTEST_EFFECT_AVOID_STARTLE, - CONTEST_EFFECT_AVOID_STARTLE_SLIGHTLY, - CONTEST_EFFECT_USER_LESS_EASILY_STARTLED, - CONTEST_EFFECT_STARTLE_FRONT_MON, - CONTEST_EFFECT_SLIGHTLY_STARTLE_PREV_MONS, - CONTEST_EFFECT_STARTLE_PREV_MON, - CONTEST_EFFECT_STARTLE_PREV_MONS, - CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, - CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, - CONTEST_EFFECT_STARTLE_PREV_MON_2, - CONTEST_EFFECT_STARTLE_PREV_MONS_2, - CONTEST_EFFECT_SHIFT_JUDGE_ATTENTION, - CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, - CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN, - CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL, - CONTEST_EFFECT_STARTLE_MONS_COOL_APPEAL, - CONTEST_EFFECT_STARTLE_MONS_BEAUTY_APPEAL, - CONTEST_EFFECT_STARTLE_MONS_CUTE_APPEAL, - CONTEST_EFFECT_STARTLE_MONS_SMART_APPEAL, - CONTEST_EFFECT_STARTLE_MONS_TOUGH_APPEAL, - CONTEST_EFFECT_MAKE_FOLLOWING_MON_NERVOUS, - CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, - CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, - CONTEST_EFFECT_BADLY_STARTLES_MONS_IN_GOOD_CONDITION, - CONTEST_EFFECT_BETTER_IF_FIRST, - CONTEST_EFFECT_BETTER_IF_LAST, - CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONES, - CONTEST_EFFECT_APPEAL_AS_GOOD_AS_PREV_ONE, - CONTEST_EFFECT_BETTER_WHEN_LATER, - CONTEST_EFFECT_QUALITY_DEPENDS_ON_TIMING, - CONTEST_EFFECT_BETTER_IF_SAME_TYPE, - CONTEST_EFFECT_BETTER_IF_DIFF_TYPE, - CONTEST_EFFECT_AFFECTED_BY_PREV_APPEAL, - CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, - CONTEST_EFFECT_BETTER_WITH_GOOD_CONDITION, - CONTEST_EFFECT_NEXT_APPEAL_EARLIER, - CONTEST_EFFECT_NEXT_APPEAL_LATER, - CONTEST_EFFECT_MAKE_SCRAMBLING_TURN_ORDER_EASIER, - CONTEST_EFFECT_SCRAMBLE_NEXT_TURN_ORDER, - CONTEST_EFFECT_EXCITE_AUDIENCE_IN_ANY_CONTEST, - CONTEST_EFFECT_BADLY_STARTLE_MONS_WITH_GOOD_APPEALS, - CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED, - CONTEST_EFFECT_DONT_EXCITE_AUDIENCE -}; - -enum -{ - COMBO_STARTER_RAIN_DANCE = 1, - COMBO_STARTER_RAGE, - COMBO_STARTER_FOCUS_ENERGY, - COMBO_STARTER_HYPNOSIS, - COMBO_STARTER_ENDURE, - COMBO_STARTER_HORN_ATTACK, - COMBO_STARTER_SWORDS_DANCE, - COMBO_STARTER_STOCKPILE, - COMBO_STARTER_SUNNY_DAY, - COMBO_STARTER_REST, - COMBO_STARTER_VICE_GRIP, - COMBO_STARTER_DEFENSE_CURL, - COMBO_STARTER_CHARGE, - COMBO_STARTER_ROCK_THROW, - COMBO_STARTER_YAWN, - COMBO_STARTER_SCARY_FACE, - COMBO_STARTER_POWDER_SNOW, - COMBO_STARTER_LOCK_ON, - COMBO_STARTER_SOFT_BOILED, - COMBO_STARTER_MEAN_LOOK, - COMBO_STARTER_SCRATCH, - COMBO_STARTER_GROWTH, - COMBO_STARTER_HAIL, - COMBO_STARTER_SANDSTORM, - COMBO_STARTER_BELLY_DRUM, - COMBO_STARTER_MIND_READER, - COMBO_STARTER_DRAGON_BREATH, - COMBO_STARTER_DRAGON_RAGE, - COMBO_STARTER_DRAGON_DANCE, - COMBO_STARTER_SURF, - COMBO_STARTER_DIVE, - COMBO_STARTER_STRING_SHOT, - COMBO_STARTER_LEER, - COMBO_STARTER_TAUNT, - COMBO_STARTER_CHARM, - COMBO_STARTER_HARDEN, - COMBO_STARTER_SING, - COMBO_STARTER_EARTHQUAKE, - COMBO_STARTER_DOUBLE_TEAM, - COMBO_STARTER_CURSE, - COMBO_STARTER_SWEET_SCENT, - COMBO_STARTER_SLUDGE, - COMBO_STARTER_SLUDGE_BOMB, - COMBO_STARTER_THUNDER_PUNCH, - COMBO_STARTER_FIRE_PUNCH, - COMBO_STARTER_ICE_PUNCH, - COMBO_STARTER_PECK, - COMBO_STARTER_METAL_SOUND, - COMBO_STARTER_MUD_SPORT, - COMBO_STARTER_WATER_SPORT, - COMBO_STARTER_BONE_CLUB, - COMBO_STARTER_BONEMERANG, - COMBO_STARTER_BONE_RUSH, - COMBO_STARTER_SAND_ATTACK, - COMBO_STARTER_MUD_SLAP, - COMBO_STARTER_FAKE_OUT, - COMBO_STARTER_PSYCHIC, - COMBO_STARTER_KINESIS, - COMBO_STARTER_CONFUSION, - COMBO_STARTER_POUND, - COMBO_STARTER_SMOG, - COMBO_STARTER_CALM_MIND -}; - enum { CONTEST_STRING_MORE_CONSCIOUS, @@ -255,7 +137,7 @@ struct ContestStruct_field_18 struct Contest { u8 playerMoveChoice; - u8 turnNumber; + u8 appealNumber; u8 unused2[CONTESTANT_COUNT]; bool16 unk1920A_0:1; // Task active flags? bool16 unk1920A_1:1; @@ -273,14 +155,14 @@ struct Contest u8 unk19211; u8 unk19212; u8 filler19213; - u8 unk19214; - u8 unk19215; + u8 turnNumber; + u8 currentContestant; u8 unk19216; // sprite ID s8 applauseLevel; u8 prevTurnOrder[CONTESTANT_COUNT]; u32 unk1921C; // saved RNG value? - u16 moveHistory[CONTEST_TURN_COUNT][CONTESTANT_COUNT]; - u8 excitementHistory[CONTEST_TURN_COUNT][CONTESTANT_COUNT]; + u16 moveHistory[CONTEST_NUM_APPEALS][CONTESTANT_COUNT]; + u8 excitementHistory[CONTEST_NUM_APPEALS][CONTESTANT_COUNT]; u8 applauseMeterSpriteId; u8 contestSetupState; u8 unk1925E; @@ -431,9 +313,9 @@ struct ContestResources #define eUnknownHeap1A004 (*(struct Shared1A004 *)(gHeap + 0x1a004)) extern struct ContestPokemon gContestMons[CONTESTANT_COUNT]; -extern s16 gContestMonConditions[CONTESTANT_COUNT]; +extern s16 gContestMonRound1Points[CONTESTANT_COUNT]; extern s16 gContestMonTotalPoints[CONTESTANT_COUNT]; -extern s16 gUnknown_02039F10[CONTESTANT_COUNT]; +extern s16 gContestMonAppealPointTotals[CONTESTANT_COUNT]; extern s16 gContestMonRound2Points[CONTESTANT_COUNT]; extern u8 gContestFinalStandings[CONTESTANT_COUNT]; extern u8 gContestMonPartyIndex; @@ -457,8 +339,8 @@ void ResetLinkContestBoolean(void); void LoadContestBgAfterMoveAnim(void); void CB2_StartContest(void); void CreateContestMonFromParty(u8 partyIndex); -void sub_80DAB8C(u8 contestType, u8 rank); -void sub_80DACBC(u8 contestType, u8 rank, bool32 isPostgame); +void SetContestants(u8 contestType, u8 rank); +void SetLinkAIContestants(u8 contestType, u8 rank, bool32 isPostgame); u8 GetContestEntryEligibility(struct Pokemon *pkmn); void sub_80DB09C(u8 contestCategory); bool8 IsSpeciesNotUnown(u16 species); -- cgit v1.2.3 From 4911849723195b1b7228a28bb294072070376b2e Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 13 Aug 2020 03:09:47 -0400 Subject: Document link contest connection --- include/contest.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index 1cad71705..5808cb925 100644 --- a/include/contest.h +++ b/include/contest.h @@ -322,7 +322,7 @@ extern u8 gContestMonPartyIndex; extern u8 gContestPlayerMonIndex; extern u8 gContestantTurnOrder[CONTESTANT_COUNT]; extern u8 gLinkContestFlags; -extern u8 gUnknown_02039F2B; +extern u8 gContestLinkLeaderIndex; extern u16 gSpecialVar_ContestCategory; extern u16 gSpecialVar_ContestRank; extern u8 gNumLinkContestPlayers; @@ -342,7 +342,7 @@ void CreateContestMonFromParty(u8 partyIndex); void SetContestants(u8 contestType, u8 rank); void SetLinkAIContestants(u8 contestType, u8 rank, bool32 isPostgame); u8 GetContestEntryEligibility(struct Pokemon *pkmn); -void sub_80DB09C(u8 contestCategory); +void CalculateRound1Points(u8 contestCategory); bool8 IsSpeciesNotUnown(u16 species); bool8 Contest_IsMonsTurnDisabled(u8 a); void SaveLinkContestResults(void); -- cgit v1.2.3 From c42c1ab8c1aaab06350ba71ceb5b89db42d3d851 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 13 Aug 2020 19:10:23 -0400 Subject: Document contest appeal --- include/contest.h | 70 +++++++++++++++++++++++++++---------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index 5808cb925..c5c674fdc 100644 --- a/include/contest.h +++ b/include/contest.h @@ -123,15 +123,15 @@ struct Shared1A004 u8 savedJunk[0x800]; }; -struct ContestStruct_field_18 +struct ContestMoveAnimData { u16 species; - u16 unk2; - u8 unk4_0:1; - u8 unk5; - u32 unk8; - u32 unkC; - u32 unk10; + u16 targetSpecies; + bool8 hasTargetAnim:1; + u8 contestant; + u32 personality; + u32 otId; + u32 targetPersonality; }; struct Contest @@ -143,29 +143,29 @@ struct Contest bool16 unk1920A_1:1; bool16 unk1920A_2:1; bool16 unk1920A_3:1; - bool16 unk1920A_4:1; + bool16 waitForJudgeSpeechBubble:1; bool16 isShowingApplauseMeter:1; bool16 applauseMeterIsMoving:1; - bool16 unk1920A_7:1; - bool16 unk1920B_0:1; + bool16 animatingAudience:1; + bool16 waitForAudienceBlend:1; bool16 sliderHeartsAnimating:1; // When the slider heart is appearing/disappearing - bool16 unk1920B_2:1; + bool16 waitForLink:1; u8 mainTaskId; u8 unk1920D[4]; - u8 unk19211; + u8 judgeAttentionTaskId; u8 unk19212; u8 filler19213; u8 turnNumber; u8 currentContestant; - u8 unk19216; // sprite ID + u8 judgeSpeechBubbleSpriteId; s8 applauseLevel; u8 prevTurnOrder[CONTESTANT_COUNT]; - u32 unk1921C; // saved RNG value? + u32 unusedRng; u16 moveHistory[CONTEST_NUM_APPEALS][CONTESTANT_COUNT]; u8 excitementHistory[CONTEST_NUM_APPEALS][CONTESTANT_COUNT]; u8 applauseMeterSpriteId; u8 contestSetupState; - u8 unk1925E; + u8 moveAnimTurnCount; }; struct ContestantStatus @@ -177,7 +177,7 @@ struct ContestantStatus u16 prevMove; u8 moveCategory; u8 ranking:2; - u8 unkB_2:2; + u8 unused1:2; u8 moveRepeatCount:3; bool8 noMoreTurns:1; // used a one-time move? bool8 nervous:1; @@ -203,18 +203,18 @@ struct ContestantStatus u8 effectStringId; // status action? u8 effectStringId2; bool8 repeatedMove:1; - bool8 unused:1; + bool8 unused2:1; bool8 repeatedPrevMove:1; // never read bool8 unk15_3:1; bool8 hasJudgesAttention:1; bool8 judgesAttentionWasRemoved:1; - bool8 unk15_6:1; - u8 unk16; + bool8 usedComboMove:1; + bool8 completedCombo; u8 unk17; u8 unk18; u8 nextTurnOrder; // turn position u8 attentionLevel; // How much the Pokemon "stood out" - u8 unk1B; + u8 contestantAnimTarget; }; struct UnknownContestStruct7 @@ -246,7 +246,7 @@ struct ContestAIInfo struct UnknownContestStruct5 { - s8 bits_0; // current move excitement? + s8 moveExcitement; u8 excitementFrozen:1; u8 excitementFreezer:3; s8 unk2; @@ -256,17 +256,17 @@ struct UnknownContestStruct4 { u8 sliderHeartSpriteId; u8 nextTurnSpriteId; - u8 sliderUpdating:1; - u8 unk2_1:1; - u8 unk2_2:1; + bool8 sliderUpdating:1; + bool8 boxBlinking:1; + bool8 updatingAppealHearts:1; }; -struct UnknownContestStruct6 +struct ContestFinalStandings { - s32 unk0; - s32 unk4; - s32 unk8; - s32 unkC; + s32 totalPoints; + s32 round1Points; + s32 random; + s32 contestant; }; struct ContestResourcesField1C @@ -292,12 +292,12 @@ struct ContestResources struct ContestAIInfo *aiData; struct UnknownContestStruct5 *field_10; struct UnknownContestStruct4 *field_14; - struct ContestStruct_field_18 *field_18; + struct ContestMoveAnimData *moveAnim; struct ContestResourcesField1C * field_1c; struct ContestResourcesField20 * field_20; u8 * contestBgTilemaps[CONTESTANT_COUNT]; - void * field_34; - void * field_38; + void * boxBlinkTiles1; + void * boxBlinkTiles2; void * field_3c; }; @@ -307,8 +307,8 @@ struct ContestResources #define eContestAI (*gContestResources->aiData) #define eContestResources10 (*gContestResources->field_10) #define eContestResources14 (*gContestResources->field_14) -#define eUnzippedContestAudienceGfx (gHeap + 0x18000) -#define eUnknownHeap19000 (gHeap + 0x19000) +#define eUnzippedContestAudience_Gfx (gHeap + 0x18000) +#define eContestAudienceFrame2_Gfx (gHeap + 0x19000) #define eContestDebugMode (gHeap[0x1a000]) #define eUnknownHeap1A004 (*(struct Shared1A004 *)(gHeap + 0x1a004)) @@ -352,7 +352,7 @@ void SetContestantEffectStringID2(u8 a, u8 b); void SetStartledString(u8 contestant, u8 jam); void MakeContestantNervous(u8 p); s8 Contest_GetMoveExcitement(u16 move); -bool8 sub_80DE1E8(u8 a); +bool8 IsContestantAllowedToCombo(u8 contestant); void Contest_PrintTextToBg0WindowAt(u32 windowId, u8 *currChar, s32 x, s32 y, s32 fontId); void ResetContestLinkResults(void); bool8 sub_80DEDA8(u8 a); -- cgit v1.2.3 From 9f4525666dca0576f7192528faea81b9ad6e2ea5 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 15 Aug 2020 14:33:08 -0400 Subject: Document misc contest --- include/contest.h | 82 +++++++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index c5c674fdc..208604f4a 100644 --- a/include/contest.h +++ b/include/contest.h @@ -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]) -- cgit v1.2.3 From e98e4652fd252edfde79155d21ee55a80a1f94ce Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 16 Aug 2020 05:07:44 -0400 Subject: Document contest live updates --- include/contest.h | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index 208604f4a..834aba402 100644 --- a/include/contest.h +++ b/include/contest.h @@ -4,17 +4,6 @@ #include "palette.h" #include "constants/contest.h" -enum -{ - CONTEST_DEBUG_MODE_OFF, - // Prints the totalPoints value for each contestant. - CONTEST_DEBUG_MODE_PRINT_POINT_TOTAL, - // Prints the ContestTV::unk_C value as a bitstring for each contestant. - CONTEST_DEBUG_MODE_PRINT_UNK_C, - // Prints the ContestTV::unk_D value as a bitstring for each contestant. - CONTEST_DEBUG_MODE_PRINT_UNK_D -}; - enum { CONTEST_STRING_MORE_CONSCIOUS, @@ -153,7 +142,7 @@ struct Contest u8 mainTaskId; u8 unk1920D[4]; u8 judgeAttentionTaskId; - u8 unk19212; + u8 blendTaskId; u8 filler19213; u8 turnNumber; u8 currentContestant; @@ -211,7 +200,7 @@ struct ContestantStatus bool8 usedComboMove:1; bool8 completedCombo; u8 comboAppealBonus; - u8 unk18; + u8 repeatJam; u8 nextTurnOrder; // turn position u8 attentionLevel; // How much the Pokemon "stood out" u8 contestantAnimTarget; @@ -271,12 +260,12 @@ struct ContestFinalStandings struct ContestTV { - u16 unk0[5]; - s16 unkA; - u8 unkC; - u8 unkD; - u8 unkE_1:1; - u8 unkE_2:1; + u16 appeals[CONTEST_NUM_APPEALS]; + s16 move; + u8 winnerFlags; + u8 loserFlags; + u8 madeAppeal:1; + u8 madeExcitingAppeal:1; }; struct ContestUnused -- cgit v1.2.3 From 2749948eebe65aa8b55738d820e4a0252dd45c1a Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 16 Aug 2020 05:52:17 -0400 Subject: Clean up contest doc --- include/contest.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index 834aba402..e4cda6e25 100644 --- a/include/contest.h +++ b/include/contest.h @@ -127,11 +127,11 @@ struct Contest { u8 playerMoveChoice; u8 appealNumber; - u8 unused2[CONTESTANT_COUNT]; - bool16 unk1920A_0:1; // Task active flags? - bool16 unk1920A_1:1; - bool16 unk1920A_2:1; - bool16 unk1920A_3:1; + u8 unk[CONTESTANT_COUNT]; // never read + bool16 unused1:1; + bool16 unused2:1; + bool16 unused3:1; + bool16 unused4:1; bool16 waitForJudgeSpeechBubble:1; bool16 isShowingApplauseMeter:1; bool16 applauseMeterIsMoving:1; @@ -140,10 +140,10 @@ struct Contest bool16 sliderHeartsAnimating:1; // When the slider heart is appearing/disappearing bool16 waitForLink:1; u8 mainTaskId; - u8 unk1920D[4]; + u8 filler1[4]; u8 judgeAttentionTaskId; u8 blendTaskId; - u8 filler19213; + u8 filler2; u8 turnNumber; u8 currentContestant; u8 judgeSpeechBubbleSpriteId; @@ -159,8 +159,8 @@ struct Contest struct ContestantStatus { - s16 appeal1; // move appeal? - s16 appeal2; // final appeal after end of turn, maybe? + s16 baseAppeal; + s16 appeal; s16 pointTotal; u16 currMove; u16 prevMove; @@ -264,8 +264,8 @@ struct ContestTV s16 move; u8 winnerFlags; u8 loserFlags; - u8 madeAppeal:1; - u8 madeExcitingAppeal:1; + bool8 madeAppeal:1; + bool8 madeExcitingAppeal:1; }; struct ContestUnused -- cgit v1.2.3 From 19cf1b9770d8ec98aec3100a1aa1b9399a8c54bf Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 18 Aug 2020 07:30:18 -0400 Subject: Fix ContestPokemon offset-named field --- include/contest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index e4cda6e25..9a4b3425d 100644 --- a/include/contest.h +++ b/include/contest.h @@ -99,7 +99,7 @@ struct ContestPokemon u8 sheen; u8 highestRank; bool8 gameCleared; - u8 unk2C[10]; + u8 unused[10]; u32 personality; u32 otId; }; -- cgit v1.2.3 From fa29ff98a342f4f434b96d4e04f47e25ca865512 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 18 Aug 2020 11:38:50 -0400 Subject: Add condition mod constants --- include/contest.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index 9a4b3425d..d008b8fce 100644 --- a/include/contest.h +++ b/include/contest.h @@ -77,6 +77,13 @@ enum { CONTEST_FILTER_ONLY_POSTGAME }; +// Constants for changing in-contest Condition (the stars that appear during appeals) +enum { + CONDITION_NO_CHANGE, + CONDITION_GAIN, + CONDITION_LOSE, +}; + struct ContestPokemon { u16 species; -- cgit v1.2.3 From 469ec5f248ce3f3708940dfaedcb1b1c2d6d3380 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 21 Aug 2020 02:36:48 -0400 Subject: Document contest AI commands --- include/contest.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index d008b8fce..d53aec212 100644 --- a/include/contest.h +++ b/include/contest.h @@ -201,7 +201,7 @@ struct ContestantStatus bool8 repeatedMove:1; bool8 unused2:1; bool8 repeatedPrevMove:1; // never read - bool8 unk15_3:1; + bool8 completedComboFlag:1; bool8 hasJudgesAttention:1; bool8 judgesAttentionWasRemoved:1; bool8 usedComboMove:1; @@ -234,7 +234,7 @@ struct ContestAIInfo /*0x10*/ u8 currentAICheck; /*0x14*/ u32 aiChecks; /*0x18*/ s16 scriptResult; - /*0x1A*/ s16 scriptArr[3]; + /*0x1A*/ s16 vars[3]; /*0x20*/ const u8 *stack[8]; /*0x40*/ u8 stackSize; /*0x41*/ u8 contestantId; -- cgit v1.2.3 From fbb70b372743fca1c9323e0011a498e672d4707b Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 21 Aug 2020 14:47:55 -0400 Subject: Document contest AI scripts --- include/contest.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/contest.h') diff --git a/include/contest.h b/include/contest.h index d53aec212..1dd4340bd 100644 --- a/include/contest.h +++ b/include/contest.h @@ -90,7 +90,7 @@ struct ContestPokemon u8 nickname[POKEMON_NAME_LENGTH + 1]; u8 trainerName[PLAYER_NAME_LENGTH + 1]; u8 trainerGfxId; - u32 aiChecks; + u32 aiFlags; u8 whichRank:2; u8 aiPool_Cool:1; u8 aiPool_Beauty:1; @@ -231,8 +231,8 @@ struct ContestAIInfo /*0x05*/ u8 moveScores[MAX_MON_MOVES]; /*0x09*/ u8 aiAction; /*0x0A*/ u8 filler[6]; - /*0x10*/ u8 currentAICheck; - /*0x14*/ u32 aiChecks; + /*0x10*/ u8 currentAIFlag; + /*0x14*/ u32 aiFlags; /*0x18*/ s16 scriptResult; /*0x1A*/ s16 vars[3]; /*0x20*/ const u8 *stack[8]; -- cgit v1.2.3