summaryrefslogtreecommitdiff
path: root/src/battle_controller_opponent.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/battle_controller_opponent.c')
-rw-r--r--src/battle_controller_opponent.c64
1 files changed, 30 insertions, 34 deletions
diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c
index c490ad314..c057e8575 100644
--- a/src/battle_controller_opponent.c
+++ b/src/battle_controller_opponent.c
@@ -1,48 +1,44 @@
#include "global.h"
#include "battle.h"
+#include "battle_ai_script_commands.h"
+#include "battle_anim.h"
+#include "battle_arena.h"
#include "battle_controllers.h"
#include "battle_message.h"
#include "battle_interface.h"
-#include "battle_anim.h"
-#include "constants/battle_anim.h"
+#include "battle_setup.h"
+#include "battle_tower.h"
#include "battle_tv.h"
-#include "battle_ai_script_commands.h"
-#include "pokemon.h"
+#include "bg.h"
+#include "data2.h"
+#include "frontier_util.h"
+#include "item.h"
#include "link.h"
-#include "util.h"
#include "main.h"
-#include "item.h"
-#include "constants/items.h"
-#include "constants/songs.h"
-#include "sound.h"
-#include "constants/moves.h"
-#include "constants/trainers.h"
-#include "window.h"
#include "m4a.h"
#include "palette.h"
+#include "pokeball.h"
+#include "pokemon.h"
+#include "random.h"
+#include "reshow_battle_screen.h"
+#include "sound.h"
+#include "string_util.h"
#include "task.h"
#include "text.h"
-#include "string_util.h"
-#include "bg.h"
-#include "reshow_battle_screen.h"
-#include "random.h"
-#include "pokeball.h"
-#include "data2.h"
-#include "battle_setup.h"
+#include "util.h"
+#include "window.h"
+#include "constants/battle_anim.h"
+#include "constants/items.h"
+#include "constants/moves.h"
+#include "constants/songs.h"
+#include "constants/trainers.h"
-extern u16 gBattle_BG0_X;
-extern u16 gBattle_BG0_Y;
extern struct MusicPlayerInfo gMPlayInfo_BGM;
-extern struct UnusedControllerStruct gUnknown_02022D0C;
extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[];
extern void sub_8172EF0(u8 battlerId, struct Pokemon *mon);
-extern void sub_81A57E4(u8 battlerId, u16 stringId);
-extern u8 GetFrontierBrainTrainerPicIndex(void);
extern u8 GetTrainerHillTrainerFrontSpriteId(u16 trainerId);
-extern u8 GetFrontierTrainerFrontSpriteId(u16 trainerId);
-extern u8 GetEreaderTrainerFrontSpriteId(void);
// this file's functions
static void OpponentHandleGetMonData(void);
@@ -542,7 +538,7 @@ static void OpponentHandleGetMonData(void)
else
{
monToCheck = gBattleBufferA[gActiveBattler][2];
- for (i = 0; i < 6; i++)
+ for (i = 0; i < PARTY_SIZE; i++)
{
if (monToCheck & 1)
size += GetOpponentMonData(i, monData + size);
@@ -885,7 +881,7 @@ static void OpponentHandleSetMonData(void)
else
{
monToCheck = gBattleBufferA[gActiveBattler][2];
- for (i = 0; i < 6; i++)
+ for (i = 0; i < PARTY_SIZE; i++)
{
if (monToCheck & 1)
SetOpponentMonData(i);
@@ -1384,7 +1380,7 @@ static void OpponentHandleTrainerSlideBack(void)
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 35;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 280;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y;
- gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80A6EEC;
+ gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation;
StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCallbackDummy);
gBattlerControllerFuncs[gActiveBattler] = sub_805F240;
}
@@ -1402,7 +1398,7 @@ static void OpponentHandleFaintAnimation(void)
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive)
{
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
- PlaySE12WithPanning(SE_POKE_DEAD, PAN_SIDE_OPPONENT);
+ PlaySE12WithPanning(SE_POKE_DEAD, SOUND_PAN_TARGET);
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_FaintOpponentMon;
gBattlerControllerFuncs[gActiveBattler] = sub_805FAC4;
}
@@ -1513,7 +1509,7 @@ static void OpponentHandlePrintString(void)
BufferStringBattle(*stringId);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
- sub_81A57E4(gActiveBattler, *stringId);
+ BattleArena_DeductMindPoints(gActiveBattler, *stringId);
}
static void OpponentHandlePrintSelectionString(void)
@@ -1810,9 +1806,9 @@ static void OpponentHandlePlaySE(void)
s8 pan;
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
- pan = PAN_SIDE_PLAYER;
+ pan = SOUND_PAN_ATTACKER;
else
- pan = PAN_SIDE_OPPONENT;
+ pan = SOUND_PAN_TARGET;
PlaySE12WithPanning(gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8), pan);
OpponentBufferExecCompleted();
@@ -1858,7 +1854,7 @@ static void OpponentHandleIntroTrainerBallThrow(void)
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 35;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 280;
gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y;
- gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80A6EEC;
+ gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation;
StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_806280C);