2 Forcing Battle Animations for Major Battles
SonikkuA-DatH edited this page 2021-12-30 00:26:50 -08:00

Caveat: this is for scripted events. Battles triggered by a trainer seeing you causes glitches if one tries editing their script As such, this is for trainers using trainerbattle_no_intro


Remember how in Pokemon RGB, fighting the rival champion forced battle anims on, even if you set it off before? Which made the fight seem more special?

Despite this not appearing in later gens for some reason, we can add it back!

First, make a new var (or recycle an unused one) to use for setting a value in include/constants/vars.h

#define VAR_ROXANNE_CALL_STEP_COUNTER        0x40F4
#define VAR_SCOTT_BF_CALL_STEP_COUNTER       0x40F5
#define VAR_RIVAL_RAYQUAZA_CALL_STEP_COUNTER 0x40F6
-#define VAR_UNUSED_0x40F7                    0x40F7 // Unused Var
+#define VAR_FORCEANIM                       0x40F7

In scripting, we'll use this to determine when we want to force Battle anims on

In src/battle_main.c , in static void BattleStartClearSetData(void), tweak this...

-if (!(gBattleTypeFlags & BATTLE_TYPE_LINK) && gSaveBlock2Ptr->optionsBattleSceneOff == TRUE)
+if (!(gBattleTypeFlags & BATTLE_TYPE_LINK) && gSaveBlock2Ptr->optionsBattleSceneOff == TRUE && VarGet(VAR_FORCEANIM) != 1)

So now the variable actually matters

But wait, you might ask. What if I lose those important fights? No worry, in src/overworld.c just go to void DoWhiteOut(void) and add a varset before warping, like so

void DoWhiteOut(void)
{
    ScriptContext2_RunNewScript(EventScript_WhiteOut);
    SetMoney(&gSaveBlock1Ptr->money, GetMoney(&gSaveBlock1Ptr->money) / 2);
+   VarSet(VAR_FORCEANIM, 0);
    HealPlayerParty();
    Overworld_ResetStateAfterWhiteOut();
    SetWarpDestinationToLastHealLocation();
    WarpIntoMap();
}

And you're done, functionality wise! Just edit your event scripts to set and unset the variable (for when you win) for the important trainer, and you're set like soo...