diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 59ab539028..24f05d6e63 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -8474,8 +8474,6 @@ Move_GRASSY_TERRAIN:: delay 4 createvisualtask AnimTask_BlendBattleAnimPal, 10, ANIM_PAL_BG, 3, 4, 0, RGB(31, 24, 31) waitforvisualfinish - restorebg - waitbgfadein end Move_MISTY_TERRAIN:: @@ -8514,8 +8512,6 @@ Move_MISTY_TERRAIN:: delay 4 createvisualtask AnimTask_BlendBattleAnimPal, 10, ANIM_PAL_BG, 3, 7, 0, RGB(31, 24, 31) waitforvisualfinish - restorebg - waitbgfadein end Move_ELECTRIFY:: @@ -9399,8 +9395,6 @@ Move_ELECTRIC_TERRAIN:: delay 2 createvisualtask AnimTask_BlendBattleAnimPal, 10, ANIM_PAL_BG, 3, 4, 0, RGB(28, 28, 0) waitforvisualfinish - restorebg - waitbgfadein end Move_DAZZLING_GLEAM:: @@ -11056,8 +11050,6 @@ Move_PSYCHIC_TERRAIN:: delay 4 createvisualtask AnimTask_BlendBattleAnimPal, 10, ANIM_PAL_BG, 3, 4, 0, RGB(27, 0, 13) waitforvisualfinish - restorebg - waitbgfadein end Move_LUNGE:: diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 5a7af4fb87..28644edf7c 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -1520,6 +1520,7 @@ BattleScript_EffectPsychicTerrain: waitanimation printfromtable gTerrainStringIds waitmessage 0x40 + playanimation BS_SCRIPTING, B_ANIM_RESTORE_BG, NULL goto BattleScript_MoveEnd BattleScript_EffectTopsyTurvy: @@ -6893,7 +6894,7 @@ BattleScript_ElectricSurgeActivates:: pause 0x20 call BattleScript_AbilityPopUp printstring STRINGID_TERRAINBECOMESELECTRIC - waitstate + waitmessage 0x40 playanimation BS_SCRIPTING, B_ANIM_RESTORE_BG, NULL end3 @@ -6901,7 +6902,7 @@ BattleScript_MistySurgeActivates:: pause 0x20 call BattleScript_AbilityPopUp printstring STRINGID_TERRAINBECOMESMISTY - waitstate + waitmessage 0x40 playanimation BS_SCRIPTING, B_ANIM_RESTORE_BG, NULL end3 @@ -6909,7 +6910,7 @@ BattleScript_GrassySurgeActivates:: pause 0x20 call BattleScript_AbilityPopUp printstring STRINGID_TERRAINBECOMESGRASSY - waitstate + waitmessage 0x40 playanimation BS_SCRIPTING, B_ANIM_RESTORE_BG, NULL end3 @@ -6917,7 +6918,7 @@ BattleScript_PsychicSurgeActivates:: pause 0x20 call BattleScript_AbilityPopUp printstring STRINGID_TERRAINBECOMESPSYCHIC - waitstate + waitmessage 0x40 playanimation BS_SCRIPTING, B_ANIM_RESTORE_BG, NULL end3 diff --git a/data/event_scripts.s b/data/event_scripts.s index 8039be6876..f22377aa27 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -2,6 +2,7 @@ #include "constants/apprentice.h" #include "constants/battle.h" #include "constants/battle_arena.h" +#include "constants/battle_config.h" #include "constants/battle_dome.h" #include "constants/battle_factory.h" #include "constants/battle_frontier.h" diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 90766f9d59..6d32abfa8c 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -518,15 +518,11 @@ #define B_ANIM_INGRAIN_HEAL 0x15 #define B_ANIM_WISH_HEAL 0x16 #define B_ANIM_MEGA_EVOLUTION 0x17 -#define B_ANIM_TERRAIN_MISTY 0x18 -#define B_ANIM_TERRAIN_GRASSY 0x19 -#define B_ANIM_TERRAIN_ELECTRIC 0x1A -#define B_ANIM_TERRAIN_PSYCHIC 0x1B -#define B_ANIM_ILLUSION_OFF 0x1C -#define B_ANIM_FORM_CHANGE 0x1D -#define B_ANIM_SLIDE_OFFSCREEN 0x1E // for Emergency Exit -#define B_ANIM_RESTORE_BG 0x1F // for Terrain Endings -#define B_ANIM_TOTEM_FLARE 0x20 // Totem boosts aura flare +#define B_ANIM_ILLUSION_OFF 0x18 +#define B_ANIM_FORM_CHANGE 0x19 +#define B_ANIM_SLIDE_OFFSCREEN 0x1A // for Emergency Exit +#define B_ANIM_RESTORE_BG 0x1B // for Terrain Endings +#define B_ANIM_TOTEM_FLARE 0x1C // Totem boosts aura flare // special animations table #define B_ANIM_LVL_UP 0x0 diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 0c063f2fbc..5b4a895f50 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -135,7 +135,7 @@ // Var Settings // To use the following features in scripting, replace the 0s with the Var ID you're assigning to it. Eg: replace VAR_UNUSED_0x40F7 with VAR_TERRAIN for that feature -#define VAR_TERRAIN 0 // If this var has a value, assigning a STATUS_FIELD_xx_TERRAIN to it before battle causes the battle to start with that terrain active +#define VAR_TERRAIN VAR_UNUSED_0x40F7 // If this var has a value, assigning a STATUS_FIELD_xx_TERRAIN to it before battle causes the battle to start with that terrain active // Interface settings #define B_ABILITY_POP_UP TRUE // In Gen5+, the Pokémon abilities are displayed in a pop-up, when they activate in battle. @@ -173,7 +173,7 @@ #define B_NEW_SURF_PARTICLE_PALETTE TRUE // If set to TRUE, it updates Surf's wave palette. #define HIDE_HEALTHBOXES_DURING_ANIMS TRUE // If set to TRUE, hides healthboxes during move animations -#define B_TERRAIN_BG_CHANGE TRUE // If set to TRUE, terrain moves permanently change the default battle background until the effect fades. +#define B_TERRAIN_BG_CHANGE FALSE // If set to TRUE, terrain moves permanently change the default battle background until the effect fades. #define B_ENABLE_DEBUG TRUE // If set to TRUE, enables a debug menu to use in battles by pressing the Select button. #endif // GUARD_CONSTANTS_BATTLE_CONFIG_H diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 6c5f37a7d4..c86691cd89 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -4403,6 +4403,15 @@ static void Cmd_playanimation(void) gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); argumentPtr = T2_READ_PTR(gBattlescriptCurrInstr + 3); + + #if B_TERRAIN_BG_CHANGE == FALSE + if (gBattlescriptCurrInstr[2] == B_ANIM_RESTORE_BG) + { + // workaround for .if not working + gBattlescriptCurrInstr += 7; + return; + } + #endif if (gBattlescriptCurrInstr[2] == B_ANIM_STATS_CHANGE || gBattlescriptCurrInstr[2] == B_ANIM_SNATCH_MOVE