battle controller opponent is done

This commit is contained in:
DizzyEggg 2017-10-26 23:12:48 +02:00
parent fa36e23683
commit 1506184465
19 changed files with 649 additions and 1493 deletions

View File

@ -3111,7 +3111,7 @@ sub_805EB9C: @ 805EB9C
_0805EBC8:
lsls r0, r5, 24
lsrs r0, 24
bl AnimBankSpriteExists
bl IsBankSpritePresent
lsls r0, 24
cmp r0, 0
beq _0805EC60
@ -3329,7 +3329,7 @@ sub_805ED70: @ 805ED70
cmp r0, 0
beq _0805EDAC
adds r0, r4, 0
bl AnimBankSpriteExists
bl IsBankSpritePresent
lsls r0, 24
cmp r0, 0
bne _0805EDC0

View File

@ -726,7 +726,7 @@ GetAnimBankSpriteId: @ 80A6240
bne _080A6268
ldr r4, =gAnimBankAttacker
ldrb r0, [r4]
bl AnimBankSpriteExists
bl IsBankSpritePresent
lsls r0, 24
cmp r0, 0
beq _080A62B6
@ -739,7 +739,7 @@ _080A6268:
bne _080A6288
ldr r4, =gAnimBankTarget
ldrb r0, [r4]
bl AnimBankSpriteExists
bl IsBankSpritePresent
lsls r0, 24
cmp r0, 0
beq _080A62B6
@ -1862,8 +1862,8 @@ _080A6A7E:
.pool
thumb_func_end GetBankByIdentity
thumb_func_start AnimBankSpriteExists
AnimBankSpriteExists: @ 80A6A90
thumb_func_start IsBankSpritePresent
IsBankSpritePresent: @ 80A6A90
push {r4,r5,lr}
lsls r0, 24
lsrs r4, r0, 24
@ -1926,7 +1926,7 @@ _080A6B1A:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end AnimBankSpriteExists
thumb_func_end IsBankSpritePresent
thumb_func_start IsDoubleBattle
IsDoubleBattle: @ 80A6B20

File diff suppressed because it is too large Load Diff

View File

@ -657,7 +657,7 @@ struct BattleStruct
u8 field_B3;
void (*savedCallback)(void);
u16 usedHeldItems[BATTLE_BANKS_COUNT];
u8 field_C0[4];
u8 chosenItem[4]; // why is this an u8?
u8 AI_itemType[2];
u8 AI_itemFlags[2];
u16 choicedMove[BATTLE_BANKS_COUNT];

View File

@ -84,7 +84,7 @@ void sub_80A6B30(struct UnknownAnimStruct2*);
void sub_80A6B90(struct UnknownAnimStruct2*, u32 arg1);
u8 sub_80A82E4(u8 bank);
u8 sub_80A5C6C(u8 bank, u8 attributeId);
bool8 AnimBankSpriteExists(u8 bank);
bool8 IsBankSpritePresent(u8 bank);
void sub_80A6C68(u8 arg0);
u8 GetAnimBankSpriteId(u8 wantedBank);
bool8 IsDoubleBattle(void);

View File

@ -238,7 +238,7 @@ void EmitResetActionMoveSelection(u8 bufferId, u8 caseId);
void EmitCmd55(u8 bufferId, u8 arg1);
// player controller
void SetBankFuncToPlayerBufferRunCommand(void);
void SetControllerToPlayer(void);
void nullsub_21(void);
void PlayerHandleGetRawMonData(void);
void sub_80587B0(void);
@ -251,27 +251,27 @@ void ActionSelectionDestroyCursorAt(u8 cursorPos);
void InitMoveSelectionsVarsAndStrings(void);
// recorded player controller
void SetBankFuncToRecordedPlayerBufferRunCommand(void);
void SetControllerToRecordedPlayer(void);
// opponent controller
void SetBankFuncToOpponentBufferRunCommand(void);
void SetControllerToOpponent(void);
// player partner controller
void SetBankFuncToPlayerPartnerBufferRunCommand(void);
void SetControllerToPlayerPartner(void);
// safari controller
void SetBankFuncToSafariBufferRunCommand(void);
void SetControllerToSafari(void);
// wally controller
void SetBankFuncToWallyBufferRunCommand(void);
void SetControllerToWally(void);
// recorded opponent controller
void SetBankFuncToRecordedOpponentBufferRunCommand(void);
void SetControllerToRecordedOpponent(void);
// link opponent
void SetBankFuncToLinkOpponentBufferRunCommand(void);
void SetControllerToLinkOpponent(void);
// link partner
void SetBankFuncToLinkPartnerBufferRunCommand(void);
void SetControllerToLinkPartner(void);
#endif // GUARD_BATTLE_CONTROLLERS_H

