diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index ccb887327fae..0bb9e072bea8 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1044,7 +1044,7 @@ .byte 0xcb .endm - .macro callterrainattack + .macro callenvironmentattack .byte 0xcc .endm @@ -1192,7 +1192,7 @@ .4byte \ptr .endm - .macro settypetoterrain ptr:req + .macro settypetoenvironment ptr:req .byte 0xeb .4byte \ptr .endm diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 45197618452d..489bffb2078c 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -2097,7 +2097,7 @@ Move_MEAN_LOOK: Move_ROCK_THROW: loadspritegfx ANIM_TAG_ROCKS - createsprite gShakeMonOrTerrainSpriteTemplate, ANIM_TARGET, 2, 6, 1, 15, 1 + createsprite gShakeMonOrPlatformSpriteTemplate, ANIM_TARGET, 2, 6, 1, 15, 1 createsprite gFallingRockSpriteTemplate, ANIM_TARGET, 2, 0, 1, 0, 0 playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET delay 6 @@ -2119,7 +2119,7 @@ Move_ROCK_THROW: Move_ROCK_SLIDE: loadspritegfx ANIM_TAG_ROCKS monbg ANIM_DEF_PARTNER - createsprite gShakeMonOrTerrainSpriteTemplate, ANIM_ATTACKER, 2, 7, 1, 11, 1 + createsprite gShakeMonOrPlatformSpriteTemplate, ANIM_ATTACKER, 2, 7, 1, 11, 1 createsprite gFallingRockSpriteTemplate, ANIM_TARGET, 2, -5, 1, -5, 1 playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET delay 2 @@ -2909,7 +2909,7 @@ Move_BARRAGE: createvisualtask AnimTask_BarrageBall, 3 playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER delay 24 - createsprite gShakeMonOrTerrainSpriteTemplate, ANIM_ATTACKER, 2, 8, 1, 40, 1 + createsprite gShakeMonOrPlatformSpriteTemplate, ANIM_ATTACKER, 2, 8, 1, 40, 1 createvisualtask AnimTask_ShakeMon, 3, ANIM_TARGET, 0, 4, 20, 1 createvisualtask AnimTask_ShakeMon, 3, ANIM_DEF_PARTNER, 0, 4, 20, 1 loopsewithpan SE_M_STRENGTH, SOUND_PAN_TARGET, 8, 2 @@ -3660,7 +3660,7 @@ Move_SUPERPOWER: createsprite gSuperpowerOrbSpriteTemplate, ANIM_TARGET, 2, ANIM_ATTACKER playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER delay 20 - createsprite gShakeMonOrTerrainSpriteTemplate, ANIM_ATTACKER, 2, 4, 1, 180, 1 + createsprite gShakeMonOrPlatformSpriteTemplate, ANIM_ATTACKER, 2, 4, 1, 180, 1 createvisualtask SoundTask_PlaySE2WithPanning, 5, SE_M_EARTHQUAKE, 0 delay 40 createsprite gSuperpowerRockSpriteTemplate, ANIM_ATTACKER, 41, 200, 96, 1, 120 @@ -5011,7 +5011,7 @@ SnoreEffect: playsewithpan SE_M_SNORE, SOUND_PAN_ATTACKER createvisualtask AnimTask_ScaleMonAndRestore, 5, -7, -7, 7, ANIM_ATTACKER, 1 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 7, 1 - createsprite gShakeMonOrTerrainSpriteTemplate, ANIM_ATTACKER, 2, 6, 1, 14, 0, 0 + createsprite gShakeMonOrPlatformSpriteTemplate, ANIM_ATTACKER, 2, 6, 1, 14, 0, 0 createsprite gSnoreZSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, -42, -38, 24, 0, 0 createsprite gSnoreZSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 0, -42, 24, 0, 0 createsprite gSnoreZSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 42, -38, 24, 0, 0 @@ -6871,7 +6871,7 @@ Move_ANCIENT_POWER: loadspritegfx ANIM_TAG_IMPACT monbg ANIM_DEF_PARTNER setalpha 12, 8 - createsprite gShakeMonOrTerrainSpriteTemplate, ANIM_ATTACKER, 2, 4, 1, 10, 1 + createsprite gShakeMonOrPlatformSpriteTemplate, ANIM_ATTACKER, 2, 4, 1, 10, 1 createsprite gAncientPowerRockSpriteTemplate, ANIM_ATTACKER, 2, 20, 32, -48, 50, 2 createsprite gAncientPowerRockSpriteTemplate, ANIM_ATTACKER, 2, 0, 32, -38, 25, 5 createsprite gAncientPowerRockSpriteTemplate, ANIM_ATTACKER, 2, 32, 32, -28, 40, 3 @@ -7292,14 +7292,14 @@ Move_METAL_CLAW: playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET createsprite gClawSlashSpriteTemplate, ANIM_TARGET, 2, -10, -10, 0 createsprite gClawSlashSpriteTemplate, ANIM_TARGET, 2, -10, 10, 0 - createsprite gShakeMonOrTerrainSpriteTemplate, ANIM_ATTACKER, 2, -4, 1, 10, 3, 1 + createsprite gShakeMonOrPlatformSpriteTemplate, ANIM_ATTACKER, 2, -4, 1, 10, 3, 1 delay 8 createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 6, 4 delay 2 playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET createsprite gClawSlashSpriteTemplate, ANIM_TARGET, 2, 10, -10, 1 createsprite gClawSlashSpriteTemplate, ANIM_TARGET, 2, 10, 10, 1 - createsprite gShakeMonOrTerrainSpriteTemplate, ANIM_ATTACKER, 2, -4, 1, 10, 3, 1 + createsprite gShakeMonOrPlatformSpriteTemplate, ANIM_ATTACKER, 2, -4, 1, 10, 3, 1 waitforvisualfinish end @@ -8515,7 +8515,7 @@ HyperVoiceEffect: createsprite gHyperVoiceRingSpriteTemplate, ANIM_ATTACKER, 0, 45, 0, 0, 0, 0, 0, 1 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 6, 1 createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 1, 0, 6, 1 - createvisualtask AnimTask_ShakeBattleTerrain, 2, 1, 0, 6, 1 + createvisualtask AnimTask_ShakeBattlePlatforms, 2, 1, 0, 6, 1 createvisualtask SoundTask_WaitForCry, 5 return @@ -8637,7 +8637,7 @@ Move_DRAGON_CLAW: createvisualtask SoundTask_PlaySE1WithPanning, 5, SE_M_RAZOR_WIND, SOUND_PAN_TARGET createsprite gClawSlashSpriteTemplate, ANIM_TARGET, 2, -10, -10, 0 createsprite gClawSlashSpriteTemplate, ANIM_TARGET, 2, -10, 10, 0 - createsprite gShakeMonOrTerrainSpriteTemplate, ANIM_ATTACKER, 2, -4, 1, 10, 3, 1 + createsprite gShakeMonOrPlatformSpriteTemplate, ANIM_ATTACKER, 2, -4, 1, 10, 3, 1 createsprite gFireSpinSpriteTemplate, ANIM_ATTACKER, 2, 0, 32, 480, 20, 16, -46, ANIM_ATTACKER delay 2 createsprite gFireSpinSpriteTemplate, ANIM_ATTACKER, 2, 0, 33, 576, 20, 8, 42, ANIM_ATTACKER @@ -8650,7 +8650,7 @@ Move_DRAGON_CLAW: createvisualtask SoundTask_PlaySE1WithPanning, 5, SE_M_RAZOR_WIND, SOUND_PAN_TARGET createsprite gClawSlashSpriteTemplate, ANIM_TARGET, 2, 10, -10, 1 createsprite gClawSlashSpriteTemplate, ANIM_TARGET, 2, 10, 10, 1 - createsprite gShakeMonOrTerrainSpriteTemplate, ANIM_ATTACKER, 2, -4, 1, 10, 3, 1 + createsprite gShakeMonOrPlatformSpriteTemplate, ANIM_ATTACKER, 2, -4, 1, 10, 3, 1 createsprite gFireSpinSpriteTemplate, ANIM_ATTACKER, 2, 0, 33, 464, 30, 15, -50, ANIM_ATTACKER delay 2 createsprite gFireSpinSpriteTemplate, ANIM_ATTACKER, 2, 0, 28, 528, 30, 13, 50, ANIM_ATTACKER @@ -9111,7 +9111,7 @@ Move_BLAST_BURN: createsprite gFirePlumeSpriteTemplate, ANIM_ATTACKER, 70, 60, -30, 24, 0, 0, 0 createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 2, -4, 3, ANIM_TARGET, 0 createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 12, 0, 20, 1 - createvisualtask AnimTask_ShakeBattleTerrain, 2, 2, 0, 10, 1 + createvisualtask AnimTask_ShakeBattlePlatforms, 2, 2, 0, 10, 1 createsprite gFirePlumeSpriteTemplate, ANIM_ATTACKER, 66, 96, 0, 24, 0, 0, 0 createsprite gFirePlumeSpriteTemplate, ANIM_ATTACKER, 66, 60, 30, 24, 0, 0, 0 createsprite gFirePlumeSpriteTemplate, ANIM_ATTACKER, 2, 0, 48, 24, 0, 0, 0 @@ -9125,32 +9125,32 @@ Move_BLAST_BURN: Move_ROCK_TOMB: loadspritegfx ANIM_TAG_X_SIGN loadspritegfx ANIM_TAG_ROCKS - createvisualtask AnimTask_ShakeBattleTerrain, 2, 2, 0, 10, 1 + createvisualtask AnimTask_ShakeBattlePlatforms, 2, 2, 0, 10, 1 waitforvisualfinish createsprite gRockTombRockSpriteTemplate, ANIM_TARGET, 2, 20, 12, 64, 114, 0 delay 8 - createvisualtask AnimTask_ShakeBattleTerrain, 2, 0, 2, 3, 1 + createvisualtask AnimTask_ShakeBattlePlatforms, 2, 0, 2, 3, 1 playsewithpan SE_M_STRENGTH, SOUND_PAN_TARGET delay 8 createsprite gRockTombRockSpriteTemplate, ANIM_TARGET, 2, -20, 12, 64, 98, 0 delay 8 - createvisualtask AnimTask_ShakeBattleTerrain, 2, 0, 2, 3, 1 + createvisualtask AnimTask_ShakeBattlePlatforms, 2, 0, 2, 3, 1 playsewithpan SE_M_STRENGTH, SOUND_PAN_TARGET delay 8 createsprite gRockTombRockSpriteTemplate, ANIM_TARGET, 66, 3, 6, 64, 82, 0 delay 8 - createvisualtask AnimTask_ShakeBattleTerrain, 2, 0, 2, 3, 1 + createvisualtask AnimTask_ShakeBattlePlatforms, 2, 0, 2, 3, 1 playsewithpan SE_M_STRENGTH, SOUND_PAN_TARGET delay 8 createsprite gRockTombRockSpriteTemplate, ANIM_TARGET, 2, -3, 13, 64, 66, 0 delay 8 - createvisualtask AnimTask_ShakeBattleTerrain, 2, 0, 2, 3, 1 + createvisualtask AnimTask_ShakeBattlePlatforms, 2, 0, 2, 3, 1 playsewithpan SE_M_STRENGTH, SOUND_PAN_TARGET delay 24 playsewithpan SE_M_HYPER_BEAM, SOUND_PAN_TARGET createsprite gRedXSpriteTemplate, ANIM_TARGET, 5, ANIM_TARGET, 50 createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 3, 0, 20, 1 - createvisualtask AnimTask_ShakeBattleTerrain, 2, 2, 0, 10, 1 + createvisualtask AnimTask_ShakeBattlePlatforms, 2, 2, 0, 10, 1 waitforvisualfinish end @@ -9635,16 +9635,16 @@ Move_SKY_UPPERCUT: end Move_SECRET_POWER: - createvisualtask AnimTask_GetBattleTerrain, 5 - jumpargeq 0, BATTLE_TERRAIN_GRASS, Move_NEEDLE_ARM - jumpargeq 0, BATTLE_TERRAIN_LONG_GRASS, Move_MAGICAL_LEAF - jumpargeq 0, BATTLE_TERRAIN_SAND, Move_MUD_SHOT - jumpargeq 0, BATTLE_TERRAIN_UNDERWATER, Move_WATERFALL - jumpargeq 0, BATTLE_TERRAIN_WATER, Move_SURF - jumpargeq 0, BATTLE_TERRAIN_POND, Move_BUBBLE_BEAM - jumpargeq 0, BATTLE_TERRAIN_MOUNTAIN, Move_ROCK_THROW - jumpargeq 0, BATTLE_TERRAIN_CAVE, Move_BITE - jumpargeq 0, BATTLE_TERRAIN_BUILDING, Move_STRENGTH + createvisualtask AnimTask_GetBattleEnvironment, 5 + jumpargeq 0, BATTLE_ENVIRONMENT_GRASS, Move_NEEDLE_ARM + jumpargeq 0, BATTLE_ENVIRONMENT_LONG_GRASS, Move_MAGICAL_LEAF + jumpargeq 0, BATTLE_ENVIRONMENT_SAND, Move_MUD_SHOT + jumpargeq 0, BATTLE_ENVIRONMENT_UNDERWATER, Move_WATERFALL + jumpargeq 0, BATTLE_ENVIRONMENT_WATER, Move_SURF + jumpargeq 0, BATTLE_ENVIRONMENT_POND, Move_BUBBLE_BEAM + jumpargeq 0, BATTLE_ENVIRONMENT_MOUNTAIN, Move_ROCK_THROW + jumpargeq 0, BATTLE_ENVIRONMENT_CAVE, Move_BITE + jumpargeq 0, BATTLE_ENVIRONMENT_BUILDING, Move_STRENGTH goto Move_SLAM Move_TWISTER: diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 0c0dc72831d6..00a40fbbb009 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -2289,7 +2289,7 @@ BattleScript_EffectNaturePower:: attackcanceler attackstring pause B_WAIT_TIME_SHORT - callterrainattack + callenvironmentattack printstring STRINGID_NATUREPOWERTURNEDINTO waitmessage B_WAIT_TIME_LONG return @@ -2799,7 +2799,7 @@ BattleScript_EffectCamouflage:: attackcanceler attackstring ppreduce - settypetoterrain BattleScript_ButItFailed + settypetoenvironment BattleScript_ButItFailed attackanimation waitanimation printstring STRINGID_PKMNCHANGEDTYPE diff --git a/graphics/battle_terrain/building/anim_map.bin b/graphics/battle_environment/building/anim_map.bin similarity index 100% rename from graphics/battle_terrain/building/anim_map.bin rename to graphics/battle_environment/building/anim_map.bin diff --git a/graphics/battle_terrain/building/anim_tiles.png b/graphics/battle_environment/building/anim_tiles.png similarity index 100% rename from graphics/battle_terrain/building/anim_tiles.png rename to graphics/battle_environment/building/anim_tiles.png diff --git a/graphics/battle_terrain/building/map.bin b/graphics/battle_environment/building/map.bin similarity index 100% rename from graphics/battle_terrain/building/map.bin rename to graphics/battle_environment/building/map.bin diff --git a/graphics/battle_terrain/building/palette.pal b/graphics/battle_environment/building/palette.pal similarity index 100% rename from graphics/battle_terrain/building/palette.pal rename to graphics/battle_environment/building/palette.pal diff --git a/graphics/battle_terrain/building/palette2.pal b/graphics/battle_environment/building/palette2.pal similarity index 100% rename from graphics/battle_terrain/building/palette2.pal rename to graphics/battle_environment/building/palette2.pal diff --git a/graphics/battle_terrain/building/palette3.pal b/graphics/battle_environment/building/palette3.pal similarity index 100% rename from graphics/battle_terrain/building/palette3.pal rename to graphics/battle_environment/building/palette3.pal diff --git a/graphics/battle_terrain/building/tiles.png b/graphics/battle_environment/building/tiles.png similarity index 100% rename from graphics/battle_terrain/building/tiles.png rename to graphics/battle_environment/building/tiles.png diff --git a/graphics/battle_terrain/cave/anim_map.bin b/graphics/battle_environment/cave/anim_map.bin similarity index 100% rename from graphics/battle_terrain/cave/anim_map.bin rename to graphics/battle_environment/cave/anim_map.bin diff --git a/graphics/battle_terrain/cave/anim_tiles.png b/graphics/battle_environment/cave/anim_tiles.png similarity index 100% rename from graphics/battle_terrain/cave/anim_tiles.png rename to graphics/battle_environment/cave/anim_tiles.png diff --git a/graphics/battle_terrain/cave/groudon.pal b/graphics/battle_environment/cave/groudon.pal similarity index 100% rename from graphics/battle_terrain/cave/groudon.pal rename to graphics/battle_environment/cave/groudon.pal diff --git a/graphics/battle_terrain/cave/map.bin b/graphics/battle_environment/cave/map.bin similarity index 100% rename from graphics/battle_terrain/cave/map.bin rename to graphics/battle_environment/cave/map.bin diff --git a/graphics/battle_terrain/cave/palette.pal b/graphics/battle_environment/cave/palette.pal similarity index 100% rename from graphics/battle_terrain/cave/palette.pal rename to graphics/battle_environment/cave/palette.pal diff --git a/graphics/battle_terrain/cave/tiles.png b/graphics/battle_environment/cave/tiles.png similarity index 100% rename from graphics/battle_terrain/cave/tiles.png rename to graphics/battle_environment/cave/tiles.png diff --git a/graphics/battle_terrain/long_grass/anim_map.bin b/graphics/battle_environment/long_grass/anim_map.bin similarity index 100% rename from graphics/battle_terrain/long_grass/anim_map.bin rename to graphics/battle_environment/long_grass/anim_map.bin diff --git a/graphics/battle_terrain/long_grass/anim_tiles.png b/graphics/battle_environment/long_grass/anim_tiles.png similarity index 100% rename from graphics/battle_terrain/long_grass/anim_tiles.png rename to graphics/battle_environment/long_grass/anim_tiles.png diff --git a/graphics/battle_terrain/long_grass/map.bin b/graphics/battle_environment/long_grass/map.bin similarity index 100% rename from graphics/battle_terrain/long_grass/map.bin rename to graphics/battle_environment/long_grass/map.bin diff --git a/graphics/battle_terrain/long_grass/palette.pal b/graphics/battle_environment/long_grass/palette.pal similarity index 100% rename from graphics/battle_terrain/long_grass/palette.pal rename to graphics/battle_environment/long_grass/palette.pal diff --git a/graphics/battle_terrain/long_grass/tiles.png b/graphics/battle_environment/long_grass/tiles.png similarity index 100% rename from graphics/battle_terrain/long_grass/tiles.png rename to graphics/battle_environment/long_grass/tiles.png diff --git a/graphics/battle_terrain/plain/palette.pal b/graphics/battle_environment/plain/palette.pal similarity index 100% rename from graphics/battle_terrain/plain/palette.pal rename to graphics/battle_environment/plain/palette.pal diff --git a/graphics/battle_terrain/pond_water/anim_map.bin b/graphics/battle_environment/pond_water/anim_map.bin similarity index 100% rename from graphics/battle_terrain/pond_water/anim_map.bin rename to graphics/battle_environment/pond_water/anim_map.bin diff --git a/graphics/battle_terrain/pond_water/anim_tiles.png b/graphics/battle_environment/pond_water/anim_tiles.png similarity index 100% rename from graphics/battle_terrain/pond_water/anim_tiles.png rename to graphics/battle_environment/pond_water/anim_tiles.png diff --git a/graphics/battle_terrain/pond_water/map.bin b/graphics/battle_environment/pond_water/map.bin similarity index 100% rename from graphics/battle_terrain/pond_water/map.bin rename to graphics/battle_environment/pond_water/map.bin diff --git a/graphics/battle_terrain/pond_water/palette.pal b/graphics/battle_environment/pond_water/palette.pal similarity index 100% rename from graphics/battle_terrain/pond_water/palette.pal rename to graphics/battle_environment/pond_water/palette.pal diff --git a/graphics/battle_terrain/pond_water/tiles.png b/graphics/battle_environment/pond_water/tiles.png similarity index 100% rename from graphics/battle_terrain/pond_water/tiles.png rename to graphics/battle_environment/pond_water/tiles.png diff --git a/graphics/battle_terrain/rock/anim_map.bin b/graphics/battle_environment/rock/anim_map.bin similarity index 100% rename from graphics/battle_terrain/rock/anim_map.bin rename to graphics/battle_environment/rock/anim_map.bin diff --git a/graphics/battle_terrain/rock/anim_tiles.png b/graphics/battle_environment/rock/anim_tiles.png similarity index 100% rename from graphics/battle_terrain/rock/anim_tiles.png rename to graphics/battle_environment/rock/anim_tiles.png diff --git a/graphics/battle_terrain/rock/map.bin b/graphics/battle_environment/rock/map.bin similarity index 100% rename from graphics/battle_terrain/rock/map.bin rename to graphics/battle_environment/rock/map.bin diff --git a/graphics/battle_terrain/rock/palette.pal b/graphics/battle_environment/rock/palette.pal similarity index 100% rename from graphics/battle_terrain/rock/palette.pal rename to graphics/battle_environment/rock/palette.pal diff --git a/graphics/battle_terrain/rock/tiles.png b/graphics/battle_environment/rock/tiles.png similarity index 100% rename from graphics/battle_terrain/rock/tiles.png rename to graphics/battle_environment/rock/tiles.png diff --git a/graphics/battle_terrain/sand/anim_map.bin b/graphics/battle_environment/sand/anim_map.bin similarity index 100% rename from graphics/battle_terrain/sand/anim_map.bin rename to graphics/battle_environment/sand/anim_map.bin diff --git a/graphics/battle_terrain/sand/anim_tiles.png b/graphics/battle_environment/sand/anim_tiles.png similarity index 100% rename from graphics/battle_terrain/sand/anim_tiles.png rename to graphics/battle_environment/sand/anim_tiles.png diff --git a/graphics/battle_terrain/sand/map.bin b/graphics/battle_environment/sand/map.bin similarity index 100% rename from graphics/battle_terrain/sand/map.bin rename to graphics/battle_environment/sand/map.bin diff --git a/graphics/battle_terrain/sand/palette.pal b/graphics/battle_environment/sand/palette.pal similarity index 100% rename from graphics/battle_terrain/sand/palette.pal rename to graphics/battle_environment/sand/palette.pal diff --git a/graphics/battle_terrain/sand/tiles.png b/graphics/battle_environment/sand/tiles.png similarity index 100% rename from graphics/battle_terrain/sand/tiles.png rename to graphics/battle_environment/sand/tiles.png diff --git a/graphics/battle_terrain/sky/anim_map.bin b/graphics/battle_environment/sky/anim_map.bin similarity index 100% rename from graphics/battle_terrain/sky/anim_map.bin rename to graphics/battle_environment/sky/anim_map.bin diff --git a/graphics/battle_terrain/sky/anim_tiles.png b/graphics/battle_environment/sky/anim_tiles.png similarity index 100% rename from graphics/battle_terrain/sky/anim_tiles.png rename to graphics/battle_environment/sky/anim_tiles.png diff --git a/graphics/battle_terrain/sky/map.bin b/graphics/battle_environment/sky/map.bin similarity index 100% rename from graphics/battle_terrain/sky/map.bin rename to graphics/battle_environment/sky/map.bin diff --git a/graphics/battle_terrain/sky/palette.pal b/graphics/battle_environment/sky/palette.pal similarity index 100% rename from graphics/battle_terrain/sky/palette.pal rename to graphics/battle_environment/sky/palette.pal diff --git a/graphics/battle_terrain/sky/tiles.png b/graphics/battle_environment/sky/tiles.png similarity index 100% rename from graphics/battle_terrain/sky/tiles.png rename to graphics/battle_environment/sky/tiles.png diff --git a/graphics/battle_terrain/stadium/battle_frontier.pal b/graphics/battle_environment/stadium/battle_frontier.pal similarity index 100% rename from graphics/battle_terrain/stadium/battle_frontier.pal rename to graphics/battle_environment/stadium/battle_frontier.pal diff --git a/graphics/battle_terrain/stadium/map.bin b/graphics/battle_environment/stadium/map.bin similarity index 100% rename from graphics/battle_terrain/stadium/map.bin rename to graphics/battle_environment/stadium/map.bin diff --git a/graphics/battle_terrain/stadium/palette1.pal b/graphics/battle_environment/stadium/palette1.pal similarity index 100% rename from graphics/battle_terrain/stadium/palette1.pal rename to graphics/battle_environment/stadium/palette1.pal diff --git a/graphics/battle_terrain/stadium/palette2.pal b/graphics/battle_environment/stadium/palette2.pal similarity index 100% rename from graphics/battle_terrain/stadium/palette2.pal rename to graphics/battle_environment/stadium/palette2.pal diff --git a/graphics/battle_terrain/stadium/palette3.pal b/graphics/battle_environment/stadium/palette3.pal similarity index 100% rename from graphics/battle_terrain/stadium/palette3.pal rename to graphics/battle_environment/stadium/palette3.pal diff --git a/graphics/battle_terrain/stadium/palette4.pal b/graphics/battle_environment/stadium/palette4.pal similarity index 100% rename from graphics/battle_terrain/stadium/palette4.pal rename to graphics/battle_environment/stadium/palette4.pal diff --git a/graphics/battle_terrain/stadium/palette5.pal b/graphics/battle_environment/stadium/palette5.pal similarity index 100% rename from graphics/battle_terrain/stadium/palette5.pal rename to graphics/battle_environment/stadium/palette5.pal diff --git a/graphics/battle_terrain/stadium/palette6.pal b/graphics/battle_environment/stadium/palette6.pal similarity index 100% rename from graphics/battle_terrain/stadium/palette6.pal rename to graphics/battle_environment/stadium/palette6.pal diff --git a/graphics/battle_terrain/stadium/palette7.pal b/graphics/battle_environment/stadium/palette7.pal similarity index 100% rename from graphics/battle_terrain/stadium/palette7.pal rename to graphics/battle_environment/stadium/palette7.pal diff --git a/graphics/battle_terrain/stadium/tiles.png b/graphics/battle_environment/stadium/tiles.png similarity index 100% rename from graphics/battle_terrain/stadium/tiles.png rename to graphics/battle_environment/stadium/tiles.png diff --git a/graphics/battle_terrain/tall_grass/anim_map.bin b/graphics/battle_environment/tall_grass/anim_map.bin similarity index 100% rename from graphics/battle_terrain/tall_grass/anim_map.bin rename to graphics/battle_environment/tall_grass/anim_map.bin diff --git a/graphics/battle_terrain/tall_grass/anim_tiles.png b/graphics/battle_environment/tall_grass/anim_tiles.png similarity index 100% rename from graphics/battle_terrain/tall_grass/anim_tiles.png rename to graphics/battle_environment/tall_grass/anim_tiles.png diff --git a/graphics/battle_terrain/tall_grass/map.bin b/graphics/battle_environment/tall_grass/map.bin similarity index 100% rename from graphics/battle_terrain/tall_grass/map.bin rename to graphics/battle_environment/tall_grass/map.bin diff --git a/graphics/battle_terrain/tall_grass/palette.pal b/graphics/battle_environment/tall_grass/palette.pal similarity index 100% rename from graphics/battle_terrain/tall_grass/palette.pal rename to graphics/battle_environment/tall_grass/palette.pal diff --git a/graphics/battle_terrain/tall_grass/tiles.png b/graphics/battle_environment/tall_grass/tiles.png similarity index 100% rename from graphics/battle_terrain/tall_grass/tiles.png rename to graphics/battle_environment/tall_grass/tiles.png diff --git a/graphics/battle_terrain/underwater/anim_map.bin b/graphics/battle_environment/underwater/anim_map.bin similarity index 100% rename from graphics/battle_terrain/underwater/anim_map.bin rename to graphics/battle_environment/underwater/anim_map.bin diff --git a/graphics/battle_terrain/underwater/anim_tiles.png b/graphics/battle_environment/underwater/anim_tiles.png similarity index 100% rename from graphics/battle_terrain/underwater/anim_tiles.png rename to graphics/battle_environment/underwater/anim_tiles.png diff --git a/graphics/battle_terrain/underwater/map.bin b/graphics/battle_environment/underwater/map.bin similarity index 100% rename from graphics/battle_terrain/underwater/map.bin rename to graphics/battle_environment/underwater/map.bin diff --git a/graphics/battle_terrain/underwater/palette.pal b/graphics/battle_environment/underwater/palette.pal similarity index 100% rename from graphics/battle_terrain/underwater/palette.pal rename to graphics/battle_environment/underwater/palette.pal diff --git a/graphics/battle_terrain/underwater/tiles.png b/graphics/battle_environment/underwater/tiles.png similarity index 100% rename from graphics/battle_terrain/underwater/tiles.png rename to graphics/battle_environment/underwater/tiles.png diff --git a/graphics/battle_terrain/water/anim_map.bin b/graphics/battle_environment/water/anim_map.bin similarity index 100% rename from graphics/battle_terrain/water/anim_map.bin rename to graphics/battle_environment/water/anim_map.bin diff --git a/graphics/battle_terrain/water/anim_tiles.png b/graphics/battle_environment/water/anim_tiles.png similarity index 100% rename from graphics/battle_terrain/water/anim_tiles.png rename to graphics/battle_environment/water/anim_tiles.png diff --git a/graphics/battle_terrain/water/kyogre.pal b/graphics/battle_environment/water/kyogre.pal similarity index 100% rename from graphics/battle_terrain/water/kyogre.pal rename to graphics/battle_environment/water/kyogre.pal diff --git a/graphics/battle_terrain/water/map.bin b/graphics/battle_environment/water/map.bin similarity index 100% rename from graphics/battle_terrain/water/map.bin rename to graphics/battle_environment/water/map.bin diff --git a/graphics/battle_terrain/water/palette.pal b/graphics/battle_environment/water/palette.pal similarity index 100% rename from graphics/battle_terrain/water/palette.pal rename to graphics/battle_environment/water/palette.pal diff --git a/graphics/battle_terrain/water/tiles.png b/graphics/battle_environment/water/tiles.png similarity index 100% rename from graphics/battle_terrain/water/tiles.png rename to graphics/battle_environment/water/tiles.png diff --git a/include/battle.h b/include/battle.h index 6c4d780186c7..8031d808a754 100644 --- a/include/battle.h +++ b/include/battle.h @@ -626,7 +626,7 @@ extern u8 gBattleTextBuff1[TEXT_BUFF_ARRAY_COUNT]; extern u8 gBattleTextBuff2[TEXT_BUFF_ARRAY_COUNT]; extern u8 gBattleTextBuff3[TEXT_BUFF_ARRAY_COUNT]; extern u32 gBattleTypeFlags; -extern u8 gBattleTerrain; +extern u8 gBattleEnvironment; extern u32 gUnusedFirstBattleVar1; extern u8 *gBattleAnimBgTileBuffer; extern u8 *gBattleAnimBgTilemapBuffer; diff --git a/include/battle_anim.h b/include/battle_anim.h index 455bf5f4cd84..ffb63bde61f4 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -70,7 +70,7 @@ void ResetBattleAnimBg(bool8); // battle_intro.c void SetAnimBgAttribute(u8 bgId, u8 attributeId, u8 value); void DrawBattlerOnBg(int bgId, u8 x, u8 y, u8 battlerPosition, u8 paletteId, u8 *tiles, u16 *tilemap, u16 tilesOffset); -void HandleIntroSlide(u8 terrainId); +void HandleIntroSlide(u8 environmentId); int GetAnimBgAttribute(u8 bgId, u8 attributeId); // battle_anim_mons.c diff --git a/include/battle_controllers.h b/include/battle_controllers.h index 064c080f6181..04cc613f8579 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -233,7 +233,7 @@ void BtlController_EmitCantSwitch(u8 bufferId); void BtlController_EmitPlaySE(u8 bufferId, u16 songId); void BtlController_EmitPlayFanfareOrBGM(u8 bufferId, u16 songId, bool8 playBGM); void BtlController_EmitFaintingCry(u8 bufferId); -void BtlController_EmitIntroSlide(u8 bufferId, u8 terrainId); +void BtlController_EmitIntroSlide(u8 bufferId, u8 environmentId); void BtlController_EmitIntroTrainerBallThrow(u8 bufferId); void BtlController_EmitDrawPartyStatusSummary(u8 bufferId, struct HpAndStatus* hpAndStatus, u8 flags); void BtlController_EmitHidePartyStatusSummary(u8 bufferId); diff --git a/include/battle_setup.h b/include/battle_setup.h index ee2837927b14..41ab13811559 100644 --- a/include/battle_setup.h +++ b/include/battle_setup.h @@ -27,7 +27,7 @@ void BattleSetup_StartLatiBattle(void); void BattleSetup_StartLegendaryBattle(void); void StartGroudonKyogreBattle(void); void StartRegiBattle(void); -u8 BattleSetup_GetTerrainId(void); +u8 BattleSetup_GetEnvironmentId(void); u8 GetSpecialBattleTransition(s32 id); void ChooseStarter(void); void ResetTrainerOpponentIds(void); diff --git a/include/constants/battle.h b/include/constants/battle.h index 50c93083f835..e00008de7152 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -296,17 +296,17 @@ #define MOVE_EFFECT_AFFECTS_USER (1 << 6) // 64 #define MOVE_EFFECT_CERTAIN (1 << 7) // 128 -// Battle terrain defines for gBattleTerrain. -#define BATTLE_TERRAIN_GRASS 0 -#define BATTLE_TERRAIN_LONG_GRASS 1 -#define BATTLE_TERRAIN_SAND 2 -#define BATTLE_TERRAIN_UNDERWATER 3 -#define BATTLE_TERRAIN_WATER 4 -#define BATTLE_TERRAIN_POND 5 -#define BATTLE_TERRAIN_MOUNTAIN 6 -#define BATTLE_TERRAIN_CAVE 7 -#define BATTLE_TERRAIN_BUILDING 8 -#define BATTLE_TERRAIN_PLAIN 9 +// Battle environment defines for gBattleEnvironment. +#define BATTLE_ENVIRONMENT_GRASS 0 +#define BATTLE_ENVIRONMENT_LONG_GRASS 1 +#define BATTLE_ENVIRONMENT_SAND 2 +#define BATTLE_ENVIRONMENT_UNDERWATER 3 +#define BATTLE_ENVIRONMENT_WATER 4 +#define BATTLE_ENVIRONMENT_POND 5 +#define BATTLE_ENVIRONMENT_MOUNTAIN 6 +#define BATTLE_ENVIRONMENT_CAVE 7 +#define BATTLE_ENVIRONMENT_BUILDING 8 +#define BATTLE_ENVIRONMENT_PLAIN 9 #define B_WAIT_TIME_LONG 64 #define B_WAIT_TIME_MED 48 diff --git a/include/graphics.h b/include/graphics.h index 9e2fb79539e0..c69326c39d29 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -3215,72 +3215,72 @@ extern const u32 gBattleVSFrame_Tilemap[]; extern const u32 gMultiBattleIntroBg_Opponent_Tilemap[]; extern const u32 gMultiBattleIntroBg_Player_Tilemap[]; -// battle terrains -extern const u32 gBattleTerrainTiles_TallGrass[]; -extern const u32 gBattleTerrainTilemap_TallGrass[]; -extern const u32 gBattleTerrainAnimTiles_TallGrass[]; -extern const u32 gBattleTerrainAnimTilemap_TallGrass[]; -extern const u32 gBattleTerrainPalette_TallGrass[]; -extern const u32 gBattleTerrainTiles_LongGrass[]; -extern const u32 gBattleTerrainTilemap_LongGrass[]; -extern const u32 gBattleTerrainAnimTiles_LongGrass[]; -extern const u32 gBattleTerrainAnimTilemap_LongGrass[]; -extern const u32 gBattleTerrainPalette_LongGrass[]; -extern const u32 gBattleTerrainTiles_Sand[]; -extern const u32 gBattleTerrainTilemap_Sand[]; -extern const u32 gBattleTerrainAnimTiles_Sand[]; -extern const u32 gBattleTerrainAnimTilemap_Sand[]; -extern const u32 gBattleTerrainPalette_Sand[]; -extern const u32 gBattleTerrainTiles_Underwater[]; -extern const u32 gBattleTerrainTilemap_Underwater[]; -extern const u32 gBattleTerrainAnimTiles_Underwater[]; -extern const u32 gBattleTerrainAnimTilemap_Underwater[]; -extern const u32 gBattleTerrainPalette_Underwater[]; -extern const u32 gBattleTerrainTiles_Water[]; -extern const u32 gBattleTerrainTilemap_Water[]; -extern const u32 gBattleTerrainAnimTiles_Water[]; -extern const u32 gBattleTerrainAnimTilemap_Water[]; -extern const u32 gBattleTerrainPalette_Water[]; -extern const u32 gBattleTerrainTiles_PondWater[]; -extern const u32 gBattleTerrainTilemap_PondWater[]; -extern const u32 gBattleTerrainAnimTiles_PondWater[]; -extern const u32 gBattleTerrainAnimTilemap_PondWater[]; -extern const u32 gBattleTerrainPalette_PondWater[]; -extern const u32 gBattleTerrainTiles_Rock[]; -extern const u32 gBattleTerrainTilemap_Rock[]; -extern const u32 gBattleTerrainAnimTiles_Rock[]; -extern const u32 gBattleTerrainAnimTilemap_Rock[]; -extern const u32 gBattleTerrainPalette_Rock[]; -extern const u32 gBattleTerrainTiles_Cave[]; -extern const u32 gBattleTerrainTilemap_Cave[]; -extern const u32 gBattleTerrainAnimTiles_Cave[]; -extern const u32 gBattleTerrainAnimTilemap_Cave[]; -extern const u32 gBattleTerrainPalette_Cave[]; -extern const u32 gBattleTerrainTiles_Building[]; -extern const u32 gBattleTerrainTilemap_Building[]; -extern const u32 gBattleTerrainAnimTiles_Building[]; -extern const u32 gBattleTerrainAnimTilemap_Building[]; -extern const u32 gBattleTerrainPalette_Building[]; -extern const u32 gBattleTerrainPalette_Plain[]; -extern const u32 gBattleTerrainPalette_Frontier[]; -extern const u32 gBattleTerrainTiles_Stadium[]; -extern const u32 gBattleTerrainTilemap_Stadium[]; -extern const u32 gBattleTerrainTiles_Rayquaza[]; -extern const u32 gBattleTerrainTilemap_Rayquaza[]; -extern const u32 gBattleTerrainAnimTiles_Rayquaza[]; -extern const u32 gBattleTerrainAnimTilemap_Rayquaza[]; -extern const u32 gBattleTerrainPalette_Rayquaza[]; -extern const u32 gBattleTerrainPalette_Kyogre[]; -extern const u32 gBattleTerrainPalette_Groudon[]; -extern const u32 gBattleTerrainPalette_BuildingGym[]; -extern const u32 gBattleTerrainPalette_BuildingLeader[]; -extern const u32 gBattleTerrainPalette_StadiumAqua[]; -extern const u32 gBattleTerrainPalette_StadiumMagma[]; -extern const u32 gBattleTerrainPalette_StadiumSidney[]; -extern const u32 gBattleTerrainPalette_StadiumPhoebe[]; -extern const u32 gBattleTerrainPalette_StadiumGlacia[]; -extern const u32 gBattleTerrainPalette_StadiumDrake[]; -extern const u32 gBattleTerrainPalette_StadiumWallace[]; +// battle environments +extern const u32 gBattleEnvironmentTiles_TallGrass[]; +extern const u32 gBattleEnvironmentTilemap_TallGrass[]; +extern const u32 gBattleEnvironmentAnimTiles_TallGrass[]; +extern const u32 gBattleEnvironmentAnimTilemap_TallGrass[]; +extern const u32 gBattleEnvironmentPalette_TallGrass[]; +extern const u32 gBattleEnvironmentTiles_LongGrass[]; +extern const u32 gBattleEnvironmentTilemap_LongGrass[]; +extern const u32 gBattleEnvironmentAnimTiles_LongGrass[]; +extern const u32 gBattleEnvironmentAnimTilemap_LongGrass[]; +extern const u32 gBattleEnvironmentPalette_LongGrass[]; +extern const u32 gBattleEnvironmentTiles_Sand[]; +extern const u32 gBattleEnvironmentTilemap_Sand[]; +extern const u32 gBattleEnvironmentAnimTiles_Sand[]; +extern const u32 gBattleEnvironmentAnimTilemap_Sand[]; +extern const u32 gBattleEnvironmentPalette_Sand[]; +extern const u32 gBattleEnvironmentTiles_Underwater[]; +extern const u32 gBattleEnvironmentTilemap_Underwater[]; +extern const u32 gBattleEnvironmentAnimTiles_Underwater[]; +extern const u32 gBattleEnvironmentAnimTilemap_Underwater[]; +extern const u32 gBattleEnvironmentPalette_Underwater[]; +extern const u32 gBattleEnvironmentTiles_Water[]; +extern const u32 gBattleEnvironmentTilemap_Water[]; +extern const u32 gBattleEnvironmentAnimTiles_Water[]; +extern const u32 gBattleEnvironmentAnimTilemap_Water[]; +extern const u32 gBattleEnvironmentPalette_Water[]; +extern const u32 gBattleEnvironmentTiles_PondWater[]; +extern const u32 gBattleEnvironmentTilemap_PondWater[]; +extern const u32 gBattleEnvironmentAnimTiles_PondWater[]; +extern const u32 gBattleEnvironmentAnimTilemap_PondWater[]; +extern const u32 gBattleEnvironmentPalette_PondWater[]; +extern const u32 gBattleEnvironmentTiles_Rock[]; +extern const u32 gBattleEnvironmentTilemap_Rock[]; +extern const u32 gBattleEnvironmentAnimTiles_Rock[]; +extern const u32 gBattleEnvironmentAnimTilemap_Rock[]; +extern const u32 gBattleEnvironmentPalette_Rock[]; +extern const u32 gBattleEnvironmentTiles_Cave[]; +extern const u32 gBattleEnvironmentTilemap_Cave[]; +extern const u32 gBattleEnvironmentAnimTiles_Cave[]; +extern const u32 gBattleEnvironmentAnimTilemap_Cave[]; +extern const u32 gBattleEnvironmentPalette_Cave[]; +extern const u32 gBattleEnvironmentTiles_Building[]; +extern const u32 gBattleEnvironmentTilemap_Building[]; +extern const u32 gBattleEnvironmentAnimTiles_Building[]; +extern const u32 gBattleEnvironmentAnimTilemap_Building[]; +extern const u32 gBattleEnvironmentPalette_Building[]; +extern const u32 gBattleEnvironmentPalette_Plain[]; +extern const u32 gBattleEnvironmentPalette_Frontier[]; +extern const u32 gBattleEnvironmentTiles_Stadium[]; +extern const u32 gBattleEnvironmentTilemap_Stadium[]; +extern const u32 gBattleEnvironmentTiles_Rayquaza[]; +extern const u32 gBattleEnvironmentTilemap_Rayquaza[]; +extern const u32 gBattleEnvironmentAnimTiles_Rayquaza[]; +extern const u32 gBattleEnvironmentAnimTilemap_Rayquaza[]; +extern const u32 gBattleEnvironmentPalette_Rayquaza[]; +extern const u32 gBattleEnvironmentPalette_Kyogre[]; +extern const u32 gBattleEnvironmentPalette_Groudon[]; +extern const u32 gBattleEnvironmentPalette_BuildingGym[]; +extern const u32 gBattleEnvironmentPalette_BuildingLeader[]; +extern const u32 gBattleEnvironmentPalette_StadiumAqua[]; +extern const u32 gBattleEnvironmentPalette_StadiumMagma[]; +extern const u32 gBattleEnvironmentPalette_StadiumSidney[]; +extern const u32 gBattleEnvironmentPalette_StadiumPhoebe[]; +extern const u32 gBattleEnvironmentPalette_StadiumGlacia[]; +extern const u32 gBattleEnvironmentPalette_StadiumDrake[]; +extern const u32 gBattleEnvironmentPalette_StadiumWallace[]; // Pokédex extern const u32 gPokedexInterface_Gfx[]; diff --git a/src/battle_anim_ground.c b/src/battle_anim_ground.c index d6d8137bcdd7..b3591544ece1 100644 --- a/src/battle_anim_ground.c +++ b/src/battle_anim_ground.c @@ -22,7 +22,7 @@ static void AnimTask_DigEndBounceMovementSetInvisible(u8); static void AnimTask_DigSetVisibleUnderground(u8); static void AnimTask_DigRiseUpFromHole(u8); static void SetDigScanlineEffect(u8, s16, s16); -static void AnimTask_ShakeTerrain(u8); +static void AnimTask_ShakePlatforms(u8); static void AnimTask_ShakeBattlers(u8); static void SetBattlersXOffsetForShake(struct Task *); static void WaitForFissureCompletion(u8); @@ -564,12 +564,12 @@ static void AnimDigDirtMound(struct Sprite *sprite) #define tMaxTime data[3] #define tbattlerSpriteIds(i) data[9 + (i)] #define tNumBattlers data[13] // AnimTask_ShakeBattlers -#define tInitialX data[13] // AnimTask_ShakeTerrain +#define tInitialX data[13] // AnimTask_ShakePlatforms #define tHorizOffset data[14] #define tInitHorizOffset data[15] -// Shakes battler(s) or the battle terrain back and forth horizontally. Used by e.g. Earthquake, Eruption -// arg0: What to shake. 0-3 for any specific battler, MAX_BATTLERS_COUNT for all battlers, MAX_BATTLERS_COUNT + 1 for the terrain +// Shakes battler(s) or the battle platforms back and forth horizontally. Used by e.g. Earthquake, Eruption +// arg0: What to shake. 0-3 for any specific battler, MAX_BATTLERS_COUNT for all battlers, MAX_BATTLERS_COUNT + 1 for the platforms // arg1: Shake intensity, used to calculate horizontal pixel offset (if 0, use move power instead) // arg2: Length of time to shake for void AnimTask_HorizontalShake(u8 taskId) @@ -585,9 +585,9 @@ void AnimTask_HorizontalShake(u8 taskId) task->tMaxTime = gBattleAnimArgs[2]; switch (gBattleAnimArgs[0]) { - case MAX_BATTLERS_COUNT + 1: // Shake terrain + case MAX_BATTLERS_COUNT + 1: // Shake platforms task->tInitialX = gBattle_BG3_X; - task->func = AnimTask_ShakeTerrain; + task->func = AnimTask_ShakePlatforms; break; case MAX_BATTLERS_COUNT: // Shake all battlers task->tNumBattlers = 0; @@ -616,7 +616,7 @@ void AnimTask_HorizontalShake(u8 taskId) } } -static void AnimTask_ShakeTerrain(u8 taskId) +static void AnimTask_ShakePlatforms(u8 taskId) { struct Task *task = &gTasks[taskId]; diff --git a/src/battle_anim_normal.c b/src/battle_anim_normal.c index 94bbb6ee4e06..fa6bd69343ad 100644 --- a/src/battle_anim_normal.c +++ b/src/battle_anim_normal.c @@ -13,9 +13,9 @@ static void AnimComplexPaletteBlend(struct Sprite *); static void AnimComplexPaletteBlend_Step1(struct Sprite *); static void AnimComplexPaletteBlend_Step2(struct Sprite *); static void AnimCirclingSparkle(struct Sprite *); -static void AnimShakeMonOrBattleTerrain(struct Sprite *); -static void AnimShakeMonOrBattleTerrain_Step(struct Sprite *); -static void AnimShakeMonOrBattleTerrain_UpdateCoordOffsetEnabled(void); +static void AnimShakeMonOrBattlePlatforms(struct Sprite *); +static void AnimShakeMonOrBattlePlatforms_Step(struct Sprite *); +static void AnimShakeMonOrBattlePlatforms_UpdateCoordOffsetEnabled(void); static void AnimHitSplatBasic(struct Sprite *); static void AnimHitSplatPersistent(struct Sprite *); static void AnimHitSplatHandleInvert(struct Sprite *); @@ -33,7 +33,7 @@ static void BlendColorCycleByTag(u8, u8, u8); static void AnimTask_BlendColorCycleByTagLoop(u8); static void AnimTask_FlashAnimTagWithColor_Step1(u8); static void AnimTask_FlashAnimTagWithColor_Step2(u8); -static void AnimTask_ShakeBattleTerrain_Step(u8); +static void AnimTask_ShakeBattlePlatforms_Step(u8); static const union AnimCmd sAnim_ConfusionDuck_0[] = { @@ -119,7 +119,7 @@ static const struct SpriteTemplate sCirclingSparkleSpriteTemplate = .callback = AnimCirclingSparkle, }; -const struct SpriteTemplate gShakeMonOrTerrainSpriteTemplate = +const struct SpriteTemplate gShakeMonOrPlatformSpriteTemplate = { .tileTag = 0, .paletteTag = 0, @@ -127,7 +127,7 @@ const struct SpriteTemplate gShakeMonOrTerrainSpriteTemplate = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = AnimShakeMonOrBattleTerrain, + .callback = AnimShakeMonOrBattlePlatforms, }; static const union AffineAnimCmd sAffineAnim_HitSplat_0[] = @@ -795,7 +795,7 @@ void AnimTask_TintPalettes(u8 taskId) #undef tColorG #undef tColorB -static void AnimShakeMonOrBattleTerrain(struct Sprite *sprite) +static void AnimShakeMonOrBattlePlatforms(struct Sprite *sprite) { u16 var0; @@ -825,12 +825,12 @@ static void AnimShakeMonOrBattleTerrain(struct Sprite *sprite) sprite->data[5] = gBattleAnimArgs[3]; var0 = sprite->data[5] - 2; if (var0 < 2) - AnimShakeMonOrBattleTerrain_UpdateCoordOffsetEnabled(); + AnimShakeMonOrBattlePlatforms_UpdateCoordOffsetEnabled(); - sprite->callback = AnimShakeMonOrBattleTerrain_Step; + sprite->callback = AnimShakeMonOrBattlePlatforms_Step; } -static void AnimShakeMonOrBattleTerrain_Step(struct Sprite *sprite) +static void AnimShakeMonOrBattlePlatforms_Step(struct Sprite *sprite) { u8 i; u16 var0; @@ -863,7 +863,7 @@ static void AnimShakeMonOrBattleTerrain_Step(struct Sprite *sprite) } } -static void AnimShakeMonOrBattleTerrain_UpdateCoordOffsetEnabled(void) +static void AnimShakeMonOrBattlePlatforms_UpdateCoordOffsetEnabled(void) { gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].coordOffsetEnabled = FALSE; gSprites[gBattlerSpriteIds[gBattleAnimTarget]].coordOffsetEnabled = FALSE; @@ -882,19 +882,19 @@ static void AnimShakeMonOrBattleTerrain_UpdateCoordOffsetEnabled(void) } } -// Task data for AnimTask_ShakeBattleTerrain +// Task data for AnimTask_ShakeBattlePlatforms #define tXOffset data[0] #define tYOffset data[1] #define tNumShakes data[2] #define tTimer data[3] #define tShakeDelay data[8] -// Can shake battle terrain back and forth on the X or down and back to original pos on Y (cant shake up from orig pos) +// Can shake battle platforms back and forth on the X or down and back to original pos on Y (cant shake up from orig pos) // arg0: x offset of shake // arg1: y offset of shake // arg2: number of shakes // arg3: time between shakes -void AnimTask_ShakeBattleTerrain(u8 taskId) +void AnimTask_ShakeBattlePlatforms(u8 taskId) { gTasks[taskId].tXOffset = gBattleAnimArgs[0]; gTasks[taskId].tYOffset = gBattleAnimArgs[1]; @@ -903,11 +903,11 @@ void AnimTask_ShakeBattleTerrain(u8 taskId) gTasks[taskId].tShakeDelay = gBattleAnimArgs[3]; gBattle_BG3_X = gBattleAnimArgs[0]; gBattle_BG3_Y = gBattleAnimArgs[1]; - gTasks[taskId].func = AnimTask_ShakeBattleTerrain_Step; + gTasks[taskId].func = AnimTask_ShakeBattlePlatforms_Step; gTasks[taskId].func(taskId); } -static void AnimTask_ShakeBattleTerrain_Step(u8 taskId) +static void AnimTask_ShakeBattlePlatforms_Step(u8 taskId) { if (gTasks[taskId].tTimer == 0) { diff --git a/src/battle_anim_utility_funcs.c b/src/battle_anim_utility_funcs.c index 18a599a4c18b..b76c636f5601 100644 --- a/src/battle_anim_utility_funcs.c +++ b/src/battle_anim_utility_funcs.c @@ -109,36 +109,36 @@ void AnimTask_BlendBattleAnimPalExclude(u8 taskId) void AnimTask_SetCamouflageBlend(u8 taskId) { u32 selectedPalettes = UnpackSelectedBattlePalettes(gBattleAnimArgs[0]); - switch (gBattleTerrain) + switch (gBattleEnvironment) { - case BATTLE_TERRAIN_GRASS: + case BATTLE_ENVIRONMENT_GRASS: gBattleAnimArgs[4] = RGB(12, 24, 2); break; - case BATTLE_TERRAIN_LONG_GRASS: + case BATTLE_ENVIRONMENT_LONG_GRASS: gBattleAnimArgs[4] = RGB(0, 15, 2); break; - case BATTLE_TERRAIN_SAND: + case BATTLE_ENVIRONMENT_SAND: gBattleAnimArgs[4] = RGB(30, 24, 11); break; - case BATTLE_TERRAIN_UNDERWATER: + case BATTLE_ENVIRONMENT_UNDERWATER: gBattleAnimArgs[4] = RGB(0, 0, 18); break; - case BATTLE_TERRAIN_WATER: + case BATTLE_ENVIRONMENT_WATER: gBattleAnimArgs[4] = RGB(11, 22, 31); break; - case BATTLE_TERRAIN_POND: + case BATTLE_ENVIRONMENT_POND: gBattleAnimArgs[4] = RGB(11, 22, 31); break; - case BATTLE_TERRAIN_MOUNTAIN: + case BATTLE_ENVIRONMENT_MOUNTAIN: gBattleAnimArgs[4] = RGB(22, 16, 10); break; - case BATTLE_TERRAIN_CAVE: + case BATTLE_ENVIRONMENT_CAVE: gBattleAnimArgs[4] = RGB(14, 9, 3); break; - case BATTLE_TERRAIN_BUILDING: + case BATTLE_ENVIRONMENT_BUILDING: gBattleAnimArgs[4] = RGB_WHITE; break; - case BATTLE_TERRAIN_PLAIN: + case BATTLE_ENVIRONMENT_PLAIN: gBattleAnimArgs[4] = RGB_WHITE; break; } @@ -937,9 +937,9 @@ static void UpdateMonScrollingBgMask(u8 taskId) } } -void AnimTask_GetBattleTerrain(u8 taskId) +void AnimTask_GetBattleEnvironment(u8 taskId) { - gBattleAnimArgs[0] = gBattleTerrain; + gBattleAnimArgs[0] = gBattleEnvironment; DestroyAnimVisualTask(taskId); } diff --git a/src/battle_bg.c b/src/battle_bg.c index 05073db96dd8..c32f5ec62368 100644 --- a/src/battle_bg.c +++ b/src/battle_bg.c @@ -599,96 +599,96 @@ const struct WindowTemplate * const gBattleWindowTemplates[] = [B_WIN_TYPE_ARENA] = sBattleArenaWindowTemplates, }; -static const struct BattleBackground sBattleTerrainTable[] = +static const struct BattleBackground sBattleEnvironmentTable[] = { - [BATTLE_TERRAIN_GRASS] = + [BATTLE_ENVIRONMENT_GRASS] = { - .tileset = gBattleTerrainTiles_TallGrass, - .tilemap = gBattleTerrainTilemap_TallGrass, - .entryTileset = gBattleTerrainAnimTiles_TallGrass, - .entryTilemap = gBattleTerrainAnimTilemap_TallGrass, - .palette = gBattleTerrainPalette_TallGrass, + .tileset = gBattleEnvironmentTiles_TallGrass, + .tilemap = gBattleEnvironmentTilemap_TallGrass, + .entryTileset = gBattleEnvironmentAnimTiles_TallGrass, + .entryTilemap = gBattleEnvironmentAnimTilemap_TallGrass, + .palette = gBattleEnvironmentPalette_TallGrass, }, - [BATTLE_TERRAIN_LONG_GRASS] = + [BATTLE_ENVIRONMENT_LONG_GRASS] = { - .tileset = gBattleTerrainTiles_LongGrass, - .tilemap = gBattleTerrainTilemap_LongGrass, - .entryTileset = gBattleTerrainAnimTiles_LongGrass, - .entryTilemap = gBattleTerrainAnimTilemap_LongGrass, - .palette = gBattleTerrainPalette_LongGrass, + .tileset = gBattleEnvironmentTiles_LongGrass, + .tilemap = gBattleEnvironmentTilemap_LongGrass, + .entryTileset = gBattleEnvironmentAnimTiles_LongGrass, + .entryTilemap = gBattleEnvironmentAnimTilemap_LongGrass, + .palette = gBattleEnvironmentPalette_LongGrass, }, - [BATTLE_TERRAIN_SAND] = + [BATTLE_ENVIRONMENT_SAND] = { - .tileset = gBattleTerrainTiles_Sand, - .tilemap = gBattleTerrainTilemap_Sand, - .entryTileset = gBattleTerrainAnimTiles_Sand, - .entryTilemap = gBattleTerrainAnimTilemap_Sand, - .palette = gBattleTerrainPalette_Sand, + .tileset = gBattleEnvironmentTiles_Sand, + .tilemap = gBattleEnvironmentTilemap_Sand, + .entryTileset = gBattleEnvironmentAnimTiles_Sand, + .entryTilemap = gBattleEnvironmentAnimTilemap_Sand, + .palette = gBattleEnvironmentPalette_Sand, }, - [BATTLE_TERRAIN_UNDERWATER] = + [BATTLE_ENVIRONMENT_UNDERWATER] = { - .tileset = gBattleTerrainTiles_Underwater, - .tilemap = gBattleTerrainTilemap_Underwater, - .entryTileset = gBattleTerrainAnimTiles_Underwater, - .entryTilemap = gBattleTerrainAnimTilemap_Underwater, - .palette = gBattleTerrainPalette_Underwater, + .tileset = gBattleEnvironmentTiles_Underwater, + .tilemap = gBattleEnvironmentTilemap_Underwater, + .entryTileset = gBattleEnvironmentAnimTiles_Underwater, + .entryTilemap = gBattleEnvironmentAnimTilemap_Underwater, + .palette = gBattleEnvironmentPalette_Underwater, }, - [BATTLE_TERRAIN_WATER] = + [BATTLE_ENVIRONMENT_WATER] = { - .tileset = gBattleTerrainTiles_Water, - .tilemap = gBattleTerrainTilemap_Water, - .entryTileset = gBattleTerrainAnimTiles_Water, - .entryTilemap = gBattleTerrainAnimTilemap_Water, - .palette = gBattleTerrainPalette_Water, + .tileset = gBattleEnvironmentTiles_Water, + .tilemap = gBattleEnvironmentTilemap_Water, + .entryTileset = gBattleEnvironmentAnimTiles_Water, + .entryTilemap = gBattleEnvironmentAnimTilemap_Water, + .palette = gBattleEnvironmentPalette_Water, }, - [BATTLE_TERRAIN_POND] = + [BATTLE_ENVIRONMENT_POND] = { - .tileset = gBattleTerrainTiles_PondWater, - .tilemap = gBattleTerrainTilemap_PondWater, - .entryTileset = gBattleTerrainAnimTiles_PondWater, - .entryTilemap = gBattleTerrainAnimTilemap_PondWater, - .palette = gBattleTerrainPalette_PondWater, + .tileset = gBattleEnvironmentTiles_PondWater, + .tilemap = gBattleEnvironmentTilemap_PondWater, + .entryTileset = gBattleEnvironmentAnimTiles_PondWater, + .entryTilemap = gBattleEnvironmentAnimTilemap_PondWater, + .palette = gBattleEnvironmentPalette_PondWater, }, - [BATTLE_TERRAIN_MOUNTAIN] = + [BATTLE_ENVIRONMENT_MOUNTAIN] = { - .tileset = gBattleTerrainTiles_Rock, - .tilemap = gBattleTerrainTilemap_Rock, - .entryTileset = gBattleTerrainAnimTiles_Rock, - .entryTilemap = gBattleTerrainAnimTilemap_Rock, - .palette = gBattleTerrainPalette_Rock, + .tileset = gBattleEnvironmentTiles_Rock, + .tilemap = gBattleEnvironmentTilemap_Rock, + .entryTileset = gBattleEnvironmentAnimTiles_Rock, + .entryTilemap = gBattleEnvironmentAnimTilemap_Rock, + .palette = gBattleEnvironmentPalette_Rock, }, - [BATTLE_TERRAIN_CAVE] = + [BATTLE_ENVIRONMENT_CAVE] = { - .tileset = gBattleTerrainTiles_Cave, - .tilemap = gBattleTerrainTilemap_Cave, - .entryTileset = gBattleTerrainAnimTiles_Cave, - .entryTilemap = gBattleTerrainAnimTilemap_Cave, - .palette = gBattleTerrainPalette_Cave, + .tileset = gBattleEnvironmentTiles_Cave, + .tilemap = gBattleEnvironmentTilemap_Cave, + .entryTileset = gBattleEnvironmentAnimTiles_Cave, + .entryTilemap = gBattleEnvironmentAnimTilemap_Cave, + .palette = gBattleEnvironmentPalette_Cave, }, - [BATTLE_TERRAIN_BUILDING] = + [BATTLE_ENVIRONMENT_BUILDING] = { - .tileset = gBattleTerrainTiles_Building, - .tilemap = gBattleTerrainTilemap_Building, - .entryTileset = gBattleTerrainAnimTiles_Building, - .entryTilemap = gBattleTerrainAnimTilemap_Building, - .palette = gBattleTerrainPalette_Building, + .tileset = gBattleEnvironmentTiles_Building, + .tilemap = gBattleEnvironmentTilemap_Building, + .entryTileset = gBattleEnvironmentAnimTiles_Building, + .entryTilemap = gBattleEnvironmentAnimTilemap_Building, + .palette = gBattleEnvironmentPalette_Building, }, - [BATTLE_TERRAIN_PLAIN] = + [BATTLE_ENVIRONMENT_PLAIN] = { - .tileset = gBattleTerrainTiles_Building, - .tilemap = gBattleTerrainTilemap_Building, - .entryTileset = gBattleTerrainAnimTiles_Building, - .entryTilemap = gBattleTerrainAnimTilemap_Building, - .palette = gBattleTerrainPalette_Plain, + .tileset = gBattleEnvironmentTiles_Building, + .tilemap = gBattleEnvironmentTilemap_Building, + .entryTileset = gBattleEnvironmentAnimTiles_Building, + .entryTilemap = gBattleEnvironmentAnimTilemap_Building, + .palette = gBattleEnvironmentPalette_Plain, }, }; @@ -761,27 +761,27 @@ void DrawMainBattleBackground(void) { if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_RECORDED_LINK)) { - LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); - LoadCompressedPalette(gBattleTerrainPalette_Frontier, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LZDecompressVram(gBattleEnvironmentTiles_Building, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); + LoadCompressedPalette(gBattleEnvironmentPalette_Frontier, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); } else if (gBattleTypeFlags & BATTLE_TYPE_GROUDON) { - LZDecompressVram(gBattleTerrainTiles_Cave, (void *)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Cave, (void *)(BG_SCREEN_ADDR(26))); - LoadCompressedPalette(gBattleTerrainPalette_Groudon, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LZDecompressVram(gBattleEnvironmentTiles_Cave, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTilemap_Cave, (void *)(BG_SCREEN_ADDR(26))); + LoadCompressedPalette(gBattleEnvironmentPalette_Groudon, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); } else if (gBattleTypeFlags & BATTLE_TYPE_KYOGRE) { - LZDecompressVram(gBattleTerrainTiles_Water, (void *)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Water, (void *)(BG_SCREEN_ADDR(26))); - LoadCompressedPalette(gBattleTerrainPalette_Kyogre, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LZDecompressVram(gBattleEnvironmentTiles_Water, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTilemap_Water, (void *)(BG_SCREEN_ADDR(26))); + LoadCompressedPalette(gBattleEnvironmentPalette_Kyogre, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); } else if (gBattleTypeFlags & BATTLE_TYPE_RAYQUAZA) { - LZDecompressVram(gBattleTerrainTiles_Rayquaza, (void *)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Rayquaza, (void *)(BG_SCREEN_ADDR(26))); - LoadCompressedPalette(gBattleTerrainPalette_Rayquaza, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LZDecompressVram(gBattleEnvironmentTiles_Rayquaza, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTilemap_Rayquaza, (void *)(BG_SCREEN_ADDR(26))); + LoadCompressedPalette(gBattleEnvironmentPalette_Rayquaza, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); } else { @@ -790,16 +790,16 @@ void DrawMainBattleBackground(void) u8 trainerClass = gTrainers[gTrainerBattleOpponent_A].trainerClass; if (trainerClass == TRAINER_CLASS_LEADER) { - LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); - LoadCompressedPalette(gBattleTerrainPalette_BuildingLeader, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LZDecompressVram(gBattleEnvironmentTiles_Building, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); + LoadCompressedPalette(gBattleEnvironmentPalette_BuildingLeader, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); return; } else if (trainerClass == TRAINER_CLASS_CHAMPION) { - LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); - LoadCompressedPalette(gBattleTerrainPalette_StadiumWallace, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LZDecompressVram(gBattleEnvironmentTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); + LoadCompressedPalette(gBattleEnvironmentPalette_StadiumWallace, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); return; } } @@ -808,49 +808,49 @@ void DrawMainBattleBackground(void) { default: case MAP_BATTLE_SCENE_NORMAL: - LZDecompressVram(sBattleTerrainTable[gBattleTerrain].tileset, (void *)(BG_CHAR_ADDR(2))); - LZDecompressVram(sBattleTerrainTable[gBattleTerrain].tilemap, (void *)(BG_SCREEN_ADDR(26))); - LoadCompressedPalette(sBattleTerrainTable[gBattleTerrain].palette, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LZDecompressVram(sBattleEnvironmentTable[gBattleEnvironment].tileset, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(sBattleEnvironmentTable[gBattleEnvironment].tilemap, (void *)(BG_SCREEN_ADDR(26))); + LoadCompressedPalette(sBattleEnvironmentTable[gBattleEnvironment].palette, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); break; case MAP_BATTLE_SCENE_GYM: - LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); - LoadCompressedPalette(gBattleTerrainPalette_BuildingGym, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LZDecompressVram(gBattleEnvironmentTiles_Building, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); + LoadCompressedPalette(gBattleEnvironmentPalette_BuildingGym, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); break; case MAP_BATTLE_SCENE_MAGMA: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); - LoadCompressedPalette(gBattleTerrainPalette_StadiumMagma, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LZDecompressVram(gBattleEnvironmentTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); + LoadCompressedPalette(gBattleEnvironmentPalette_StadiumMagma, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); break; case MAP_BATTLE_SCENE_AQUA: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); - LoadCompressedPalette(gBattleTerrainPalette_StadiumAqua, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LZDecompressVram(gBattleEnvironmentTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); + LoadCompressedPalette(gBattleEnvironmentPalette_StadiumAqua, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); break; case MAP_BATTLE_SCENE_SIDNEY: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); - LoadCompressedPalette(gBattleTerrainPalette_StadiumSidney, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LZDecompressVram(gBattleEnvironmentTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); + LoadCompressedPalette(gBattleEnvironmentPalette_StadiumSidney, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); break; case MAP_BATTLE_SCENE_PHOEBE: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); - LoadCompressedPalette(gBattleTerrainPalette_StadiumPhoebe, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LZDecompressVram(gBattleEnvironmentTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); + LoadCompressedPalette(gBattleEnvironmentPalette_StadiumPhoebe, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); break; case MAP_BATTLE_SCENE_GLACIA: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); - LoadCompressedPalette(gBattleTerrainPalette_StadiumGlacia, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LZDecompressVram(gBattleEnvironmentTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); + LoadCompressedPalette(gBattleEnvironmentPalette_StadiumGlacia, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); break; case MAP_BATTLE_SCENE_DRAKE: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); - LoadCompressedPalette(gBattleTerrainPalette_StadiumDrake, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LZDecompressVram(gBattleEnvironmentTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); + LoadCompressedPalette(gBattleEnvironmentPalette_StadiumDrake, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); break; case MAP_BATTLE_SCENE_FRONTIER: - LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2))); - LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); - LoadCompressedPalette(gBattleTerrainPalette_Frontier, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LZDecompressVram(gBattleEnvironmentTiles_Building, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); + LoadCompressedPalette(gBattleEnvironmentPalette_Frontier, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); break; } } @@ -1144,8 +1144,8 @@ void DrawBattleEntryBackground(void) { if (!(gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) || gPartnerTrainerId == TRAINER_STEVEN_PARTNER) { - LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)(BG_CHAR_ADDR(1))); - LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void *)(BG_SCREEN_ADDR(28))); + LZDecompressVram(gBattleEnvironmentAnimTiles_Building, (void *)(BG_CHAR_ADDR(1))); + LZDecompressVram(gBattleEnvironmentAnimTilemap_Building, (void *)(BG_SCREEN_ADDR(28))); } else { @@ -1161,18 +1161,18 @@ void DrawBattleEntryBackground(void) } else if (gBattleTypeFlags & BATTLE_TYPE_GROUDON) { - LZDecompressVram(gBattleTerrainAnimTiles_Cave, (void *)(BG_CHAR_ADDR(1))); - LZDecompressVram(gBattleTerrainAnimTilemap_Cave, (void *)(BG_SCREEN_ADDR(28))); + LZDecompressVram(gBattleEnvironmentAnimTiles_Cave, (void *)(BG_CHAR_ADDR(1))); + LZDecompressVram(gBattleEnvironmentAnimTilemap_Cave, (void *)(BG_SCREEN_ADDR(28))); } else if (gBattleTypeFlags & BATTLE_TYPE_KYOGRE) { - LZDecompressVram(gBattleTerrainAnimTiles_Underwater, (void *)(BG_CHAR_ADDR(1))); - LZDecompressVram(gBattleTerrainAnimTilemap_Underwater, (void *)(BG_SCREEN_ADDR(28))); + LZDecompressVram(gBattleEnvironmentAnimTiles_Underwater, (void *)(BG_CHAR_ADDR(1))); + LZDecompressVram(gBattleEnvironmentAnimTilemap_Underwater, (void *)(BG_SCREEN_ADDR(28))); } else if (gBattleTypeFlags & BATTLE_TYPE_RAYQUAZA) { - LZDecompressVram(gBattleTerrainAnimTiles_Rayquaza, (void *)(BG_CHAR_ADDR(1))); - LZDecompressVram(gBattleTerrainAnimTilemap_Rayquaza, (void *)(BG_SCREEN_ADDR(28))); + LZDecompressVram(gBattleEnvironmentAnimTiles_Rayquaza, (void *)(BG_CHAR_ADDR(1))); + LZDecompressVram(gBattleEnvironmentAnimTilemap_Rayquaza, (void *)(BG_SCREEN_ADDR(28))); } else { @@ -1181,27 +1181,27 @@ void DrawBattleEntryBackground(void) u8 trainerClass = gTrainers[gTrainerBattleOpponent_A].trainerClass; if (trainerClass == TRAINER_CLASS_LEADER) { - LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)(BG_CHAR_ADDR(1))); - LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void *)(BG_SCREEN_ADDR(28))); + LZDecompressVram(gBattleEnvironmentAnimTiles_Building, (void *)(BG_CHAR_ADDR(1))); + LZDecompressVram(gBattleEnvironmentAnimTilemap_Building, (void *)(BG_SCREEN_ADDR(28))); return; } else if (trainerClass == TRAINER_CLASS_CHAMPION) { - LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)(BG_CHAR_ADDR(1))); - LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void *)(BG_SCREEN_ADDR(28))); + LZDecompressVram(gBattleEnvironmentAnimTiles_Building, (void *)(BG_CHAR_ADDR(1))); + LZDecompressVram(gBattleEnvironmentAnimTilemap_Building, (void *)(BG_SCREEN_ADDR(28))); return; } } if (GetCurrentMapBattleScene() == MAP_BATTLE_SCENE_NORMAL) { - LZDecompressVram(sBattleTerrainTable[gBattleTerrain].entryTileset, (void *)(BG_CHAR_ADDR(1))); - LZDecompressVram(sBattleTerrainTable[gBattleTerrain].entryTilemap, (void *)(BG_SCREEN_ADDR(28))); + LZDecompressVram(sBattleEnvironmentTable[gBattleEnvironment].entryTileset, (void *)(BG_CHAR_ADDR(1))); + LZDecompressVram(sBattleEnvironmentTable[gBattleEnvironment].entryTilemap, (void *)(BG_SCREEN_ADDR(28))); } else { - LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)(BG_CHAR_ADDR(1))); - LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void *)(BG_SCREEN_ADDR(28))); + LZDecompressVram(gBattleEnvironmentAnimTiles_Building, (void *)(BG_CHAR_ADDR(1))); + LZDecompressVram(gBattleEnvironmentAnimTilemap_Building, (void *)(BG_SCREEN_ADDR(28))); } } } @@ -1225,11 +1225,11 @@ bool8 LoadChosenBattleElement(u8 caseId) case 3: if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_EREADER_TRAINER)) { - LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTiles_Building, (void *)(BG_CHAR_ADDR(2))); } else if (gBattleTypeFlags & BATTLE_TYPE_GROUDON) { - LZDecompressVram(gBattleTerrainTiles_Cave, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTiles_Cave, (void *)(BG_CHAR_ADDR(2))); } else { @@ -1238,12 +1238,12 @@ bool8 LoadChosenBattleElement(u8 caseId) u8 trainerClass = gTrainers[gTrainerBattleOpponent_A].trainerClass; if (trainerClass == TRAINER_CLASS_LEADER) { - LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTiles_Building, (void *)(BG_CHAR_ADDR(2))); break; } else if (trainerClass == TRAINER_CLASS_CHAMPION) { - LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); break; } } @@ -1252,31 +1252,31 @@ bool8 LoadChosenBattleElement(u8 caseId) { default: case MAP_BATTLE_SCENE_NORMAL: - LZDecompressVram(sBattleTerrainTable[gBattleTerrain].tileset, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(sBattleEnvironmentTable[gBattleEnvironment].tileset, (void *)(BG_CHAR_ADDR(2))); break; case MAP_BATTLE_SCENE_GYM: - LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTiles_Building, (void *)(BG_CHAR_ADDR(2))); break; case MAP_BATTLE_SCENE_MAGMA: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); break; case MAP_BATTLE_SCENE_AQUA: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); break; case MAP_BATTLE_SCENE_SIDNEY: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); break; case MAP_BATTLE_SCENE_PHOEBE: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); break; case MAP_BATTLE_SCENE_GLACIA: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); break; case MAP_BATTLE_SCENE_DRAKE: - LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTiles_Stadium, (void *)(BG_CHAR_ADDR(2))); break; case MAP_BATTLE_SCENE_FRONTIER: - LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2))); + LZDecompressVram(gBattleEnvironmentTiles_Building, (void *)(BG_CHAR_ADDR(2))); break; } } @@ -1284,14 +1284,14 @@ bool8 LoadChosenBattleElement(u8 caseId) case 4: if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_EREADER_TRAINER)) { - LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleEnvironmentTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); } else if (gBattleTypeFlags & BATTLE_TYPE_KYOGRE_GROUDON) { if (gGameVersion == VERSION_RUBY) - LZDecompressVram(gBattleTerrainTilemap_Cave, (void *)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleEnvironmentTilemap_Cave, (void *)(BG_SCREEN_ADDR(26))); else - LZDecompressVram(gBattleTerrainTilemap_Water, (void *)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleEnvironmentTilemap_Water, (void *)(BG_SCREEN_ADDR(26))); } else { @@ -1300,12 +1300,12 @@ bool8 LoadChosenBattleElement(u8 caseId) u8 trainerClass = gTrainers[gTrainerBattleOpponent_A].trainerClass; if (trainerClass == TRAINER_CLASS_LEADER) { - LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleEnvironmentTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); break; } else if (trainerClass == TRAINER_CLASS_CHAMPION) { - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleEnvironmentTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); break; } } @@ -1314,31 +1314,31 @@ bool8 LoadChosenBattleElement(u8 caseId) { default: case MAP_BATTLE_SCENE_NORMAL: - LZDecompressVram(sBattleTerrainTable[gBattleTerrain].tilemap, (void *)(BG_SCREEN_ADDR(26))); + LZDecompressVram(sBattleEnvironmentTable[gBattleEnvironment].tilemap, (void *)(BG_SCREEN_ADDR(26))); break; case MAP_BATTLE_SCENE_GYM: - LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleEnvironmentTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); break; case MAP_BATTLE_SCENE_MAGMA: - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleEnvironmentTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); break; case MAP_BATTLE_SCENE_AQUA: - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleEnvironmentTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); break; case MAP_BATTLE_SCENE_SIDNEY: - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleEnvironmentTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); break; case MAP_BATTLE_SCENE_PHOEBE: - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleEnvironmentTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); break; case MAP_BATTLE_SCENE_GLACIA: - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleEnvironmentTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); break; case MAP_BATTLE_SCENE_DRAKE: - LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleEnvironmentTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26))); break; case MAP_BATTLE_SCENE_FRONTIER: - LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); + LZDecompressVram(gBattleEnvironmentTilemap_Building, (void *)(BG_SCREEN_ADDR(26))); break; } } @@ -1346,14 +1346,14 @@ bool8 LoadChosenBattleElement(u8 caseId) case 5: if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_EREADER_TRAINER)) { - LoadCompressedPalette(gBattleTerrainPalette_Frontier, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LoadCompressedPalette(gBattleEnvironmentPalette_Frontier, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); } else if (gBattleTypeFlags & BATTLE_TYPE_KYOGRE_GROUDON) { if (gGameVersion == VERSION_RUBY) - LoadCompressedPalette(gBattleTerrainPalette_Groudon, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LoadCompressedPalette(gBattleEnvironmentPalette_Groudon, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); else - LoadCompressedPalette(gBattleTerrainPalette_Kyogre, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LoadCompressedPalette(gBattleEnvironmentPalette_Kyogre, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); } else { @@ -1362,12 +1362,12 @@ bool8 LoadChosenBattleElement(u8 caseId) u8 trainerClass = gTrainers[gTrainerBattleOpponent_A].trainerClass; if (trainerClass == TRAINER_CLASS_LEADER) { - LoadCompressedPalette(gBattleTerrainPalette_BuildingLeader, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LoadCompressedPalette(gBattleEnvironmentPalette_BuildingLeader, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); break; } else if (trainerClass == TRAINER_CLASS_CHAMPION) { - LoadCompressedPalette(gBattleTerrainPalette_StadiumWallace, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LoadCompressedPalette(gBattleEnvironmentPalette_StadiumWallace, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); break; } } @@ -1376,31 +1376,31 @@ bool8 LoadChosenBattleElement(u8 caseId) { default: case MAP_BATTLE_SCENE_NORMAL: - LoadCompressedPalette(sBattleTerrainTable[gBattleTerrain].palette, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LoadCompressedPalette(sBattleEnvironmentTable[gBattleEnvironment].palette, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); break; case MAP_BATTLE_SCENE_GYM: - LoadCompressedPalette(gBattleTerrainPalette_BuildingGym, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LoadCompressedPalette(gBattleEnvironmentPalette_BuildingGym, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); break; case MAP_BATTLE_SCENE_MAGMA: - LoadCompressedPalette(gBattleTerrainPalette_StadiumMagma, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LoadCompressedPalette(gBattleEnvironmentPalette_StadiumMagma, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); break; case MAP_BATTLE_SCENE_AQUA: - LoadCompressedPalette(gBattleTerrainPalette_StadiumAqua, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LoadCompressedPalette(gBattleEnvironmentPalette_StadiumAqua, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); break; case MAP_BATTLE_SCENE_SIDNEY: - LoadCompressedPalette(gBattleTerrainPalette_StadiumSidney, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LoadCompressedPalette(gBattleEnvironmentPalette_StadiumSidney, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); break; case MAP_BATTLE_SCENE_PHOEBE: - LoadCompressedPalette(gBattleTerrainPalette_StadiumPhoebe, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LoadCompressedPalette(gBattleEnvironmentPalette_StadiumPhoebe, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); break; case MAP_BATTLE_SCENE_GLACIA: - LoadCompressedPalette(gBattleTerrainPalette_StadiumGlacia, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LoadCompressedPalette(gBattleEnvironmentPalette_StadiumGlacia, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); break; case MAP_BATTLE_SCENE_DRAKE: - LoadCompressedPalette(gBattleTerrainPalette_StadiumDrake, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LoadCompressedPalette(gBattleEnvironmentPalette_StadiumDrake, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); break; case MAP_BATTLE_SCENE_FRONTIER: - LoadCompressedPalette(gBattleTerrainPalette_Frontier, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LoadCompressedPalette(gBattleEnvironmentPalette_Frontier, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); break; } } diff --git a/src/battle_controllers.c b/src/battle_controllers.c index 2ba5d4329d85..02276a7e14ec 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -1417,10 +1417,10 @@ void BtlController_EmitFaintingCry(u8 bufferId) PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } -void BtlController_EmitIntroSlide(u8 bufferId, u8 terrainId) +void BtlController_EmitIntroSlide(u8 bufferId, u8 environmentId) { sBattleBuffersTransferData[0] = CONTROLLER_INTROSLIDE; - sBattleBuffersTransferData[1] = terrainId; + sBattleBuffersTransferData[1] = environmentId; PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 2); } diff --git a/src/battle_intro.c b/src/battle_intro.c index 571c5e85a2fb..0a0226c608da 100644 --- a/src/battle_intro.c +++ b/src/battle_intro.c @@ -24,16 +24,16 @@ static void BattleIntroSlidePartner(u8); static const TaskFunc sBattleIntroSlideFuncs[] = { - [BATTLE_TERRAIN_GRASS] = BattleIntroSlide1, - [BATTLE_TERRAIN_LONG_GRASS] = BattleIntroSlide1, - [BATTLE_TERRAIN_SAND] = BattleIntroSlide2, - [BATTLE_TERRAIN_UNDERWATER] = BattleIntroSlide2, - [BATTLE_TERRAIN_WATER] = BattleIntroSlide2, - [BATTLE_TERRAIN_POND] = BattleIntroSlide1, - [BATTLE_TERRAIN_MOUNTAIN] = BattleIntroSlide1, - [BATTLE_TERRAIN_CAVE] = BattleIntroSlide1, - [BATTLE_TERRAIN_BUILDING] = BattleIntroSlide3, - [BATTLE_TERRAIN_PLAIN] = BattleIntroSlide3, + [BATTLE_ENVIRONMENT_GRASS] = BattleIntroSlide1, + [BATTLE_ENVIRONMENT_LONG_GRASS] = BattleIntroSlide1, + [BATTLE_ENVIRONMENT_SAND] = BattleIntroSlide2, + [BATTLE_ENVIRONMENT_UNDERWATER] = BattleIntroSlide2, + [BATTLE_ENVIRONMENT_WATER] = BattleIntroSlide2, + [BATTLE_ENVIRONMENT_POND] = BattleIntroSlide1, + [BATTLE_ENVIRONMENT_MOUNTAIN] = BattleIntroSlide1, + [BATTLE_ENVIRONMENT_CAVE] = BattleIntroSlide1, + [BATTLE_ENVIRONMENT_BUILDING] = BattleIntroSlide3, + [BATTLE_ENVIRONMENT_PLAIN] = BattleIntroSlide3, }; void SetAnimBgAttribute(u8 bgId, u8 attributeId, u8 value) @@ -100,9 +100,9 @@ int GetAnimBgAttribute(u8 bgId, u8 attributeId) } #define tState data[0] -#define tTerrain data[1] +#define tEnvironment data[1] -void HandleIntroSlide(u8 terrain) +void HandleIntroSlide(u8 environment) { u8 taskId; @@ -120,16 +120,16 @@ void HandleIntroSlide(u8 terrain) } else if ((gBattleTypeFlags & BATTLE_TYPE_KYOGRE_GROUDON) && gGameVersion != VERSION_RUBY) { - terrain = BATTLE_TERRAIN_UNDERWATER; + environment = BATTLE_ENVIRONMENT_UNDERWATER; taskId = CreateTask(BattleIntroSlide2, 0); } else { - taskId = CreateTask(sBattleIntroSlideFuncs[terrain], 0); + taskId = CreateTask(sBattleIntroSlideFuncs[environment], 0); } gTasks[taskId].tState = 0; - gTasks[taskId].tTerrain = terrain; + gTasks[taskId].tEnvironment = environment; gTasks[taskId].data[2] = 0; gTasks[taskId].data[3] = 0; gTasks[taskId].data[4] = 0; @@ -194,7 +194,7 @@ static void BattleIntroSlide1(u8 taskId) } else { - if (gTasks[taskId].tTerrain == BATTLE_TERRAIN_LONG_GRASS) + if (gTasks[taskId].tEnvironment == BATTLE_ENVIRONMENT_LONG_GRASS) { if (gBattle_BG1_Y != (u16)(-80)) gBattle_BG1_Y -= 2; @@ -240,18 +240,18 @@ static void BattleIntroSlide2(u8 taskId) { int i; - switch (gTasks[taskId].tTerrain) + switch (gTasks[taskId].tEnvironment) { - case BATTLE_TERRAIN_SAND: - case BATTLE_TERRAIN_WATER: + case BATTLE_ENVIRONMENT_SAND: + case BATTLE_ENVIRONMENT_WATER: gBattle_BG1_X += 8; break; - case BATTLE_TERRAIN_UNDERWATER: + case BATTLE_ENVIRONMENT_UNDERWATER: gBattle_BG1_X += 6; break; } - if (gTasks[taskId].tTerrain == BATTLE_TERRAIN_WATER) + if (gTasks[taskId].tEnvironment == BATTLE_ENVIRONMENT_WATER) { gBattle_BG1_Y = Cos2(gTasks[taskId].data[6]) / 512 - 8; if (gTasks[taskId].data[6] < 180) diff --git a/src/battle_main.c b/src/battle_main.c index c19089deb043..b216316d4ef9 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -144,7 +144,7 @@ EWRAM_DATA u8 gBattleTextBuff3[TEXT_BUFF_ARRAY_COUNT] = {0}; // it will instead overflow into useful data. EWRAM_DATA static u32 sFlickerArray[25] = {0}; EWRAM_DATA u32 gBattleTypeFlags = 0; -EWRAM_DATA u8 gBattleTerrain = 0; +EWRAM_DATA u8 gBattleEnvironment = 0; EWRAM_DATA u32 gUnusedFirstBattleVar1 = 0; // Never read EWRAM_DATA struct MultiPartnerMenuPokemon gMultiPartnerParty[MULTI_PARTY_SIZE] = {0}; EWRAM_DATA static struct MultiPartnerMenuPokemon* sMultiPartnerPartyBuffer = NULL; @@ -669,9 +669,9 @@ static void CB2_InitBattleInternal(void) gBattle_BG3_X = 0; gBattle_BG3_Y = 0; - gBattleTerrain = BattleSetup_GetTerrainId(); + gBattleEnvironment = BattleSetup_GetEnvironmentId(); if (gBattleTypeFlags & BATTLE_TYPE_RECORDED) - gBattleTerrain = BATTLE_TERRAIN_BUILDING; + gBattleEnvironment = BATTLE_ENVIRONMENT_BUILDING; InitBattleBgsVideo(); LoadBattleTextboxAndBackground(); @@ -3378,7 +3378,7 @@ static void BattleIntroPrepareBackgroundSlide(void) if (gBattleControllerExecFlags == 0) { gActiveBattler = GetBattlerAtPosition(0); - BtlController_EmitIntroSlide(BUFFER_A, gBattleTerrain); + BtlController_EmitIntroSlide(BUFFER_A, gBattleEnvironment); MarkBattlerForControllerExec(gActiveBattler); gBattleMainFunc = BattleIntroDrawTrainersOrMonsSprites; gBattleCommunication[MULTIUSE_STATE] = 0; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 49279bdb9c01..21b0af1c174d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -280,7 +280,7 @@ static void Cmd_sethail(void); static void Cmd_trymemento(void); static void Cmd_setforcedtarget(void); static void Cmd_setcharge(void); -static void Cmd_callterrainattack(void); +static void Cmd_callenvironmentattack(void); static void Cmd_cureifburnedparalysedorpoisoned(void); static void Cmd_settorment(void); static void Cmd_jumpifnodamage(void); @@ -311,7 +311,7 @@ static void Cmd_trycastformdatachange(void); static void Cmd_settypebasedhalvers(void); static void Cmd_setweatherballtype(void); static void Cmd_tryrecycleitem(void); -static void Cmd_settypetoterrain(void); +static void Cmd_settypetoenvironment(void); static void Cmd_pursuitdoubles(void); static void Cmd_snatchsetbattlers(void); static void Cmd_removelightscreenreflect(void); @@ -532,7 +532,7 @@ void (* const gBattleScriptingCommandsTable[])(void) = Cmd_trymemento, //0xC9 Cmd_setforcedtarget, //0xCA Cmd_setcharge, //0xCB - Cmd_callterrainattack, //0xCC + Cmd_callenvironmentattack, //0xCC Cmd_cureifburnedparalysedorpoisoned, //0xCD Cmd_settorment, //0xCE Cmd_jumpifnodamage, //0xCF @@ -563,7 +563,7 @@ void (* const gBattleScriptingCommandsTable[])(void) = Cmd_settypebasedhalvers, //0xE8 Cmd_setweatherballtype, //0xE9 Cmd_tryrecycleitem, //0xEA - Cmd_settypetoterrain, //0xEB + Cmd_settypetoenvironment, //0xEB Cmd_pursuitdoubles, //0xEC Cmd_snatchsetbattlers, //0xED Cmd_removelightscreenreflect, //0xEE @@ -758,16 +758,16 @@ static const u8 sFlailHpScaleToPowerTable[] = static const u16 sNaturePowerMoves[] = { - [BATTLE_TERRAIN_GRASS] = MOVE_STUN_SPORE, - [BATTLE_TERRAIN_LONG_GRASS] = MOVE_RAZOR_LEAF, - [BATTLE_TERRAIN_SAND] = MOVE_EARTHQUAKE, - [BATTLE_TERRAIN_UNDERWATER] = MOVE_HYDRO_PUMP, - [BATTLE_TERRAIN_WATER] = MOVE_SURF, - [BATTLE_TERRAIN_POND] = MOVE_BUBBLE_BEAM, - [BATTLE_TERRAIN_MOUNTAIN] = MOVE_ROCK_SLIDE, - [BATTLE_TERRAIN_CAVE] = MOVE_SHADOW_BALL, - [BATTLE_TERRAIN_BUILDING] = MOVE_SWIFT, - [BATTLE_TERRAIN_PLAIN] = MOVE_SWIFT + [BATTLE_ENVIRONMENT_GRASS] = MOVE_STUN_SPORE, + [BATTLE_ENVIRONMENT_LONG_GRASS] = MOVE_RAZOR_LEAF, + [BATTLE_ENVIRONMENT_SAND] = MOVE_EARTHQUAKE, + [BATTLE_ENVIRONMENT_UNDERWATER] = MOVE_HYDRO_PUMP, + [BATTLE_ENVIRONMENT_WATER] = MOVE_SURF, + [BATTLE_ENVIRONMENT_POND] = MOVE_BUBBLE_BEAM, + [BATTLE_ENVIRONMENT_MOUNTAIN] = MOVE_ROCK_SLIDE, + [BATTLE_ENVIRONMENT_CAVE] = MOVE_SHADOW_BALL, + [BATTLE_ENVIRONMENT_BUILDING] = MOVE_SWIFT, + [BATTLE_ENVIRONMENT_PLAIN] = MOVE_SWIFT }; // format: min. weight (hectograms), base power @@ -823,18 +823,18 @@ static const u8 sPickupProbabilities[] = 30, 40, 50, 60, 70, 80, 90, 94, 98 }; -static const u8 sTerrainToType[] = -{ - [BATTLE_TERRAIN_GRASS] = TYPE_GRASS, - [BATTLE_TERRAIN_LONG_GRASS] = TYPE_GRASS, - [BATTLE_TERRAIN_SAND] = TYPE_GROUND, - [BATTLE_TERRAIN_UNDERWATER] = TYPE_WATER, - [BATTLE_TERRAIN_WATER] = TYPE_WATER, - [BATTLE_TERRAIN_POND] = TYPE_WATER, - [BATTLE_TERRAIN_MOUNTAIN] = TYPE_ROCK, - [BATTLE_TERRAIN_CAVE] = TYPE_ROCK, - [BATTLE_TERRAIN_BUILDING] = TYPE_NORMAL, - [BATTLE_TERRAIN_PLAIN] = TYPE_NORMAL, +static const u8 sEnvironmentToType[] = +{ + [BATTLE_ENVIRONMENT_GRASS] = TYPE_GRASS, + [BATTLE_ENVIRONMENT_LONG_GRASS] = TYPE_GRASS, + [BATTLE_ENVIRONMENT_SAND] = TYPE_GROUND, + [BATTLE_ENVIRONMENT_UNDERWATER] = TYPE_WATER, + [BATTLE_ENVIRONMENT_WATER] = TYPE_WATER, + [BATTLE_ENVIRONMENT_POND] = TYPE_WATER, + [BATTLE_ENVIRONMENT_MOUNTAIN] = TYPE_ROCK, + [BATTLE_ENVIRONMENT_CAVE] = TYPE_ROCK, + [BATTLE_ENVIRONMENT_BUILDING] = TYPE_NORMAL, + [BATTLE_ENVIRONMENT_PLAIN] = TYPE_NORMAL, }; // - ITEM_ULTRA_BALL skips Master Ball and ITEM_NONE @@ -9033,10 +9033,10 @@ static void Cmd_setcharge(void) } // Nature Power -static void Cmd_callterrainattack(void) +static void Cmd_callenvironmentattack(void) { gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; - gCurrentMove = sNaturePowerMoves[gBattleTerrain]; + gCurrentMove = sNaturePowerMoves[gBattleEnvironment]; gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); BattleScriptPush(gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]); gBattlescriptCurrInstr++; @@ -9545,30 +9545,30 @@ static void Cmd_jumpifhasnohp(void) static void Cmd_getsecretpowereffect(void) { - switch (gBattleTerrain) + switch (gBattleEnvironment) { - case BATTLE_TERRAIN_GRASS: + case BATTLE_ENVIRONMENT_GRASS: gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_POISON; break; - case BATTLE_TERRAIN_LONG_GRASS: + case BATTLE_ENVIRONMENT_LONG_GRASS: gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_SLEEP; break; - case BATTLE_TERRAIN_SAND: + case BATTLE_ENVIRONMENT_SAND: gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_ACC_MINUS_1; break; - case BATTLE_TERRAIN_UNDERWATER: + case BATTLE_ENVIRONMENT_UNDERWATER: gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_DEF_MINUS_1; break; - case BATTLE_TERRAIN_WATER: + case BATTLE_ENVIRONMENT_WATER: gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_ATK_MINUS_1; break; - case BATTLE_TERRAIN_POND: + case BATTLE_ENVIRONMENT_POND: gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_SPD_MINUS_1; break; - case BATTLE_TERRAIN_MOUNTAIN: + case BATTLE_ENVIRONMENT_MOUNTAIN: gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_CONFUSION; break; - case BATTLE_TERRAIN_CAVE: + case BATTLE_ENVIRONMENT_CAVE: gBattleCommunication[MOVE_EFFECT_BYTE] = MOVE_EFFECT_FLINCH; break; default: @@ -9755,12 +9755,12 @@ static void Cmd_tryrecycleitem(void) } } -static void Cmd_settypetoterrain(void) +static void Cmd_settypetoenvironment(void) { - if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, sTerrainToType[gBattleTerrain])) + if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, sEnvironmentToType[gBattleEnvironment])) { - SET_BATTLER_TYPE(gBattlerAttacker, sTerrainToType[gBattleTerrain]); - PREPARE_TYPE_BUFFER(gBattleTextBuff1, sTerrainToType[gBattleTerrain]); + SET_BATTLER_TYPE(gBattlerAttacker, sEnvironmentToType[gBattleEnvironment]); + PREPARE_TYPE_BUFFER(gBattleTextBuff1, sEnvironmentToType[gBattleEnvironment]); gBattlescriptCurrInstr += 5; } diff --git a/src/battle_setup.c b/src/battle_setup.c index e87ce6dd2718..77444d5f288e 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -632,7 +632,7 @@ static void CB2_EndScriptedWildBattle(void) } } -u8 BattleSetup_GetTerrainId(void) +u8 BattleSetup_GetEnvironmentId(void) { u16 tileBehavior; s16 x, y; @@ -641,11 +641,11 @@ u8 BattleSetup_GetTerrainId(void) tileBehavior = MapGridGetMetatileBehaviorAt(x, y); if (MetatileBehavior_IsTallGrass(tileBehavior)) - return BATTLE_TERRAIN_GRASS; + return BATTLE_ENVIRONMENT_GRASS; if (MetatileBehavior_IsLongGrass(tileBehavior)) - return BATTLE_TERRAIN_LONG_GRASS; + return BATTLE_ENVIRONMENT_LONG_GRASS; if (MetatileBehavior_IsSandOrDeepSand(tileBehavior)) - return BATTLE_TERRAIN_SAND; + return BATTLE_ENVIRONMENT_SAND; switch (gMapHeader.mapType) { @@ -655,41 +655,41 @@ u8 BattleSetup_GetTerrainId(void) break; case MAP_TYPE_UNDERGROUND: if (MetatileBehavior_IsIndoorEncounter(tileBehavior)) - return BATTLE_TERRAIN_BUILDING; + return BATTLE_ENVIRONMENT_BUILDING; if (MetatileBehavior_IsSurfableWaterOrUnderwater(tileBehavior)) - return BATTLE_TERRAIN_POND; - return BATTLE_TERRAIN_CAVE; + return BATTLE_ENVIRONMENT_POND; + return BATTLE_ENVIRONMENT_CAVE; case MAP_TYPE_INDOOR: case MAP_TYPE_SECRET_BASE: - return BATTLE_TERRAIN_BUILDING; + return BATTLE_ENVIRONMENT_BUILDING; case MAP_TYPE_UNDERWATER: - return BATTLE_TERRAIN_UNDERWATER; + return BATTLE_ENVIRONMENT_UNDERWATER; case MAP_TYPE_OCEAN_ROUTE: if (MetatileBehavior_IsSurfableWaterOrUnderwater(tileBehavior)) - return BATTLE_TERRAIN_WATER; - return BATTLE_TERRAIN_PLAIN; + return BATTLE_ENVIRONMENT_WATER; + return BATTLE_ENVIRONMENT_PLAIN; } if (MetatileBehavior_IsDeepOrOceanWater(tileBehavior)) - return BATTLE_TERRAIN_WATER; + return BATTLE_ENVIRONMENT_WATER; if (MetatileBehavior_IsSurfableWaterOrUnderwater(tileBehavior)) - return BATTLE_TERRAIN_POND; + return BATTLE_ENVIRONMENT_POND; if (MetatileBehavior_IsMountain(tileBehavior)) - return BATTLE_TERRAIN_MOUNTAIN; + return BATTLE_ENVIRONMENT_MOUNTAIN; if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_SURFING)) { // Is BRIDGE_TYPE_POND_*? if (MetatileBehavior_GetBridgeType(tileBehavior) != BRIDGE_TYPE_OCEAN) - return BATTLE_TERRAIN_POND; + return BATTLE_ENVIRONMENT_POND; if (MetatileBehavior_IsBridgeOverWater(tileBehavior) == TRUE) - return BATTLE_TERRAIN_WATER; + return BATTLE_ENVIRONMENT_WATER; } if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(ROUTE113) && gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE113)) - return BATTLE_TERRAIN_SAND; + return BATTLE_ENVIRONMENT_SAND; if (GetSavedWeather() == WEATHER_SANDSTORM) - return BATTLE_TERRAIN_SAND; + return BATTLE_ENVIRONMENT_SAND; - return BATTLE_TERRAIN_PLAIN; + return BATTLE_ENVIRONMENT_PLAIN; } static u8 GetBattleTransitionTypeByMap(void) diff --git a/src/data/graphics/battle_environment.h b/src/data/graphics/battle_environment.h new file mode 100644 index 000000000000..d1abc026deda --- /dev/null +++ b/src/data/graphics/battle_environment.h @@ -0,0 +1,88 @@ +const u32 gBattleEnvironmentTiles_TallGrass[] = INCBIN_U32("graphics/battle_environment/tall_grass/tiles.4bpp.lz"); +const u32 gBattleEnvironmentPalette_TallGrass[] = INCBIN_U32("graphics/battle_environment/tall_grass/palette.gbapal.lz"); +const u32 gBattleEnvironmentTilemap_TallGrass[] = INCBIN_U32("graphics/battle_environment/tall_grass/map.bin.lz"); + +const u32 gBattleEnvironmentTiles_LongGrass[] = INCBIN_U32("graphics/battle_environment/long_grass/tiles.4bpp.lz"); +const u32 gBattleEnvironmentPalette_LongGrass[] = INCBIN_U32("graphics/battle_environment/long_grass/palette.gbapal.lz"); +const u32 gBattleEnvironmentTilemap_LongGrass[] = INCBIN_U32("graphics/battle_environment/long_grass/map.bin.lz"); + +const u32 gBattleEnvironmentTiles_Sand[] = INCBIN_U32("graphics/battle_environment/sand/tiles.4bpp.lz"); +const u32 gBattleEnvironmentPalette_Sand[] = INCBIN_U32("graphics/battle_environment/sand/palette.gbapal.lz"); +const u32 gBattleEnvironmentTilemap_Sand[] = INCBIN_U32("graphics/battle_environment/sand/map.bin.lz"); + +const u32 gBattleEnvironmentTiles_Underwater[] = INCBIN_U32("graphics/battle_environment/underwater/tiles.4bpp.lz"); +const u32 gBattleEnvironmentPalette_Underwater[] = INCBIN_U32("graphics/battle_environment/underwater/palette.gbapal.lz"); +const u32 gBattleEnvironmentTilemap_Underwater[] = INCBIN_U32("graphics/battle_environment/underwater/map.bin.lz"); + +const u32 gBattleEnvironmentTiles_Water[] = INCBIN_U32("graphics/battle_environment/water/tiles.4bpp.lz"); +const u32 gBattleEnvironmentPalette_Water[] = INCBIN_U32("graphics/battle_environment/water/palette.gbapal.lz"); +const u32 gBattleEnvironmentTilemap_Water[] = INCBIN_U32("graphics/battle_environment/water/map.bin.lz"); + +const u32 gBattleEnvironmentTiles_PondWater[] = INCBIN_U32("graphics/battle_environment/pond_water/tiles.4bpp.lz"); +const u32 gBattleEnvironmentPalette_PondWater[] = INCBIN_U32("graphics/battle_environment/pond_water/palette.gbapal.lz"); +const u32 gBattleEnvironmentTilemap_PondWater[] = INCBIN_U32("graphics/battle_environment/pond_water/map.bin.lz"); + +const u32 gBattleEnvironmentTiles_Rock[] = INCBIN_U32("graphics/battle_environment/rock/tiles.4bpp.lz"); +const u32 gBattleEnvironmentPalette_Rock[] = INCBIN_U32("graphics/battle_environment/rock/palette.gbapal.lz"); +const u32 gBattleEnvironmentTilemap_Rock[] = INCBIN_U32("graphics/battle_environment/rock/map.bin.lz"); + +const u32 gBattleEnvironmentTiles_Cave[] = INCBIN_U32("graphics/battle_environment/cave/tiles.4bpp.lz"); +const u32 gBattleEnvironmentPalette_Cave[] = INCBIN_U32("graphics/battle_environment/cave/palette.gbapal.lz"); +const u32 gBattleEnvironmentTilemap_Cave[] = INCBIN_U32("graphics/battle_environment/cave/map.bin.lz"); + +const u32 gBattleEnvironmentPalette_Plain[] = INCBIN_U32("graphics/battle_environment/plain/palette.gbapal.lz"); + +const u32 gBattleEnvironmentTiles_Building[] = INCBIN_U32("graphics/battle_environment/building/tiles.4bpp.lz"); +const u32 gBattleEnvironmentPalette_Frontier[] = INCBIN_U32("graphics/battle_environment/stadium/battle_frontier.gbapal.lz"); // this is also used for link battles +const u32 gBattleEnvironmentTilemap_Building[] = INCBIN_U32("graphics/battle_environment/building/map.bin.lz"); + +const u32 gBattleEnvironmentTiles_Stadium[] = INCBIN_U32("graphics/battle_environment/stadium/tiles.4bpp.lz"); +const u32 gBattleEnvironmentTilemap_Stadium[] = INCBIN_U32("graphics/battle_environment/stadium/map.bin.lz"); + +const u32 gBattleEnvironmentTiles_Rayquaza[] = INCBIN_U32("graphics/battle_environment/sky/tiles.4bpp.lz"); +const u32 gBattleEnvironmentTilemap_Rayquaza[] = INCBIN_U32("graphics/battle_environment/sky/map.bin.lz"); + +const u32 gBattleEnvironmentPalette_Building[] = INCBIN_U32("graphics/battle_environment/building/palette.gbapal.lz"); + +const u32 gBattleEnvironmentPalette_Kyogre[] = INCBIN_U32("graphics/battle_environment/water/kyogre.gbapal.lz"); +const u32 gBattleEnvironmentPalette_Groudon[] = INCBIN_U32("graphics/battle_environment/cave/groudon.gbapal.lz"); +const u32 gBattleEnvironmentPalette_BuildingGym[] = INCBIN_U32("graphics/battle_environment/building/palette2.gbapal.lz"); +const u32 gBattleEnvironmentPalette_BuildingLeader[] = INCBIN_U32("graphics/battle_environment/building/palette3.gbapal.lz"); +const u32 gBattleEnvironmentPalette_StadiumAqua[] = INCBIN_U32("graphics/battle_environment/stadium/palette1.gbapal.lz"); +const u32 gBattleEnvironmentPalette_StadiumMagma[] = INCBIN_U32("graphics/battle_environment/stadium/palette2.gbapal.lz"); +const u32 gBattleEnvironmentPalette_StadiumSidney[] = INCBIN_U32("graphics/battle_environment/stadium/palette3.gbapal.lz"); +const u32 gBattleEnvironmentPalette_StadiumPhoebe[] = INCBIN_U32("graphics/battle_environment/stadium/palette4.gbapal.lz"); +const u32 gBattleEnvironmentPalette_StadiumGlacia[] = INCBIN_U32("graphics/battle_environment/stadium/palette5.gbapal.lz"); +const u32 gBattleEnvironmentPalette_StadiumDrake[] = INCBIN_U32("graphics/battle_environment/stadium/palette6.gbapal.lz"); +const u32 gBattleEnvironmentPalette_StadiumWallace[] = INCBIN_U32("graphics/battle_environment/stadium/palette7.gbapal.lz"); +const u32 gBattleEnvironmentPalette_Rayquaza[] = INCBIN_U32("graphics/battle_environment/sky/palette.gbapal.lz"); + +const u32 gBattleEnvironmentAnimTiles_TallGrass[] = INCBIN_U32("graphics/battle_environment/tall_grass/anim_tiles.4bpp.lz"); +const u32 gBattleEnvironmentAnimTilemap_TallGrass[] = INCBIN_U32("graphics/battle_environment/tall_grass/anim_map.bin.lz"); + +const u32 gBattleEnvironmentAnimTiles_LongGrass[] = INCBIN_U32("graphics/battle_environment/long_grass/anim_tiles.4bpp.lz"); +const u32 gBattleEnvironmentAnimTilemap_LongGrass[] = INCBIN_U32("graphics/battle_environment/long_grass/anim_map.bin.lz"); + +const u32 gBattleEnvironmentAnimTiles_Sand[] = INCBIN_U32("graphics/battle_environment/sand/anim_tiles.4bpp.lz"); +const u32 gBattleEnvironmentAnimTilemap_Sand[] = INCBIN_U32("graphics/battle_environment/sand/anim_map.bin.lz"); + +const u32 gBattleEnvironmentAnimTiles_Underwater[] = INCBIN_U32("graphics/battle_environment/underwater/anim_tiles.4bpp.lz"); +const u32 gBattleEnvironmentAnimTilemap_Underwater[] = INCBIN_U32("graphics/battle_environment/underwater/anim_map.bin.lz"); + +const u32 gBattleEnvironmentAnimTiles_Water[] = INCBIN_U32("graphics/battle_environment/water/anim_tiles.4bpp.lz"); +const u32 gBattleEnvironmentAnimTilemap_Water[] = INCBIN_U32("graphics/battle_environment/water/anim_map.bin.lz"); + +const u32 gBattleEnvironmentAnimTiles_PondWater[] = INCBIN_U32("graphics/battle_environment/pond_water/anim_tiles.4bpp.lz"); +const u32 gBattleEnvironmentAnimTilemap_PondWater[] = INCBIN_U32("graphics/battle_environment/pond_water/anim_map.bin.lz"); + +const u32 gBattleEnvironmentAnimTiles_Rock[] = INCBIN_U32("graphics/battle_environment/rock/anim_tiles.4bpp.lz"); +const u32 gBattleEnvironmentAnimTilemap_Rock[] = INCBIN_U32("graphics/battle_environment/rock/anim_map.bin.lz"); + +const u32 gBattleEnvironmentAnimTiles_Cave[] = INCBIN_U32("graphics/battle_environment/cave/anim_tiles.4bpp.lz"); +const u32 gBattleEnvironmentAnimTilemap_Cave[] = INCBIN_U32("graphics/battle_environment/cave/anim_map.bin.lz"); + +const u32 gBattleEnvironmentAnimTiles_Building[] = INCBIN_U32("graphics/battle_environment/building/anim_tiles.4bpp.lz"); +const u32 gBattleEnvironmentAnimTilemap_Building[] = INCBIN_U32("graphics/battle_environment/building/anim_map.bin.lz"); + +const u32 gBattleEnvironmentAnimTiles_Rayquaza[] = INCBIN_U32("graphics/battle_environment/sky/anim_tiles.4bpp.lz"); +const u32 gBattleEnvironmentAnimTilemap_Rayquaza[] = INCBIN_U32("graphics/battle_environment/sky/anim_map.bin.lz"); diff --git a/src/data/graphics/battle_terrain.h b/src/data/graphics/battle_terrain.h deleted file mode 100644 index e719fafe3c5d..000000000000 --- a/src/data/graphics/battle_terrain.h +++ /dev/null @@ -1,88 +0,0 @@ -const u32 gBattleTerrainTiles_TallGrass[] = INCBIN_U32("graphics/battle_terrain/tall_grass/tiles.4bpp.lz"); -const u32 gBattleTerrainPalette_TallGrass[] = INCBIN_U32("graphics/battle_terrain/tall_grass/palette.gbapal.lz"); -const u32 gBattleTerrainTilemap_TallGrass[] = INCBIN_U32("graphics/battle_terrain/tall_grass/map.bin.lz"); - -const u32 gBattleTerrainTiles_LongGrass[] = INCBIN_U32("graphics/battle_terrain/long_grass/tiles.4bpp.lz"); -const u32 gBattleTerrainPalette_LongGrass[] = INCBIN_U32("graphics/battle_terrain/long_grass/palette.gbapal.lz"); -const u32 gBattleTerrainTilemap_LongGrass[] = INCBIN_U32("graphics/battle_terrain/long_grass/map.bin.lz"); - -const u32 gBattleTerrainTiles_Sand[] = INCBIN_U32("graphics/battle_terrain/sand/tiles.4bpp.lz"); -const u32 gBattleTerrainPalette_Sand[] = INCBIN_U32("graphics/battle_terrain/sand/palette.gbapal.lz"); -const u32 gBattleTerrainTilemap_Sand[] = INCBIN_U32("graphics/battle_terrain/sand/map.bin.lz"); - -const u32 gBattleTerrainTiles_Underwater[] = INCBIN_U32("graphics/battle_terrain/underwater/tiles.4bpp.lz"); -const u32 gBattleTerrainPalette_Underwater[] = INCBIN_U32("graphics/battle_terrain/underwater/palette.gbapal.lz"); -const u32 gBattleTerrainTilemap_Underwater[] = INCBIN_U32("graphics/battle_terrain/underwater/map.bin.lz"); - -const u32 gBattleTerrainTiles_Water[] = INCBIN_U32("graphics/battle_terrain/water/tiles.4bpp.lz"); -const u32 gBattleTerrainPalette_Water[] = INCBIN_U32("graphics/battle_terrain/water/palette.gbapal.lz"); -const u32 gBattleTerrainTilemap_Water[] = INCBIN_U32("graphics/battle_terrain/water/map.bin.lz"); - -const u32 gBattleTerrainTiles_PondWater[] = INCBIN_U32("graphics/battle_terrain/pond_water/tiles.4bpp.lz"); -const u32 gBattleTerrainPalette_PondWater[] = INCBIN_U32("graphics/battle_terrain/pond_water/palette.gbapal.lz"); -const u32 gBattleTerrainTilemap_PondWater[] = INCBIN_U32("graphics/battle_terrain/pond_water/map.bin.lz"); - -const u32 gBattleTerrainTiles_Rock[] = INCBIN_U32("graphics/battle_terrain/rock/tiles.4bpp.lz"); -const u32 gBattleTerrainPalette_Rock[] = INCBIN_U32("graphics/battle_terrain/rock/palette.gbapal.lz"); -const u32 gBattleTerrainTilemap_Rock[] = INCBIN_U32("graphics/battle_terrain/rock/map.bin.lz"); - -const u32 gBattleTerrainTiles_Cave[] = INCBIN_U32("graphics/battle_terrain/cave/tiles.4bpp.lz"); -const u32 gBattleTerrainPalette_Cave[] = INCBIN_U32("graphics/battle_terrain/cave/palette.gbapal.lz"); -const u32 gBattleTerrainTilemap_Cave[] = INCBIN_U32("graphics/battle_terrain/cave/map.bin.lz"); - -const u32 gBattleTerrainPalette_Plain[] = INCBIN_U32("graphics/battle_terrain/plain/palette.gbapal.lz"); - -const u32 gBattleTerrainTiles_Building[] = INCBIN_U32("graphics/battle_terrain/building/tiles.4bpp.lz"); -const u32 gBattleTerrainPalette_Frontier[] = INCBIN_U32("graphics/battle_terrain/stadium/battle_frontier.gbapal.lz"); // this is also used for link battles -const u32 gBattleTerrainTilemap_Building[] = INCBIN_U32("graphics/battle_terrain/building/map.bin.lz"); - -const u32 gBattleTerrainTiles_Stadium[] = INCBIN_U32("graphics/battle_terrain/stadium/tiles.4bpp.lz"); -const u32 gBattleTerrainTilemap_Stadium[] = INCBIN_U32("graphics/battle_terrain/stadium/map.bin.lz"); - -const u32 gBattleTerrainTiles_Rayquaza[] = INCBIN_U32("graphics/battle_terrain/sky/tiles.4bpp.lz"); -const u32 gBattleTerrainTilemap_Rayquaza[] = INCBIN_U32("graphics/battle_terrain/sky/map.bin.lz"); - -const u32 gBattleTerrainPalette_Building[] = INCBIN_U32("graphics/battle_terrain/building/palette.gbapal.lz"); - -const u32 gBattleTerrainPalette_Kyogre[] = INCBIN_U32("graphics/battle_terrain/water/kyogre.gbapal.lz"); -const u32 gBattleTerrainPalette_Groudon[] = INCBIN_U32("graphics/battle_terrain/cave/groudon.gbapal.lz"); -const u32 gBattleTerrainPalette_BuildingGym[] = INCBIN_U32("graphics/battle_terrain/building/palette2.gbapal.lz"); -const u32 gBattleTerrainPalette_BuildingLeader[] = INCBIN_U32("graphics/battle_terrain/building/palette3.gbapal.lz"); -const u32 gBattleTerrainPalette_StadiumAqua[] = INCBIN_U32("graphics/battle_terrain/stadium/palette1.gbapal.lz"); -const u32 gBattleTerrainPalette_StadiumMagma[] = INCBIN_U32("graphics/battle_terrain/stadium/palette2.gbapal.lz"); -const u32 gBattleTerrainPalette_StadiumSidney[] = INCBIN_U32("graphics/battle_terrain/stadium/palette3.gbapal.lz"); -const u32 gBattleTerrainPalette_StadiumPhoebe[] = INCBIN_U32("graphics/battle_terrain/stadium/palette4.gbapal.lz"); -const u32 gBattleTerrainPalette_StadiumGlacia[] = INCBIN_U32("graphics/battle_terrain/stadium/palette5.gbapal.lz"); -const u32 gBattleTerrainPalette_StadiumDrake[] = INCBIN_U32("graphics/battle_terrain/stadium/palette6.gbapal.lz"); -const u32 gBattleTerrainPalette_StadiumWallace[] = INCBIN_U32("graphics/battle_terrain/stadium/palette7.gbapal.lz"); -const u32 gBattleTerrainPalette_Rayquaza[] = INCBIN_U32("graphics/battle_terrain/sky/palette.gbapal.lz"); - -const u32 gBattleTerrainAnimTiles_TallGrass[] = INCBIN_U32("graphics/battle_terrain/tall_grass/anim_tiles.4bpp.lz"); -const u32 gBattleTerrainAnimTilemap_TallGrass[] = INCBIN_U32("graphics/battle_terrain/tall_grass/anim_map.bin.lz"); - -const u32 gBattleTerrainAnimTiles_LongGrass[] = INCBIN_U32("graphics/battle_terrain/long_grass/anim_tiles.4bpp.lz"); -const u32 gBattleTerrainAnimTilemap_LongGrass[] = INCBIN_U32("graphics/battle_terrain/long_grass/anim_map.bin.lz"); - -const u32 gBattleTerrainAnimTiles_Sand[] = INCBIN_U32("graphics/battle_terrain/sand/anim_tiles.4bpp.lz"); -const u32 gBattleTerrainAnimTilemap_Sand[] = INCBIN_U32("graphics/battle_terrain/sand/anim_map.bin.lz"); - -const u32 gBattleTerrainAnimTiles_Underwater[] = INCBIN_U32("graphics/battle_terrain/underwater/anim_tiles.4bpp.lz"); -const u32 gBattleTerrainAnimTilemap_Underwater[] = INCBIN_U32("graphics/battle_terrain/underwater/anim_map.bin.lz"); - -const u32 gBattleTerrainAnimTiles_Water[] = INCBIN_U32("graphics/battle_terrain/water/anim_tiles.4bpp.lz"); -const u32 gBattleTerrainAnimTilemap_Water[] = INCBIN_U32("graphics/battle_terrain/water/anim_map.bin.lz"); - -const u32 gBattleTerrainAnimTiles_PondWater[] = INCBIN_U32("graphics/battle_terrain/pond_water/anim_tiles.4bpp.lz"); -const u32 gBattleTerrainAnimTilemap_PondWater[] = INCBIN_U32("graphics/battle_terrain/pond_water/anim_map.bin.lz"); - -const u32 gBattleTerrainAnimTiles_Rock[] = INCBIN_U32("graphics/battle_terrain/rock/anim_tiles.4bpp.lz"); -const u32 gBattleTerrainAnimTilemap_Rock[] = INCBIN_U32("graphics/battle_terrain/rock/anim_map.bin.lz"); - -const u32 gBattleTerrainAnimTiles_Cave[] = INCBIN_U32("graphics/battle_terrain/cave/anim_tiles.4bpp.lz"); -const u32 gBattleTerrainAnimTilemap_Cave[] = INCBIN_U32("graphics/battle_terrain/cave/anim_map.bin.lz"); - -const u32 gBattleTerrainAnimTiles_Building[] = INCBIN_U32("graphics/battle_terrain/building/anim_tiles.4bpp.lz"); -const u32 gBattleTerrainAnimTilemap_Building[] = INCBIN_U32("graphics/battle_terrain/building/anim_map.bin.lz"); - -const u32 gBattleTerrainAnimTiles_Rayquaza[] = INCBIN_U32("graphics/battle_terrain/sky/anim_tiles.4bpp.lz"); -const u32 gBattleTerrainAnimTilemap_Rayquaza[] = INCBIN_U32("graphics/battle_terrain/sky/anim_map.bin.lz"); diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 133afe3b0dd2..96249941e18a 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -237,7 +237,7 @@ void EvolutionScene(struct Pokemon *mon, u16 postEvoSpecies, bool8 canStopEvo, u gBattle_BG3_X = 256; gBattle_BG3_Y = 0; - gBattleTerrain = BATTLE_TERRAIN_PLAIN; + gBattleEnvironment = BATTLE_ENVIRONMENT_PLAIN; InitBattleBgsVideo(); LoadBattleTextboxAndBackground(); @@ -343,7 +343,7 @@ static void CB2_EvolutionSceneLoadGraphics(void) gBattle_BG3_X = 256; gBattle_BG3_Y = 0; - gBattleTerrain = BATTLE_TERRAIN_PLAIN; + gBattleEnvironment = BATTLE_ENVIRONMENT_PLAIN; InitBattleBgsVideo(); LoadBattleTextboxAndBackground(); diff --git a/src/graphics.c b/src/graphics.c index 26120226951e..22d390fa72fa 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -942,7 +942,7 @@ const u32 gBattleVSFrame_Pal[] = INCBIN_U32("graphics/battle_transitions/vs_fram const u32 gVsLettersGfx[] = INCBIN_U32("graphics/battle_transitions/vs.4bpp.lz"); -#include "data/graphics/battle_terrain.h" +#include "data/graphics/battle_environment.h" // Battle Dome const u32 gDomeTourneyTree_Gfx[] = INCBIN_U32("graphics/battle_frontier/tourney_tree.4bpp.lz"); diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c index a334038d8d81..f27407755472 100644 --- a/src/pokeblock_feed.c +++ b/src/pokeblock_feed.c @@ -760,7 +760,7 @@ static bool8 LoadMonAndSceneGfx(struct Pokemon *mon) break; case 6: ResetTempTileDataBuffers(); - DecompressAndCopyTileDataToVram(1, gBattleTerrainTiles_Building, 0, 0, 0); + DecompressAndCopyTileDataToVram(1, gBattleEnvironmentTiles_Building, 0, 0, 0); sPokeblockFeed->loadGfxState++; break; case 7: @@ -771,7 +771,7 @@ static bool8 LoadMonAndSceneGfx(struct Pokemon *mon) } break; case 8: - LoadCompressedPalette(gBattleTerrainPalette_Frontier, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); + LoadCompressedPalette(gBattleEnvironmentPalette_Frontier, BG_PLTT_ID(2), 3 * PLTT_SIZE_4BPP); sPokeblockFeed->loadGfxState = 0; return TRUE; }