Merge pull request #1516 from GriffinRichards/doc-miscbattle

Miscellaneous battle documentation
This commit is contained in:
GriffinR
2021-10-19 08:09:17 -04:00
committed by GitHub
70 changed files with 4275 additions and 4235 deletions

View File

@@ -34,9 +34,6 @@
#include "constants/trainers.h"
#include "trainer_hill.h"
extern struct MusicPlayerInfo gMPlayInfo_BGM;
// this file's functions
static void OpponentHandleGetMonData(void);
static void OpponentHandleGetRawMonData(void);
static void OpponentHandleSetMonData(void);
@@ -430,7 +427,7 @@ static void FreeMonSpriteAfterSwitchOutAnim(void)
static void CompleteOnInactiveTextPrinter(void)
{
if (!IsTextPrinterActive(0))
if (!IsTextPrinterActive(B_WIN_MSG))
OpponentBufferExecCompleted();
}
@@ -558,7 +555,7 @@ static void OpponentHandleGetMonData(void)
monToCheck >>= 1;
}
}
BtlController_EmitDataTransfer(1, size, monData);
BtlController_EmitDataTransfer(BUFFER_B, size, monData);
OpponentBufferExecCompleted();
}
@@ -878,7 +875,7 @@ static void OpponentHandleGetRawMonData(void)
for (i = 0; i < gBattleBufferA[gActiveBattler][2]; i++)
dst[i] = src[i];
BtlController_EmitDataTransfer(1, gBattleBufferA[gActiveBattler][2], dst);
BtlController_EmitDataTransfer(BUFFER_B, gBattleBufferA[gActiveBattler][2], dst);
OpponentBufferExecCompleted();
}
@@ -1524,7 +1521,7 @@ static void OpponentHandlePrintString(void)
gBattle_BG0_Y = 0;
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
BufferStringBattle(*stringId);
BattlePutTextOnWindow(gDisplayedStringBattle, 0);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
BattleArena_DeductMindPoints(gActiveBattler, *stringId);
}
@@ -1549,7 +1546,7 @@ static void OpponentHandleChooseMove(void)
{
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{
BtlController_EmitTwoReturnValues(1, 10, ChooseMoveAndTargetInBattlePalace());
BtlController_EmitTwoReturnValues(BUFFER_B, 10, ChooseMoveAndTargetInBattlePalace());
OpponentBufferExecCompleted();
}
else
@@ -1566,13 +1563,13 @@ static void OpponentHandleChooseMove(void)
switch (chosenMoveId)
{
case AI_CHOICE_WATCH:
BtlController_EmitTwoReturnValues(1, B_ACTION_SAFARI_WATCH_CAREFULLY, 0);
BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SAFARI_WATCH_CAREFULLY, 0);
break;
case AI_CHOICE_FLEE:
BtlController_EmitTwoReturnValues(1, B_ACTION_RUN, 0);
BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_RUN, 0);
break;
case 6:
BtlController_EmitTwoReturnValues(1, 15, gBattlerTarget);
BtlController_EmitTwoReturnValues(BUFFER_B, 15, gBattlerTarget);
break;
default:
if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER))
@@ -1583,7 +1580,7 @@ static void OpponentHandleChooseMove(void)
if (gAbsentBattlerFlags & gBitTable[gBattlerTarget])
gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT);
}
BtlController_EmitTwoReturnValues(1, 10, (chosenMoveId) | (gBattlerTarget << 8));
BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (gBattlerTarget << 8));
break;
}
OpponentBufferExecCompleted();
@@ -1598,11 +1595,11 @@ static void OpponentHandleChooseMove(void)
} while (move == MOVE_NONE);
if (gBattleMoves[move].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER))
BtlController_EmitTwoReturnValues(1, 10, (chosenMoveId) | (gActiveBattler << 8));
BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (gActiveBattler << 8));
else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
BtlController_EmitTwoReturnValues(1, 10, (chosenMoveId) | (GetBattlerAtPosition(Random() & 2) << 8));
BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (GetBattlerAtPosition(Random() & 2) << 8));
else
BtlController_EmitTwoReturnValues(1, 10, (chosenMoveId) | (GetBattlerAtPosition(B_POSITION_PLAYER_LEFT) << 8));
BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (GetBattlerAtPosition(B_POSITION_PLAYER_LEFT) << 8));
OpponentBufferExecCompleted();
}
@@ -1611,7 +1608,7 @@ static void OpponentHandleChooseMove(void)
static void OpponentHandleChooseItem(void)
{
BtlController_EmitOneReturnValue(1, *(gBattleStruct->chosenItem + (gActiveBattler / 2) * 2));
BtlController_EmitOneReturnValue(BUFFER_B, *(gBattleStruct->chosenItem + (gActiveBattler / 2) * 2));
OpponentBufferExecCompleted();
}
@@ -1668,7 +1665,7 @@ static void OpponentHandleChoosePokemon(void)
*(gBattleStruct->monToSwitchIntoId + gActiveBattler) = chosenMonId;
BtlController_EmitChosenMonReturnValue(1, chosenMonId, NULL);
BtlController_EmitChosenMonReturnValue(BUFFER_B, chosenMonId, NULL);
OpponentBufferExecCompleted();
}