View File

@ -64,7 +64,6 @@ SECTIONS {
src/battle_controller_player.o(.text);
asm/battle_7.o(.text);
src/battle_controller_opponent.o(.text);
asm/battle_controller_opponent.o(.text);
src/battle_ai_switch_items.o(.text);
src/battle_controller_link_opponent.o(.text);
src/pokemon_1.o(.text);

View File

@ -941,7 +941,7 @@ static bool8 ShouldUseItem(void)
if (shouldUse)
{
EmitTwoReturnValues(1, ACTION_USE_ITEM, 0);
*(gBattleStruct->field_C0 + (gActiveBank / 2) * 2) = item;
*(gBattleStruct->chosenItem + (gActiveBank / 2) * 2) = item;
gBattleResources->battleHistory->trainerItems[i] = 0;
return shouldUse;
}

View File

@ -660,7 +660,7 @@ bool8 IsAnimBankSpriteVisible(u8 bank)
else
return FALSE;
}
if (!AnimBankSpriteExists(bank))
if (!IsBankSpritePresent(bank))
return FALSE;
if (IsContest())
return TRUE; // this line wont ever be reached.

View File

@ -199,7 +199,7 @@ static void nullsub_28(void)
{
}
void SetBankFuncToLinkOpponentBufferRunCommand(void)
void SetControllerToLinkOpponent(void)
{
gBattleBankFunc[gActiveBank] = LinkOpponentBufferRunCommand;
}
@ -1846,7 +1846,7 @@ static void LinkOpponentHandleCmd50(void)
static void LinkOpponentHandleSpriteInvisibility(void)
{
if (AnimBankSpriteExists(gActiveBank))
if (IsBankSpritePresent(gActiveBank))
{
gSprites[gBankSpriteIds[gActiveBank]].invisible = gBattleBufferA[gActiveBank][1];
SetBattleSpriteInvisibilityBitToSpriteInvisibility(gActiveBank);

View File

@ -194,7 +194,7 @@ static void nullsub_112(void)
{
}
void SetBankFuncToLinkPartnerBufferRunCommand(void)
void SetControllerToLinkPartner(void)
{
gBattleBankFunc[gActiveBank] = LinkPartnerBufferRunCommand;
}
@ -1678,7 +1678,7 @@ static void LinkPartnerHandleCmd50(void)
static void LinkPartnerHandleSpriteInvisibility(void)
{
if (AnimBankSpriteExists(gActiveBank))
if (IsBankSpritePresent(gActiveBank))
{
gSprites[gBankSpriteIds[gActiveBank]].invisible = gBattleBufferA[gActiveBank][1];
SetBattleSpriteInvisibilityBitToSpriteInvisibility(gActiveBank);

File diff suppressed because it is too large Load Diff

View File

@ -239,7 +239,7 @@ void nullsub_21(void)
{
}
void SetBankFuncToPlayerBufferRunCommand(void)
void SetControllerToPlayer(void)
{
gBattleBankFunc[gActiveBank] = PlayerBufferRunCommand;
gDoingBattleAnim = FALSE;
@ -3083,7 +3083,7 @@ static void PlayerHandleCmd50(void)
static void PlayerHandleSpriteInvisibility(void)
{
if (AnimBankSpriteExists(gActiveBank))
if (IsBankSpritePresent(gActiveBank))
{
gSprites[gBankSpriteIds[gActiveBank]].invisible = gBattleBufferA[gActiveBank][1];
SetBattleSpriteInvisibilityBitToSpriteInvisibility(gActiveBank);

View File

@ -209,7 +209,7 @@ static void nullsub_77(void)
{
}
void SetBankFuncToPlayerPartnerBufferRunCommand(void)
void SetControllerToPlayerPartner(void)
{
gBattleBankFunc[gActiveBank] = PlayerPartnerBufferRunCommand;
}
@ -1924,7 +1924,7 @@ static void PlayerPartnerHandleCmd50(void)
static void PlayerPartnerHandleSpriteInvisibility(void)
{
if (AnimBankSpriteExists(gActiveBank))
if (IsBankSpritePresent(gActiveBank))
{
gSprites[gBankSpriteIds[gActiveBank]].invisible = gBattleBufferA[gActiveBank][1];
SetBattleSpriteInvisibilityBitToSpriteInvisibility(gActiveBank);

View File

@ -198,7 +198,7 @@ static void nullsub_70(void)
{
}
void SetBankFuncToRecordedOpponentBufferRunCommand(void)
void SetControllerToRecordedOpponent(void)
{
gBattleBankFunc[gActiveBank] = RecordedOpponentBufferRunCommand;
}
@ -1788,7 +1788,7 @@ static void RecordedOpponentHandleCmd50(void)
static void RecordedOpponentHandleSpriteInvisibility(void)
{
if (AnimBankSpriteExists(gActiveBank))
if (IsBankSpritePresent(gActiveBank))
{
gSprites[gBankSpriteIds[gActiveBank]].invisible = gBattleBufferA[gActiveBank][1];
SetBattleSpriteInvisibilityBitToSpriteInvisibility(gActiveBank);

View File

@ -197,7 +197,7 @@ static void nullsub_120(void)
{
}
void SetBankFuncToRecordedPlayerBufferRunCommand(void)
void SetControllerToRecordedPlayer(void)
{
gBattleBankFunc[gActiveBank] = RecordedPlayerBufferRunCommand;
}
@ -1808,7 +1808,7 @@ static void RecordedPlayerHandleCmd50(void)
static void RecordedPlayerHandleSpriteInvisibility(void)
{
if (AnimBankSpriteExists(gActiveBank))
if (IsBankSpritePresent(gActiveBank))
{
gSprites[gBankSpriteIds[gActiveBank]].invisible = gBattleBufferA[gActiveBank][1];
SetBattleSpriteInvisibilityBitToSpriteInvisibility(gActiveBank);

View File

@ -175,7 +175,7 @@ static void nullsub_114(void)
{
}
void SetBankFuncToSafariBufferRunCommand(void)
void SetControllerToSafari(void)
{
gBattleBankFunc[gActiveBank] = SafariBufferRunCommand;
}

View File

@ -201,7 +201,7 @@ static void nullsub_117(void)
{
}
void SetBankFuncToWallyBufferRunCommand(void)
void SetControllerToWally(void)
{
gBattleBankFunc[gActiveBank] = WallyBufferRunCommand;
gBattleStruct->wallyBattleState = 0;

View File

@ -145,30 +145,30 @@ static void SetControllersVariables(void)
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED)
{
gBattleBankFunc[0] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToRecordedPlayer;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[1] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[2] = SetBankFuncToPlayerPartnerBufferRunCommand;
gBattleBankFunc[2] = SetControllerToPlayerPartner;
gBanksByIdentity[2] = IDENTITY_PLAYER_MON2;
gBattleBankFunc[3] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[3] = SetControllerToOpponent;
gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2;
}
else
{
gBattleBankFunc[0] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToPlayer;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[1] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[2] = SetBankFuncToPlayerPartnerBufferRunCommand;
gBattleBankFunc[2] = SetControllerToPlayerPartner;
gBanksByIdentity[2] = IDENTITY_PLAYER_MON2;
gBattleBankFunc[3] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[3] = SetControllerToOpponent;
gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2;
}
@ -189,15 +189,15 @@ static void SetControllersVariables(void)
gBattleMainFunc = BeginBattleIntro;
if (gBattleTypeFlags & BATTLE_TYPE_SAFARI)
gBattleBankFunc[0] = SetBankFuncToSafariBufferRunCommand;
gBattleBankFunc[0] = SetControllerToSafari;
else if (gBattleTypeFlags & BATTLE_TYPE_WALLY_TUTORIAL)
gBattleBankFunc[0] = SetBankFuncToWallyBufferRunCommand;
gBattleBankFunc[0] = SetControllerToWally;
else
gBattleBankFunc[0] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToPlayer;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[1] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gNoOfAllBanks = 2;
@ -210,20 +210,20 @@ static void SetControllersVariables(void)
{
gBattleMainFunc = BeginBattleIntro;
gBattleBankFunc[0] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToRecordedPlayer;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[1] = SetBankFuncToRecordedOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToRecordedOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gNoOfAllBanks = 2;
}
else // see how the banks are switched
{
gBattleBankFunc[1] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[1] = SetControllerToRecordedPlayer;
gBanksByIdentity[1] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[0] = SetBankFuncToRecordedOpponentBufferRunCommand;
gBattleBankFunc[0] = SetControllerToRecordedOpponent;
gBanksByIdentity[0] = IDENTITY_OPPONENT_MON1;
gNoOfAllBanks = 2;
@ -231,10 +231,10 @@ static void SetControllersVariables(void)
}
else
{
gBattleBankFunc[0] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToRecordedPlayer;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[1] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
}
}
@ -243,16 +243,16 @@ static void SetControllersVariables(void)
{
gBattleMainFunc = BeginBattleIntro;
gBattleBankFunc[0] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToPlayer;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[1] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[2] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[2] = SetControllerToPlayer;
gBanksByIdentity[2] = IDENTITY_PLAYER_MON2;
gBattleBankFunc[3] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[3] = SetControllerToOpponent;
gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2;
gNoOfAllBanks = 4;
@ -263,16 +263,16 @@ static void SetControllersVariables(void)
{
gBattleMainFunc = BeginBattleIntro;
gBattleBankFunc[0] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToRecordedPlayer;
gBanksByIdentity[0] = 0;
gBattleBankFunc[1] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToOpponent;
gBanksByIdentity[1] = 1;
gBattleBankFunc[2] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[2] = SetControllerToRecordedPlayer;
gBanksByIdentity[2] = 2;
gBattleBankFunc[3] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[3] = SetControllerToOpponent;
gBanksByIdentity[3] = 3;
gNoOfAllBanks = 4;
@ -307,7 +307,7 @@ static void SetControllersVariables(void)
if (i == var)
{
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetControllerToRecordedPlayer;
switch (gLinkPlayers[i].lp_field_18)
{
case 0:
@ -325,7 +325,7 @@ static void SetControllersVariables(void)
else if ((!(gLinkPlayers[i].lp_field_18 & 1) && !(gLinkPlayers[var].lp_field_18 & 1))
|| ((gLinkPlayers[i].lp_field_18 & 1) && (gLinkPlayers[var].lp_field_18 & 1)))
{
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetControllerToRecordedPlayer;
switch (gLinkPlayers[i].lp_field_18)
{
case 0:
@ -342,7 +342,7 @@ static void SetControllersVariables(void)
}
else
{
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetBankFuncToRecordedOpponentBufferRunCommand;
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetControllerToRecordedOpponent;
switch (gLinkPlayers[i].lp_field_18)
{
case 0:
@ -361,51 +361,51 @@ static void SetControllersVariables(void)
}
else if (gBattleTypeFlags & BATTLE_TYPE_WILD)
{
gBattleBankFunc[0] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToRecordedPlayer;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[2] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[2] = SetControllerToRecordedPlayer;
gBanksByIdentity[2] = IDENTITY_PLAYER_MON2;
if (gBattleTypeFlags & BATTLE_TYPE_x2000000)
{
gBattleBankFunc[1] = SetBankFuncToRecordedOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToRecordedOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[3] = SetBankFuncToRecordedOpponentBufferRunCommand;
gBattleBankFunc[3] = SetControllerToRecordedOpponent;
gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2;
}
else
{
gBattleBankFunc[1] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[3] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[3] = SetControllerToOpponent;
gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2;
}
}
else
{
gBattleBankFunc[1] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[1] = SetControllerToRecordedPlayer;
gBanksByIdentity[1] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[3] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[3] = SetControllerToRecordedPlayer;
gBanksByIdentity[3] = IDENTITY_PLAYER_MON2;
if (gBattleTypeFlags & BATTLE_TYPE_x2000000)
{
gBattleBankFunc[0] = SetBankFuncToRecordedOpponentBufferRunCommand;
gBattleBankFunc[0] = SetControllerToRecordedOpponent;
gBanksByIdentity[0] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[2] = SetBankFuncToRecordedOpponentBufferRunCommand;
gBattleBankFunc[2] = SetControllerToRecordedOpponent;
gBanksByIdentity[2] = IDENTITY_OPPONENT_MON2;
}
else
{
gBattleBankFunc[0] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[0] = SetControllerToOpponent;
gBanksByIdentity[0] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[2] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[2] = SetControllerToOpponent;
gBanksByIdentity[2] = IDENTITY_OPPONENT_MON2;
}
}
@ -424,20 +424,20 @@ static void SetControllersVariablesInLinkBattle(void)
{
gBattleMainFunc = BeginBattleIntro;
gBattleBankFunc[0] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToPlayer;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[1] = SetBankFuncToLinkOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToLinkOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gNoOfAllBanks = 2;
}
else
{
gBattleBankFunc[1] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[1] = SetControllerToPlayer;
gBanksByIdentity[1] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[0] = SetBankFuncToLinkOpponentBufferRunCommand;
gBattleBankFunc[0] = SetControllerToLinkOpponent;
gBanksByIdentity[0] = IDENTITY_OPPONENT_MON1;
gNoOfAllBanks = 2;
@ -449,32 +449,32 @@ static void SetControllersVariablesInLinkBattle(void)
{
gBattleMainFunc = BeginBattleIntro;
gBattleBankFunc[0] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToPlayer;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[1] = SetBankFuncToLinkOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToLinkOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[2] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[2] = SetControllerToPlayer;
gBanksByIdentity[2] = IDENTITY_PLAYER_MON2;
gBattleBankFunc[3] = SetBankFuncToLinkOpponentBufferRunCommand;
gBattleBankFunc[3] = SetControllerToLinkOpponent;
gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2;
gNoOfAllBanks = 4;
}
else
{
gBattleBankFunc[1] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[1] = SetControllerToPlayer;
gBanksByIdentity[1] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[0] = SetBankFuncToLinkOpponentBufferRunCommand;
gBattleBankFunc[0] = SetControllerToLinkOpponent;
gBanksByIdentity[0] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[3] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[3] = SetControllerToPlayer;
gBanksByIdentity[3] = IDENTITY_PLAYER_MON2;
gBattleBankFunc[2] = SetBankFuncToLinkOpponentBufferRunCommand;
gBattleBankFunc[2] = SetControllerToLinkOpponent;
gBanksByIdentity[2] = IDENTITY_OPPONENT_MON2;
gNoOfAllBanks = 4;
@ -486,32 +486,32 @@ static void SetControllersVariablesInLinkBattle(void)
{
gBattleMainFunc = BeginBattleIntro;
gBattleBankFunc[0] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToPlayer;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[1] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[2] = SetBankFuncToLinkPartnerBufferRunCommand;
gBattleBankFunc[2] = SetControllerToLinkPartner;
gBanksByIdentity[2] = IDENTITY_PLAYER_MON2;
gBattleBankFunc[3] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[3] = SetControllerToOpponent;
gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2;
gNoOfAllBanks = 4;
}
else
{
gBattleBankFunc[0] = SetBankFuncToLinkPartnerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToLinkPartner;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[1] = SetBankFuncToLinkOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToLinkOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[2] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[2] = SetControllerToPlayer;
gBanksByIdentity[2] = IDENTITY_PLAYER_MON2;
gBattleBankFunc[3] = SetBankFuncToLinkOpponentBufferRunCommand;
gBattleBankFunc[3] = SetControllerToLinkOpponent;
gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2;
gNoOfAllBanks = 4;
@ -549,7 +549,7 @@ static void SetControllersVariablesInLinkBattle(void)
if (i == multiplayerId)
{
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetControllerToPlayer;
switch (gLinkPlayers[i].lp_field_18)
{
case 0:
@ -569,7 +569,7 @@ static void SetControllersVariablesInLinkBattle(void)
if ((!(gLinkPlayers[i].lp_field_18 & 1) && !(gLinkPlayers[multiplayerId].lp_field_18 & 1))
|| ((gLinkPlayers[i].lp_field_18 & 1) && (gLinkPlayers[multiplayerId].lp_field_18 & 1)))
{
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetBankFuncToLinkPartnerBufferRunCommand;
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetControllerToLinkPartner;
switch (gLinkPlayers[i].lp_field_18)
{
case 0:
@ -586,7 +586,7 @@ static void SetControllersVariablesInLinkBattle(void)
}
else
{
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetBankFuncToLinkOpponentBufferRunCommand;
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetControllerToLinkOpponent;
switch (gLinkPlayers[i].lp_field_18)
{
case 0: