From b85bf34862629e93b6cb63e0f7440fda6d35fe8b Mon Sep 17 00:00:00 2001 From: Tustin2121 Date: Sat, 10 Aug 2019 02:02:46 -0400 Subject: [PATCH] Whiteout Changes - The screen actually fades to white on whiteout now. - Added "trainer win" speeches to everyone (hopefully). - Fixed some bugs in Rustboro. --- data/battle_scripts_1.s | 24 ++++++++++- data/maps/RustboroCity/scripts.inc | 4 +- include/strings.h | 12 ++++++ src/battle_main.c | 5 ++- src/battle_message.c | 4 ++ src/battle_setup.c | 64 +++++++++++++++++++++++++++++- src/strings.c | 12 ++++++ 7 files changed, 119 insertions(+), 6 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index c2dadfa22..29dd6a265 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -3013,7 +3013,15 @@ BattleScript_LocalBattleLost:: jumpifhalfword CMP_EQUAL, gTrainerBattleOpponent_A, 0x400, BattleScript_LocalBattleLostEnd BattleScript_LocalBattleLostPrintWhiteOut:: printstring STRINGID_PLAYERWHITEOUT - waitmessage 0x40 + @ waitmessage 0x40 + @ Trihard Emerald + jumpifnotbattletype BATTLE_TYPE_TRAINER, BattleScript_LocalNormalBattleLostPrintWhiteOut + trainerslidein BS_ATTACKER + waitstate +BattleScript_LocalNormalBattleLostPrintWhiteOut: + printstring STRINGID_TRAINER1WINTEXT + @ waitmessage 0x40 + @ TriHard End printstring STRINGID_PLAYERWHITEOUT2 waitmessage 0x40 BattleScript_LocalBattleLostEnd:: @@ -3040,6 +3048,20 @@ BattleScript_LocalBattleLostDoTrainer2WinText:: BattleScript_LocalBattleLostEnd_:: end2 +BattleScript_LocalNormalBattleLostPrintTrainersWinText:: + printstring STRINGID_PLAYERWHITEOUT + waitmessage 0x40 + jumpifnotbattletype BATTLE_TYPE_TRAINER, BattleScript_LocalBattleLostPrintWhiteOut + trainerslidein BS_ATTACKER + waitstate + printstring STRINGID_TRAINER1WINTEXT + waitmessage 0x40 +BattleScript_LocalNormalBattleLostEnd_:: + printstring STRINGID_PLAYERWHITEOUT2 + waitmessage 0x40 + end2 + + BattleScript_82DAA0B:: returnopponentmon1toball BS_ATTACKER waitstate diff --git a/data/maps/RustboroCity/scripts.inc b/data/maps/RustboroCity/scripts.inc index 9cc7a2365..740d64f47 100644 --- a/data/maps/RustboroCity/scripts.inc +++ b/data/maps/RustboroCity/scripts.inc @@ -348,10 +348,10 @@ RustboroCity_Text_AquaGirl_Boy: .string "Do it again, and I deck ya one.$" RustboroCity_Text_AquaGirl_Girl: .string "Gotta say, girl. I was ready to turn\n" - .string "around a deck a guy wanting to get\l" + .string "around and deck a guy wanting to get\l" .string "handsey with me.\p" .string "Yeah, you know what I mean. That\n" - .string "face your making is mood.$" + .string "face you're making is mood.$" RustboroCity_EventScript_AquaGirlB: msgbox RustboroCity_Text_AquaGirlB, MSGBOX_NPC end diff --git a/include/strings.h b/include/strings.h index b8d1ca726..3164d68ab 100644 --- a/include/strings.h +++ b/include/strings.h @@ -2741,6 +2741,18 @@ extern const u8 gText_TrainerCloseBy[]; extern const u8 gText_The[]; +extern const u8 gText_Whiteout_WildMon[]; +extern const u8 gText_Whiteout_GoodTrainer[]; +extern const u8 gText_Whiteout_YoungTrainer[]; +extern const u8 gText_Whiteout_NinjaTrainer[]; +extern const u8 gText_Whiteout_Interview[]; +extern const u8 gText_Whiteout_Embarrasment[]; +extern const u8 gText_Whiteout_BadTrainer[]; +extern const u8 gText_Whiteout_AquaTrainer[]; +extern const u8 gText_Whiteout_AquaAdmin[]; +extern const u8 gText_Whiteout_RivalHero[]; +extern const u8 gText_Whiteout_RivalBirch[]; + extern const u8 gText_Sunday[]; extern const u8 gText_Monday[]; extern const u8 gText_Tuesday[]; diff --git a/src/battle_main.c b/src/battle_main.c index 74814135c..f96525ecb 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -5192,7 +5192,10 @@ static void HandleEndTurn_FinishBattle(void) sub_8186444(); Restore1HPDeathPreventedMons(); RemoveDeadMonFromParty(TRUE); - BeginFastPaletteFade(3); + if (gBattleOutcome == B_OUTCOME_LOST || gBattleOutcome == B_OUTCOME_DREW) + BeginFastPaletteFade(1); + else + BeginFastPaletteFade(3); FadeOutMapMusic(5); gBattleMainFunc = FreeResetData_ReturnToOvOrDoEvolutions; gCB2_AfterEvolution = BattleMainCB2; diff --git a/src/battle_message.c b/src/battle_message.c index f6549abd1..bc8672148 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -2618,6 +2618,10 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) CopyTrainerHillTrainerText(3, gTrainerBattleOpponent_A); toCpy = gStringVar4; } + else + { + toCpy = GetTrainerWonSpeech(); + } break; case B_TXT_26: // ? HANDLE_NICKNAME_STRING_CASE(gBattleScripting.battler, *(&gBattleStruct->field_52)) diff --git a/src/battle_setup.c b/src/battle_setup.c index a5aea579c..53d66738b 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -368,6 +368,55 @@ static void CreateBattleStartTask(u8 transition, u16 song) #undef tState #undef tTransition +void BattleSetup_SetupVictoryLines(void) +{ + if (gTrainerBattleOpponent_A == TRAINER_NONE) return; + switch (gTrainers[gTrainerBattleOpponent_A].trainerClass) + { + case TRAINER_CLASS_MAGMA_ADMIN: + case TRAINER_CLASS_MAGMA_LEADER: + case TRAINER_CLASS_TEAM_MAGMA: + sTrainerVictorySpeech = (u8*)gText_Whiteout_BadTrainer; + break; + case TRAINER_CLASS_TEAM_AQUA: + sTrainerVictorySpeech = (u8*)gText_Whiteout_AquaTrainer; + break; + case TRAINER_CLASS_AQUA_ADMIN: + sTrainerVictorySpeech = (u8*)gText_Whiteout_AquaAdmin; + break; + case TRAINER_CLASS_CHAMPION: + case TRAINER_CLASS_ELITE_FOUR: + sTrainerVictorySpeech = (u8*)gText_Whiteout_Embarrasment; + break; + case TRAINER_CLASS_YOUNGSTER: + case TRAINER_CLASS_SCHOOL_KID: + case TRAINER_CLASS_TWINS: + case TRAINER_CLASS_TUBER_F: + case TRAINER_CLASS_TUBER_M: + sTrainerVictorySpeech = (u8*)gText_Whiteout_YoungTrainer; + break; + case TRAINER_CLASS_NINJA_BOY: + sTrainerVictorySpeech = (u8*)gText_Whiteout_NinjaTrainer; + break; + case TRAINER_CLASS_INTERVIEWER: + sTrainerVictorySpeech = (u8*)gText_Whiteout_Interview; + break; + case TRAINER_CLASS_PKMN_TRAINER_3: + if (gTrainers[gTrainerBattleOpponent_A].trainerPic == TRAINER_PIC_WALLY) + { + sTrainerVictorySpeech = (u8*)gText_Whiteout_RivalHero; + } + else + { + sTrainerVictorySpeech = (u8*)gText_Whiteout_RivalBirch; + } + break; + default: + sTrainerVictorySpeech = (u8*)gText_Whiteout_GoodTrainer; + break; + } +} + void BattleSetup_StartWildBattle(void) { if (GetSafariZoneFlag()) @@ -1312,6 +1361,8 @@ void BattleSetup_StartTrainerBattle(void) SetHillTrainerFlag(); } + + BattleSetup_SetupVictoryLines(); sNoOfPossibleTrainerRetScripts = gNoOfApproachingTrainers; gNoOfApproachingTrainers = 0; @@ -1374,6 +1425,7 @@ void BattleSetup_StartRematchBattle(void) { gBattleTypeFlags = BATTLE_TYPE_TRAINER; gMain.savedCallback = CB2_EndRematchBattle; + BattleSetup_SetupVictoryLines(); DoTrainerBattle(); ScriptContext1_Stop(); } @@ -1521,7 +1573,7 @@ static const u8 *GetIntroSpeechOfApproachingTrainer(void) const u8 *GetTrainerALoseText(void) { const u8 *string; - + if (gTrainerBattleOpponent_A == TRAINER_SECRET_BASE) string = GetSecretBaseTrainerLoseText(); else @@ -1539,7 +1591,15 @@ const u8 *GetTrainerBLoseText(void) const u8 *GetTrainerWonSpeech(void) { - return ReturnEmptyStringIfNull(sTrainerVictorySpeech); + const u8 *string; + + if ((gBattleTypeFlags & BATTLE_TYPE_TRAINER) == 0) + string = gText_Whiteout_WildMon; + else + string = sTrainerVictorySpeech; + + StringExpandPlaceholders(gStringVar4, ReturnEmptyStringIfNull(string)); + return gStringVar4; } static const u8 *GetTrainerCantBattleSpeech(void) diff --git a/src/strings.c b/src/strings.c index c0645d32b..c27376118 100644 --- a/src/strings.c +++ b/src/strings.c @@ -1919,6 +1919,18 @@ const u8 gText_PokeBalls[] = _("POKé BALLS"); const u8 gText_Berry[] = _("BERRY"); const u8 gText_Berries[] = _("BERRIES"); +const u8 gText_Whiteout_WildMon[] = _("The wild Pokémon lunged for {PLAYER}!"); +const u8 gText_Whiteout_GoodTrainer[] = _("Good battle!\pHey, are you alright?"); +const u8 gText_Whiteout_YoungTrainer[] = _("Yay I won! You lost! Ha ha!\p{PLAYER} curled up into a ball in embarrassment."); +const u8 gText_Whiteout_NinjaTrainer[] = _("You fell to the ninja! Whacha!"); +const u8 gText_Whiteout_Interview[] = _("Gabby: Do you have any final words before\nthis goes to air to millions?\p{PLAYER} curled up into a ball in embarrassment."); +const u8 gText_Whiteout_Embarrasment[] = _("The crowds go wild.\p{PLAYER} curled up into a ball in embarrassment."); +const u8 gText_Whiteout_BadTrainer[] = _("Now, finish {PLAYER_them} off!\pThe foe Pokémon lunged for {PLAYER}!"); +const u8 gText_Whiteout_AquaTrainer[] = _("I guess I won this scrap!\pYou alright? You don't look so good."); +const u8 gText_Whiteout_AquaAdmin[] = _("As usual for one of our grunts…"); +const u8 gText_Whiteout_RivalHero[] = _("{RIVAL_HERO}: Serves you right…"); +const u8 gText_Whiteout_RivalBirch[] = _("{RIVAL_BIRCH}: Ah, good…\nSee how it feels for once?"); + const u8 gText_Num1[] = _("one"); const u8 gText_Num2[] = _("two"); const u8 gText_Num3[] = _("three");