Add controller buffer constants, finish misc battle doc
This commit is contained in:
@@ -248,17 +248,17 @@ static void HandleInputChooseAction(void)
|
||||
|
||||
switch (gActionSelectionCursor[gActiveBattler])
|
||||
{
|
||||
case B_ACTION_USE_MOVE:
|
||||
BtlController_EmitTwoReturnValues(1, B_ACTION_USE_MOVE, 0);
|
||||
case 0: // Top left
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_USE_MOVE, 0);
|
||||
break;
|
||||
case B_ACTION_USE_ITEM:
|
||||
BtlController_EmitTwoReturnValues(1, B_ACTION_USE_ITEM, 0);
|
||||
case 1: // Top right
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_USE_ITEM, 0);
|
||||
break;
|
||||
case B_ACTION_SWITCH:
|
||||
BtlController_EmitTwoReturnValues(1, B_ACTION_SWITCH, 0);
|
||||
case 2: // Bottom left
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0);
|
||||
break;
|
||||
case B_ACTION_RUN:
|
||||
BtlController_EmitTwoReturnValues(1, B_ACTION_RUN, 0);
|
||||
case 3: // Bottom right
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_RUN, 0);
|
||||
break;
|
||||
}
|
||||
PlayerBufferExecCompleted();
|
||||
@@ -319,7 +319,7 @@ static void HandleInputChooseAction(void)
|
||||
return;
|
||||
}
|
||||
PlaySE(SE_SELECT);
|
||||
BtlController_EmitTwoReturnValues(1, B_ACTION_CANCEL_PARTNER, 0);
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_CANCEL_PARTNER, 0);
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
@@ -365,7 +365,7 @@ static void HandleInputChooseTarget(void)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
|
||||
BtlController_EmitTwoReturnValues(1, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8));
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8));
|
||||
EndBounceEffect(gMultiUsePlayerCursor, BOUNCE_HEALTHBOX);
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
@@ -523,7 +523,7 @@ static void HandleInputChooseMove(void)
|
||||
|
||||
if (!canSelectTarget)
|
||||
{
|
||||
BtlController_EmitTwoReturnValues(1, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8));
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8));
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
else
|
||||
@@ -543,7 +543,7 @@ static void HandleInputChooseMove(void)
|
||||
else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
BtlController_EmitTwoReturnValues(1, 10, 0xFFFF);
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, 10, 0xFFFF);
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
else if (JOY_NEW(DPAD_LEFT))
|
||||
@@ -1174,7 +1174,7 @@ static void Task_GiveExpToMon(u8 taskId)
|
||||
gainedExp -= nextLvlExp - currExp;
|
||||
savedActiveBattler = gActiveBattler;
|
||||
gActiveBattler = battlerId;
|
||||
BtlController_EmitTwoReturnValues(1, RET_VALUE_LEVELED_UP, gainedExp);
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, RET_VALUE_LEVELED_UP, gainedExp);
|
||||
gActiveBattler = savedActiveBattler;
|
||||
|
||||
if (IsDoubleBattle() == TRUE
|
||||
@@ -1253,7 +1253,7 @@ static void Task_GiveExpWithExpBar(u8 taskId)
|
||||
gainedExp -= expOnNextLvl - currExp;
|
||||
savedActiveBattler = gActiveBattler;
|
||||
gActiveBattler = battlerId;
|
||||
BtlController_EmitTwoReturnValues(1, RET_VALUE_LEVELED_UP, gainedExp);
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, RET_VALUE_LEVELED_UP, gainedExp);
|
||||
gActiveBattler = savedActiveBattler;
|
||||
gTasks[taskId].func = Task_LaunchLvlUpAnim;
|
||||
}
|
||||
@@ -1361,9 +1361,9 @@ static void WaitForMonSelection(void)
|
||||
if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active)
|
||||
{
|
||||
if (gPartyMenuUseExitCallback == TRUE)
|
||||
BtlController_EmitChosenMonReturnValue(1, gSelectedMonPartyId, gBattlePartyCurrentOrder);
|
||||
BtlController_EmitChosenMonReturnValue(BUFFER_B, gSelectedMonPartyId, gBattlePartyCurrentOrder);
|
||||
else
|
||||
BtlController_EmitChosenMonReturnValue(1, PARTY_SIZE, NULL);
|
||||
BtlController_EmitChosenMonReturnValue(BUFFER_B, PARTY_SIZE, NULL);
|
||||
|
||||
if ((gBattleBufferA[gActiveBattler][1] & 0xF) == 1)
|
||||
PrintLinkStandbyMsg();
|
||||
@@ -1387,7 +1387,7 @@ static void CompleteWhenChoseItem(void)
|
||||
{
|
||||
if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active)
|
||||
{
|
||||
BtlController_EmitOneReturnValue(1, gSpecialVar_ItemId);
|
||||
BtlController_EmitOneReturnValue(BUFFER_B, gSpecialVar_ItemId);
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
@@ -1439,9 +1439,9 @@ static void PlayerHandleYesNoInput(void)
|
||||
PlaySE(SE_SELECT);
|
||||
|
||||
if (gMultiUsePlayerCursor != 0)
|
||||
BtlController_EmitTwoReturnValues(1, 0xE, 0);
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, 0xE, 0);
|
||||
else
|
||||
BtlController_EmitTwoReturnValues(1, 0xD, 0);
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, 0xD, 0);
|
||||
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
@@ -1600,7 +1600,7 @@ static void PlayerHandleGetMonData(void)
|
||||
monToCheck >>= 1;
|
||||
}
|
||||
}
|
||||
BtlController_EmitDataTransfer(1, size, monData);
|
||||
BtlController_EmitDataTransfer(BUFFER_B, size, monData);
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
|
||||
@@ -1920,7 +1920,7 @@ void PlayerHandleGetRawMonData(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);
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
|
||||
@@ -2226,13 +2226,14 @@ static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit)
|
||||
|
||||
static void PlayerHandleReturnMonToBall(void)
|
||||
{
|
||||
if (gBattleBufferA[gActiveBattler][1] == 0)
|
||||
if (!gBattleBufferA[gActiveBattler][1])
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
|
||||
gBattlerControllerFuncs[gActiveBattler] = DoSwitchOutAnimation;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Skip animation, just remove battler
|
||||
FreeSpriteOamMatrix(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
DestroySprite(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
SetHealthboxSpriteInvisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
@@ -2620,7 +2621,7 @@ static void PlayerChooseMoveInBattlePalace(void)
|
||||
if (--*(gBattleStruct->arenaMindPoints + gActiveBattler) == 0)
|
||||
{
|
||||
gBattlePalaceMoveSelectionRngValue = gRngValue;
|
||||
BtlController_EmitTwoReturnValues(1, 10, ChooseMoveAndTargetInBattlePalace());
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, 10, ChooseMoveAndTargetInBattlePalace());
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
@@ -2670,7 +2671,7 @@ static void PlayerHandleChoosePokemon(void)
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_ARENA && (gBattleBufferA[gActiveBattler][1] & 0xF) != PARTY_ACTION_CANT_SWITCH)
|
||||
{
|
||||
BtlController_EmitChosenMonReturnValue(1, gBattlerPartyIndexes[gActiveBattler] + 1, gBattlePartyCurrentOrder);
|
||||
BtlController_EmitChosenMonReturnValue(BUFFER_B, gBattlerPartyIndexes[gActiveBattler] + 1, gBattlePartyCurrentOrder);
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
else
|
||||
@@ -2827,25 +2828,25 @@ static void PlayerHandleCmd32(void)
|
||||
|
||||
static void PlayerHandleTwoReturnValues(void)
|
||||
{
|
||||
BtlController_EmitTwoReturnValues(1, 0, 0);
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, 0, 0);
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
|
||||
static void PlayerHandleChosenMonReturnValue(void)
|
||||
{
|
||||
BtlController_EmitChosenMonReturnValue(1, 0, NULL);
|
||||
BtlController_EmitChosenMonReturnValue(BUFFER_B, 0, NULL);
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
|
||||
static void PlayerHandleOneReturnValue(void)
|
||||
{
|
||||
BtlController_EmitOneReturnValue(1, 0);
|
||||
BtlController_EmitOneReturnValue(BUFFER_B, 0);
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
|
||||
static void PlayerHandleOneReturnValue_Duplicate(void)
|
||||
{
|
||||
BtlController_EmitOneReturnValue_Duplicate(1, 0);
|
||||
BtlController_EmitOneReturnValue_Duplicate(BUFFER_B, 0);
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
|
||||
@@ -3098,14 +3099,14 @@ static void PlayerHandleLinkStandbyMsg(void)
|
||||
RecordedBattle_RecordAllBattlerData(&gBattleBufferA[gActiveBattler][2]);
|
||||
switch (gBattleBufferA[gActiveBattler][1])
|
||||
{
|
||||
case 0:
|
||||
case LINK_STANDBY_MSG_STOP_BOUNCE:
|
||||
PrintLinkStandbyMsg();
|
||||
// fall through
|
||||
case 1:
|
||||
case LINK_STANDBY_STOP_BOUNCE_ONLY:
|
||||
EndBounceEffect(gActiveBattler, BOUNCE_HEALTHBOX);
|
||||
EndBounceEffect(gActiveBattler, BOUNCE_MON);
|
||||
break;
|
||||
case 2:
|
||||
case LINK_STANDBY_MSG_ONLY:
|
||||
PrintLinkStandbyMsg();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user