Add controller buffer constants, finish misc battle doc
This commit is contained in:
+54
-53
@@ -105,7 +105,7 @@ static void TryDoEventsBeforeFirstTurn(void);
|
||||
static void HandleTurnActionSelectionState(void);
|
||||
static void RunTurnActionsFunctions(void);
|
||||
static void SetActionsAndBattlersTurnOrder(void);
|
||||
static void sub_803CDF8(void);
|
||||
static void UpdateBattlerPartyOrdersOnSwitch(void);
|
||||
static bool8 AllAtActionConfirmed(void);
|
||||
static void CheckFocusPunch_ClearVarsBeforeTurnStarts(void);
|
||||
static void FreeResetData_ReturnToOvOrDoEvolutions(void);
|
||||
@@ -2063,7 +2063,8 @@ static u8 CreateNPCTrainerParty(struct Pokemon *party, u16 trainerNum, bool8 fir
|
||||
return gTrainers[trainerNum].partySize;
|
||||
}
|
||||
|
||||
static void sub_8038A04(void) // unused
|
||||
// Unused
|
||||
static void HBlankCB_Battle(void)
|
||||
{
|
||||
if (REG_VCOUNT < DISPLAY_HEIGHT && REG_VCOUNT >= 111)
|
||||
SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_SCREENBASE(24) | BGCNT_TXT256x512);
|
||||
@@ -3348,7 +3349,7 @@ static void BattleIntroGetMonsData(void)
|
||||
{
|
||||
case 0:
|
||||
gActiveBattler = gBattleCommunication[1];
|
||||
BtlController_EmitGetMonData(0, REQUEST_ALL_BATTLE, 0);
|
||||
BtlController_EmitGetMonData(BUFFER_A, REQUEST_ALL_BATTLE, 0);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
break;
|
||||
@@ -3370,7 +3371,7 @@ static void BattleIntroPrepareBackgroundSlide(void)
|
||||
if (gBattleControllerExecFlags == 0)
|
||||
{
|
||||
gActiveBattler = GetBattlerAtPosition(0);
|
||||
BtlController_EmitIntroSlide(0, gBattleTerrain);
|
||||
BtlController_EmitIntroSlide(BUFFER_A, gBattleTerrain);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
gBattleMainFunc = BattleIntroDrawTrainersOrMonsSprites;
|
||||
gBattleCommunication[0] = 0;
|
||||
@@ -3415,7 +3416,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
|
||||
|
||||
if (GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_LEFT)
|
||||
{
|
||||
BtlController_EmitDrawTrainerPic(0);
|
||||
BtlController_EmitDrawTrainerPic(BUFFER_A);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
|
||||
@@ -3423,7 +3424,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
|
||||
{
|
||||
if (GetBattlerPosition(gActiveBattler) == B_POSITION_OPPONENT_LEFT)
|
||||
{
|
||||
BtlController_EmitDrawTrainerPic(0);
|
||||
BtlController_EmitDrawTrainerPic(BUFFER_A);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT
|
||||
@@ -3448,7 +3449,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
|
||||
{
|
||||
HandleSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBattler].species), FLAG_SET_SEEN, gBattleMons[gActiveBattler].personality);
|
||||
}
|
||||
BtlController_EmitLoadMonSprite(0);
|
||||
BtlController_EmitLoadMonSprite(BUFFER_A);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
gBattleResults.lastOpponentSpecies = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES, NULL);
|
||||
}
|
||||
@@ -3459,14 +3460,14 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
|
||||
if (GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_RIGHT
|
||||
|| GetBattlerPosition(gActiveBattler) == B_POSITION_OPPONENT_RIGHT)
|
||||
{
|
||||
BtlController_EmitDrawTrainerPic(0);
|
||||
BtlController_EmitDrawTrainerPic(BUFFER_A);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
}
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS && GetBattlerPosition(gActiveBattler) == B_POSITION_OPPONENT_RIGHT)
|
||||
{
|
||||
BtlController_EmitDrawTrainerPic(0);
|
||||
BtlController_EmitDrawTrainerPic(BUFFER_A);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
|
||||
@@ -3501,7 +3502,7 @@ static void BattleIntroDrawPartySummaryScreens(void)
|
||||
}
|
||||
}
|
||||
gActiveBattler = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
|
||||
BtlController_EmitDrawPartyStatusSummary(0, hpStatus, 0x80);
|
||||
BtlController_EmitDrawPartyStatusSummary(BUFFER_A, hpStatus, PARTY_SUMM_SKIP_DRAW_DELAY);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
@@ -3519,7 +3520,7 @@ static void BattleIntroDrawPartySummaryScreens(void)
|
||||
}
|
||||
}
|
||||
gActiveBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
|
||||
BtlController_EmitDrawPartyStatusSummary(0, hpStatus, 0x80);
|
||||
BtlController_EmitDrawPartyStatusSummary(BUFFER_A, hpStatus, PARTY_SUMM_SKIP_DRAW_DELAY);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
|
||||
gBattleMainFunc = BattleIntroPrintTrainerWantsToBattle;
|
||||
@@ -3612,7 +3613,7 @@ static void BattleIntroOpponent2SendsOutMonAnimation(void)
|
||||
{
|
||||
if (GetBattlerPosition(gActiveBattler) == position)
|
||||
{
|
||||
BtlController_EmitIntroTrainerBallThrow(0);
|
||||
BtlController_EmitIntroTrainerBallThrow(BUFFER_A);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
}
|
||||
@@ -3646,7 +3647,7 @@ static void BattleIntroOpponent1SendsOutMonAnimation(void)
|
||||
{
|
||||
if (GetBattlerPosition(gActiveBattler) == position)
|
||||
{
|
||||
BtlController_EmitIntroTrainerBallThrow(0);
|
||||
BtlController_EmitIntroTrainerBallThrow(BUFFER_A);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
if (gBattleTypeFlags & (BATTLE_TYPE_MULTI | BATTLE_TYPE_TWO_OPPONENTS))
|
||||
{
|
||||
@@ -3679,7 +3680,8 @@ static void BattleIntroRecordMonsToDex(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_803B3AC(void) // unused
|
||||
// Unused
|
||||
static void BattleIntroSkipRecordMonsToDex(void)
|
||||
{
|
||||
if (gBattleControllerExecFlags == 0)
|
||||
gBattleMainFunc = BattleIntroPrintPlayerSendsOut;
|
||||
@@ -3730,7 +3732,7 @@ static void BattleIntroPlayer2SendsOutMonAnimation(void)
|
||||
{
|
||||
if (GetBattlerPosition(gActiveBattler) == position)
|
||||
{
|
||||
BtlController_EmitIntroTrainerBallThrow(0);
|
||||
BtlController_EmitIntroTrainerBallThrow(BUFFER_A);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
}
|
||||
@@ -3765,7 +3767,7 @@ static void BattleIntroPlayer1SendsOutMonAnimation(void)
|
||||
{
|
||||
if (GetBattlerPosition(gActiveBattler) == position)
|
||||
{
|
||||
BtlController_EmitIntroTrainerBallThrow(0);
|
||||
BtlController_EmitIntroTrainerBallThrow(BUFFER_A);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
if (gBattleTypeFlags & (BATTLE_TYPE_MULTI))
|
||||
{
|
||||
@@ -3782,7 +3784,8 @@ static void BattleIntroPlayer1SendsOutMonAnimation(void)
|
||||
gBattleMainFunc = TryDoEventsBeforeFirstTurn;
|
||||
}
|
||||
|
||||
void sub_803B598(void) // unused
|
||||
// Unused
|
||||
static void BattleIntroSwitchInPlayerMons(void)
|
||||
{
|
||||
if (gBattleControllerExecFlags == 0)
|
||||
{
|
||||
@@ -3790,7 +3793,7 @@ void sub_803B598(void) // unused
|
||||
{
|
||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||
{
|
||||
BtlController_EmitSwitchInAnim(0, gBattlerPartyIndexes[gActiveBattler], FALSE);
|
||||
BtlController_EmitSwitchInAnim(BUFFER_A, gBattlerPartyIndexes[gActiveBattler], FALSE);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
}
|
||||
@@ -3865,7 +3868,7 @@ static void TryDoEventsBeforeFirstTurn(void)
|
||||
}
|
||||
TurnValuesCleanUp(FALSE);
|
||||
SpecialStatusesClear();
|
||||
*(&gBattleStruct->field_91) = gAbsentBattlerFlags;
|
||||
*(&gBattleStruct->absentBattlerFlags) = gAbsentBattlerFlags;
|
||||
BattlePutTextOnWindow(gText_EmptyString3, B_WIN_MSG);
|
||||
gBattleMainFunc = HandleTurnActionSelectionState;
|
||||
ResetSentPokesToOpponentValue();
|
||||
@@ -3972,7 +3975,7 @@ void BattleTurnPassed(void)
|
||||
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
||||
*(gBattleStruct->monToSwitchIntoId + i) = PARTY_SIZE;
|
||||
|
||||
*(&gBattleStruct->field_91) = gAbsentBattlerFlags;
|
||||
*(&gBattleStruct->absentBattlerFlags) = gAbsentBattlerFlags;
|
||||
BattlePutTextOnWindow(gText_EmptyString3, B_WIN_MSG);
|
||||
gBattleMainFunc = HandleTurnActionSelectionState;
|
||||
gRandomTurnNumber = Random();
|
||||
@@ -4054,10 +4057,8 @@ void SwitchPartyOrder(u8 battler)
|
||||
u8 partyId1;
|
||||
u8 partyId2;
|
||||
|
||||
// gBattleStruct->field_60[battler][i]
|
||||
|
||||
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
|
||||
gBattlePartyCurrentOrder[i] = *(battler * 3 + i + (u8*)(gBattleStruct->field_60));
|
||||
gBattlePartyCurrentOrder[i] = *(battler * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders));
|
||||
|
||||
partyId1 = GetPartyIdFromBattlePartyId(gBattlerPartyIndexes[battler]);
|
||||
partyId2 = GetPartyIdFromBattlePartyId(*(gBattleStruct->monToSwitchIntoId + battler));
|
||||
@@ -4067,15 +4068,15 @@ void SwitchPartyOrder(u8 battler)
|
||||
{
|
||||
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
|
||||
{
|
||||
*(battler * 3 + i + (u8*)(gBattleStruct->field_60)) = gBattlePartyCurrentOrder[i];
|
||||
*(BATTLE_PARTNER(battler) * 3 + i + (u8*)(gBattleStruct->field_60)) = gBattlePartyCurrentOrder[i];
|
||||
*(battler * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i];
|
||||
*(BATTLE_PARTNER(battler) * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
|
||||
{
|
||||
*(battler * 3 + i + (u8*)(gBattleStruct->field_60)) = gBattlePartyCurrentOrder[i];
|
||||
*(battler * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4111,10 +4112,10 @@ static void HandleTurnActionSelectionState(void)
|
||||
*(gBattleStruct->monToSwitchIntoId + gActiveBattler) = PARTY_SIZE;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_MULTI
|
||||
|| (position & BIT_FLANK) == B_FLANK_LEFT
|
||||
|| gBattleStruct->field_91 & gBitTable[GetBattlerAtPosition(BATTLE_PARTNER(position))]
|
||||
|| gBattleStruct->absentBattlerFlags & gBitTable[GetBattlerAtPosition(BATTLE_PARTNER(position))]
|
||||
|| gBattleCommunication[GetBattlerAtPosition(BATTLE_PARTNER(position))] == STATE_WAIT_ACTION_CONFIRMED)
|
||||
{
|
||||
if (gBattleStruct->field_91 & gBitTable[gActiveBattler])
|
||||
if (gBattleStruct->absentBattlerFlags & gBitTable[gActiveBattler])
|
||||
{
|
||||
gChosenActionByBattler[gActiveBattler] = B_ACTION_NOTHING_FAINTED;
|
||||
if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI))
|
||||
@@ -4132,7 +4133,7 @@ static void HandleTurnActionSelectionState(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
BtlController_EmitChooseAction(0, gChosenActionByBattler[0], gBattleBufferB[0][1] | (gBattleBufferB[0][2] << 8));
|
||||
BtlController_EmitChooseAction(BUFFER_A, gChosenActionByBattler[0], gBattleBufferB[0][1] | (gBattleBufferB[0][2] << 8));
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
gBattleCommunication[gActiveBattler]++;
|
||||
}
|
||||
@@ -4181,7 +4182,7 @@ static void HandleTurnActionSelectionState(void)
|
||||
i);
|
||||
}
|
||||
|
||||
BtlController_EmitChooseMove(0, (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) != 0, FALSE, &moveInfo);
|
||||
BtlController_EmitChooseMove(BUFFER_A, (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) != 0, FALSE, &moveInfo);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
break;
|
||||
@@ -4200,17 +4201,17 @@ static void HandleTurnActionSelectionState(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
BtlController_EmitChooseItem(0, gBattleStruct->field_60[gActiveBattler]);
|
||||
BtlController_EmitChooseItem(BUFFER_A, gBattleStruct->battlerPartyOrders[gActiveBattler]);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
break;
|
||||
case B_ACTION_SWITCH:
|
||||
*(gBattleStruct->field_58 + gActiveBattler) = gBattlerPartyIndexes[gActiveBattler];
|
||||
*(gBattleStruct->battlerPartyIndexes + gActiveBattler) = gBattlerPartyIndexes[gActiveBattler];
|
||||
if (gBattleMons[gActiveBattler].status2 & (STATUS2_WRAPPED | STATUS2_ESCAPE_PREVENTION)
|
||||
|| gBattleTypeFlags & BATTLE_TYPE_ARENA
|
||||
|| gStatuses3[gActiveBattler] & STATUS3_ROOTED)
|
||||
{
|
||||
BtlController_EmitChoosePokemon(0, PARTY_ACTION_CANT_SWITCH, PARTY_SIZE, ABILITY_NONE, gBattleStruct->field_60[gActiveBattler]);
|
||||
BtlController_EmitChoosePokemon(BUFFER_A, PARTY_ACTION_CANT_SWITCH, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]);
|
||||
}
|
||||
else if ((i = ABILITY_ON_OPPOSING_FIELD(gActiveBattler, ABILITY_SHADOW_TAG))
|
||||
|| ((i = ABILITY_ON_OPPOSING_FIELD(gActiveBattler, ABILITY_ARENA_TRAP))
|
||||
@@ -4219,16 +4220,16 @@ static void HandleTurnActionSelectionState(void)
|
||||
|| ((i = AbilityBattleEffects(ABILITYEFFECT_CHECK_FIELD_EXCEPT_BATTLER, gActiveBattler, ABILITY_MAGNET_PULL, 0, 0))
|
||||
&& IS_BATTLER_OF_TYPE(gActiveBattler, TYPE_STEEL)))
|
||||
{
|
||||
BtlController_EmitChoosePokemon(0, ((i - 1) << 4) | PARTY_ACTION_ABILITY_PREVENTS, PARTY_SIZE, gLastUsedAbility, gBattleStruct->field_60[gActiveBattler]);
|
||||
BtlController_EmitChoosePokemon(BUFFER_A, ((i - 1) << 4) | PARTY_ACTION_ABILITY_PREVENTS, PARTY_SIZE, gLastUsedAbility, gBattleStruct->battlerPartyOrders[gActiveBattler]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gActiveBattler == 2 && gChosenActionByBattler[0] == B_ACTION_SWITCH)
|
||||
BtlController_EmitChoosePokemon(0, PARTY_ACTION_CHOOSE_MON, *(gBattleStruct->monToSwitchIntoId + 0), ABILITY_NONE, gBattleStruct->field_60[gActiveBattler]);
|
||||
BtlController_EmitChoosePokemon(BUFFER_A, PARTY_ACTION_CHOOSE_MON, *(gBattleStruct->monToSwitchIntoId + 0), ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]);
|
||||
else if (gActiveBattler == 3 && gChosenActionByBattler[1] == B_ACTION_SWITCH)
|
||||
BtlController_EmitChoosePokemon(0, PARTY_ACTION_CHOOSE_MON, *(gBattleStruct->monToSwitchIntoId + 1), ABILITY_NONE, gBattleStruct->field_60[gActiveBattler]);
|
||||
BtlController_EmitChoosePokemon(BUFFER_A, PARTY_ACTION_CHOOSE_MON, *(gBattleStruct->monToSwitchIntoId + 1), ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]);
|
||||
else
|
||||
BtlController_EmitChoosePokemon(0, PARTY_ACTION_CHOOSE_MON, PARTY_SIZE, ABILITY_NONE, gBattleStruct->field_60[gActiveBattler]);
|
||||
BtlController_EmitChoosePokemon(BUFFER_A, PARTY_ACTION_CHOOSE_MON, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]);
|
||||
}
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
break;
|
||||
@@ -4243,7 +4244,7 @@ static void HandleTurnActionSelectionState(void)
|
||||
}
|
||||
break;
|
||||
case B_ACTION_SAFARI_POKEBLOCK:
|
||||
BtlController_EmitChooseItem(0, gBattleStruct->field_60[gActiveBattler]);
|
||||
BtlController_EmitChooseItem(BUFFER_A, gBattleStruct->battlerPartyOrders[gActiveBattler]);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
break;
|
||||
case B_ACTION_CANCEL_PARTNER:
|
||||
@@ -4253,7 +4254,7 @@ static void HandleTurnActionSelectionState(void)
|
||||
if (gBattleMons[GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gActiveBattler)))].status2 & STATUS2_MULTIPLETURNS
|
||||
|| gBattleMons[GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gActiveBattler)))].status2 & STATUS2_RECHARGE)
|
||||
{
|
||||
BtlController_EmitEndBounceEffect(0);
|
||||
BtlController_EmitEndBounceEffect(BUFFER_A);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
return;
|
||||
}
|
||||
@@ -4281,7 +4282,7 @@ static void HandleTurnActionSelectionState(void)
|
||||
{
|
||||
RecordedBattle_ClearBattlerAction(GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gActiveBattler))), 3);
|
||||
}
|
||||
BtlController_EmitEndBounceEffect(0);
|
||||
BtlController_EmitEndBounceEffect(BUFFER_A);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
return;
|
||||
}
|
||||
@@ -4337,7 +4338,7 @@ static void HandleTurnActionSelectionState(void)
|
||||
return;
|
||||
case 15:
|
||||
gChosenActionByBattler[gActiveBattler] = B_ACTION_SWITCH;
|
||||
sub_803CDF8();
|
||||
UpdateBattlerPartyOrdersOnSwitch();
|
||||
return;
|
||||
default:
|
||||
RecordedBattle_CheckMovesetChanges(B_RECORD_MODE_PLAYBACK);
|
||||
@@ -4389,7 +4390,7 @@ static void HandleTurnActionSelectionState(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
sub_803CDF8();
|
||||
UpdateBattlerPartyOrdersOnSwitch();
|
||||
gBattleCommunication[gActiveBattler]++;
|
||||
}
|
||||
break;
|
||||
@@ -4434,15 +4435,15 @@ static void HandleTurnActionSelectionState(void)
|
||||
else
|
||||
i = FALSE;
|
||||
|
||||
if (((gBattleTypeFlags & (BATTLE_TYPE_MULTI | BATTLE_TYPE_DOUBLE)) != BATTLE_TYPE_DOUBLE)
|
||||
if (((gBattleTypeFlags & BATTLE_TYPE_MULTI) || !(gBattleTypeFlags & BATTLE_TYPE_DOUBLE))
|
||||
|| (position & BIT_FLANK) != B_FLANK_LEFT
|
||||
|| (*(&gBattleStruct->field_91) & gBitTable[GetBattlerAtPosition(position ^ BIT_FLANK)]))
|
||||
|| (*(&gBattleStruct->absentBattlerFlags) & gBitTable[GetBattlerAtPosition(position ^ BIT_FLANK)]))
|
||||
{
|
||||
BtlController_EmitLinkStandbyMsg(0, 0, i);
|
||||
BtlController_EmitLinkStandbyMsg(BUFFER_A, LINK_STANDBY_MSG_STOP_BOUNCE, i);
|
||||
}
|
||||
else
|
||||
{
|
||||
BtlController_EmitLinkStandbyMsg(0, 1, i);
|
||||
BtlController_EmitLinkStandbyMsg(BUFFER_A, LINK_STANDBY_STOP_BOUNCE_ONLY, i);
|
||||
}
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
gBattleCommunication[gActiveBattler]++;
|
||||
@@ -4538,20 +4539,20 @@ static bool8 AllAtActionConfirmed(void)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void sub_803CDF8(void)
|
||||
static void UpdateBattlerPartyOrdersOnSwitch(void)
|
||||
{
|
||||
*(gBattleStruct->monToSwitchIntoId + gActiveBattler) = gBattleBufferB[gActiveBattler][1];
|
||||
RecordedBattle_SetBattlerAction(gActiveBattler, gBattleBufferB[gActiveBattler][1]);
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_LINK && gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||
{
|
||||
*(gActiveBattler * 3 + (u8*)(gBattleStruct->field_60) + 0) &= 0xF;
|
||||
*(gActiveBattler * 3 + (u8*)(gBattleStruct->field_60) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0);
|
||||
*(gActiveBattler * 3 + (u8*)(gBattleStruct->field_60) + 1) = gBattleBufferB[gActiveBattler][3];
|
||||
*(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) &= 0xF;
|
||||
*(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0);
|
||||
*(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 1) = gBattleBufferB[gActiveBattler][3];
|
||||
|
||||
*((gActiveBattler ^ BIT_FLANK) * 3 + (u8*)(gBattleStruct->field_60) + 0) &= (0xF0);
|
||||
*((gActiveBattler ^ BIT_FLANK) * 3 + (u8*)(gBattleStruct->field_60) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0) >> 4;
|
||||
*((gActiveBattler ^ BIT_FLANK) * 3 + (u8*)(gBattleStruct->field_60) + 2) = gBattleBufferB[gActiveBattler][3];
|
||||
*((gActiveBattler ^ BIT_FLANK) * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) &= (0xF0);
|
||||
*((gActiveBattler ^ BIT_FLANK) * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0) >> 4;
|
||||
*((gActiveBattler ^ BIT_FLANK) * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 2) = gBattleBufferB[gActiveBattler][3];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user