Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename battle terrain to environment #2014

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions asm/macros/battle_script.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@
.byte 0xcb
.endm

.macro callterrainattack
.macro callenvironmentattack
.byte 0xcc
.endm

Expand Down Expand Up @@ -1192,7 +1192,7 @@
.4byte \ptr
.endm

.macro settypetoterrain ptr:req
.macro settypetoenvironment ptr:req
.byte 0xeb
.4byte \ptr
.endm
Expand Down
56 changes: 28 additions & 28 deletions data/battle_anim_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -2289,7 +2289,7 @@ BattleScript_EffectNaturePower::
attackcanceler
attackstring
pause B_WAIT_TIME_SHORT
callterrainattack
callenvironmentattack
printstring STRINGID_NATUREPOWERTURNEDINTO
waitmessage B_WAIT_TIME_LONG
return
Expand Down Expand Up @@ -2799,7 +2799,7 @@ BattleScript_EffectCamouflage::
attackcanceler
attackstring
ppreduce
settypetoterrain BattleScript_ButItFailed
settypetoenvironment BattleScript_ButItFailed
attackanimation
waitanimation
printstring STRINGID_PKMNCHANGEDTYPE
Expand Down
2 changes: 1 addition & 1 deletion include/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion include/battle_anim.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/battle_controllers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion include/battle_setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
22 changes: 11 additions & 11 deletions include/constants/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading