diff --git a/include/battle.h b/include/battle.h index 3c2b6ed197..f3b788037e 100644 --- a/include/battle.h +++ b/include/battle.h @@ -669,6 +669,7 @@ struct BattleStruct u8 trainerSlidePlayerMonUnaffectedMsgState:2; bool8 trainerSlideMegaEvolutionMsgDone:1; bool8 trainerSlideZMoveMsgDone:1; + bool8 trainerSlideBeforeFirstTurnMsgDone:1; }; #define F_DYNAMIC_TYPE_1 (1 << 6) diff --git a/include/battle_message.h b/include/battle_message.h index de60d6d026..93bb63022b 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -236,6 +236,7 @@ enum TRAINER_SLIDE_PLAYER_MON_UNAFFECTED, TRAINER_SLIDE_MEGA_EVOLUTION, TRAINER_SLIDE_Z_MOVE, + TRAINER_SLIDE_BEFORE_FIRST_TURN, }; void BufferStringBattle(u16 stringID); diff --git a/src/battle_main.c b/src/battle_main.c index d144590d59..a93bef7ac6 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3776,6 +3776,9 @@ static void TryDoEventsBeforeFirstTurn(void) StopCryAndClearCrySongs(); BattleScriptExecute(BattleScript_ArenaTurnBeginning); } + + if ((i = ShouldDoTrainerSlide(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), TRAINER_SLIDE_BEFORE_FIRST_TURN))) + BattleScriptExecute(i == 1 ? BattleScript_TrainerASlideMsgEnd2 : BattleScript_TrainerBSlideMsgEnd2); } static void HandleEndTurn_ContinueBattle(void) diff --git a/src/battle_message.c b/src/battle_message.c index f321da46c0..ed430e9f8c 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -3881,6 +3881,7 @@ struct TrainerSlide const u8 *msgPlayerMonUnaffected; const u8 *msgMegaEvolution; const u8 *msgZMove; + const u8 *msgBeforeFirstTurn; }; static const struct TrainerSlide sTrainerSlides[] = @@ -3899,6 +3900,7 @@ static const struct TrainerSlide sTrainerSlides[] = .msgPlayerMonUnaffected = sText_ButNoEffect, .msgMegaEvolution = sText_PowderExplodes, .msgZMove = sText_Electromagnetism, + .msgBeforeFirstTurn = sText_GravityIntensified, }, */ }; @@ -4044,6 +4046,14 @@ u32 ShouldDoTrainerSlide(u32 battlerId, u32 which) return TRUE; } break; + case TRAINER_SLIDE_BEFORE_FIRST_TURN: + if (sTrainerSlides[i].msgBeforeFirstTurn != NULL && !gBattleStruct->trainerSlideBeforeFirstTurnMsgDone) + { + gBattleStruct->trainerSlideBeforeFirstTurnMsgDone = TRUE; + gBattleStruct->trainerSlideMsg = sTrainerSlides[i].msgBeforeFirstTurn; + return TRUE; + } + break; } break; }