Merge branch 'master' of https://github.com/pret/pokeemerald into dump_maps
This commit is contained in:
+16
-16
@@ -354,7 +354,7 @@ static const u8 sUnknown_0831BCF3[] = {4, 4, 4, 4};
|
||||
void CB2_InitBattle(void)
|
||||
{
|
||||
MoveSaveBlocks_ResetHeap();
|
||||
AllocateBattleResrouces();
|
||||
AllocateBattleResources();
|
||||
AllocateBattleSpritesData();
|
||||
AllocateMonSpritesGfx();
|
||||
sub_8185F84();
|
||||
@@ -2845,9 +2845,9 @@ static void BattleStartClearSetData(void)
|
||||
*(i + 3 * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 0) = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
for (i = 0; i < BATTLE_BANKS_COUNT; i++)
|
||||
{
|
||||
*(gBattleStruct->field_294 + i) = 6;
|
||||
*(gBattleStruct->AI_monToSwitchIntoId + i) = 6;
|
||||
}
|
||||
|
||||
gBattleStruct->field_DF = 0;
|
||||
@@ -2927,8 +2927,8 @@ void SwitchInClearSetData(void)
|
||||
{
|
||||
gDisableStructs[gActiveBank].substituteHP = disableStructCopy.substituteHP;
|
||||
gDisableStructs[gActiveBank].bankWithSureHit = disableStructCopy.bankWithSureHit;
|
||||
gDisableStructs[gActiveBank].perishSong1 = disableStructCopy.perishSong1;
|
||||
gDisableStructs[gActiveBank].perishSong2 = disableStructCopy.perishSong2;
|
||||
gDisableStructs[gActiveBank].perishSongTimer1 = disableStructCopy.perishSongTimer1;
|
||||
gDisableStructs[gActiveBank].perishSongTimer2 = disableStructCopy.perishSongTimer2;
|
||||
gDisableStructs[gActiveBank].bankPreventingEscape = disableStructCopy.bankPreventingEscape;
|
||||
}
|
||||
|
||||
@@ -3674,7 +3674,7 @@ static void TryDoEventsBeforeFirstTurn(void)
|
||||
}
|
||||
for (i = 0; i < BATTLE_BANKS_COUNT; i++)
|
||||
{
|
||||
*(gBattleStruct->field_5C + i) = 6;
|
||||
*(gBattleStruct->monToSwitchIntoId + i) = 6;
|
||||
gActionForBanks[i] = ACTION_INIT_VALUE;
|
||||
gChosenMovesByBanks[i] = MOVE_NONE;
|
||||
}
|
||||
@@ -3785,7 +3785,7 @@ void BattleTurnPassed(void)
|
||||
}
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
*(gBattleStruct->field_5C + i) = 6;
|
||||
*(gBattleStruct->monToSwitchIntoId + i) = 6;
|
||||
|
||||
*(&gBattleStruct->field_91) = gAbsentBankFlags;
|
||||
BattleHandleAddTextPrinter(gText_EmptyString3, 0);
|
||||
@@ -3876,7 +3876,7 @@ void sub_803BDA0(u8 bank)
|
||||
gUnknown_0203CF00[i] = *(bank * 3 + i + (u8*)(gBattleStruct->field_60));
|
||||
|
||||
r4 = pokemon_order_func(gBattlePartyID[bank]);
|
||||
r1 = pokemon_order_func(*(gBattleStruct->field_5C + bank));
|
||||
r1 = pokemon_order_func(*(gBattleStruct->monToSwitchIntoId + bank));
|
||||
sub_81B8FB0(r4, r1);
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||
@@ -3924,7 +3924,7 @@ static void HandleTurnActionSelectionState(void)
|
||||
gBattleCommunication[gActiveBank] = STATE_BEFORE_ACTION_CHOSEN;
|
||||
break;
|
||||
case STATE_BEFORE_ACTION_CHOSEN: // choose an action
|
||||
*(gBattleStruct->field_5C + gActiveBank) = 6;
|
||||
*(gBattleStruct->monToSwitchIntoId + gActiveBank) = 6;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_MULTI
|
||||
|| !(identity & BIT_MON)
|
||||
|| gBattleStruct->field_91 & gBitTable[GetBankByIdentity(identity ^ BIT_MON)]
|
||||
@@ -4042,9 +4042,9 @@ static void HandleTurnActionSelectionState(void)
|
||||
else
|
||||
{
|
||||
if (gActiveBank == 2 && gActionForBanks[0] == ACTION_SWITCH)
|
||||
EmitChoosePokemon(0, 0, *(gBattleStruct->field_5C + 0), ABILITY_NONE, gBattleStruct->field_60[gActiveBank]);
|
||||
EmitChoosePokemon(0, 0, *(gBattleStruct->monToSwitchIntoId + 0), ABILITY_NONE, gBattleStruct->field_60[gActiveBank]);
|
||||
else if (gActiveBank == 3 && gActionForBanks[1] == ACTION_SWITCH)
|
||||
EmitChoosePokemon(0, 0, *(gBattleStruct->field_5C + 1), ABILITY_NONE, gBattleStruct->field_60[gActiveBank]);
|
||||
EmitChoosePokemon(0, 0, *(gBattleStruct->monToSwitchIntoId + 1), ABILITY_NONE, gBattleStruct->field_60[gActiveBank]);
|
||||
else
|
||||
EmitChoosePokemon(0, 0, 6, ABILITY_NONE, gBattleStruct->field_60[gActiveBank]);
|
||||
}
|
||||
@@ -4331,7 +4331,7 @@ static void HandleTurnActionSelectionState(void)
|
||||
for (i = 0; i < gNoOfAllBanks; i++)
|
||||
{
|
||||
if (gActionForBanks[i] == ACTION_SWITCH)
|
||||
sub_80571DC(i, *(gBattleStruct->field_5C + i));
|
||||
sub_80571DC(i, *(gBattleStruct->monToSwitchIntoId + i));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4355,7 +4355,7 @@ static bool8 sub_803CDB8(void)
|
||||
|
||||
static void sub_803CDF8(void)
|
||||
{
|
||||
*(gBattleStruct->field_5C + gActiveBank) = gBattleBufferB[gActiveBank][1];
|
||||
*(gBattleStruct->monToSwitchIntoId + gActiveBank) = gBattleBufferB[gActiveBank][1];
|
||||
RecordedBattle_SetBankAction(gActiveBank, gBattleBufferB[gActiveBank][1]);
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_LINK && gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||
@@ -4759,7 +4759,7 @@ static void HandleEndTurn_BattleWon(void)
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER
|
||||
&& gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_x4000000 | BATTLE_TYPE_EREADER_TRAINER))
|
||||
{
|
||||
BattleMusicStop();
|
||||
BattleStopLowHpSound();
|
||||
gBattlescriptCurrInstr = BattleScript_FrontierTrainerBattleWon;
|
||||
|
||||
if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_3FE)
|
||||
@@ -4769,7 +4769,7 @@ static void HandleEndTurn_BattleWon(void)
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && !(gBattleTypeFlags & BATTLE_TYPE_LINK))
|
||||
{
|
||||
BattleMusicStop();
|
||||
BattleStopLowHpSound();
|
||||
gBattlescriptCurrInstr = BattleScript_LocalTrainerBattleWon;
|
||||
|
||||
switch (gTrainers[gTrainerBattleOpponent_A].trainerClass)
|
||||
@@ -5610,7 +5610,7 @@ static void HandleAction_NothingIsFainted(void)
|
||||
|
||||
static void HandleAction_ActionFinished(void)
|
||||
{
|
||||
*(gBattleStruct->field_5C + gBanksByTurnOrder[gCurrentTurnActionNumber]) = 6;
|
||||
*(gBattleStruct->monToSwitchIntoId + gBanksByTurnOrder[gCurrentTurnActionNumber]) = 6;
|
||||
gCurrentTurnActionNumber++;
|
||||
gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber];
|
||||
SpecialStatusesClear();
|
||||
|
||||
Reference in New Issue
Block a user