Document contest live updates

This commit is contained in:
GriffinR 2020-08-16 05:07:44 -04:00
parent 9f4525666d
commit e98e4652fd
8 changed files with 732 additions and 658 deletions

View File

@ -2436,7 +2436,7 @@ gTVSafariFanClubText10:: @ 08289D33
.string "and make the challenge yourself!\p" .string "and make the challenge yourself!\p"
.string "Until next time, cheerio!$" .string "Until next time, cheerio!$"
gTVContestLiveUpdatesText00:: @ 08289DD6 ContestLiveUpdates_Text_Intro:: @ 08289DD6
.string "“POKéMON CONTEST LIVE UPDATES!”\p" .string "“POKéMON CONTEST LIVE UPDATES!”\p"
.string "MC: Thanks for joining us!\p" .string "MC: Thanks for joining us!\p"
.string "We're live from the just-ended\n" .string "We're live from the just-ended\n"
@ -2455,117 +2455,117 @@ gTVContestLiveUpdatesText00:: @ 08289DD6
.string "MC: Let's hear what the fans have\n" .string "MC: Let's hear what the fans have\n"
.string "to say about this CONTEST.$" .string "to say about this CONTEST.$"
gTVContestLiveUpdatesText01:: @ 08289F53 ContestLiveUpdates_Text_WonBothRounds:: @ 08289F53
.string "Spectator: The {STR_VAR_2} was tops in\n" .string "Spectator: The {STR_VAR_2} was tops in\n"
.string "both primary and secondary judging!\p" .string "both primary and secondary judging!\p"
.string "That {STR_VAR_2} will keep winning!$" .string "That {STR_VAR_2} will keep winning!$"
gTVContestLiveUpdatesText02:: @ 08289FB0 ContestLiveUpdates_Text_BetterRound2:: @ 08289FB0
.string "Spectator: The {STR_VAR_2} didn't do\n" .string "Spectator: The {STR_VAR_2} didn't do\n"
.string "well in the primary judging, but it\l" .string "well in the primary judging, but it\l"
.string "cleaned up in the secondary judging!\p" .string "cleaned up in the secondary judging!\p"
.string "It was a miraculous comeback\n" .string "It was a miraculous comeback\n"
.string "for that {STR_VAR_2}. Yippee!$" .string "for that {STR_VAR_2}. Yippee!$"
gTVContestLiveUpdatesText03:: @ 0828A047 ContestLiveUpdates_Text_EqualRounds:: @ 0828A047
.string "Spectator: The {STR_VAR_2} remained\n" .string "Spectator: The {STR_VAR_2} remained\n"
.string "consistent throughout both primary\l" .string "consistent throughout both primary\l"
.string "and secondary judging.\p" .string "and secondary judging.\p"
.string "{STR_VAR_3} and the {STR_VAR_2},\n" .string "{STR_VAR_3} and the {STR_VAR_2},\n"
.string "they're no ordinary combo!$" .string "they're no ordinary combo!$"
gTVContestLiveUpdatesText04:: @ 0828A0C6 ContestLiveUpdates_Text_BetterRound1:: @ 0828A0C6
.string "Spectator: In terms of being {STR_VAR_1},\n" .string "Spectator: In terms of being {STR_VAR_1},\n"
.string "that {STR_VAR_2} was outstanding.\p" .string "that {STR_VAR_2} was outstanding.\p"
.string "I hope it makes better appeals\n" .string "I hope it makes better appeals\n"
.string "next time, though.$" .string "next time, though.$"
gTVContestLiveUpdatesText05:: @ 0828A132 ContestLiveUpdates_Text_GotNervous:: @ 0828A132
.string "Spectator: When the {STR_VAR_2} got\n" .string "Spectator: When the {STR_VAR_2} got\n"
.string "nervous, I couldn't stop myself from\l" .string "nervous, I couldn't stop myself from\l"
.string "shouting encouragement.\p" .string "shouting encouragement.\p"
.string "I'd like to say this to that\n" .string "I'd like to say this to that\n"
.string "{STR_VAR_2}, “Congratulations!”$" .string "{STR_VAR_2}, “Congratulations!”$"
gTVContestLiveUpdatesText06:: @ 0828A1BE ContestLiveUpdates_Text_StartledFoes:: @ 0828A1BE
.string "Spectator: That {STR_VAR_2}'s appeal\n" .string "Spectator: That {STR_VAR_2}'s appeal\n"
.string "startled even me!\p" .string "startled even me!\p"
.string "{STR_VAR_2}, you were awesome!$" .string "{STR_VAR_2}, you were awesome!$"
gTVContestLiveUpdatesText07:: @ 0828A202 ContestLiveUpdates_Text_UsedCombo:: @ 0828A202
.string "Spectator: That {STR_VAR_2}'s combo\n" .string "Spectator: That {STR_VAR_2}'s combo\n"
.string "appeal was stunning!\p" .string "appeal was stunning!\p"
.string "It's shaken me to the core!$" .string "It's shaken me to the core!$"
gTVContestLiveUpdatesText08:: @ 0828A24E ContestLiveUpdates_Text_ExcitingAppeal:: @ 0828A24E
.string "Spectator: The winning {STR_VAR_2}'s\n" .string "Spectator: The winning {STR_VAR_2}'s\n"
.string "appeal got my heart pounding!$" .string "appeal got my heart pounding!$"
gTVContestLiveUpdatesText09:: @ 0828A288 ContestLiveUpdates_Text_WasCool:: @ 0828A288
.string "{STR_VAR_2}!\n" .string "{STR_VAR_2}!\n"
.string "You were cool!$" .string "You were cool!$"
gTVContestLiveUpdatesText10:: @ 0828A29B ContestLiveUpdates_Text_WasBeautiful:: @ 0828A29B
.string "{STR_VAR_2}!\n" .string "{STR_VAR_2}!\n"
.string "You were beautiful!$" .string "You were beautiful!$"
gTVContestLiveUpdatesText11:: @ 0828A2B3 ContestLiveUpdates_Text_WasCute:: @ 0828A2B3
.string "{STR_VAR_2}!\n" .string "{STR_VAR_2}!\n"
.string "You were cute!$" .string "You were cute!$"
gTVContestLiveUpdatesText12:: @ 0828A2C6 ContestLiveUpdates_Text_WasSmart:: @ 0828A2C6
.string "{STR_VAR_2}!\n" .string "{STR_VAR_2}!\n"
.string "You were smart!$" .string "You were smart!$"
gTVContestLiveUpdatesText13:: @ 0828A2DA ContestLiveUpdates_Text_WasTough:: @ 0828A2DA
.string "{STR_VAR_2}!\n" .string "{STR_VAR_2}!\n"
.string "You were tough!$" .string "You were tough!$"
gTVContestLiveUpdatesText14:: @ 0828A2EE ContestLiveUpdates_Text_VeryExcitingAppeal:: @ 0828A2EE
.string "Spectator: The winning {STR_VAR_2}'s\n" .string "Spectator: The winning {STR_VAR_2}'s\n"
.string "appeal still has my heart pounding!$" .string "appeal still has my heart pounding!$"
gTVContestLiveUpdatesText15:: @ 0828A32E ContestLiveUpdates_Text_VeryCool:: @ 0828A32E
.string "{STR_VAR_2}!\n" .string "{STR_VAR_2}!\n"
.string "You're the last word in cool!$" .string "You're the last word in cool!$"
gTVContestLiveUpdatesText16:: @ 0828A350 ContestLiveUpdates_Text_VeryBeautiful:: @ 0828A350
.string "{STR_VAR_2}!\n" .string "{STR_VAR_2}!\n"
.string "You're the most beautiful!$" .string "You're the most beautiful!$"
gTVContestLiveUpdatesText17:: @ 0828A36F ContestLiveUpdates_Text_VeryCute:: @ 0828A36F
.string "{STR_VAR_2}!\n" .string "{STR_VAR_2}!\n"
.string "You're simply the cutest!$" .string "You're simply the cutest!$"
gTVContestLiveUpdatesText18:: @ 0828A38D ContestLiveUpdates_Text_VerySmart:: @ 0828A38D
.string "{STR_VAR_2}!\n" .string "{STR_VAR_2}!\n"
.string "You're the smartest among the smart!$" .string "You're the smartest among the smart!$"
gTVContestLiveUpdatesText19:: @ 0828A3B6 ContestLiveUpdates_Text_VeryTough:: @ 0828A3B6
.string "{STR_VAR_2}!\n" .string "{STR_VAR_2}!\n"
.string "You're the toughest of the tough!$" .string "You're the toughest of the tough!$"
gTVContestLiveUpdatesText20:: @ 0828A3DC ContestLiveUpdates_Text_TookBreak:: @ 0828A3DC
.string "Spectator: Even when the {STR_VAR_2}\n" .string "Spectator: Even when the {STR_VAR_2}\n"
.string "took a break from making appeals,\l" .string "took a break from making appeals,\l"
.string "I couldn't take my eyes off it.\p" .string "I couldn't take my eyes off it.\p"
.string "I'm captivated by that {STR_VAR_2}.$" .string "I'm captivated by that {STR_VAR_2}.$"
gTVContestLiveUpdatesText21:: @ 0828A455 ContestLiveUpdates_Text_GotStartled:: @ 0828A455
.string "Spectator: When the {STR_VAR_2} was\n" .string "Spectator: When the {STR_VAR_2} was\n"
.string "startled by another POKéMON's appeal,\l" .string "startled by another POKéMON's appeal,\l"
.string "I was close to tears.\p" .string "I was close to tears.\p"
.string "{STR_VAR_2}, you were resilient!\n" .string "{STR_VAR_2}, you were resilient!\n"
.string "Way to go!$" .string "Way to go!$"
gTVContestLiveUpdatesText22:: @ 0828A4CF ContestLiveUpdates_Text_MoveWonderful:: @ 0828A4CF
.string "Spectator: Oh…\n" .string "Spectator: Oh…\n"
.string "That {STR_VAR_2}'s {STR_VAR_3}!\l" .string "That {STR_VAR_2}'s {STR_VAR_3}!\l"
.string "{STR_VAR_2}'s {STR_VAR_3}!\l" .string "{STR_VAR_2}'s {STR_VAR_3}!\l"
.string "{STR_VAR_2}'s {STR_VAR_3}!\l" .string "{STR_VAR_2}'s {STR_VAR_3}!\l"
.string "How could it be so wonderful?$" .string "How could it be so wonderful?$"
gTVContestLiveUpdatesText23:: @ 0828A51C ContestLiveUpdates_Text_TalkAboutAnotherMon:: @ 0828A51C
.string "MC: Well, there you have it. This place\n" .string "MC: Well, there you have it. This place\n"
.string "is full of the {STR_VAR_1}'s fans!\p" .string "is full of the {STR_VAR_1}'s fans!\p"
.string "I should also mention that another\n" .string "I should also mention that another\n"
@ -2573,20 +2573,20 @@ gTVContestLiveUpdatesText23:: @ 0828A51C
.string "caught my eye.\p" .string "caught my eye.\p"
.string "{STR_VAR_2}'s {STR_VAR_3}…$" .string "{STR_VAR_2}'s {STR_VAR_3}…$"
gTVContestLiveUpdatesText24:: @ 0828A5AC ContestLiveUpdates_Text_FailedToAppeal:: @ 0828A5AC
.string "It failed to make a single appeal during\n" .string "It failed to make a single appeal during\n"
.string "secondary judging out of nervousness.\p" .string "secondary judging out of nervousness.\p"
.string "Next time, I would like to see this\n" .string "Next time, I would like to see this\n"
.string "{STR_VAR_1} make even one appeal.$" .string "{STR_VAR_1} make even one appeal.$"
gTVContestLiveUpdatesText25:: @ 0828A638 ContestLiveUpdates_Text_LastInBothRounds:: @ 0828A638
.string "It came dead last in both primary\n" .string "It came dead last in both primary\n"
.string "and secondary judging.\p" .string "and secondary judging.\p"
.string "I hope that {STR_VAR_1} will retrain this\n" .string "I hope that {STR_VAR_1} will retrain this\n"
.string "{STR_VAR_2} and erase the shame of\l" .string "{STR_VAR_2} and erase the shame of\l"
.string "this undisputed last-place finish.$" .string "this undisputed last-place finish.$"
gTVContestLiveUpdatesText26:: @ 0828A6CF ContestLiveUpdates_Text_NotExcitingEnough:: @ 0828A6CF
.string "It failed to take advantage of\n" .string "It failed to take advantage of\n"
.string "the audience's excitement and make\l" .string "the audience's excitement and make\l"
.string "an appropriate appeal.\p" .string "an appropriate appeal.\p"
@ -2594,7 +2594,7 @@ gTVContestLiveUpdatesText26:: @ 0828A6CF
.string "a feel for the audience and whip their\l" .string "a feel for the audience and whip their\l"
.string "excitement to a fever pitch next time.$" .string "excitement to a fever pitch next time.$"
gTVContestLiveUpdatesText27:: @ 0828A797 ContestLiveUpdates_Text_LostAfterWinningRound1:: @ 0828A797
.string "While finishing first in the primary\n" .string "While finishing first in the primary\n"
.string "judging, its appeals in the secondary\l" .string "judging, its appeals in the secondary\l"
.string "judging failed to click.\p" .string "judging failed to click.\p"
@ -2603,14 +2603,14 @@ gTVContestLiveUpdatesText27:: @ 0828A797
.string "I'm sure {STR_VAR_1} is studying how to\n" .string "I'm sure {STR_VAR_1} is studying how to\n"
.string "make more effective appeals now.$" .string "make more effective appeals now.$"
gTVContestLiveUpdatesText28:: @ 0828A86D ContestLiveUpdates_Text_NeverExciting:: @ 0828A86D
.string "The audience never got excited by its\n" .string "The audience never got excited by its\n"
.string "appeals during the secondary judging.\p" .string "appeals during the secondary judging.\p"
.string "We hope it will stop worrying about\n" .string "We hope it will stop worrying about\n"
.string "other POKéMON and learn to pitch\l" .string "other POKéMON and learn to pitch\l"
.string "its appeals to the audience more.$" .string "its appeals to the audience more.$"
gTVContestLiveUpdatesText29:: @ 0828A920 ContestLiveUpdates_Text_LostBySmallMargin:: @ 0828A920
.string "It lost to {STR_VAR_1}'s {STR_VAR_2}\n" .string "It lost to {STR_VAR_1}'s {STR_VAR_2}\n"
.string "by only a small margin.\p" .string "by only a small margin.\p"
.string "It must be heartbreaking to come\n" .string "It must be heartbreaking to come\n"
@ -2618,7 +2618,7 @@ gTVContestLiveUpdatesText29:: @ 0828A920
.string "I wouldn't be surprised if {STR_VAR_3}\n" .string "I wouldn't be surprised if {STR_VAR_3}\n"
.string "were weeping over this outcome.$" .string "were weeping over this outcome.$"
gTVContestLiveUpdatesText30:: @ 0828A9CC ContestLiveUpdates_Text_RepeatedAppeals:: @ 0828A9CC
.string "It disappointed the JUDGE by\n" .string "It disappointed the JUDGE by\n"
.string "repeating the same appeals.\p" .string "repeating the same appeals.\p"
.string "It's an unforgivable error in any\n" .string "It's an unforgivable error in any\n"
@ -2626,14 +2626,14 @@ gTVContestLiveUpdatesText30:: @ 0828A9CC
.string "{STR_VAR_1} should feel guilty for\n" .string "{STR_VAR_1} should feel guilty for\n"
.string "this sorry showing.$" .string "this sorry showing.$"
gTVContestLiveUpdatesText31:: @ 0828AA74 ContestLiveUpdates_Text_ValiantEffortButLost:: @ 0828AA74
.string "{STR_VAR_1} turned in a valiant effort,\n" .string "{STR_VAR_1} turned in a valiant effort,\n"
.string "but…\p" .string "but…\p"
.string "It was all for naught, finishing last.\p" .string "It was all for naught, finishing last.\p"
.string "{STR_VAR_1} should learn from this loss\n" .string "{STR_VAR_1} should learn from this loss\n"
.string "and put the knowledge to good use.$" .string "and put the knowledge to good use.$"
gTVContestLiveUpdatesText32:: @ 0828AB01 ContestLiveUpdates_Text_Outro:: @ 0828AB01
.string "I'd like to end this program with our\n" .string "I'd like to end this program with our\n"
.string "usual farewell to the winners.\p" .string "usual farewell to the winners.\p"
.string "This time, it's {STR_VAR_1} and\n" .string "This time, it's {STR_VAR_1} and\n"

View File

@ -133,5 +133,59 @@
#define NUM_SECRET_BASE_FLAGS 32 // by definition, bitfield of 2 u16s #define NUM_SECRET_BASE_FLAGS 32 // by definition, bitfield of 2 u16s
// TV Show states for Pokemon Contest Live Updates
#define CONTESTLIVE_STATE_INTRO 0
#define CONTESTLIVE_STATE_WON_BOTH_ROUNDS 1
#define CONTESTLIVE_STATE_BETTER_ROUND2 2
#define CONTESTLIVE_STATE_EQUAL_ROUNDS 3
#define CONTESTLIVE_STATE_BETTER_ROUND1 4
#define CONTESTLIVE_STATE_GOT_NERVOUS 5
#define CONTESTLIVE_STATE_STARTLED_OTHER 6
#define CONTESTLIVE_STATE_USED_COMBO 7
#define CONTESTLIVE_STATE_EXCITING_APPEAL 8
#define CONTESTLIVE_STATE_COOL 9
#define CONTESTLIVE_STATE_BEAUTIFUL 10
#define CONTESTLIVE_STATE_CUTE 11
#define CONTESTLIVE_STATE_SMART 12
#define CONTESTLIVE_STATE_TOUGH 13
#define CONTESTLIVE_STATE_VERY_EXCITING_APPEAL 14
#define CONTESTLIVE_STATE_VERY_COOL 15
#define CONTESTLIVE_STATE_VERY_BEAUTIFUL 16
#define CONTESTLIVE_STATE_VERY_CUTE 17
#define CONTESTLIVE_STATE_VERY_SMART 18
#define CONTESTLIVE_STATE_VERY_TOUGH 19
#define CONTESTLIVE_STATE_TOOK_BREAK 20
#define CONTESTLIVE_STATE_GOT_STARTLED 21
#define CONTESTLIVE_STATE_USED_MOVE 22
#define CONTESTLIVE_STATE_TALK_ABOUT_LOSER 23
#define CONTESTLIVE_STATE_NO_APPEALS 24
#define CONTESTLIVE_STATE_LAST_BOTH 25
#define CONTESTLIVE_STATE_NOT_EXCITING_ENOUGH 26
#define CONTESTLIVE_STATE_LOST_AFTER_ROUND1_WIN 27
#define CONTESTLIVE_STATE_NO_EXCITING_APPEALS 28
#define CONTESTLIVE_STATE_LOST_SMALL_MARGIN 29
#define CONTESTLIVE_STATE_REPEATED_APPEALS 30
#define CONTESTLIVE_STATE_LOST 31
#define CONTESTLIVE_STATE_OUTRO 32
// Flags used to comment on winner
#define CONTESTLIVE_FLAG_EXCITING_APPEAL (1 << 0)
#define CONTESTLIVE_FLAG_GOT_NERVOUS (1 << 1)
#define CONTESTLIVE_FLAG_MAXED_EXCITEMENT (1 << 2)
#define CONTESTLIVE_FLAG_USED_COMBO (1 << 3)
#define CONTESTLIVE_FLAG_STARTLED_OTHER (1 << 4)
#define CONTESTLIVE_FLAG_SKIPPED_TURN (1 << 5)
#define CONTESTLIVE_FLAG_GOT_STARTLED (1 << 6)
#define CONTESTLIVE_FLAG_MADE_APPEAL (1 << 7)
// Flags used to comment on loser
#define CONTESTLIVE_FLAG_LOST (1 << 0)
#define CONTESTLIVE_FLAG_REPEATED_MOVE (1 << 1)
#define CONTESTLIVE_FLAG_LOST_SMALL_MARGIN (1 << 2)
#define CONTESTLIVE_FLAG_NO_EXCITEMENT (1 << 3)
#define CONTESTLIVE_FLAG_BLEW_LEAD (1 << 4)
#define CONTESTLIVE_FLAG_MISSED_EXCITEMENT (1 << 5)
#define CONTESTLIVE_FLAG_LAST_BOTH_ROUNDS (1 << 6)
#define CONTESTLIVE_FLAG_NO_APPEALS (1 << 7)
#endif //GUARD_CONSTANTS_TV_H #endif //GUARD_CONSTANTS_TV_H

View File

@ -4,17 +4,6 @@
#include "palette.h" #include "palette.h"
#include "constants/contest.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 enum
{ {
CONTEST_STRING_MORE_CONSCIOUS, CONTEST_STRING_MORE_CONSCIOUS,
@ -153,7 +142,7 @@ struct Contest
u8 mainTaskId; u8 mainTaskId;
u8 unk1920D[4]; u8 unk1920D[4];
u8 judgeAttentionTaskId; u8 judgeAttentionTaskId;
u8 unk19212; u8 blendTaskId;
u8 filler19213; u8 filler19213;
u8 turnNumber; u8 turnNumber;
u8 currentContestant; u8 currentContestant;
@ -211,7 +200,7 @@ struct ContestantStatus
bool8 usedComboMove:1; bool8 usedComboMove:1;
bool8 completedCombo; bool8 completedCombo;
u8 comboAppealBonus; u8 comboAppealBonus;
u8 unk18; u8 repeatJam;
u8 nextTurnOrder; // turn position u8 nextTurnOrder; // turn position
u8 attentionLevel; // How much the Pokemon "stood out" u8 attentionLevel; // How much the Pokemon "stood out"
u8 contestantAnimTarget; u8 contestantAnimTarget;
@ -271,12 +260,12 @@ struct ContestFinalStandings
struct ContestTV struct ContestTV
{ {
u16 unk0[5]; u16 appeals[CONTEST_NUM_APPEALS];
s16 unkA; s16 move;
u8 unkC; u8 winnerFlags;
u8 unkD; u8 loserFlags;
u8 unkE_1:1; u8 madeAppeal:1;
u8 unkE_2:1; u8 madeExcitingAppeal:1;
}; };
struct ContestUnused struct ContestUnused

View File

@ -294,39 +294,39 @@ extern const u8 gTVSafariFanClubText07[];
extern const u8 gTVSafariFanClubText08[]; extern const u8 gTVSafariFanClubText08[];
extern const u8 gTVSafariFanClubText09[]; extern const u8 gTVSafariFanClubText09[];
extern const u8 gTVSafariFanClubText10[]; extern const u8 gTVSafariFanClubText10[];
extern const u8 gTVContestLiveUpdatesText00[]; extern const u8 ContestLiveUpdates_Text_Intro[];
extern const u8 gTVContestLiveUpdatesText01[]; extern const u8 ContestLiveUpdates_Text_WonBothRounds[];
extern const u8 gTVContestLiveUpdatesText02[]; extern const u8 ContestLiveUpdates_Text_BetterRound2[];
extern const u8 gTVContestLiveUpdatesText03[]; extern const u8 ContestLiveUpdates_Text_EqualRounds[];
extern const u8 gTVContestLiveUpdatesText04[]; extern const u8 ContestLiveUpdates_Text_BetterRound1[];
extern const u8 gTVContestLiveUpdatesText05[]; extern const u8 ContestLiveUpdates_Text_GotNervous[];
extern const u8 gTVContestLiveUpdatesText06[]; extern const u8 ContestLiveUpdates_Text_StartledFoes[];
extern const u8 gTVContestLiveUpdatesText07[]; extern const u8 ContestLiveUpdates_Text_UsedCombo[];
extern const u8 gTVContestLiveUpdatesText08[]; extern const u8 ContestLiveUpdates_Text_ExcitingAppeal[];
extern const u8 gTVContestLiveUpdatesText09[]; extern const u8 ContestLiveUpdates_Text_WasCool[];
extern const u8 gTVContestLiveUpdatesText10[]; extern const u8 ContestLiveUpdates_Text_WasBeautiful[];
extern const u8 gTVContestLiveUpdatesText11[]; extern const u8 ContestLiveUpdates_Text_WasCute[];
extern const u8 gTVContestLiveUpdatesText12[]; extern const u8 ContestLiveUpdates_Text_WasSmart[];
extern const u8 gTVContestLiveUpdatesText13[]; extern const u8 ContestLiveUpdates_Text_WasTough[];
extern const u8 gTVContestLiveUpdatesText14[]; extern const u8 ContestLiveUpdates_Text_VeryExcitingAppeal[];
extern const u8 gTVContestLiveUpdatesText15[]; extern const u8 ContestLiveUpdates_Text_VeryCool[];
extern const u8 gTVContestLiveUpdatesText16[]; extern const u8 ContestLiveUpdates_Text_VeryBeautiful[];
extern const u8 gTVContestLiveUpdatesText17[]; extern const u8 ContestLiveUpdates_Text_VeryCute[];
extern const u8 gTVContestLiveUpdatesText18[]; extern const u8 ContestLiveUpdates_Text_VerySmart[];
extern const u8 gTVContestLiveUpdatesText19[]; extern const u8 ContestLiveUpdates_Text_VeryTough[];
extern const u8 gTVContestLiveUpdatesText20[]; extern const u8 ContestLiveUpdates_Text_TookBreak[];
extern const u8 gTVContestLiveUpdatesText21[]; extern const u8 ContestLiveUpdates_Text_GotStartled[];
extern const u8 gTVContestLiveUpdatesText22[]; extern const u8 ContestLiveUpdates_Text_MoveWonderful[];
extern const u8 gTVContestLiveUpdatesText23[]; extern const u8 ContestLiveUpdates_Text_TalkAboutAnotherMon[];
extern const u8 gTVContestLiveUpdatesText24[]; extern const u8 ContestLiveUpdates_Text_FailedToAppeal[];
extern const u8 gTVContestLiveUpdatesText25[]; extern const u8 ContestLiveUpdates_Text_LastInBothRounds[];
extern const u8 gTVContestLiveUpdatesText26[]; extern const u8 ContestLiveUpdates_Text_NotExcitingEnough[];
extern const u8 gTVContestLiveUpdatesText27[]; extern const u8 ContestLiveUpdates_Text_LostAfterWinningRound1[];
extern const u8 gTVContestLiveUpdatesText28[]; extern const u8 ContestLiveUpdates_Text_NeverExciting[];
extern const u8 gTVContestLiveUpdatesText29[]; extern const u8 ContestLiveUpdates_Text_LostBySmallMargin[];
extern const u8 gTVContestLiveUpdatesText30[]; extern const u8 ContestLiveUpdates_Text_RepeatedAppeals[];
extern const u8 gTVContestLiveUpdatesText31[]; extern const u8 ContestLiveUpdates_Text_ValiantEffortButLost[];
extern const u8 gTVContestLiveUpdatesText32[]; extern const u8 ContestLiveUpdates_Text_Outro[];
extern const u8 gTVPokemonBattleUpdateText00[]; extern const u8 gTVPokemonBattleUpdateText00[];
extern const u8 gTVPokemonBattleUpdateText01[]; extern const u8 gTVPokemonBattleUpdateText01[];
extern const u8 gTVPokemonBattleUpdateText02[]; extern const u8 gTVPokemonBattleUpdateText02[];

View File

@ -124,18 +124,18 @@ typedef union // size = 0x24
struct { struct {
/*0x00*/ u8 kind; /*0x00*/ u8 kind;
/*0x01*/ bool8 active; /*0x01*/ bool8 active;
/*0x02*/ u16 winningSpecies; /*0x02*/ u16 losingSpecies;
/*0x04*/ u8 winningTrainerName[8]; /*0x04*/ u8 losingTrainerName[8];
/*0x0C*/ u8 appealFlags2; /*0x0C*/ u8 loserAppealFlag;
/*0x0D*/ u8 round1Rank; /*0x0D*/ u8 round1Placing;
/*0x0e*/ u8 round2Rank; /*0x0e*/ u8 round2Placing;
/*0x0f*/ u8 appealFlags1; /*0x0f*/ u8 winnerAppealFlag;
/*0x10*/ u16 move; /*0x10*/ u16 move;
/*0x12*/ u16 species; /*0x12*/ u16 winningSpecies;
/*0x14*/ u8 playerName[8]; /*0x14*/ u8 winningTrainerName[8];
/*0x1C*/ u8 category; /*0x1C*/ u8 category;
/*0x1D*/ u8 language; /*0x1D*/ u8 winningTrainerLanguage;
/*0x1E*/ u8 winningTrainerLanguage; /*0x1E*/ u8 losingTrainerLanguage;
} contestLiveUpdates; } contestLiveUpdates;
// TVSHOW_3_CHEERS_FOR_POKEBLOCKS // TVSHOW_3_CHEERS_FOR_POKEBLOCKS

View File

@ -59,11 +59,11 @@ void SaveRecordedItemPurchasesForTVShow(void);
bool8 ShouldAirFrontierTVShow(void); bool8 ShouldAirFrontierTVShow(void);
void sub_80EE8C8(u16 winStreak, u8 facilityAndMode); void sub_80EE8C8(u16 winStreak, u8 facilityAndMode);
void BravoTrainerPokemonProfile_BeforeInterview2(u8 contestStandingPlace); void BravoTrainerPokemonProfile_BeforeInterview2(u8 contestStandingPlace);
void ContestLiveUpdates_BeforeInterview_1(u8 a0); void ContestLiveUpdates_Init(u8 round1Placing);
void ContestLiveUpdates_BeforeInterview_2(u8 a0); void ContestLiveUpdates_SetRound2Placing(u8 round2Placing);
void ContestLiveUpdates_BeforeInterview_3(u8 a0); void ContestLiveUpdates_SetWinnerAppealFlag(u8 flag);
void ContestLiveUpdates_BeforeInterview_4(u16 a0); void ContestLiveUpdates_SetWinnerMoveUsed(u16 move);
void ContestLiveUpdates_BeforeInterview_5(u8 a0, u8 a1); void ContestLiveUpdates_SetLoserData(u8 flag, u8 loser);
void ResetGabbyAndTy(void); void ResetGabbyAndTy(void);
#endif //GUARD_TV_H #endif //GUARD_TV_H

View File

@ -2,12 +2,6 @@
#include "gpu_regs.h" #include "gpu_regs.h"
#include "bg.h" #include "bg.h"
#include "malloc.h" #include "malloc.h"
#include "constants/items.h"
#include "constants/event_objects.h"
#include "constants/moves.h"
#include "constants/songs.h"
#include "constants/species.h"
#include "constants/flags.h"
#include "battle.h" #include "battle.h"
#include "battle_anim.h" #include "battle_anim.h"
#include "contest.h" #include "contest.h"
@ -42,8 +36,15 @@
#include "contest_link.h" #include "contest_link.h"
#include "international_string_util.h" #include "international_string_util.h"
#include "data.h" #include "data.h"
#include "constants/rgb.h"
#include "contest_ai.h" #include "contest_ai.h"
#include "constants/event_objects.h"
#include "constants/flags.h"
#include "constants/items.h"
#include "constants/moves.h"
#include "constants/rgb.h"
#include "constants/songs.h"
#include "constants/species.h"
#include "constants/tv.h"
// This file's functions. // This file's functions.
static void LoadContestPalettes(void); static void LoadContestPalettes(void);
@ -113,7 +114,7 @@ static void SetBottomSliderHeartsInvisibility(bool8);
static void CreateNextTurnSprites(void); static void CreateNextTurnSprites(void);
static void CreateApplauseMeterSprite(void); static void CreateApplauseMeterSprite(void);
static void CreateJudgeAttentionEyeTask(void); static void CreateJudgeAttentionEyeTask(void);
static void sub_80DC7EC(void); static void CreateUnusedBlendTask(void);
static void ContestDebugDoPrint(void); static void ContestDebugDoPrint(void);
static void DrawContestantWindows(void); static void DrawContestantWindows(void);
static void ApplyNextTurnOrder(void); static void ApplyNextTurnOrder(void);
@ -164,9 +165,9 @@ static void Task_UpdateAppealHearts(u8);
static void SpriteCB_UpdateHeartSlider(struct Sprite *); static void SpriteCB_UpdateHeartSlider(struct Sprite *);
static void Task_FlashJudgeAttentionEye(u8); static void Task_FlashJudgeAttentionEye(u8);
static void Task_StopFlashJudgeAttentionEye(u8); static void Task_StopFlashJudgeAttentionEye(u8);
static void sub_80DC8D0(u8); static void Task_UnusedBlend(u8);
static void sub_80DC81C(u8); static void InitUnusedBlendTaskData(u8);
static void sub_80DC87C(u8); static void UpdateBlendTaskContestantData(u8);
static void SpriteCB_BlinkContestantBox(struct Sprite *); static void SpriteCB_BlinkContestantBox(struct Sprite *);
static void SpriteCB_EndBlinkContestantBox(struct Sprite *sprite); static void SpriteCB_EndBlinkContestantBox(struct Sprite *sprite);
static u8 StartApplauseOverflowAnimation(void); static u8 StartApplauseOverflowAnimation(void);
@ -183,9 +184,9 @@ static void Task_WaitRaiseCurtainAtRoundEnd(u8);
static void Task_StartRaiseCurtainAtRoundEnd(u8); static void Task_StartRaiseCurtainAtRoundEnd(u8);
static void Task_WaitForSliderHeartAnim(u8); static void Task_WaitForSliderHeartAnim(u8);
static void SetBattleTargetSpritePosition(void); static void SetBattleTargetSpritePosition(void);
static void sub_80DF250(void); static void CalculateContestLiveUpdateData(void);
static void sub_80DF4F8(void); static void SetConestLiveUpdateTVData(void);
static void sub_80DF080(u8); static void SetContestLiveUpdateFlags(u8);
static void ContestDebugPrintBitStrings(void); static void ContestDebugPrintBitStrings(void);
static void StripPlayerNameForLinkContest(u8 *); static void StripPlayerNameForLinkContest(u8 *);
static void StripMonNameForLinkContest(u8 *, s32); static void StripMonNameForLinkContest(u8 *, s32);
@ -233,6 +234,13 @@ enum {
STAT_SYMBOL_SQUARE, STAT_SYMBOL_SQUARE,
}; };
enum {
CONTEST_DEBUG_MODE_OFF,
CONTEST_DEBUG_MODE_PRINT_POINT_TOTAL,
CONTEST_DEBUG_MODE_PRINT_WINNER_FLAGS,
CONTEST_DEBUG_MODE_PRINT_LOSER_FLAGS
};
#define MOVE_WINDOWS_START WIN_MOVE0 #define MOVE_WINDOWS_START WIN_MOVE0
#define TAG_CONTEST_SYMBOLS_PAL 0xABE0 #define TAG_CONTEST_SYMBOLS_PAL 0xABE0
@ -964,9 +972,9 @@ void LoadContestBgAfterMoveAnim(void)
LoadContestPalettes(); LoadContestPalettes();
for (i = 0; i < CONTESTANT_COUNT; i++) for (i = 0; i < CONTESTANT_COUNT; i++)
{ {
u32 contestantWindowId = MOVE_WINDOWS_START + i; u32 contestantWindowId = 5 + i;
LoadPalette(eUnknownHeap1A004.cachedWindowPalettes[contestantWindowId], 16 * (MOVE_WINDOWS_START + gContestantTurnOrder[i]), sizeof((eUnknownHeap1A004.cachedWindowPalettes[contestantWindowId]))); LoadPalette(eUnknownHeap1A004.cachedWindowPalettes[contestantWindowId], 16 * (5 + gContestantTurnOrder[i]), sizeof((eUnknownHeap1A004.cachedWindowPalettes[contestantWindowId])));
} }
} }
@ -1257,9 +1265,9 @@ static bool8 SetupContestGraphics(u8 *stateVar)
case 5: case 5:
LoadCompressedPalette(gOldContestPalette, 0, 0x200); LoadCompressedPalette(gOldContestPalette, 0, 0x200);
CpuCopy32(gPlttBufferUnfaded + 128, tempPalette1, 16 * sizeof(u16)); CpuCopy32(gPlttBufferUnfaded + 128, tempPalette1, 16 * sizeof(u16));
CpuCopy32(gPlttBufferUnfaded + (MOVE_WINDOWS_START + gContestPlayerMonIndex) * 16, tempPalette2, 16 * sizeof(u16)); CpuCopy32(gPlttBufferUnfaded + (5 + gContestPlayerMonIndex) * 16, tempPalette2, 16 * sizeof(u16));
CpuCopy32(tempPalette2, gPlttBufferUnfaded + 128, 16 * sizeof(u16)); CpuCopy32(tempPalette2, gPlttBufferUnfaded + 128, 16 * sizeof(u16));
CpuCopy32(tempPalette1, gPlttBufferUnfaded + (MOVE_WINDOWS_START + gContestPlayerMonIndex) * 16, 16 * sizeof(u16)); CpuCopy32(tempPalette1, gPlttBufferUnfaded + (5 + gContestPlayerMonIndex) * 16, 16 * sizeof(u16));
DmaCopy32Defvars(3, gPlttBufferUnfaded, eUnknownHeap1A004.cachedWindowPalettes, sizeof(eUnknownHeap1A004.cachedWindowPalettes)); DmaCopy32Defvars(3, gPlttBufferUnfaded, eUnknownHeap1A004.cachedWindowPalettes, sizeof(eUnknownHeap1A004.cachedWindowPalettes));
LoadContestPalettes(); LoadContestPalettes();
break; break;
@ -1272,7 +1280,7 @@ static bool8 SetupContestGraphics(u8 *stateVar)
CreateNextTurnSprites(); CreateNextTurnSprites();
CreateApplauseMeterSprite(); CreateApplauseMeterSprite();
CreateJudgeAttentionEyeTask(); CreateJudgeAttentionEyeTask();
sub_80DC7EC(); CreateUnusedBlendTask();
gBattlerPositions[0] = B_POSITION_PLAYER_LEFT; gBattlerPositions[0] = B_POSITION_PLAYER_LEFT;
gBattlerPositions[1] = B_POSITION_OPPONENT_LEFT; gBattlerPositions[1] = B_POSITION_OPPONENT_LEFT;
gBattlerPositions[2] = B_POSITION_OPPONENT_RIGHT; gBattlerPositions[2] = B_POSITION_OPPONENT_RIGHT;
@ -1591,7 +1599,7 @@ static void Task_HideMoveSelectScreen(u8 taskId)
gBattle_BG2_Y = 0; gBattle_BG2_Y = 0;
SetBottomSliderHeartsInvisibility(FALSE); SetBottomSliderHeartsInvisibility(FALSE);
for (i = 0; i < CONTESTANT_COUNT; i++) for (i = 0; i < MAX_MON_MOVES; i++)
{ {
FillWindowPixelBuffer(MOVE_WINDOWS_START + i, PIXEL_FILL(0)); FillWindowPixelBuffer(MOVE_WINDOWS_START + i, PIXEL_FILL(0));
PutWindowTilemap(MOVE_WINDOWS_START + i); PutWindowTilemap(MOVE_WINDOWS_START + i);
@ -1751,7 +1759,7 @@ static void Task_DoAppeals(u8 taskId)
gTasks[taskId].tState = APPEALSTATE_2; gTasks[taskId].tState = APPEALSTATE_2;
return; return;
case APPEALSTATE_2: case APPEALSTATE_2:
sub_80DF080(contestant); SetContestLiveUpdateFlags(contestant);
ContestDebugPrintBitStrings(); ContestDebugPrintBitStrings();
if (eContestantStatus[contestant].numTurnsSkipped != 0 if (eContestantStatus[contestant].numTurnsSkipped != 0
|| eContestantStatus[contestant].noMoreTurns) || eContestantStatus[contestant].noMoreTurns)
@ -2170,8 +2178,8 @@ static void Task_DoAppeals(u8 taskId)
case APPEALSTATE_UPDATE_HEARTS_FROM_REPEAT: case APPEALSTATE_UPDATE_HEARTS_FROM_REPEAT:
if (!Contest_RunTextPrinters()) if (!Contest_RunTextPrinters())
{ {
UpdateAppealHearts(eContestantStatus[contestant].appeal2, -eContestantStatus[contestant].unk18, contestant); UpdateAppealHearts(eContestantStatus[contestant].appeal2, -eContestantStatus[contestant].repeatJam, contestant);
eContestantStatus[contestant].appeal2 -= eContestantStatus[contestant].unk18; eContestantStatus[contestant].appeal2 -= eContestantStatus[contestant].repeatJam;
gTasks[taskId].tState = APPEALSTATE_WAIT_HEARTS_FROM_REPEAT; gTasks[taskId].tState = APPEALSTATE_WAIT_HEARTS_FROM_REPEAT;
} }
return; return;
@ -2659,8 +2667,8 @@ static void Task_EndAppeals(u8 taskId)
BravoTrainerPokemonProfile_BeforeInterview1(eContestantStatus[gContestPlayerMonIndex].prevMove); BravoTrainerPokemonProfile_BeforeInterview1(eContestantStatus[gContestPlayerMonIndex].prevMove);
else else
{ {
sub_80DF250(); CalculateContestLiveUpdateData();
sub_80DF4F8(); SetConestLiveUpdateTVData();
ContestDebugPrintBitStrings(); ContestDebugPrintBitStrings();
} }
gContestRngValue = gRngValue; gContestRngValue = gRngValue;
@ -3990,7 +3998,7 @@ static void Task_StopFlashJudgeAttentionEye(u8 taskId)
{ {
gTasks[eContest.judgeAttentionTaskId].data[contestant * 4 + 0] = 0xFF; gTasks[eContest.judgeAttentionTaskId].data[contestant * 4 + 0] = 0xFF;
gTasks[eContest.judgeAttentionTaskId].data[contestant * 4 + 1] = 0; gTasks[eContest.judgeAttentionTaskId].data[contestant * 4 + 1] = 0;
BlendPalette((eContest.prevTurnOrder[contestant] + MOVE_WINDOWS_START) * 16 + 6, 2, 0, RGB(31, 31, 18)); BlendPalette((eContest.prevTurnOrder[contestant] + 5) * 16 + 6, 2, 0, RGB(31, 31, 18));
DestroyTask(taskId); DestroyTask(taskId);
} }
} }
@ -4014,58 +4022,62 @@ static void Task_FlashJudgeAttentionEye(u8 taskId)
|| gTasks[taskId].data[offset + 0] == 0) || gTasks[taskId].data[offset + 0] == 0)
gTasks[taskId].data[offset + 1] ^= 1; gTasks[taskId].data[offset + 1] ^= 1;
BlendPalette( BlendPalette((eContest.prevTurnOrder[i] + 5) * 16 + 6, 2, gTasks[taskId].data[offset + 0], RGB(31, 31, 18));
(eContest.prevTurnOrder[i] + MOVE_WINDOWS_START) * 16 + 6,
2,
gTasks[taskId].data[offset + 0],
RGB(31, 31, 18));
} }
} }
} }
static void sub_80DC7EC(void) // Note: While the below task is run for the entire Appeals portion of the contest,
// because data[i * 4] is always 0xFF it never does anything
// If turned on by setting that data between 0 and 16, it blends
// an odd selection of palette colors (e.g. the text box, the appeal hearts
// for only one contestant, the heart outlines in the move selection box, etc)
// Given the similarities, it's possible this was an incorrect attempt
// at something similar to what CreateJudgeAttentionEyeTask does
static void CreateUnusedBlendTask(void)
{ {
s32 i; s32 i;
eContest.unk19212 = CreateTask(sub_80DC8D0, 30); eContest.blendTaskId = CreateTask(Task_UnusedBlend, 30);
for (i = 0; i < CONTESTANT_COUNT; i++) for (i = 0; i < CONTESTANT_COUNT; i++)
sub_80DC81C(i); InitUnusedBlendTaskData(i);
} }
static void sub_80DC81C(u8 contestant) static void InitUnusedBlendTaskData(u8 contestant)
{ {
gTasks[eContest.unk19212].data[contestant * 4 + 0] = 0xFF; gTasks[eContest.blendTaskId].data[contestant * 4] = 0xFF;
gTasks[eContest.unk19212].data[contestant * 4 + 1] = 0; gTasks[eContest.blendTaskId].data[contestant * 4 + 1] = 0;
} }
static void sub_80DC864(void) static void UpdateBlendTaskContestantsData(void)
{ {
s32 i; s32 i;
for (i = 0; i < CONTESTANT_COUNT; i++) for (i = 0; i < CONTESTANT_COUNT; i++)
sub_80DC87C(i); UpdateBlendTaskContestantData(i);
} }
static void sub_80DC87C(u8 contestant) static void UpdateBlendTaskContestantData(u8 contestant)
{ {
u32 windowId1; u32 palOffset1;
u32 windowId2; u32 palOffset2;
sub_80DC81C(contestant); InitUnusedBlendTaskData(contestant);
windowId1 = contestant + MOVE_WINDOWS_START; palOffset1 = contestant + 5;
DmaCopy16Defvars(3, DmaCopy16Defvars(3,
gPlttBufferUnfaded + windowId1 * 16 + 10, gPlttBufferUnfaded + palOffset1 * 16 + 10,
gPlttBufferFaded + windowId1 * 16 + 10, gPlttBufferFaded + palOffset1 * 16 + 10,
2); 2);
windowId2 = (contestant + MOVE_WINDOWS_START) * 16 + 12 + contestant; palOffset2 = (contestant + 5) * 16 + 12 + contestant;
DmaCopy16Defvars(3, DmaCopy16Defvars(3,
gPlttBufferUnfaded + windowId2, gPlttBufferUnfaded + palOffset2,
gPlttBufferFaded + windowId2, gPlttBufferFaded + palOffset2,
2); 2);
} }
static void sub_80DC8D0(u8 taskId) // See comments on CreateUnusedBlendTask
static void Task_UnusedBlend(u8 taskId)
{ {
u8 i; u8 i;
@ -4073,23 +4085,24 @@ static void sub_80DC8D0(u8 taskId)
{ {
u8 idx = i * 4; u8 idx = i * 4;
if (gTasks[taskId].data[idx + 0] != 0xFF) // Below is never true
if (gTasks[taskId].data[idx] != 0xFF)
{ {
if (++gTasks[taskId].data[idx + 2] > 2) if (++gTasks[taskId].data[idx + 2] > 2)
{ {
gTasks[taskId].data[idx + 2] = 0; gTasks[taskId].data[idx + 2] = 0;
if (gTasks[taskId].data[idx + 1] == 0) if (gTasks[taskId].data[idx + 1] == 0)
gTasks[taskId].data[idx + 0]++; gTasks[taskId].data[idx]++;
else else
gTasks[taskId].data[idx + 0]--; gTasks[taskId].data[idx]--;
if (gTasks[taskId].data[idx + 0] == 16 if (gTasks[taskId].data[idx] == 16
|| gTasks[taskId].data[idx + 0] == 0) || gTasks[taskId].data[idx] == 0)
gTasks[taskId].data[idx + 1] ^= 1; gTasks[taskId].data[idx + 1] ^= 1;
BlendPalette((i + MOVE_WINDOWS_START) * 16 + 10, 1, gTasks[taskId].data[idx + 0], RGB(31, 31, 18)); BlendPalette((i + 5) * 16 + 10, 1, gTasks[taskId].data[idx + 0], RGB(31, 31, 18));
BlendPalette((i + MOVE_WINDOWS_START) * 16 + 12 + i, 1, gTasks[taskId].data[idx + 0], RGB(31, 31, 18)); BlendPalette((i + 5) * 16 + 12 + i, 1, gTasks[taskId].data[idx + 0], RGB(31, 31, 18));
} }
} }
} }
@ -4241,8 +4254,8 @@ static void ContestDebugDoPrint(void)
{ {
case CONTEST_DEBUG_MODE_OFF: case CONTEST_DEBUG_MODE_OFF:
break; break;
case CONTEST_DEBUG_MODE_PRINT_UNK_C: case CONTEST_DEBUG_MODE_PRINT_WINNER_FLAGS:
case CONTEST_DEBUG_MODE_PRINT_UNK_D: case CONTEST_DEBUG_MODE_PRINT_LOSER_FLAGS:
ContestDebugPrintBitStrings(); ContestDebugPrintBitStrings();
break; break;
// The only other possible value is 1, which is only set by ContestDebugTogglePointTotal. // The only other possible value is 1, which is only set by ContestDebugTogglePointTotal.
@ -4401,8 +4414,8 @@ static void DrawContestantWindows(void)
for (i = 0; i < CONTESTANT_COUNT; i++) for (i = 0; i < CONTESTANT_COUNT; i++)
{ {
s32 windowId = i + MOVE_WINDOWS_START; s32 windowId = i + 5;
LoadPalette(eUnknownHeap1A004.cachedWindowPalettes[windowId], (gContestantTurnOrder[i] + MOVE_WINDOWS_START) * 16, sizeof(eUnknownHeap1A004.cachedWindowPalettes[0])); LoadPalette(eUnknownHeap1A004.cachedWindowPalettes[windowId], (gContestantTurnOrder[i] + 5) * 16, sizeof(eUnknownHeap1A004.cachedWindowPalettes[0]));
} }
DrawContestantWindowText(); DrawContestantWindowText();
} }
@ -4486,7 +4499,7 @@ static void CalculateAppealMoveImpact(u8 contestant)
} }
} }
if (eContestantStatus[contestant].repeatedMove) if (eContestantStatus[contestant].repeatedMove)
eContestantStatus[contestant].unk18 = (eContestantStatus[contestant].moveRepeatCount + 1) * 10; eContestantStatus[contestant].repeatJam = (eContestantStatus[contestant].moveRepeatCount + 1) * 10;
if (eContestantStatus[contestant].nervous) if (eContestantStatus[contestant].nervous)
{ {
@ -5145,7 +5158,7 @@ static void Task_ResetForNextRound(u8 taskId)
for (i = 0; i < CONTESTANT_COUNT; i++) for (i = 0; i < CONTESTANT_COUNT; i++)
eContest.prevTurnOrder[i] = gContestantTurnOrder[i]; eContest.prevTurnOrder[i] = gContestantTurnOrder[i];
FillContestantWindowBgs(); FillContestantWindowBgs();
sub_80DC864(); UpdateBlendTaskContestantsData();
DrawConditionStars(); DrawConditionStars();
DrawContestantWindows(); DrawContestantWindows();
ShowHideNextTurnGfx(TRUE); ShowHideNextTurnGfx(TRUE);
@ -5393,12 +5406,12 @@ static void SetMoveTargetPosition(u16 move)
} }
} }
static void Contest_PrintTextToBg0WindowStd(u32 a, const u8 *b) static void Contest_PrintTextToBg0WindowStd(u32 windowId, const u8 *b)
{ {
struct TextPrinterTemplate printerTemplate; struct TextPrinterTemplate printerTemplate;
printerTemplate.currentChar = b; printerTemplate.currentChar = b;
printerTemplate.windowId = a; printerTemplate.windowId = windowId;
printerTemplate.fontId = 1; printerTemplate.fontId = 1;
printerTemplate.x = 0; printerTemplate.x = 0;
printerTemplate.y = 1; printerTemplate.y = 1;
@ -5412,7 +5425,7 @@ static void Contest_PrintTextToBg0WindowStd(u32 a, const u8 *b)
printerTemplate.shadowColor = 8; printerTemplate.shadowColor = 8;
AddTextPrinter(&printerTemplate, 0, 0); AddTextPrinter(&printerTemplate, 0, 0);
PutWindowTilemap(a); PutWindowTilemap(windowId);
Contest_SetBgCopyFlags(0); Contest_SetBgCopyFlags(0);
} }
@ -5610,8 +5623,7 @@ void ClearContestWinnerPicsInContestHall(void)
gSaveBlock1Ptr->contestWinners[i] = gUnknown_08587FA4[i]; gSaveBlock1Ptr->contestWinners[i] = gUnknown_08587FA4[i];
} }
// The functions below are probably related to Contests in TV. static void SetContestLiveUpdateFlags(u8 contestant)
static void sub_80DF080(u8 contestant)
{ {
s32 i; s32 i;
@ -5619,278 +5631,292 @@ static void sub_80DF080(u8 contestant)
&& eContestExcitement.moveExcitement > 0 && eContestExcitement.moveExcitement > 0
&& !eContestantStatus[contestant].repeatedMove) && !eContestantStatus[contestant].repeatedMove)
{ {
gContestResources->tv[contestant].unkC |= 1; gContestResources->tv[contestant].winnerFlags |= CONTESTLIVE_FLAG_EXCITING_APPEAL;
gContestResources->tv[contestant].unkE_2 = 1; gContestResources->tv[contestant].madeExcitingAppeal = TRUE;
} }
if (eContestantStatus[contestant].nervous) if (eContestantStatus[contestant].nervous)
gContestResources->tv[contestant].unkC |= 2; gContestResources->tv[contestant].winnerFlags |= CONTESTLIVE_FLAG_GOT_NERVOUS;
if (!eContestExcitement.frozen if (!eContestExcitement.frozen
&& eContestExcitement.moveExcitement != 0 && eContestExcitement.moveExcitement != 0
&& eContestExcitement.excitementAppealBonus == 60) && eContestExcitement.excitementAppealBonus == 60)
{ {
gContestResources->tv[contestant].unkC |= 4; gContestResources->tv[contestant].winnerFlags |= CONTESTLIVE_FLAG_MAXED_EXCITEMENT;
} }
if (eContestantStatus[contestant].usedComboMove if (eContestantStatus[contestant].usedComboMove
&& eContestantStatus[contestant].completedCombo) && eContestantStatus[contestant].completedCombo)
{ {
gContestResources->tv[contestant].unkC |= 8; gContestResources->tv[contestant].winnerFlags |= CONTESTLIVE_FLAG_USED_COMBO;
} }
for (i = 0; i < CONTESTANT_COUNT; i++) for (i = 0; i < CONTESTANT_COUNT; i++)
{ {
if (i != contestant && eContestantStatus[i].jam != 0) if (i != contestant && eContestantStatus[i].jam != 0)
{ {
gContestResources->tv[contestant].unkC |= 0x10; gContestResources->tv[contestant].winnerFlags |= CONTESTLIVE_FLAG_STARTLED_OTHER;
gContestResources->tv[i].unkC |= 0x40; gContestResources->tv[i].winnerFlags |= CONTESTLIVE_FLAG_GOT_STARTLED;
} }
} }
if (eContestantStatus[contestant].numTurnsSkipped != 0 if (eContestantStatus[contestant].numTurnsSkipped != 0
|| eContestantStatus[contestant].noMoreTurns) || eContestantStatus[contestant].noMoreTurns)
{ {
gContestResources->tv[contestant].unkC |= 0x20; gContestResources->tv[contestant].winnerFlags |= CONTESTLIVE_FLAG_SKIPPED_TURN;
} }
else if (!eContestantStatus[contestant].nervous) else if (!eContestantStatus[contestant].nervous)
{ {
gContestResources->tv[contestant].unkC |= 0x80; gContestResources->tv[contestant].winnerFlags |= CONTESTLIVE_FLAG_MADE_APPEAL;
gContestResources->tv[contestant].unkE_1 = 1; gContestResources->tv[contestant].madeAppeal = TRUE;
gContestResources->tv[contestant].unk0[eContest.appealNumber] = eContestantStatus[contestant].currMove; gContestResources->tv[contestant].appeals[eContest.appealNumber] = eContestantStatus[contestant].currMove;
} }
if (eContestantStatus[contestant].repeatedMove) if (eContestantStatus[contestant].repeatedMove)
gContestResources->tv[contestant].unkD |= 2; gContestResources->tv[contestant].loserFlags |= CONTESTLIVE_FLAG_REPEATED_MOVE;
if (eContest.applauseLevel == 4 if (eContest.applauseLevel == 4
&& !eContestExcitement.frozen && !eContestExcitement.frozen
&& eContestExcitement.moveExcitement < 0) && eContestExcitement.moveExcitement < 0)
{ {
gContestResources->tv[contestant].unkD |= 0x20; gContestResources->tv[contestant].loserFlags |= CONTESTLIVE_FLAG_MISSED_EXCITEMENT;
} }
} }
static void sub_80DF250(void) static void CalculateContestLiveUpdateData(void)
{ {
u8 r1; u8 loser;
s32 i, j; s32 i, j;
bool32 r12, r8; bool32 notLastInRound1, notLastInRound2;
u16 sp0[6]; u16 appealMoves[CONTEST_NUM_APPEALS + 1];
u8 spC[6]; u8 numMoveUses[CONTEST_NUM_APPEALS + 1];
u16 sp14[5]; u16 moveCandidates[CONTEST_NUM_APPEALS];
u8 var_38; u8 winner;
u8 r3; u8 mostUses;
u8 count; u8 numMoveCandidates;
r1 = 0; loser = 0;
var_38 = 0; winner = 0;
// Get loser/winner ids
for (i = 0; i < CONTESTANT_COUNT; i++) for (i = 0; i < CONTESTANT_COUNT; i++)
{ {
if (gContestFinalStandings[i] == 0) if (gContestFinalStandings[i] == 0)
var_38 = i; winner = i;
else if (gContestFinalStandings[i] == 3) else if (gContestFinalStandings[i] == CONTESTANT_COUNT - 1)
r1 = i; loser = i;
} }
gContestResources->tv[r1].unkD |= 1; // Set flags for commenting on loser
gContestResources->tv[loser].loserFlags |= CONTESTLIVE_FLAG_LOST;
for (i = 0; i < CONTESTANT_COUNT; i++) for (i = 0; i < CONTESTANT_COUNT; i++)
{ {
if (i != var_38 && gContestMonTotalPoints[var_38] - gContestMonTotalPoints[i] <= 50) if (i != winner && gContestMonTotalPoints[winner] - gContestMonTotalPoints[i] <= 50)
gContestResources->tv[i].unkD |= 4; gContestResources->tv[i].loserFlags |= CONTESTLIVE_FLAG_LOST_SMALL_MARGIN;
if (!gContestResources->tv[i].unkE_2) if (!gContestResources->tv[i].madeExcitingAppeal)
gContestResources->tv[i].unkD |= 8; gContestResources->tv[i].loserFlags |= CONTESTLIVE_FLAG_NO_EXCITEMENT;
for (j = 0; j < CONTESTANT_COUNT; j++) for (j = 0; j < CONTESTANT_COUNT; j++)
{ {
if (gContestMonRound1Points[i] < gContestMonRound1Points[j]) if (gContestMonRound1Points[i] < gContestMonRound1Points[j])
break; break;
} }
if (j == 4 && gContestFinalStandings[i] != 0) if (j == CONTESTANT_COUNT && gContestFinalStandings[i] != 0)
gContestResources->tv[i].unkD |= 0x10; gContestResources->tv[i].loserFlags |= CONTESTLIVE_FLAG_BLEW_LEAD;
r12 = FALSE; notLastInRound1 = FALSE;
r8 = FALSE; notLastInRound2 = FALSE;
for (j = 0; j < CONTESTANT_COUNT; j++) for (j = 0; j < CONTESTANT_COUNT; j++)
{ {
if (gContestMonRound1Points[i] > gContestMonRound1Points[j]) if (gContestMonRound1Points[i] > gContestMonRound1Points[j])
r12 = TRUE; notLastInRound1 = TRUE;
if (gContestMonRound2Points[i] > gContestMonRound2Points[j]) if (gContestMonRound2Points[i] > gContestMonRound2Points[j])
r8 = TRUE; notLastInRound2 = TRUE;
} }
if (!r12 && !r8) if (!notLastInRound1 && !notLastInRound2)
gContestResources->tv[i].unkD |= 0x40; gContestResources->tv[i].loserFlags |= CONTESTLIVE_FLAG_LAST_BOTH_ROUNDS;
if (!gContestResources->tv[i].unkE_1) if (!gContestResources->tv[i].madeAppeal)
gContestResources->tv[i].unkD |= 0x80; gContestResources->tv[i].loserFlags |= CONTESTLIVE_FLAG_NO_APPEALS;
} }
for (i = 0; i < 5; i++) // Get what moves the winner used and how many times they used them
for (i = 0; i < CONTEST_NUM_APPEALS; i++)
{ {
sp0[i] = 0; appealMoves[i] = MOVE_NONE;
spC[i] = 0; numMoveUses[i] = 0;
} }
sp0[5] = 0xFFFF; appealMoves[CONTEST_NUM_APPEALS] = 0xFFFF;
spC[5] = 0; numMoveUses[CONTEST_NUM_APPEALS] = 0;
for (i = 0; i < 5; i++) for (i = 0; i < CONTEST_NUM_APPEALS; i++)
{ {
if (gContestResources->tv[var_38].unk0[i] != 0) if (gContestResources->tv[winner].appeals[i] != MOVE_NONE)
{ {
for (j = 0; j < 5; j++) for (j = 0; j < CONTEST_NUM_APPEALS; j++)
{ {
if (gContestResources->tv[var_38].unk0[i] != sp0[j]) if (gContestResources->tv[winner].appeals[i] != appealMoves[j])
{ {
if (sp0[j] == 0) if (appealMoves[j] == MOVE_NONE)
{ {
sp0[j] = gContestResources->tv[var_38].unk0[i]; appealMoves[j] = gContestResources->tv[winner].appeals[i];
spC[j]++; numMoveUses[j]++;
} }
} }
else else
{ {
spC[j]++; numMoveUses[j]++;
} }
} }
} }
} }
sp14[0] = sp0[0]; // Choose an appeal move to comment on for the winner (most commonly used)
r3 = spC[0]; moveCandidates[0] = appealMoves[0];
count = 0; mostUses = numMoveUses[0];
for (i = 1; sp0[i] != 0xFFFF; i++) numMoveCandidates = 0;
for (i = 1; appealMoves[i] != 0xFFFF; i++)
{ {
if (r3 < spC[i]) if (mostUses < numMoveUses[i])
{ {
sp14[0] = sp0[i]; moveCandidates[0] = appealMoves[i];
r3 = spC[i]; mostUses = numMoveUses[i];
count = 1; numMoveCandidates = 1;
} }
else if (r3 == spC[i]) else if (mostUses == numMoveUses[i])
{ {
sp14[count] = sp0[i]; moveCandidates[numMoveCandidates] = appealMoves[i];
count++; numMoveCandidates++;
} }
} }
gContestResources->tv[var_38].unkA = sp14[Random() % count]; gContestResources->tv[winner].move = moveCandidates[Random() % numMoveCandidates];
} }
static void sub_80DF4F8(void) static void SetConestLiveUpdateTVData(void)
{ {
s32 i; s32 i;
u32 bits; u32 flags;
u8 r7; u8 winner;
u8 r9, r10; u8 round1Placing, round2Placing;
u8 count; u8 count;
u8 r5; u8 randAction;
u8 r2; u8 numLoserCandidates;
u16 var; u8 flagId;
u8 r4; u16 winnerFlag;
u8 r6; u8 loserFlag;
u8 sp0[4]; u8 loser;
u8 loserCandidates[CONTESTANT_COUNT - 1];
// Players mon didn't win, don't generate show
if (gContestFinalStandings[gContestPlayerMonIndex] != 0) if (gContestFinalStandings[gContestPlayerMonIndex] != 0)
return; return;
r7 = 0; // Get winner id (unnecessary, we now know it's gContestPlayerMonIndex)
winner = 0;
for (i = 0; i < CONTESTANT_COUNT; i++) for (i = 0; i < CONTESTANT_COUNT; i++)
{ {
if (gContestFinalStandings[i] == 0) if (gContestFinalStandings[i] == 0)
r7 = i; winner = i;
} }
r9 = 0; // Get winner's placement in Round 1 and 2
r10 = 0; round1Placing = 0;
round2Placing = 0;
for (i = 0; i < CONTESTANT_COUNT; i++) for (i = 0; i < CONTESTANT_COUNT; i++)
{ {
if (gContestMonRound1Points[r7] < gContestMonRound1Points[i]) if (gContestMonRound1Points[winner] < gContestMonRound1Points[i])
r9++; round1Placing++;
if (gContestMonRound2Points[r7] < gContestMonRound2Points[i]) if (gContestMonRound2Points[winner] < gContestMonRound2Points[i])
r10++; round2Placing++;
} }
bits = gContestResources->tv[r7].unkC; // Count how many TV comment-worthy actions the winner took
flags = gContestResources->tv[winner].winnerFlags;
count = 0; count = 0;
for (i = 0; i < 8; bits >>= 1, i++) for (i = 0; i < 8; flags >>= 1, i++)
{ {
if (bits & 1) if (flags & 1)
count++; count++;
} }
r5 = Random() % count; // Randomly choose one of these actions to comment on
bits = gContestResources->tv[r7].unkC; randAction = Random() % count;
flags = gContestResources->tv[winner].winnerFlags;
count = 0; count = 0;
r2 = 0; flagId = 0;
for (i = 0; i < 8; bits >>= 1, r2++, i++) for (i = 0; i < 8; flags >>= 1, flagId++, i++)
{ {
if (!(bits & 1)) if (!(flags & 1))
continue; continue;
if (r5 == count) if (randAction == count)
break; break;
count++; count++;
} }
winnerFlag = 1 << flagId;
var = 1 << r2; // Pick a losing player with the highest severity of bad actions to comment on
if (r7 == 0) if (winner == 0)
{ {
sp0[0] = 1; loserCandidates[0] = 1;
r4 = gContestResources->tv[1].unkD; loserFlag = gContestResources->tv[1].loserFlags;
i = 2; i = 2;
} }
else else
{ {
sp0[0] = 0; loserCandidates[0] = 0;
r4 = gContestResources->tv[0].unkD; loserFlag = gContestResources->tv[0].loserFlags;
i = 1; i = 1;
} }
r5 = 1; numLoserCandidates = 1;
for (; i < CONTESTANT_COUNT; i++) for (; i < CONTESTANT_COUNT; i++)
{ {
if (i != r7) if (i != winner)
{ {
if (r4 < gContestResources->tv[i].unkD) if (loserFlag < gContestResources->tv[i].loserFlags)
{ {
sp0[0] = i; // Losing player currently has the worst (highest) set of flags, only candidate
r4 = gContestResources->tv[i].unkD; loserCandidates[0] = i;
r5 = 1; loserFlag = gContestResources->tv[i].loserFlags;
numLoserCandidates = 1;
} }
else if (r4 == gContestResources->tv[i].unkD) else if (loserFlag == gContestResources->tv[i].loserFlags)
{ {
sp0[r5] = i; // Tie, increment number of loser candidates
r5++; loserCandidates[numLoserCandidates] = i;
numLoserCandidates++;
} }
} }
} }
loser = loserCandidates[Random() % numLoserCandidates];
r6 = sp0[Random() % r5]; // Choose the "worst" action to comment on (flag with highest value)
r2 = 0x80; flagId = CONTESTLIVE_FLAG_NO_APPEALS;
for (i = 0; i < 8; r2 >>= 1, i++) for (i = 0; i < 8; flagId >>= 1, i++)
{ {
r4 = gContestResources->tv[r6].unkD & r2; loserFlag = gContestResources->tv[loser].loserFlags & flagId;
if (r4) if (loserFlag)
break; break;
} }
ContestLiveUpdates_BeforeInterview_1(r9); ContestLiveUpdates_Init(round1Placing);
ContestLiveUpdates_BeforeInterview_2(r10); ContestLiveUpdates_SetRound2Placing(round2Placing);
ContestLiveUpdates_BeforeInterview_3(var); ContestLiveUpdates_SetWinnerAppealFlag(winnerFlag);
ContestLiveUpdates_BeforeInterview_4(gContestResources->tv[r7].unkA); ContestLiveUpdates_SetWinnerMoveUsed(gContestResources->tv[winner].move);
ContestLiveUpdates_BeforeInterview_5(r4, r6); ContestLiveUpdates_SetLoserData(loserFlag, loser);
} }
// Unused // Unused
void ContestDebugToggleBitfields(bool8 showUnkD) void ContestDebugToggleBitfields(bool8 loserFlags)
{ {
if (eContestDebugMode == CONTEST_DEBUG_MODE_OFF) if (eContestDebugMode == CONTEST_DEBUG_MODE_OFF)
{ {
if (!showUnkD) if (!loserFlags)
eContestDebugMode = CONTEST_DEBUG_MODE_PRINT_UNK_C; eContestDebugMode = CONTEST_DEBUG_MODE_PRINT_WINNER_FLAGS;
else else
eContestDebugMode = CONTEST_DEBUG_MODE_PRINT_UNK_D; eContestDebugMode = CONTEST_DEBUG_MODE_PRINT_LOSER_FLAGS;
} }
else else
{ {
@ -5920,19 +5946,19 @@ static void ContestDebugPrintBitStrings(void)
if (!gEnableContestDebugging) if (!gEnableContestDebugging)
return; return;
if (eContestDebugMode != CONTEST_DEBUG_MODE_PRINT_UNK_C && eContestDebugMode != CONTEST_DEBUG_MODE_PRINT_UNK_D) if (eContestDebugMode != CONTEST_DEBUG_MODE_PRINT_WINNER_FLAGS && eContestDebugMode != CONTEST_DEBUG_MODE_PRINT_LOSER_FLAGS)
return; return;
for (i = 0; i < CONTESTANT_COUNT; i++) for (i = 0; i < CONTESTANT_COUNT; i++)
FillWindowPixelBuffer(i, PIXEL_FILL(0)); FillWindowPixelBuffer(i, PIXEL_FILL(0));
if (eContestDebugMode == CONTEST_DEBUG_MODE_PRINT_UNK_C) if (eContestDebugMode == CONTEST_DEBUG_MODE_PRINT_WINNER_FLAGS)
{ {
for (i = 0; i < CONTESTANT_COUNT; i++) for (i = 0; i < CONTESTANT_COUNT; i++)
{ {
txtPtr = StringCopy(text1, gText_CDot); txtPtr = StringCopy(text1, gText_CDot);
Contest_PrintTextToBg0WindowAt(gContestantTurnOrder[i], text1, 5, 1, 7); Contest_PrintTextToBg0WindowAt(gContestantTurnOrder[i], text1, 5, 1, 7);
bits = gContestResources->tv[i].unkC; bits = gContestResources->tv[i].winnerFlags;
for (j = 7; j > -1; j--) // Weird loop. for (j = 7; j > -1; j--) // Weird loop.
{ {
txtPtr = ConvertIntToDecimalStringN(txtPtr, bits & 1, STR_CONV_MODE_LEFT_ALIGN, 1); txtPtr = ConvertIntToDecimalStringN(txtPtr, bits & 1, STR_CONV_MODE_LEFT_ALIGN, 1);
@ -5947,12 +5973,12 @@ static void ContestDebugPrintBitStrings(void)
Contest_PrintTextToBg0WindowAt(gContestantTurnOrder[i], text1 + j, 55, 1, 7); Contest_PrintTextToBg0WindowAt(gContestantTurnOrder[i], text1 + j, 55, 1, 7);
} }
} }
else else // CONTEST_DEBUG_MODE_PRINT_LOSER_FLAGS
{ {
for (i = 0; i < CONTESTANT_COUNT; i++) for (i = 0; i < CONTESTANT_COUNT; i++)
{ {
StringCopy(text1, gText_BDot); StringCopy(text1, gText_BDot);
bits = gContestResources->tv[i].unkD; bits = gContestResources->tv[i].loserFlags;
txtPtr = &text1[2]; txtPtr = &text1[2];
for (j = 7; j > -1; j--) // Weird loop. for (j = 7; j > -1; j--) // Weird loop.
{ {

729
src/tv.c
View File

@ -387,39 +387,39 @@ static const u8 *const sTVBravoTrainerBattleTowerTextGroup[] = {
}; };
static const u8 *const sTVContestLiveUpdatesTextGroup[] = { static const u8 *const sTVContestLiveUpdatesTextGroup[] = {
gTVContestLiveUpdatesText00, [CONTESTLIVE_STATE_INTRO] = ContestLiveUpdates_Text_Intro,
gTVContestLiveUpdatesText01, [CONTESTLIVE_STATE_WON_BOTH_ROUNDS] = ContestLiveUpdates_Text_WonBothRounds,
gTVContestLiveUpdatesText02, [CONTESTLIVE_STATE_BETTER_ROUND2] = ContestLiveUpdates_Text_BetterRound2,
gTVContestLiveUpdatesText03, [CONTESTLIVE_STATE_EQUAL_ROUNDS] = ContestLiveUpdates_Text_EqualRounds,
gTVContestLiveUpdatesText04, [CONTESTLIVE_STATE_BETTER_ROUND1] = ContestLiveUpdates_Text_BetterRound1,
gTVContestLiveUpdatesText05, [CONTESTLIVE_STATE_GOT_NERVOUS] = ContestLiveUpdates_Text_GotNervous,
gTVContestLiveUpdatesText06, [CONTESTLIVE_STATE_STARTLED_OTHER] = ContestLiveUpdates_Text_StartledFoes,
gTVContestLiveUpdatesText07, [CONTESTLIVE_STATE_USED_COMBO] = ContestLiveUpdates_Text_UsedCombo,
gTVContestLiveUpdatesText08, [CONTESTLIVE_STATE_EXCITING_APPEAL] = ContestLiveUpdates_Text_ExcitingAppeal,
gTVContestLiveUpdatesText09, [CONTESTLIVE_STATE_COOL] = ContestLiveUpdates_Text_WasCool,
gTVContestLiveUpdatesText10, [CONTESTLIVE_STATE_BEAUTIFUL] = ContestLiveUpdates_Text_WasBeautiful,
gTVContestLiveUpdatesText11, [CONTESTLIVE_STATE_CUTE] = ContestLiveUpdates_Text_WasCute,
gTVContestLiveUpdatesText12, [CONTESTLIVE_STATE_SMART] = ContestLiveUpdates_Text_WasSmart,
gTVContestLiveUpdatesText13, [CONTESTLIVE_STATE_TOUGH] = ContestLiveUpdates_Text_WasTough,
gTVContestLiveUpdatesText14, [CONTESTLIVE_STATE_VERY_EXCITING_APPEAL] = ContestLiveUpdates_Text_VeryExcitingAppeal,
gTVContestLiveUpdatesText15, [CONTESTLIVE_STATE_VERY_COOL] = ContestLiveUpdates_Text_VeryCool,
gTVContestLiveUpdatesText16, [CONTESTLIVE_STATE_VERY_BEAUTIFUL] = ContestLiveUpdates_Text_VeryBeautiful,
gTVContestLiveUpdatesText17, [CONTESTLIVE_STATE_VERY_CUTE] = ContestLiveUpdates_Text_VeryCute,
gTVContestLiveUpdatesText18, [CONTESTLIVE_STATE_VERY_SMART] = ContestLiveUpdates_Text_VerySmart,
gTVContestLiveUpdatesText19, [CONTESTLIVE_STATE_VERY_TOUGH] = ContestLiveUpdates_Text_VeryTough,
gTVContestLiveUpdatesText20, [CONTESTLIVE_STATE_TOOK_BREAK] = ContestLiveUpdates_Text_TookBreak,
gTVContestLiveUpdatesText21, [CONTESTLIVE_STATE_GOT_STARTLED] = ContestLiveUpdates_Text_GotStartled,
gTVContestLiveUpdatesText22, [CONTESTLIVE_STATE_USED_MOVE] = ContestLiveUpdates_Text_MoveWonderful,
gTVContestLiveUpdatesText23, [CONTESTLIVE_STATE_TALK_ABOUT_LOSER] = ContestLiveUpdates_Text_TalkAboutAnotherMon,
gTVContestLiveUpdatesText24, [CONTESTLIVE_STATE_NO_APPEALS] = ContestLiveUpdates_Text_FailedToAppeal,
gTVContestLiveUpdatesText25, [CONTESTLIVE_STATE_LAST_BOTH] = ContestLiveUpdates_Text_LastInBothRounds,
gTVContestLiveUpdatesText26, [CONTESTLIVE_STATE_NOT_EXCITING_ENOUGH] = ContestLiveUpdates_Text_NotExcitingEnough,
gTVContestLiveUpdatesText27, [CONTESTLIVE_STATE_LOST_AFTER_ROUND1_WIN] = ContestLiveUpdates_Text_LostAfterWinningRound1,
gTVContestLiveUpdatesText28, [CONTESTLIVE_STATE_NO_EXCITING_APPEALS] = ContestLiveUpdates_Text_NeverExciting,
gTVContestLiveUpdatesText29, [CONTESTLIVE_STATE_LOST_SMALL_MARGIN] = ContestLiveUpdates_Text_LostBySmallMargin,
gTVContestLiveUpdatesText30, [CONTESTLIVE_STATE_REPEATED_APPEALS] = ContestLiveUpdates_Text_RepeatedAppeals,
gTVContestLiveUpdatesText31, [CONTESTLIVE_STATE_LOST] = ContestLiveUpdates_Text_ValiantEffortButLost,
gTVContestLiveUpdatesText32 [CONTESTLIVE_STATE_OUTRO] = ContestLiveUpdates_Text_Outro
}; };
static const u8 *const sTVPokemonBattleUpdateTextGroup[] = { static const u8 *const sTVPokemonBattleUpdateTextGroup[] = {
@ -1268,19 +1268,19 @@ static void InterviewAfter_ContestLiveUpdates(void)
show2 = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; show2 = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot];
show2->contestLiveUpdates.kind = TVSHOW_CONTEST_LIVE_UPDATES; show2->contestLiveUpdates.kind = TVSHOW_CONTEST_LIVE_UPDATES;
show2->contestLiveUpdates.active = TRUE; show2->contestLiveUpdates.active = TRUE;
StringCopy(show2->contestLiveUpdates.playerName, gSaveBlock2Ptr->playerName); StringCopy(show2->contestLiveUpdates.winningTrainerName, gSaveBlock2Ptr->playerName); // Show only begins running if player won, so always load players name
show2->contestLiveUpdates.category = gSpecialVar_ContestCategory; show2->contestLiveUpdates.category = gSpecialVar_ContestCategory;
show2->contestLiveUpdates.species = GetMonData(&gPlayerParty[gContestMonPartyIndex], MON_DATA_SPECIES, NULL); show2->contestLiveUpdates.winningSpecies = GetMonData(&gPlayerParty[gContestMonPartyIndex], MON_DATA_SPECIES, NULL);
show2->contestLiveUpdates.winningSpecies = show->contestLiveUpdates.winningSpecies; show2->contestLiveUpdates.losingSpecies = show->contestLiveUpdates.losingSpecies;
show2->contestLiveUpdates.appealFlags2 = show->contestLiveUpdates.appealFlags2; show2->contestLiveUpdates.loserAppealFlag = show->contestLiveUpdates.loserAppealFlag;
show2->contestLiveUpdates.round1Rank = show->contestLiveUpdates.round1Rank; show2->contestLiveUpdates.round1Placing = show->contestLiveUpdates.round1Placing;
show2->contestLiveUpdates.round2Rank = show->contestLiveUpdates.round2Rank; show2->contestLiveUpdates.round2Placing = show->contestLiveUpdates.round2Placing;
show2->contestLiveUpdates.move = show->contestLiveUpdates.move; show2->contestLiveUpdates.move = show->contestLiveUpdates.move;
show2->contestLiveUpdates.appealFlags1 = show->contestLiveUpdates.appealFlags1; show2->contestLiveUpdates.winnerAppealFlag = show->contestLiveUpdates.winnerAppealFlag;
StringCopy(show2->contestLiveUpdates.winningTrainerName, show->contestLiveUpdates.winningTrainerName); StringCopy(show2->contestLiveUpdates.losingTrainerName, show->contestLiveUpdates.losingTrainerName);
tv_store_id_2x(show2); tv_store_id_2x(show2);
show2->contestLiveUpdates.language = gGameLanguage; show2->contestLiveUpdates.winningTrainerLanguage = gGameLanguage;
show2->contestLiveUpdates.winningTrainerLanguage = show->contestLiveUpdates.winningTrainerLanguage; show2->contestLiveUpdates.losingTrainerLanguage = show->contestLiveUpdates.losingTrainerLanguage;
DeleteTVShowInArrayByIdx(gSaveBlock1Ptr->tvShows, LAST_TVSHOW_IDX); DeleteTVShowInArrayByIdx(gSaveBlock1Ptr->tvShows, LAST_TVSHOW_IDX);
} }
} }
@ -1399,7 +1399,7 @@ void PutFanClubSpecialOnTheAir(void)
} }
} }
void ContestLiveUpdates_BeforeInterview_1(u8 a0) void ContestLiveUpdates_Init(u8 round1Placing)
{ {
TVShow *show; TVShow *show;
@ -1408,12 +1408,12 @@ void ContestLiveUpdates_BeforeInterview_1(u8 a0)
if (sCurTVShowSlot != -1) if (sCurTVShowSlot != -1)
{ {
show = &gSaveBlock1Ptr->tvShows[LAST_TVSHOW_IDX]; show = &gSaveBlock1Ptr->tvShows[LAST_TVSHOW_IDX];
show->contestLiveUpdates.round1Rank = a0; show->contestLiveUpdates.round1Placing = round1Placing;
show->contestLiveUpdates.kind = TVSHOW_CONTEST_LIVE_UPDATES; show->contestLiveUpdates.kind = TVSHOW_CONTEST_LIVE_UPDATES;
} }
} }
void ContestLiveUpdates_BeforeInterview_2(u8 a0) void ContestLiveUpdates_SetRound2Placing(u8 round2Placing)
{ {
TVShow *show; TVShow *show;
@ -1421,11 +1421,11 @@ void ContestLiveUpdates_BeforeInterview_2(u8 a0)
sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows);
if (sCurTVShowSlot != -1) if (sCurTVShowSlot != -1)
{ {
show->contestLiveUpdates.round2Rank = a0; show->contestLiveUpdates.round2Placing = round2Placing;
} }
} }
void ContestLiveUpdates_BeforeInterview_3(u8 a0) void ContestLiveUpdates_SetWinnerAppealFlag(u8 flag)
{ {
TVShow *show; TVShow *show;
@ -1433,11 +1433,11 @@ void ContestLiveUpdates_BeforeInterview_3(u8 a0)
sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows);
if (sCurTVShowSlot != -1) if (sCurTVShowSlot != -1)
{ {
show->contestLiveUpdates.appealFlags1 = a0; show->contestLiveUpdates.winnerAppealFlag = flag;
} }
} }
void ContestLiveUpdates_BeforeInterview_4(u16 a0) void ContestLiveUpdates_SetWinnerMoveUsed(u16 move)
{ {
TVShow *show; TVShow *show;
@ -1445,11 +1445,11 @@ void ContestLiveUpdates_BeforeInterview_4(u16 a0)
sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows);
if (sCurTVShowSlot != -1) if (sCurTVShowSlot != -1)
{ {
show->contestLiveUpdates.move = a0; show->contestLiveUpdates.move = move;
} }
} }
void ContestLiveUpdates_BeforeInterview_5(u8 a0, u8 a1) void ContestLiveUpdates_SetLoserData(u8 flag, u8 loser)
{ {
TVShow *show; TVShow *show;
@ -1457,21 +1457,21 @@ void ContestLiveUpdates_BeforeInterview_5(u8 a0, u8 a1)
sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows);
if (sCurTVShowSlot != -1) if (sCurTVShowSlot != -1)
{ {
show->contestLiveUpdates.winningSpecies = gContestMons[a1].species; show->contestLiveUpdates.losingSpecies = gContestMons[loser].species;
StringCopy(show->contestLiveUpdates.winningTrainerName, gContestMons[a1].trainerName); StringCopy(show->contestLiveUpdates.losingTrainerName, gContestMons[loser].trainerName);
StripExtCtrlCodes(show->contestLiveUpdates.winningTrainerName); StripExtCtrlCodes(show->contestLiveUpdates.losingTrainerName);
show->contestLiveUpdates.appealFlags2 = a0; show->contestLiveUpdates.loserAppealFlag = flag;
if (a1 + 1 > gNumLinkContestPlayers) if (loser + 1 > gNumLinkContestPlayers)
{ {
show->contestLiveUpdates.winningTrainerLanguage = gLinkPlayers[0].language; show->contestLiveUpdates.losingTrainerLanguage = gLinkPlayers[0].language;
} }
else if (gGameLanguage == LANGUAGE_JAPANESE || gLinkPlayers[a1].language == LANGUAGE_JAPANESE) else if (gGameLanguage == LANGUAGE_JAPANESE || gLinkPlayers[loser].language == LANGUAGE_JAPANESE)
{ {
show->contestLiveUpdates.winningTrainerLanguage = LANGUAGE_JAPANESE; show->contestLiveUpdates.losingTrainerLanguage = LANGUAGE_JAPANESE;
} }
else else
{ {
show->contestLiveUpdates.winningTrainerLanguage = gLinkPlayers[a1].language; show->contestLiveUpdates.losingTrainerLanguage = gLinkPlayers[loser].language;
} }
} }
} }
@ -3810,10 +3810,10 @@ static void sub_80F0708(void) // FIXME: register allocation shenanigans
switch (gSaveBlock1Ptr->tvShows[i].common.kind) switch (gSaveBlock1Ptr->tvShows[i].common.kind)
{ {
case TVSHOW_CONTEST_LIVE_UPDATES: case TVSHOW_CONTEST_LIVE_UPDATES:
j = (&gSaveBlock1Ptr->tvShows[i])->contestLiveUpdates.species;
sub_80F0B24(j, i);
j = (&gSaveBlock1Ptr->tvShows[i])->contestLiveUpdates.winningSpecies; j = (&gSaveBlock1Ptr->tvShows[i])->contestLiveUpdates.winningSpecies;
sub_80F0B24(j, i); sub_80F0B24(j, i);
j = (&gSaveBlock1Ptr->tvShows[i])->contestLiveUpdates.losingSpecies;
sub_80F0B24(j, i);
break; break;
case TVSHOW_3_CHEERS_FOR_POKEBLOCKS: case TVSHOW_3_CHEERS_FOR_POKEBLOCKS:
break; break;
@ -4307,8 +4307,8 @@ static void sub_80F12A4(TVShow *shows)
curShow->bravoTrainerTower.pokemonNameLanguage = TV_GetStringLanguage(curShow->bravoTrainerTower.pokemonName); curShow->bravoTrainerTower.pokemonNameLanguage = TV_GetStringLanguage(curShow->bravoTrainerTower.pokemonName);
break; break;
case TVSHOW_CONTEST_LIVE_UPDATES: case TVSHOW_CONTEST_LIVE_UPDATES:
curShow->contestLiveUpdates.language = TV_GetStringLanguage(curShow->contestLiveUpdates.playerName);
curShow->contestLiveUpdates.winningTrainerLanguage = TV_GetStringLanguage(curShow->contestLiveUpdates.winningTrainerName); curShow->contestLiveUpdates.winningTrainerLanguage = TV_GetStringLanguage(curShow->contestLiveUpdates.winningTrainerName);
curShow->contestLiveUpdates.losingTrainerLanguage = TV_GetStringLanguage(curShow->contestLiveUpdates.losingTrainerName);
break; break;
case TVSHOW_3_CHEERS_FOR_POKEBLOCKS: case TVSHOW_3_CHEERS_FOR_POKEBLOCKS:
curShow->threeCheers.language = TV_GetStringLanguage(curShow->threeCheers.playerName); curShow->threeCheers.language = TV_GetStringLanguage(curShow->threeCheers.playerName);
@ -5173,6 +5173,12 @@ static void DoTVShowPokemonNewsMassOutbreak(void)
ShowFieldMessage(sTVMassOutbreakTextGroup[sTVShowState]); ShowFieldMessage(sTVMassOutbreakTextGroup[sTVShowState]);
} }
// TV Show that plays after a Link Contest.
// First talks about the winner and something they did, then about a losing player and something they did
// The show is only generated when the player wins, but can be record mixed to other games
// Each state buffers any needed data for a message to print from sTVContestLiveUpdatesTextGroup
// Many cases in this function are identical, and its size can be reduced a good deal by collapsing them
// Can't get this to match while collapsing them though
static void DoTVShowPokemonContestLiveUpdates(void) static void DoTVShowPokemonContestLiveUpdates(void)
{ {
TVShow *show; TVShow *show;
@ -5183,339 +5189,338 @@ static void DoTVShowPokemonContestLiveUpdates(void)
state = sTVShowState; state = sTVShowState;
switch (state) switch (state)
{ {
case 0: case CONTESTLIVE_STATE_INTRO:
BufferContestName(gStringVar1, show->contestLiveUpdates.category); BufferContestName(gStringVar1, show->contestLiveUpdates.category);
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
TVShowConvertInternationalString(gStringVar3, show->contestLiveUpdates.playerName, show->contestLiveUpdates.language); TVShowConvertInternationalString(gStringVar3, show->contestLiveUpdates.winningTrainerName, show->contestLiveUpdates.winningTrainerLanguage);
if (show->contestLiveUpdates.round1Rank == show->contestLiveUpdates.round2Rank) if (show->contestLiveUpdates.round1Placing == show->contestLiveUpdates.round2Placing)
{
if (show->contestLiveUpdates.round1Placing == 0)
{ {
if (show->contestLiveUpdates.round1Rank == 0) sTVShowState = CONTESTLIVE_STATE_WON_BOTH_ROUNDS;
{
sTVShowState = 1;
}
else
{
sTVShowState = 3;
}
}
else if (show->contestLiveUpdates.round1Rank > show->contestLiveUpdates.round2Rank)
{
sTVShowState = 2;
} }
else else
{ {
sTVShowState = 4; sTVShowState = CONTESTLIVE_STATE_EQUAL_ROUNDS;
} }
}
else if (show->contestLiveUpdates.round1Placing > show->contestLiveUpdates.round2Placing)
{
sTVShowState = CONTESTLIVE_STATE_BETTER_ROUND2;
}
else
{
sTVShowState = CONTESTLIVE_STATE_BETTER_ROUND1;
}
break;
case CONTESTLIVE_STATE_WON_BOTH_ROUNDS:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
switch (show->contestLiveUpdates.winnerAppealFlag)
{
case CONTESTLIVE_FLAG_EXCITING_APPEAL:
sTVShowState = CONTESTLIVE_STATE_EXCITING_APPEAL;
break; break;
case 1: case CONTESTLIVE_FLAG_GOT_NERVOUS:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); sTVShowState = CONTESTLIVE_STATE_GOT_NERVOUS;
switch (show->contestLiveUpdates.appealFlags1)
{
case 0x01:
sTVShowState = 8;
break;
case 0x02:
sTVShowState = 5;
break;
case 0x04:
sTVShowState = 14;
break;
case 0x08:
sTVShowState = 7;
break;
case 0x10:
sTVShowState = 6;
break;
case 0x20:
sTVShowState = 20;
break;
case 0x40:
sTVShowState = 21;
break;
case 0x80:
sTVShowState = 22;
break;
}
break; break;
case 2: case CONTESTLIVE_FLAG_MAXED_EXCITEMENT:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); sTVShowState = CONTESTLIVE_STATE_VERY_EXCITING_APPEAL;
switch (show->contestLiveUpdates.appealFlags1)
{
case 0x01:
sTVShowState = 8;
break;
case 0x02:
sTVShowState = 5;
break;
case 0x04:
sTVShowState = 14;
break;
case 0x08:
sTVShowState = 7;
break;
case 0x10:
sTVShowState = 6;
break;
case 0x20:
sTVShowState = 20;
break;
case 0x40:
sTVShowState = 21;
break;
case 0x80:
sTVShowState = 22;
break;
}
break; break;
case 3: case CONTESTLIVE_FLAG_USED_COMBO:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); sTVShowState = CONTESTLIVE_STATE_USED_COMBO;
TVShowConvertInternationalString(gStringVar3, show->contestLiveUpdates.playerName, show->contestLiveUpdates.language);
switch (show->contestLiveUpdates.appealFlags1)
{
case 0x01:
sTVShowState = 8;
break;
case 0x02:
sTVShowState = 5;
break;
case 0x04:
sTVShowState = 14;
break;
case 0x08:
sTVShowState = 7;
break;
case 0x10:
sTVShowState = 6;
break;
case 0x20:
sTVShowState = 20;
break;
case 0x40:
sTVShowState = 21;
break;
case 0x80:
sTVShowState = 22;
break;
}
break; break;
case 4: case CONTESTLIVE_FLAG_STARTLED_OTHER:
switch (show->contestLiveUpdates.category) sTVShowState = CONTESTLIVE_STATE_STARTLED_OTHER;
{
case 0:
StringCopy(gStringVar1, gText_Cool);
break;
case 1:
StringCopy(gStringVar1, gText_Beauty);
break;
case 2:
StringCopy(gStringVar1, gText_Cute);
break;
case 3:
StringCopy(gStringVar1, gText_Smart);
break;
case 4:
StringCopy(gStringVar1, gText_Tough);
break;
}
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]);
switch (show->contestLiveUpdates.appealFlags1)
{
case 0x01:
sTVShowState = 8;
break;
case 0x02:
sTVShowState = 5;
break;
case 0x04:
sTVShowState = 14;
break;
case 0x08:
sTVShowState = 7;
break;
case 0x10:
sTVShowState = 6;
break;
case 0x20:
sTVShowState = 20;
break;
case 0x40:
sTVShowState = 21;
break;
case 0x80:
sTVShowState = 22;
break;
}
break; break;
case 5: case CONTESTLIVE_FLAG_SKIPPED_TURN:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); sTVShowState = CONTESTLIVE_STATE_TOOK_BREAK;
sTVShowState = 23;
break; break;
case 6: case CONTESTLIVE_FLAG_GOT_STARTLED:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); sTVShowState = CONTESTLIVE_STATE_GOT_STARTLED;
sTVShowState = 23;
break; break;
case 7: case CONTESTLIVE_FLAG_MADE_APPEAL:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); sTVShowState = CONTESTLIVE_STATE_USED_MOVE;
sTVShowState = 23;
break; break;
case 8: }
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); break;
switch (show->contestLiveUpdates.category) case CONTESTLIVE_STATE_BETTER_ROUND2:
{ StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
case 0: switch (show->contestLiveUpdates.winnerAppealFlag)
sTVShowState = 9; {
break; case CONTESTLIVE_FLAG_EXCITING_APPEAL:
case 1: sTVShowState = CONTESTLIVE_STATE_EXCITING_APPEAL;
sTVShowState = 10;
break;
case 2:
sTVShowState = 11;
break;
case 3:
sTVShowState = 12;
break;
case 4:
sTVShowState = 13;
break;
}
break; break;
case 9: case CONTESTLIVE_FLAG_GOT_NERVOUS:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); sTVShowState = CONTESTLIVE_STATE_GOT_NERVOUS;
sTVShowState = 23;
break; break;
case 10: case CONTESTLIVE_FLAG_MAXED_EXCITEMENT:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); sTVShowState = CONTESTLIVE_STATE_VERY_EXCITING_APPEAL;
sTVShowState = 23;
break; break;
case 11: case CONTESTLIVE_FLAG_USED_COMBO:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); sTVShowState = CONTESTLIVE_STATE_USED_COMBO;
sTVShowState = 23;
break; break;
case 12: case CONTESTLIVE_FLAG_STARTLED_OTHER:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); sTVShowState = CONTESTLIVE_STATE_STARTLED_OTHER;
sTVShowState = 23;
break; break;
case 13: case CONTESTLIVE_FLAG_SKIPPED_TURN:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); sTVShowState = CONTESTLIVE_STATE_TOOK_BREAK;
sTVShowState = 23;
break; break;
case 14: case CONTESTLIVE_FLAG_GOT_STARTLED:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); sTVShowState = CONTESTLIVE_STATE_GOT_STARTLED;
switch (show->contestLiveUpdates.category)
{
case 0:
sTVShowState = 15;
break;
case 1:
sTVShowState = 16;
break;
case 2:
sTVShowState = 17;
break;
case 3:
sTVShowState = 18;
break;
case 4:
sTVShowState = 19;
break;
}
break; break;
case 15: case CONTESTLIVE_FLAG_MADE_APPEAL:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); sTVShowState = CONTESTLIVE_STATE_USED_MOVE;
sTVShowState = 23;
break; break;
case 16: }
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); break;
sTVShowState = 23; case CONTESTLIVE_STATE_EQUAL_ROUNDS:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
TVShowConvertInternationalString(gStringVar3, show->contestLiveUpdates.winningTrainerName, show->contestLiveUpdates.winningTrainerLanguage);
switch (show->contestLiveUpdates.winnerAppealFlag)
{
case CONTESTLIVE_FLAG_EXCITING_APPEAL:
sTVShowState = CONTESTLIVE_STATE_EXCITING_APPEAL;
break; break;
case 17: case CONTESTLIVE_FLAG_GOT_NERVOUS:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); sTVShowState = CONTESTLIVE_STATE_GOT_NERVOUS;
sTVShowState = 23;
break; break;
case 18: case CONTESTLIVE_FLAG_MAXED_EXCITEMENT:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); sTVShowState = CONTESTLIVE_STATE_VERY_EXCITING_APPEAL;
sTVShowState = 23;
break; break;
case 19: case CONTESTLIVE_FLAG_USED_COMBO:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); sTVShowState = CONTESTLIVE_STATE_USED_COMBO;
sTVShowState = 23;
break; break;
case 20: case CONTESTLIVE_FLAG_STARTLED_OTHER:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); sTVShowState = CONTESTLIVE_STATE_STARTLED_OTHER;
sTVShowState = 23;
break; break;
case 21: case CONTESTLIVE_FLAG_SKIPPED_TURN:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); sTVShowState = CONTESTLIVE_STATE_TOOK_BREAK;
sTVShowState = 23;
break; break;
case 22: case CONTESTLIVE_FLAG_GOT_STARTLED:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); sTVShowState = CONTESTLIVE_STATE_GOT_STARTLED;
StringCopy(gStringVar3, gMoveNames[show->contestLiveUpdates.move]);
sTVShowState = 23;
break; break;
case 23: case CONTESTLIVE_FLAG_MADE_APPEAL:
StringCopy(gStringVar1, gSpeciesNames[show->contestLiveUpdates.species]); sTVShowState = CONTESTLIVE_STATE_USED_MOVE;
TVShowConvertInternationalString(gStringVar2, show->contestLiveUpdates.winningTrainerName, show->contestLiveUpdates.winningTrainerLanguage);
StringCopy(gStringVar3, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
switch (show->contestLiveUpdates.appealFlags2)
{
case 0x01:
sTVShowState = 31;
break;
case 0x02:
sTVShowState = 30;
break;
case 0x04:
sTVShowState = 29;
break;
case 0x08:
sTVShowState = 28;
break;
case 0x10:
sTVShowState = 27;
break;
case 0x20:
sTVShowState = 26;
break;
case 0x40:
sTVShowState = 25;
break;
case 0x80:
sTVShowState = 24;
break;
}
break; break;
case 24: }
StringCopy(gStringVar1, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); break;
sTVShowState = 32; case CONTESTLIVE_STATE_BETTER_ROUND1:
switch (show->contestLiveUpdates.category)
{
case CONTEST_CATEGORY_COOL:
StringCopy(gStringVar1, gText_Cool);
break; break;
case 25: case CONTEST_CATEGORY_BEAUTY:
TVShowConvertInternationalString(gStringVar1, show->contestLiveUpdates.winningTrainerName, show->contestLiveUpdates.winningTrainerLanguage); StringCopy(gStringVar1, gText_Beauty);
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
sTVShowState = 32;
break; break;
case 28: case CONTEST_CATEGORY_CUTE:
sTVShowState = 32; StringCopy(gStringVar1, gText_Cute);
break; break;
case 29: case CONTEST_CATEGORY_SMART:
TVShowConvertInternationalString(gStringVar1, show->contestLiveUpdates.playerName, show->contestLiveUpdates.language); StringCopy(gStringVar1, gText_Smart);
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]);
TVShowConvertInternationalString(gStringVar3, show->contestLiveUpdates.winningTrainerName, show->contestLiveUpdates.winningTrainerLanguage);
sTVShowState = 32;
break; break;
case 26: case CONTEST_CATEGORY_TOUGH:
case 27: StringCopy(gStringVar1, gText_Tough);
case 30:
case 31:
TVShowConvertInternationalString(gStringVar1, show->contestLiveUpdates.winningTrainerName, show->contestLiveUpdates.winningTrainerLanguage);
sTVShowState = 32;
break; break;
case 32: }
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
TVShowConvertInternationalString(gStringVar1, show->contestLiveUpdates.playerName, show->contestLiveUpdates.language); switch (show->contestLiveUpdates.winnerAppealFlag)
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); {
TVShowDone(); case CONTESTLIVE_FLAG_EXCITING_APPEAL:
sTVShowState = CONTESTLIVE_STATE_EXCITING_APPEAL;
break; break;
case CONTESTLIVE_FLAG_GOT_NERVOUS:
sTVShowState = CONTESTLIVE_STATE_GOT_NERVOUS;
break;
case CONTESTLIVE_FLAG_MAXED_EXCITEMENT:
sTVShowState = CONTESTLIVE_STATE_VERY_EXCITING_APPEAL;
break;
case CONTESTLIVE_FLAG_USED_COMBO:
sTVShowState = CONTESTLIVE_STATE_USED_COMBO;
break;
case CONTESTLIVE_FLAG_STARTLED_OTHER:
sTVShowState = CONTESTLIVE_STATE_STARTLED_OTHER;
break;
case CONTESTLIVE_FLAG_SKIPPED_TURN:
sTVShowState = CONTESTLIVE_STATE_TOOK_BREAK;
break;
case CONTESTLIVE_FLAG_GOT_STARTLED:
sTVShowState = CONTESTLIVE_STATE_GOT_STARTLED;
break;
case CONTESTLIVE_FLAG_MADE_APPEAL:
sTVShowState = CONTESTLIVE_STATE_USED_MOVE;
break;
}
break;
case CONTESTLIVE_STATE_GOT_NERVOUS:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER;
break;
case CONTESTLIVE_STATE_STARTLED_OTHER:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER;
break;
case CONTESTLIVE_STATE_USED_COMBO:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER;
break;
case CONTESTLIVE_STATE_EXCITING_APPEAL:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
switch (show->contestLiveUpdates.category)
{
case CONTEST_CATEGORY_COOL:
sTVShowState = CONTESTLIVE_STATE_COOL;
break;
case CONTEST_CATEGORY_BEAUTY:
sTVShowState = CONTESTLIVE_STATE_BEAUTIFUL;
break;
case CONTEST_CATEGORY_CUTE:
sTVShowState = CONTESTLIVE_STATE_CUTE;
break;
case CONTEST_CATEGORY_SMART:
sTVShowState = CONTESTLIVE_STATE_SMART;
break;
case CONTEST_CATEGORY_TOUGH:
sTVShowState = CONTESTLIVE_STATE_TOUGH;
break;
}
break;
case CONTESTLIVE_STATE_COOL:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER;
break;
case CONTESTLIVE_STATE_BEAUTIFUL:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER;
break;
case CONTESTLIVE_STATE_CUTE:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER;
break;
case CONTESTLIVE_STATE_SMART:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER;
break;
case CONTESTLIVE_STATE_TOUGH:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER;
break;
case CONTESTLIVE_STATE_VERY_EXCITING_APPEAL:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
switch (show->contestLiveUpdates.category)
{
case CONTEST_CATEGORY_COOL:
sTVShowState = CONTESTLIVE_STATE_VERY_COOL;
break;
case CONTEST_CATEGORY_BEAUTY:
sTVShowState = CONTESTLIVE_STATE_VERY_BEAUTIFUL;
break;
case CONTEST_CATEGORY_CUTE:
sTVShowState = CONTESTLIVE_STATE_VERY_CUTE;
break;
case CONTEST_CATEGORY_SMART:
sTVShowState = CONTESTLIVE_STATE_VERY_SMART;
break;
case CONTEST_CATEGORY_TOUGH:
sTVShowState = CONTESTLIVE_STATE_VERY_TOUGH;
break;
}
break;
case CONTESTLIVE_STATE_VERY_COOL:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER;
break;
case CONTESTLIVE_STATE_VERY_BEAUTIFUL:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER;
break;
case CONTESTLIVE_STATE_VERY_CUTE:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER;
break;
case CONTESTLIVE_STATE_VERY_SMART:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER;
break;
case CONTESTLIVE_STATE_VERY_TOUGH:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER;
break;
case CONTESTLIVE_STATE_TOOK_BREAK:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER;
break;
case CONTESTLIVE_STATE_GOT_STARTLED:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER;
break;
case CONTESTLIVE_STATE_USED_MOVE:
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
StringCopy(gStringVar3, gMoveNames[show->contestLiveUpdates.move]);
sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER;
break;
case CONTESTLIVE_STATE_TALK_ABOUT_LOSER:
StringCopy(gStringVar1, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
TVShowConvertInternationalString(gStringVar2, show->contestLiveUpdates.losingTrainerName, show->contestLiveUpdates.losingTrainerLanguage);
StringCopy(gStringVar3, gSpeciesNames[show->contestLiveUpdates.losingSpecies]);
switch (show->contestLiveUpdates.loserAppealFlag)
{
case CONTESTLIVE_FLAG_LOST:
sTVShowState = CONTESTLIVE_STATE_LOST;
break;
case CONTESTLIVE_FLAG_REPEATED_MOVE:
sTVShowState = CONTESTLIVE_STATE_REPEATED_APPEALS;
break;
case CONTESTLIVE_FLAG_LOST_SMALL_MARGIN:
sTVShowState = CONTESTLIVE_STATE_LOST_SMALL_MARGIN;
break;
case CONTESTLIVE_FLAG_NO_EXCITEMENT:
sTVShowState = CONTESTLIVE_STATE_NO_EXCITING_APPEALS;
break;
case CONTESTLIVE_FLAG_BLEW_LEAD:
sTVShowState = CONTESTLIVE_STATE_LOST_AFTER_ROUND1_WIN;
break;
case CONTESTLIVE_FLAG_MISSED_EXCITEMENT:
sTVShowState = CONTESTLIVE_STATE_NOT_EXCITING_ENOUGH;
break;
case CONTESTLIVE_FLAG_LAST_BOTH_ROUNDS:
sTVShowState = CONTESTLIVE_STATE_LAST_BOTH;
break;
case CONTESTLIVE_FLAG_NO_APPEALS:
sTVShowState = CONTESTLIVE_STATE_NO_APPEALS;
break;
}
break;
case CONTESTLIVE_STATE_NO_APPEALS:
StringCopy(gStringVar1, gSpeciesNames[show->contestLiveUpdates.losingSpecies]);
sTVShowState = CONTESTLIVE_STATE_OUTRO;
break;
case CONTESTLIVE_STATE_LAST_BOTH:
TVShowConvertInternationalString(gStringVar1, show->contestLiveUpdates.losingTrainerName, show->contestLiveUpdates.losingTrainerLanguage);
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.losingSpecies]);
sTVShowState = CONTESTLIVE_STATE_OUTRO;
break;
case CONTESTLIVE_STATE_NO_EXCITING_APPEALS:
sTVShowState = CONTESTLIVE_STATE_OUTRO;
break;
case CONTESTLIVE_STATE_LOST_SMALL_MARGIN:
TVShowConvertInternationalString(gStringVar1, show->contestLiveUpdates.winningTrainerName, show->contestLiveUpdates.winningTrainerLanguage);
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
TVShowConvertInternationalString(gStringVar3, show->contestLiveUpdates.losingTrainerName, show->contestLiveUpdates.losingTrainerLanguage);
sTVShowState = CONTESTLIVE_STATE_OUTRO;
break;
case CONTESTLIVE_STATE_NOT_EXCITING_ENOUGH:
case CONTESTLIVE_STATE_LOST_AFTER_ROUND1_WIN:
case CONTESTLIVE_STATE_REPEATED_APPEALS:
case CONTESTLIVE_STATE_LOST:
TVShowConvertInternationalString(gStringVar1, show->contestLiveUpdates.losingTrainerName, show->contestLiveUpdates.losingTrainerLanguage);
sTVShowState = CONTESTLIVE_STATE_OUTRO;
break;
case CONTESTLIVE_STATE_OUTRO:
TVShowConvertInternationalString(gStringVar1, show->contestLiveUpdates.winningTrainerName, show->contestLiveUpdates.winningTrainerLanguage);
StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]);
TVShowDone();
break;
} }
ShowFieldMessage(sTVContestLiveUpdatesTextGroup[state]); ShowFieldMessage(sTVContestLiveUpdatesTextGroup[state]);
} }