Renamed BATTLELINKMSGTYPE_ to BATTLELINKCOMMTYPE_

I want to avoid the word "message" since PRET has already chosen "battle message" as the term for predefined strings usable in the battle scripts and UI.

I was considering the term "battle link packet" instead, but the library for wireless communications already uses the word "packet" even though GBATEK does not. I'm going with "battle link communication type" instead. For this particular context, I don't think we need a compound noun ("X type"); the singular noun "type" is fine enough.
This commit is contained in:
DavidJCobb
2025-04-26 11:37:20 -04:00
parent d8721b668e
commit b4ee45f3e8
17 changed files with 226 additions and 226 deletions
+3 -3
View File
@@ -108,9 +108,9 @@ enum {
// Special arguments for Battle Controller functions. // Special arguments for Battle Controller functions.
enum { enum {
BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, // gBattleBufferA BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, // gBattleBufferA
BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, // gBattleBufferB BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, // gBattleBufferB
BATTLELINKMSGTYPE_CONTROLLER_BECOMING_IDLE BATTLELINKCOMMTYPE_CONTROLLER_BECOMING_IDLE
}; };
enum { enum {
+9 -9
View File
@@ -23,7 +23,7 @@ static bool8 ShouldSwitchIfPerishSong(void)
&& gDisableStructs[gActiveBattler].perishSongTimer == 0) && gDisableStructs[gActiveBattler].perishSongTimer == 0)
{ {
*(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE;
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SWITCH, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SWITCH, 0);
return TRUE; return TRUE;
} }
else else
@@ -107,7 +107,7 @@ static bool8 ShouldSwitchIfWonderGuard(void)
{ {
// We found a mon. // We found a mon.
*(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = i; *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = i;
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SWITCH, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SWITCH, 0);
return TRUE; return TRUE;
} }
} }
@@ -207,7 +207,7 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void)
{ {
// we found a mon. // we found a mon.
*(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = i; *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = i;
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SWITCH, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SWITCH, 0);
return TRUE; return TRUE;
} }
} }
@@ -229,14 +229,14 @@ static bool8 ShouldSwitchIfNaturalCure(void)
&& Random() & 1) && Random() & 1)
{ {
*(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE;
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SWITCH, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SWITCH, 0);
return TRUE; return TRUE;
} }
else if (gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0 else if (gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0
&& Random() & 1) && Random() & 1)
{ {
*(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE;
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SWITCH, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SWITCH, 0);
return TRUE; return TRUE;
} }
@@ -248,7 +248,7 @@ static bool8 ShouldSwitchIfNaturalCure(void)
if (Random() & 1) if (Random() & 1)
{ {
*(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE;
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SWITCH, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SWITCH, 0);
return TRUE; return TRUE;
} }
@@ -416,7 +416,7 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent)
if (moveFlags & MOVE_RESULT_SUPER_EFFECTIVE && Random() % moduloPercent == 0) if (moveFlags & MOVE_RESULT_SUPER_EFFECTIVE && Random() % moduloPercent == 0)
{ {
*(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = i; *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = i;
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SWITCH, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SWITCH, 0);
return TRUE; return TRUE;
} }
} }
@@ -599,7 +599,7 @@ void AI_TrySwitchOrUseItem(void)
} }
} }
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_USE_MOVE, BATTLE_OPPOSITE(gActiveBattler) << 8); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_USE_MOVE, BATTLE_OPPOSITE(gActiveBattler) << 8);
} }
static void ModulateByTypeEffectiveness(u8 atkType, u8 defType1, u8 defType2, u8 *var) static void ModulateByTypeEffectiveness(u8 atkType, u8 defType1, u8 defType2, u8 *var)
@@ -933,7 +933,7 @@ static bool8 ShouldUseItem(void)
if (shouldUse) if (shouldUse)
{ {
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_USE_ITEM, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_USE_ITEM, 0);
*(gBattleStruct->chosenItem + (gActiveBattler / 2) * 2) = item; *(gBattleStruct->chosenItem + (gActiveBattler / 2) * 2) = item;
gBattleResources->battleHistory->trainerItems[i] = ITEM_NONE; gBattleResources->battleHistory->trainerItems[i] = ITEM_NONE;
return shouldUse; return shouldUse;
+2 -2
View File
@@ -518,7 +518,7 @@ static void LinkOpponentBufferExecCompleted(void)
{ {
u8 playerId = GetMultiplayerId(); u8 playerId = GetMultiplayerId();
PrepareBufferDataTransferLink(BATTLELINKMSGTYPE_CONTROLLER_BECOMING_IDLE, 4, &playerId); PrepareBufferDataTransferLink(BATTLELINKCOMMTYPE_CONTROLLER_BECOMING_IDLE, 4, &playerId);
gBattleBufferA[gActiveBattler][0] = CONTROLLER_TERMINATOR_NOP; gBattleBufferA[gActiveBattler][0] = CONTROLLER_TERMINATOR_NOP;
} }
else else
@@ -548,7 +548,7 @@ static void LinkOpponentHandleGetMonData(void)
monToCheck >>= 1; monToCheck >>= 1;
} }
} }
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, size, monData); BtlController_EmitDataTransfer(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, size, monData);
LinkOpponentBufferExecCompleted(); LinkOpponentBufferExecCompleted();
} }
+2 -2
View File
@@ -400,7 +400,7 @@ static void LinkPartnerBufferExecCompleted(void)
{ {
u8 playerId = GetMultiplayerId(); u8 playerId = GetMultiplayerId();
PrepareBufferDataTransferLink(BATTLELINKMSGTYPE_CONTROLLER_BECOMING_IDLE, 4, &playerId); PrepareBufferDataTransferLink(BATTLELINKCOMMTYPE_CONTROLLER_BECOMING_IDLE, 4, &playerId);
gBattleBufferA[gActiveBattler][0] = CONTROLLER_TERMINATOR_NOP; gBattleBufferA[gActiveBattler][0] = CONTROLLER_TERMINATOR_NOP;
} }
else else
@@ -442,7 +442,7 @@ static void LinkPartnerHandleGetMonData(void)
monToCheck >>= 1; monToCheck >>= 1;
} }
} }
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, size, monData); BtlController_EmitDataTransfer(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, size, monData);
LinkPartnerBufferExecCompleted(); LinkPartnerBufferExecCompleted();
} }
+13 -13
View File
@@ -531,7 +531,7 @@ static void OpponentBufferExecCompleted(void)
{ {
u8 playerId = GetMultiplayerId(); u8 playerId = GetMultiplayerId();
PrepareBufferDataTransferLink(BATTLELINKMSGTYPE_CONTROLLER_BECOMING_IDLE, 4, &playerId); PrepareBufferDataTransferLink(BATTLELINKCOMMTYPE_CONTROLLER_BECOMING_IDLE, 4, &playerId);
gBattleBufferA[gActiveBattler][0] = CONTROLLER_TERMINATOR_NOP; gBattleBufferA[gActiveBattler][0] = CONTROLLER_TERMINATOR_NOP;
} }
else else
@@ -561,7 +561,7 @@ static void OpponentHandleGetMonData(void)
monToCheck >>= 1; monToCheck >>= 1;
} }
} }
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, size, monData); BtlController_EmitDataTransfer(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, size, monData);
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
} }
@@ -881,7 +881,7 @@ static void OpponentHandleGetRawMonData(void)
for (i = 0; i < gBattleBufferA[gActiveBattler][2]; i++) for (i = 0; i < gBattleBufferA[gActiveBattler][2]; i++)
dst[i] = src[i]; dst[i] = src[i];
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, gBattleBufferA[gActiveBattler][2], dst); BtlController_EmitDataTransfer(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, gBattleBufferA[gActiveBattler][2], dst);
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
} }
@@ -1552,7 +1552,7 @@ static void OpponentHandleChooseMove(void)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_PALACE) if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{ {
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, ChooseMoveAndTargetInBattlePalace()); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 10, ChooseMoveAndTargetInBattlePalace());
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
} }
else else
@@ -1569,13 +1569,13 @@ static void OpponentHandleChooseMove(void)
switch (chosenMoveId) switch (chosenMoveId)
{ {
case AI_CHOICE_WATCH: case AI_CHOICE_WATCH:
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SAFARI_WATCH_CAREFULLY, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SAFARI_WATCH_CAREFULLY, 0);
break; break;
case AI_CHOICE_FLEE: case AI_CHOICE_FLEE:
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_RUN, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_RUN, 0);
break; break;
case 6: case 6:
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 15, gBattlerTarget); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 15, gBattlerTarget);
break; break;
default: default:
if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER))
@@ -1586,7 +1586,7 @@ static void OpponentHandleChooseMove(void)
if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) if (gAbsentBattlerFlags & gBitTable[gBattlerTarget])
gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT);
} }
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, (chosenMoveId) | (gBattlerTarget << 8)); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 10, (chosenMoveId) | (gBattlerTarget << 8));
break; break;
} }
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
@@ -1601,11 +1601,11 @@ static void OpponentHandleChooseMove(void)
} while (move == MOVE_NONE); } while (move == MOVE_NONE);
if (gBattleMoves[move].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) if (gBattleMoves[move].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER))
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, (chosenMoveId) | (gActiveBattler << 8)); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 10, (chosenMoveId) | (gActiveBattler << 8));
else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, (chosenMoveId) | (GetBattlerAtPosition(Random() & 2) << 8)); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 10, (chosenMoveId) | (GetBattlerAtPosition(Random() & 2) << 8));
else else
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, (chosenMoveId) | (GetBattlerAtPosition(B_POSITION_PLAYER_LEFT) << 8)); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 10, (chosenMoveId) | (GetBattlerAtPosition(B_POSITION_PLAYER_LEFT) << 8));
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
} }
@@ -1614,7 +1614,7 @@ static void OpponentHandleChooseMove(void)
static void OpponentHandleChooseItem(void) static void OpponentHandleChooseItem(void)
{ {
BtlController_EmitOneReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, *(gBattleStruct->chosenItem + (gActiveBattler / 2) * 2)); BtlController_EmitOneReturnValue(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, *(gBattleStruct->chosenItem + (gActiveBattler / 2) * 2));
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
} }
@@ -1671,7 +1671,7 @@ static void OpponentHandleChoosePokemon(void)
*(gBattleStruct->monToSwitchIntoId + gActiveBattler) = chosenMonId; *(gBattleStruct->monToSwitchIntoId + gActiveBattler) = chosenMonId;
BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, chosenMonId, NULL); BtlController_EmitChosenMonReturnValue(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, chosenMonId, NULL);
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
} }
+24 -24
View File
@@ -204,7 +204,7 @@ static void PlayerBufferExecCompleted(void)
{ {
u8 playerId = GetMultiplayerId(); u8 playerId = GetMultiplayerId();
PrepareBufferDataTransferLink(BATTLELINKMSGTYPE_CONTROLLER_BECOMING_IDLE, 4, &playerId); PrepareBufferDataTransferLink(BATTLELINKCOMMTYPE_CONTROLLER_BECOMING_IDLE, 4, &playerId);
gBattleBufferA[gActiveBattler][0] = CONTROLLER_TERMINATOR_NOP; gBattleBufferA[gActiveBattler][0] = CONTROLLER_TERMINATOR_NOP;
} }
else else
@@ -249,16 +249,16 @@ static void HandleInputChooseAction(void)
switch (gActionSelectionCursor[gActiveBattler]) switch (gActionSelectionCursor[gActiveBattler])
{ {
case 0: // Top left case 0: // Top left
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_USE_MOVE, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_USE_MOVE, 0);
break; break;
case 1: // Top right case 1: // Top right
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_USE_ITEM, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_USE_ITEM, 0);
break; break;
case 2: // Bottom left case 2: // Bottom left
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SWITCH, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SWITCH, 0);
break; break;
case 3: // Bottom right case 3: // Bottom right
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_RUN, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_RUN, 0);
break; break;
} }
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
@@ -319,7 +319,7 @@ static void HandleInputChooseAction(void)
return; return;
} }
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_CANCEL_PARTNER, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_CANCEL_PARTNER, 0);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
} }
@@ -365,7 +365,7 @@ static void HandleInputChooseTarget(void)
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget; gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8)); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8));
EndBounceEffect(gMultiUsePlayerCursor, BOUNCE_HEALTHBOX); EndBounceEffect(gMultiUsePlayerCursor, BOUNCE_HEALTHBOX);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
@@ -523,7 +523,7 @@ static void HandleInputChooseMove(void)
if (!canSelectTarget) if (!canSelectTarget)
{ {
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8)); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8));
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
else else
@@ -543,7 +543,7 @@ static void HandleInputChooseMove(void)
else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59) else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59)
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, 0xFFFF); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 10, 0xFFFF);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
else if (JOY_NEW(DPAD_LEFT)) else if (JOY_NEW(DPAD_LEFT))
@@ -1174,7 +1174,7 @@ static void Task_GiveExpToMon(u8 taskId)
gainedExp -= nextLvlExp - currExp; gainedExp -= nextLvlExp - currExp;
savedActiveBattler = gActiveBattler; savedActiveBattler = gActiveBattler;
gActiveBattler = battlerId; gActiveBattler = battlerId;
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, RET_VALUE_LEVELED_UP, gainedExp); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, RET_VALUE_LEVELED_UP, gainedExp);
gActiveBattler = savedActiveBattler; gActiveBattler = savedActiveBattler;
if (IsDoubleBattle() == TRUE if (IsDoubleBattle() == TRUE
@@ -1253,7 +1253,7 @@ static void Task_GiveExpWithExpBar(u8 taskId)
gainedExp -= expOnNextLvl - currExp; gainedExp -= expOnNextLvl - currExp;
savedActiveBattler = gActiveBattler; savedActiveBattler = gActiveBattler;
gActiveBattler = battlerId; gActiveBattler = battlerId;
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, RET_VALUE_LEVELED_UP, gainedExp); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, RET_VALUE_LEVELED_UP, gainedExp);
gActiveBattler = savedActiveBattler; gActiveBattler = savedActiveBattler;
gTasks[taskId].func = Task_LaunchLvlUpAnim; gTasks[taskId].func = Task_LaunchLvlUpAnim;
} }
@@ -1361,9 +1361,9 @@ static void WaitForMonSelection(void)
if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active) if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active)
{ {
if (gPartyMenuUseExitCallback == TRUE) if (gPartyMenuUseExitCallback == TRUE)
BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, gSelectedMonPartyId, gBattlePartyCurrentOrder); BtlController_EmitChosenMonReturnValue(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, gSelectedMonPartyId, gBattlePartyCurrentOrder);
else else
BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, PARTY_SIZE, NULL); BtlController_EmitChosenMonReturnValue(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, PARTY_SIZE, NULL);
if ((gBattleBufferA[gActiveBattler][1] & 0xF) == 1) if ((gBattleBufferA[gActiveBattler][1] & 0xF) == 1)
PrintLinkStandbyMsg(); PrintLinkStandbyMsg();
@@ -1387,7 +1387,7 @@ static void CompleteWhenChoseItem(void)
{ {
if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active) if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active)
{ {
BtlController_EmitOneReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, gSpecialVar_ItemId); BtlController_EmitOneReturnValue(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, gSpecialVar_ItemId);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
} }
@@ -1439,9 +1439,9 @@ static void PlayerHandleYesNoInput(void)
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
if (gMultiUsePlayerCursor != 0) if (gMultiUsePlayerCursor != 0)
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 0xE, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 0xE, 0);
else else
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 0xD, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 0xD, 0);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
@@ -1600,7 +1600,7 @@ static void PlayerHandleGetMonData(void)
monToCheck >>= 1; monToCheck >>= 1;
} }
} }
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, size, monData); BtlController_EmitDataTransfer(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, size, monData);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
@@ -1920,7 +1920,7 @@ void PlayerHandleGetRawMonData(void)
for (i = 0; i < gBattleBufferA[gActiveBattler][2]; i++) for (i = 0; i < gBattleBufferA[gActiveBattler][2]; i++)
dst[i] = src[i]; dst[i] = src[i];
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, gBattleBufferA[gActiveBattler][2], dst); BtlController_EmitDataTransfer(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, gBattleBufferA[gActiveBattler][2], dst);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
@@ -2621,7 +2621,7 @@ static void PlayerChooseMoveInBattlePalace(void)
if (--*(gBattleStruct->arenaMindPoints + gActiveBattler) == 0) if (--*(gBattleStruct->arenaMindPoints + gActiveBattler) == 0)
{ {
gBattlePalaceMoveSelectionRngValue = gRngValue; gBattlePalaceMoveSelectionRngValue = gRngValue;
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, ChooseMoveAndTargetInBattlePalace()); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 10, ChooseMoveAndTargetInBattlePalace());
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
} }
@@ -2671,7 +2671,7 @@ static void PlayerHandleChoosePokemon(void)
if (gBattleTypeFlags & BATTLE_TYPE_ARENA && (gBattleBufferA[gActiveBattler][1] & 0xF) != PARTY_ACTION_CANT_SWITCH) if (gBattleTypeFlags & BATTLE_TYPE_ARENA && (gBattleBufferA[gActiveBattler][1] & 0xF) != PARTY_ACTION_CANT_SWITCH)
{ {
BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, gBattlerPartyIndexes[gActiveBattler] + 1, gBattlePartyCurrentOrder); BtlController_EmitChosenMonReturnValue(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, gBattlerPartyIndexes[gActiveBattler] + 1, gBattlePartyCurrentOrder);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
else else
@@ -2828,25 +2828,25 @@ static void PlayerHandleCmd32(void)
static void PlayerHandleTwoReturnValues(void) static void PlayerHandleTwoReturnValues(void)
{ {
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 0, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 0, 0);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
static void PlayerHandleChosenMonReturnValue(void) static void PlayerHandleChosenMonReturnValue(void)
{ {
BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 0, NULL); BtlController_EmitChosenMonReturnValue(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 0, NULL);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
static void PlayerHandleOneReturnValue(void) static void PlayerHandleOneReturnValue(void)
{ {
BtlController_EmitOneReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 0); BtlController_EmitOneReturnValue(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 0);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
static void PlayerHandleOneReturnValue_Duplicate(void) static void PlayerHandleOneReturnValue_Duplicate(void)
{ {
BtlController_EmitOneReturnValue_Duplicate(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 0); BtlController_EmitOneReturnValue_Duplicate(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 0);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
+6 -6
View File
@@ -332,7 +332,7 @@ static void Task_GiveExpToMon(u8 taskId)
gainedExp -= nextLvlExp - currExp; gainedExp -= nextLvlExp - currExp;
savedActiveBank = gActiveBattler; savedActiveBank = gActiveBattler;
gActiveBattler = battlerId; gActiveBattler = battlerId;
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, RET_VALUE_LEVELED_UP, gainedExp); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, RET_VALUE_LEVELED_UP, gainedExp);
gActiveBattler = savedActiveBank; gActiveBattler = savedActiveBank;
if (IsDoubleBattle() == TRUE if (IsDoubleBattle() == TRUE
@@ -411,7 +411,7 @@ static void Task_GiveExpWithExpBar(u8 taskId)
gainedExp -= expOnNextLvl - currExp; gainedExp -= expOnNextLvl - currExp;
savedActiveBank = gActiveBattler; savedActiveBank = gActiveBattler;
gActiveBattler = battlerId; gActiveBattler = battlerId;
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, RET_VALUE_LEVELED_UP, gainedExp); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, RET_VALUE_LEVELED_UP, gainedExp);
gActiveBattler = savedActiveBank; gActiveBattler = savedActiveBank;
gTasks[taskId].func = Task_LaunchLvlUpAnim; gTasks[taskId].func = Task_LaunchLvlUpAnim;
} }
@@ -584,7 +584,7 @@ static void PlayerPartnerBufferExecCompleted(void)
{ {
u8 playerId = GetMultiplayerId(); u8 playerId = GetMultiplayerId();
PrepareBufferDataTransferLink(BATTLELINKMSGTYPE_CONTROLLER_BECOMING_IDLE, 4, &playerId); PrepareBufferDataTransferLink(BATTLELINKCOMMTYPE_CONTROLLER_BECOMING_IDLE, 4, &playerId);
gBattleBufferA[gActiveBattler][0] = CONTROLLER_TERMINATOR_NOP; gBattleBufferA[gActiveBattler][0] = CONTROLLER_TERMINATOR_NOP;
} }
else else
@@ -626,7 +626,7 @@ static void PlayerPartnerHandleGetMonData(void)
monToCheck >>= 1; monToCheck >>= 1;
} }
} }
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, size, monData); BtlController_EmitDataTransfer(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, size, monData);
PlayerPartnerBufferExecCompleted(); PlayerPartnerBufferExecCompleted();
} }
@@ -1527,7 +1527,7 @@ static void PlayerPartnerHandleChooseMove(void)
gBattlerTarget = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT); gBattlerTarget = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT);
} }
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, chosenMoveId | (gBattlerTarget << 8)); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 10, chosenMoveId | (gBattlerTarget << 8));
PlayerPartnerBufferExecCompleted(); PlayerPartnerBufferExecCompleted();
} }
@@ -1557,7 +1557,7 @@ static void PlayerPartnerHandleChoosePokemon(void)
} }
*(gBattleStruct->monToSwitchIntoId + gActiveBattler) = chosenMonId; *(gBattleStruct->monToSwitchIntoId + gActiveBattler) = chosenMonId;
BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, chosenMonId, NULL); BtlController_EmitChosenMonReturnValue(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, chosenMonId, NULL);
PlayerPartnerBufferExecCompleted(); PlayerPartnerBufferExecCompleted();
} }
+6 -6
View File
@@ -504,7 +504,7 @@ static void RecordedOpponentBufferExecCompleted(void)
{ {
u8 playerId = GetMultiplayerId(); u8 playerId = GetMultiplayerId();
PrepareBufferDataTransferLink(BATTLELINKMSGTYPE_CONTROLLER_BECOMING_IDLE, 4, &playerId); PrepareBufferDataTransferLink(BATTLELINKCOMMTYPE_CONTROLLER_BECOMING_IDLE, 4, &playerId);
gBattleBufferA[gActiveBattler][0] = CONTROLLER_TERMINATOR_NOP; gBattleBufferA[gActiveBattler][0] = CONTROLLER_TERMINATOR_NOP;
} }
else else
@@ -534,7 +534,7 @@ static void RecordedOpponentHandleGetMonData(void)
monToCheck >>= 1; monToCheck >>= 1;
} }
} }
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, size, monData); BtlController_EmitDataTransfer(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, size, monData);
RecordedOpponentBufferExecCompleted(); RecordedOpponentBufferExecCompleted();
} }
@@ -1402,7 +1402,7 @@ static void RecordedOpponentHandlePrintSelectionString(void)
static void RecordedOpponentHandleChooseAction(void) static void RecordedOpponentHandleChooseAction(void)
{ {
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, RecordedBattle_GetBattlerAction(gActiveBattler), 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, RecordedBattle_GetBattlerAction(gActiveBattler), 0);
RecordedOpponentBufferExecCompleted(); RecordedOpponentBufferExecCompleted();
} }
@@ -1415,13 +1415,13 @@ static void RecordedOpponentHandleChooseMove(void)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_PALACE) if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{ {
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, ChooseMoveAndTargetInBattlePalace()); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 10, ChooseMoveAndTargetInBattlePalace());
} }
else else
{ {
u8 moveId = RecordedBattle_GetBattlerAction(gActiveBattler); u8 moveId = RecordedBattle_GetBattlerAction(gActiveBattler);
u8 target = RecordedBattle_GetBattlerAction(gActiveBattler); u8 target = RecordedBattle_GetBattlerAction(gActiveBattler);
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, moveId | (target << 8)); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 10, moveId | (target << 8));
} }
RecordedOpponentBufferExecCompleted(); RecordedOpponentBufferExecCompleted();
@@ -1435,7 +1435,7 @@ static void RecordedOpponentHandleChooseItem(void)
static void RecordedOpponentHandleChoosePokemon(void) static void RecordedOpponentHandleChoosePokemon(void)
{ {
*(gBattleStruct->monToSwitchIntoId + gActiveBattler) = RecordedBattle_GetBattlerAction(gActiveBattler); *(gBattleStruct->monToSwitchIntoId + gActiveBattler) = RecordedBattle_GetBattlerAction(gActiveBattler);
BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, *(gBattleStruct->monToSwitchIntoId + gActiveBattler), NULL); BtlController_EmitChosenMonReturnValue(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, *(gBattleStruct->monToSwitchIntoId + gActiveBattler), NULL);
RecordedOpponentBufferExecCompleted(); RecordedOpponentBufferExecCompleted();
} }
+7 -7
View File
@@ -475,7 +475,7 @@ static void RecordedPlayerBufferExecCompleted(void)
{ {
u8 playerId = GetMultiplayerId(); u8 playerId = GetMultiplayerId();
PrepareBufferDataTransferLink(BATTLELINKMSGTYPE_CONTROLLER_BECOMING_IDLE, 4, &playerId); PrepareBufferDataTransferLink(BATTLELINKCOMMTYPE_CONTROLLER_BECOMING_IDLE, 4, &playerId);
gBattleBufferA[gActiveBattler][0] = CONTROLLER_TERMINATOR_NOP; gBattleBufferA[gActiveBattler][0] = CONTROLLER_TERMINATOR_NOP;
} }
else else
@@ -517,7 +517,7 @@ static void RecordedPlayerHandleGetMonData(void)
monToCheck >>= 1; monToCheck >>= 1;
} }
} }
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, size, monData); BtlController_EmitDataTransfer(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, size, monData);
RecordedPlayerBufferExecCompleted(); RecordedPlayerBufferExecCompleted();
} }
@@ -1414,7 +1414,7 @@ static void ChooseActionInBattlePalace(void)
{ {
if (gBattleCommunication[4] >= gBattlersCount / 2) if (gBattleCommunication[4] >= gBattlersCount / 2)
{ {
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, RecordedBattle_GetBattlerAction(gActiveBattler), 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, RecordedBattle_GetBattlerAction(gActiveBattler), 0);
RecordedPlayerBufferExecCompleted(); RecordedPlayerBufferExecCompleted();
} }
} }
@@ -1427,7 +1427,7 @@ static void RecordedPlayerHandleChooseAction(void)
} }
else else
{ {
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, RecordedBattle_GetBattlerAction(gActiveBattler), 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, RecordedBattle_GetBattlerAction(gActiveBattler), 0);
RecordedPlayerBufferExecCompleted(); RecordedPlayerBufferExecCompleted();
} }
} }
@@ -1441,13 +1441,13 @@ static void RecordedPlayerHandleChooseMove(void)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_PALACE) if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{ {
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, ChooseMoveAndTargetInBattlePalace()); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 10, ChooseMoveAndTargetInBattlePalace());
} }
else else
{ {
u8 moveId = RecordedBattle_GetBattlerAction(gActiveBattler); u8 moveId = RecordedBattle_GetBattlerAction(gActiveBattler);
u8 target = RecordedBattle_GetBattlerAction(gActiveBattler); u8 target = RecordedBattle_GetBattlerAction(gActiveBattler);
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, moveId | (target << 8)); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 10, moveId | (target << 8));
} }
RecordedPlayerBufferExecCompleted(); RecordedPlayerBufferExecCompleted();
@@ -1461,7 +1461,7 @@ static void RecordedPlayerHandleChooseItem(void)
static void RecordedPlayerHandleChoosePokemon(void) static void RecordedPlayerHandleChoosePokemon(void)
{ {
*(gBattleStruct->monToSwitchIntoId + gActiveBattler) = RecordedBattle_GetBattlerAction(gActiveBattler); *(gBattleStruct->monToSwitchIntoId + gActiveBattler) = RecordedBattle_GetBattlerAction(gActiveBattler);
BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, *(gBattleStruct->monToSwitchIntoId + gActiveBattler), NULL); BtlController_EmitChosenMonReturnValue(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, *(gBattleStruct->monToSwitchIntoId + gActiveBattler), NULL);
RecordedPlayerBufferExecCompleted(); RecordedPlayerBufferExecCompleted();
} }
+6 -6
View File
@@ -176,16 +176,16 @@ static void HandleInputChooseAction(void)
switch (gActionSelectionCursor[gActiveBattler]) switch (gActionSelectionCursor[gActiveBattler])
{ {
case 0: case 0:
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SAFARI_BALL, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SAFARI_BALL, 0);
break; break;
case 1: case 1:
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SAFARI_POKEBLOCK, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SAFARI_POKEBLOCK, 0);
break; break;
case 2: case 2:
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SAFARI_GO_NEAR, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SAFARI_GO_NEAR, 0);
break; break;
case 3: case 3:
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SAFARI_RUN, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SAFARI_RUN, 0);
break; break;
} }
SafariBufferExecCompleted(); SafariBufferExecCompleted();
@@ -280,7 +280,7 @@ static void CompleteWhenChosePokeblock(void)
{ {
if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active) if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active)
{ {
BtlController_EmitOneReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, gSpecialVar_ItemId); BtlController_EmitOneReturnValue(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, gSpecialVar_ItemId);
SafariBufferExecCompleted(); SafariBufferExecCompleted();
} }
} }
@@ -298,7 +298,7 @@ static void SafariBufferExecCompleted(void)
{ {
u8 playerId = GetMultiplayerId(); u8 playerId = GetMultiplayerId();
PrepareBufferDataTransferLink(BATTLELINKMSGTYPE_CONTROLLER_BECOMING_IDLE, 4, &playerId); PrepareBufferDataTransferLink(BATTLELINKCOMMTYPE_CONTROLLER_BECOMING_IDLE, 4, &playerId);
gBattleBufferA[gActiveBattler][0] = CONTROLLER_TERMINATOR_NOP; gBattleBufferA[gActiveBattler][0] = CONTROLLER_TERMINATOR_NOP;
} }
else else
+8 -8
View File
@@ -196,7 +196,7 @@ static void WallyHandleActions(void)
if (--gBattleStruct->wallyWaitFrames == 0) if (--gBattleStruct->wallyWaitFrames == 0)
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_USE_MOVE, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_USE_MOVE, 0);
WallyBufferExecCompleted(); WallyBufferExecCompleted();
gBattleStruct->wallyBattleState++; gBattleStruct->wallyBattleState++;
gBattleStruct->wallyMovesState = 0; gBattleStruct->wallyMovesState = 0;
@@ -207,7 +207,7 @@ static void WallyHandleActions(void)
if (--gBattleStruct->wallyWaitFrames == 0) if (--gBattleStruct->wallyWaitFrames == 0)
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_USE_MOVE, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_USE_MOVE, 0);
WallyBufferExecCompleted(); WallyBufferExecCompleted();
gBattleStruct->wallyBattleState++; gBattleStruct->wallyBattleState++;
gBattleStruct->wallyMovesState = 0; gBattleStruct->wallyMovesState = 0;
@@ -217,7 +217,7 @@ static void WallyHandleActions(void)
case 3: case 3:
if (--gBattleStruct->wallyWaitFrames == 0) if (--gBattleStruct->wallyWaitFrames == 0)
{ {
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_WALLY_THROW, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_WALLY_THROW, 0);
WallyBufferExecCompleted(); WallyBufferExecCompleted();
gBattleStruct->wallyBattleState++; gBattleStruct->wallyBattleState++;
gBattleStruct->wallyMovesState = 0; gBattleStruct->wallyMovesState = 0;
@@ -238,7 +238,7 @@ static void WallyHandleActions(void)
if (--gBattleStruct->wallyWaitFrames == 0) if (--gBattleStruct->wallyWaitFrames == 0)
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_USE_ITEM, 0); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, B_ACTION_USE_ITEM, 0);
WallyBufferExecCompleted(); WallyBufferExecCompleted();
} }
break; break;
@@ -278,7 +278,7 @@ static void CompleteOnChosenItem(void)
{ {
if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active) if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active)
{ {
BtlController_EmitOneReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, gSpecialVar_ItemId); BtlController_EmitOneReturnValue(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, gSpecialVar_ItemId);
WallyBufferExecCompleted(); WallyBufferExecCompleted();
} }
} }
@@ -408,7 +408,7 @@ static void WallyBufferExecCompleted(void)
{ {
u8 playerId = GetMultiplayerId(); u8 playerId = GetMultiplayerId();
PrepareBufferDataTransferLink(BATTLELINKMSGTYPE_CONTROLLER_BECOMING_IDLE, 4, &playerId); PrepareBufferDataTransferLink(BATTLELINKCOMMTYPE_CONTROLLER_BECOMING_IDLE, 4, &playerId);
gBattleBufferA[gActiveBattler][0] = CONTROLLER_TERMINATOR_NOP; gBattleBufferA[gActiveBattler][0] = CONTROLLER_TERMINATOR_NOP;
} }
else else
@@ -444,7 +444,7 @@ static void WallyHandleGetMonData(void)
monToCheck >>= 1; monToCheck >>= 1;
} }
} }
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, size, monData); BtlController_EmitDataTransfer(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, size, monData);
WallyBufferExecCompleted(); WallyBufferExecCompleted();
} }
@@ -1241,7 +1241,7 @@ static void WallyHandleChooseMove(void)
if (--gBattleStruct->wallyMoveFrames == 0) if (--gBattleStruct->wallyMoveFrames == 0)
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, 0x100); BtlController_EmitTwoReturnValues(BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE, 10, 0x100);
WallyBufferExecCompleted(); WallyBufferExecCompleted();
} }
break; break;
+6 -6
View File
@@ -659,11 +659,11 @@ static void PrepareBufferDataTransfer(u8 bufferId, u8 *data, u16 size)
{ {
switch (bufferId) switch (bufferId)
{ {
case BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER: case BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER:
for (i = 0; i < size; data++, i++) for (i = 0; i < size; data++, i++)
gBattleBufferA[gActiveBattler][i] = *data; gBattleBufferA[gActiveBattler][i] = *data;
break; break;
case BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE: case BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE:
for (i = 0; i < size; data++, i++) for (i = 0; i < size; data++, i++)
gBattleBufferB[gActiveBattler][i] = *data; gBattleBufferB[gActiveBattler][i] = *data;
break; break;
@@ -724,7 +724,7 @@ enum
}; };
// We want to send a message. Place it into the "send" buffer. // We want to send a message. Place it into the "send" buffer.
// First argument is a BATTLELINKMSGTYPE_... // First argument is a BATTLELINKCOMMTYPE_...
void PrepareBufferDataTransferLink(u8 bufferId, u16 size, u8 *data) void PrepareBufferDataTransferLink(u8 bufferId, u16 size, u8 *data)
{ {
s32 alignedSize; s32 alignedSize;
@@ -922,7 +922,7 @@ static void Task_HandleCopyReceivedLinkBuffersData(u8 taskId)
switch (BYTE_TO_RECEIVE(0)) switch (BYTE_TO_RECEIVE(0))
{ {
case BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER: case BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER:
if (IS_BATTLE_CONTROLLER_ACTIVE_ON_LOCAL(battlerId)) if (IS_BATTLE_CONTROLLER_ACTIVE_ON_LOCAL(battlerId))
return; return;
@@ -937,10 +937,10 @@ static void Task_HandleCopyReceivedLinkBuffersData(u8 taskId)
gEffectBattler = BYTE_TO_RECEIVE(LINK_BUFF_EFFECT_BATTLER); gEffectBattler = BYTE_TO_RECEIVE(LINK_BUFF_EFFECT_BATTLER);
} }
break; break;
case BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE: case BATTLELINKCOMMTYPE_CONTROLLER_TO_ENGINE:
memcpy(gBattleBufferB[battlerId], &gLinkBattleRecvBuffer[gTasks[taskId].tCurrentBlock_Start + LINK_BUFF_DATA], blockSize); memcpy(gBattleBufferB[battlerId], &gLinkBattleRecvBuffer[gTasks[taskId].tCurrentBlock_Start + LINK_BUFF_DATA], blockSize);
break; break;
case BATTLELINKMSGTYPE_CONTROLLER_BECOMING_IDLE: case BATTLELINKCOMMTYPE_CONTROLLER_BECOMING_IDLE:
playerId = BYTE_TO_RECEIVE(LINK_BUFF_DATA); playerId = BYTE_TO_RECEIVE(LINK_BUFF_DATA);
MARK_BATTLE_CONTROLLER_IDLE_FOR_PLAYER(battlerId, playerId); MARK_BATTLE_CONTROLLER_IDLE_FOR_PLAYER(battlerId, playerId);
break; break;
+27 -27
View File
@@ -3360,7 +3360,7 @@ static void BattleIntroGetMonsData(void)
{ {
case 0: case 0:
gActiveBattler = gBattleCommunication[1]; gActiveBattler = gBattleCommunication[1];
BtlController_EmitGetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_ALL_BATTLE, 0); BtlController_EmitGetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_ALL_BATTLE, 0);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattleCommunication[MULTIUSE_STATE]++; gBattleCommunication[MULTIUSE_STATE]++;
break; break;
@@ -3382,7 +3382,7 @@ static void BattleIntroPrepareBackgroundSlide(void)
if (gBattleControllerExecFlags == 0) if (gBattleControllerExecFlags == 0)
{ {
gActiveBattler = GetBattlerAtPosition(0); gActiveBattler = GetBattlerAtPosition(0);
BtlController_EmitIntroSlide(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gBattleEnvironment); BtlController_EmitIntroSlide(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, gBattleEnvironment);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattleMainFunc = BattleIntroDrawTrainersOrMonsSprites; gBattleMainFunc = BattleIntroDrawTrainersOrMonsSprites;
gBattleCommunication[MULTIUSE_STATE] = 0; gBattleCommunication[MULTIUSE_STATE] = 0;
@@ -3427,7 +3427,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
if (GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_LEFT) if (GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_LEFT)
{ {
BtlController_EmitDrawTrainerPic(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitDrawTrainerPic(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
@@ -3435,7 +3435,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
{ {
if (GetBattlerPosition(gActiveBattler) == B_POSITION_OPPONENT_LEFT) if (GetBattlerPosition(gActiveBattler) == B_POSITION_OPPONENT_LEFT)
{ {
BtlController_EmitDrawTrainerPic(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitDrawTrainerPic(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT
@@ -3460,7 +3460,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
{ {
HandleSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBattler].species), FLAG_SET_SEEN, gBattleMons[gActiveBattler].personality); HandleSetPokedexFlag(SpeciesToNationalPokedexNum(gBattleMons[gActiveBattler].species), FLAG_SET_SEEN, gBattleMons[gActiveBattler].personality);
} }
BtlController_EmitLoadMonSprite(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitLoadMonSprite(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattleResults.lastOpponentSpecies = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES, NULL); gBattleResults.lastOpponentSpecies = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES, NULL);
} }
@@ -3471,14 +3471,14 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
if (GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_RIGHT if (GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_RIGHT
|| GetBattlerPosition(gActiveBattler) == B_POSITION_OPPONENT_RIGHT) || GetBattlerPosition(gActiveBattler) == B_POSITION_OPPONENT_RIGHT)
{ {
BtlController_EmitDrawTrainerPic(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitDrawTrainerPic(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
} }
if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS && GetBattlerPosition(gActiveBattler) == B_POSITION_OPPONENT_RIGHT) if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS && GetBattlerPosition(gActiveBattler) == B_POSITION_OPPONENT_RIGHT)
{ {
BtlController_EmitDrawTrainerPic(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitDrawTrainerPic(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
@@ -3513,7 +3513,7 @@ static void BattleIntroDrawPartySummaryScreens(void)
} }
} }
gActiveBattler = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); gActiveBattler = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
BtlController_EmitDrawPartyStatusSummary(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, hpStatus, PARTY_SUMM_SKIP_DRAW_DELAY); BtlController_EmitDrawPartyStatusSummary(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, hpStatus, PARTY_SUMM_SKIP_DRAW_DELAY);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
for (i = 0; i < PARTY_SIZE; i++) for (i = 0; i < PARTY_SIZE; i++)
@@ -3531,7 +3531,7 @@ static void BattleIntroDrawPartySummaryScreens(void)
} }
} }
gActiveBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); gActiveBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
BtlController_EmitDrawPartyStatusSummary(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, hpStatus, PARTY_SUMM_SKIP_DRAW_DELAY); BtlController_EmitDrawPartyStatusSummary(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, hpStatus, PARTY_SUMM_SKIP_DRAW_DELAY);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattleMainFunc = BattleIntroPrintTrainerWantsToBattle; gBattleMainFunc = BattleIntroPrintTrainerWantsToBattle;
@@ -3631,7 +3631,7 @@ static void BattleIntroOpponent2SendsOutMonAnimation(void)
{ {
if (GetBattlerPosition(gActiveBattler) == position) if (GetBattlerPosition(gActiveBattler) == position)
{ {
BtlController_EmitIntroTrainerBallThrow(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitIntroTrainerBallThrow(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
} }
@@ -3669,7 +3669,7 @@ static void BattleIntroOpponent1SendsOutMonAnimation(void)
{ {
if (GetBattlerPosition(gActiveBattler) == position) if (GetBattlerPosition(gActiveBattler) == position)
{ {
BtlController_EmitIntroTrainerBallThrow(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitIntroTrainerBallThrow(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
if (gBattleTypeFlags & (BATTLE_TYPE_MULTI | BATTLE_TYPE_TWO_OPPONENTS)) if (gBattleTypeFlags & (BATTLE_TYPE_MULTI | BATTLE_TYPE_TWO_OPPONENTS))
{ {
@@ -3761,7 +3761,7 @@ static void BattleIntroPlayer2SendsOutMonAnimation(void)
{ {
if (GetBattlerPosition(gActiveBattler) == position) if (GetBattlerPosition(gActiveBattler) == position)
{ {
BtlController_EmitIntroTrainerBallThrow(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitIntroTrainerBallThrow(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
} }
@@ -3800,7 +3800,7 @@ static void BattleIntroPlayer1SendsOutMonAnimation(void)
{ {
if (GetBattlerPosition(gActiveBattler) == position) if (GetBattlerPosition(gActiveBattler) == position)
{ {
BtlController_EmitIntroTrainerBallThrow(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitIntroTrainerBallThrow(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
if (gBattleTypeFlags & (BATTLE_TYPE_MULTI)) if (gBattleTypeFlags & (BATTLE_TYPE_MULTI))
{ {
@@ -3825,7 +3825,7 @@ static void UNUSED BattleIntroSwitchInPlayerMons(void)
{ {
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
{ {
BtlController_EmitSwitchInAnim(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gBattlerPartyIndexes[gActiveBattler], FALSE); BtlController_EmitSwitchInAnim(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, gBattlerPartyIndexes[gActiveBattler], FALSE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
} }
@@ -4165,7 +4165,7 @@ static void HandleTurnActionSelectionState(void)
} }
else else
{ {
BtlController_EmitChooseAction(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gChosenActionByBattler[0], gBattleBufferB[0][1] | (gBattleBufferB[0][2] << 8)); BtlController_EmitChooseAction(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, gChosenActionByBattler[0], gBattleBufferB[0][1] | (gBattleBufferB[0][2] << 8));
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattleCommunication[gActiveBattler]++; gBattleCommunication[gActiveBattler]++;
} }
@@ -4214,7 +4214,7 @@ static void HandleTurnActionSelectionState(void)
i); i);
} }
BtlController_EmitChooseMove(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) != 0, FALSE, &moveInfo); BtlController_EmitChooseMove(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) != 0, FALSE, &moveInfo);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
break; break;
@@ -4233,7 +4233,7 @@ static void HandleTurnActionSelectionState(void)
} }
else else
{ {
BtlController_EmitChooseItem(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gBattleStruct->battlerPartyOrders[gActiveBattler]); BtlController_EmitChooseItem(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, gBattleStruct->battlerPartyOrders[gActiveBattler]);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
break; break;
@@ -4243,7 +4243,7 @@ static void HandleTurnActionSelectionState(void)
|| gBattleTypeFlags & BATTLE_TYPE_ARENA || gBattleTypeFlags & BATTLE_TYPE_ARENA
|| gStatuses3[gActiveBattler] & STATUS3_ROOTED) || gStatuses3[gActiveBattler] & STATUS3_ROOTED)
{ {
BtlController_EmitChoosePokemon(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, PARTY_ACTION_CANT_SWITCH, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]); BtlController_EmitChoosePokemon(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, PARTY_ACTION_CANT_SWITCH, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]);
} }
else if ((i = ABILITY_ON_OPPOSING_FIELD(gActiveBattler, ABILITY_SHADOW_TAG)) else if ((i = ABILITY_ON_OPPOSING_FIELD(gActiveBattler, ABILITY_SHADOW_TAG))
|| ((i = ABILITY_ON_OPPOSING_FIELD(gActiveBattler, ABILITY_ARENA_TRAP)) || ((i = ABILITY_ON_OPPOSING_FIELD(gActiveBattler, ABILITY_ARENA_TRAP))
@@ -4252,16 +4252,16 @@ static void HandleTurnActionSelectionState(void)
|| ((i = AbilityBattleEffects(ABILITYEFFECT_CHECK_FIELD_EXCEPT_BATTLER, gActiveBattler, ABILITY_MAGNET_PULL, 0, 0)) || ((i = AbilityBattleEffects(ABILITYEFFECT_CHECK_FIELD_EXCEPT_BATTLER, gActiveBattler, ABILITY_MAGNET_PULL, 0, 0))
&& IS_BATTLER_OF_TYPE(gActiveBattler, TYPE_STEEL))) && IS_BATTLER_OF_TYPE(gActiveBattler, TYPE_STEEL)))
{ {
BtlController_EmitChoosePokemon(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, ((i - 1) << 4) | PARTY_ACTION_ABILITY_PREVENTS, PARTY_SIZE, gLastUsedAbility, gBattleStruct->battlerPartyOrders[gActiveBattler]); BtlController_EmitChoosePokemon(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, ((i - 1) << 4) | PARTY_ACTION_ABILITY_PREVENTS, PARTY_SIZE, gLastUsedAbility, gBattleStruct->battlerPartyOrders[gActiveBattler]);
} }
else else
{ {
if (gActiveBattler == 2 && gChosenActionByBattler[0] == B_ACTION_SWITCH) if (gActiveBattler == 2 && gChosenActionByBattler[0] == B_ACTION_SWITCH)
BtlController_EmitChoosePokemon(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, PARTY_ACTION_CHOOSE_MON, *(gBattleStruct->monToSwitchIntoId + 0), ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]); BtlController_EmitChoosePokemon(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, PARTY_ACTION_CHOOSE_MON, *(gBattleStruct->monToSwitchIntoId + 0), ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]);
else if (gActiveBattler == 3 && gChosenActionByBattler[1] == B_ACTION_SWITCH) else if (gActiveBattler == 3 && gChosenActionByBattler[1] == B_ACTION_SWITCH)
BtlController_EmitChoosePokemon(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, PARTY_ACTION_CHOOSE_MON, *(gBattleStruct->monToSwitchIntoId + 1), ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]); BtlController_EmitChoosePokemon(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, PARTY_ACTION_CHOOSE_MON, *(gBattleStruct->monToSwitchIntoId + 1), ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]);
else else
BtlController_EmitChoosePokemon(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, PARTY_ACTION_CHOOSE_MON, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]); BtlController_EmitChoosePokemon(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, PARTY_ACTION_CHOOSE_MON, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]);
} }
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
break; break;
@@ -4276,7 +4276,7 @@ static void HandleTurnActionSelectionState(void)
} }
break; break;
case B_ACTION_SAFARI_POKEBLOCK: case B_ACTION_SAFARI_POKEBLOCK:
BtlController_EmitChooseItem(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gBattleStruct->battlerPartyOrders[gActiveBattler]); BtlController_EmitChooseItem(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, gBattleStruct->battlerPartyOrders[gActiveBattler]);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
break; break;
case B_ACTION_CANCEL_PARTNER: case B_ACTION_CANCEL_PARTNER:
@@ -4286,7 +4286,7 @@ static void HandleTurnActionSelectionState(void)
if (gBattleMons[GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gActiveBattler)))].status2 & STATUS2_MULTIPLETURNS if (gBattleMons[GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gActiveBattler)))].status2 & STATUS2_MULTIPLETURNS
|| gBattleMons[GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gActiveBattler)))].status2 & STATUS2_RECHARGE) || gBattleMons[GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gActiveBattler)))].status2 & STATUS2_RECHARGE)
{ {
BtlController_EmitEndBounceEffect(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitEndBounceEffect(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
return; return;
} }
@@ -4314,7 +4314,7 @@ static void HandleTurnActionSelectionState(void)
{ {
RecordedBattle_ClearBattlerAction(GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gActiveBattler))), 3); RecordedBattle_ClearBattlerAction(GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gActiveBattler))), 3);
} }
BtlController_EmitEndBounceEffect(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitEndBounceEffect(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
return; return;
} }
@@ -4467,11 +4467,11 @@ static void HandleTurnActionSelectionState(void)
|| (position & BIT_FLANK) != B_FLANK_LEFT || (position & BIT_FLANK) != B_FLANK_LEFT
|| (*(&gBattleStruct->absentBattlerFlags) & gBitTable[GetBattlerAtPosition(BATTLE_PARTNER(position))])) || (*(&gBattleStruct->absentBattlerFlags) & gBitTable[GetBattlerAtPosition(BATTLE_PARTNER(position))]))
{ {
BtlController_EmitLinkStandbyMsg(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_STOP_BOUNCE, i); BtlController_EmitLinkStandbyMsg(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_STOP_BOUNCE, i);
} }
else else
{ {
BtlController_EmitLinkStandbyMsg(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_STOP_BOUNCE_ONLY, i); BtlController_EmitLinkStandbyMsg(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_STOP_BOUNCE_ONLY, i);
} }
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattleCommunication[gActiveBattler]++; gBattleCommunication[gActiveBattler]++;
+93 -93
View File
@@ -1239,7 +1239,7 @@ static void Cmd_ppreduce(void)
if (MOVE_IS_PERMANENT(gBattlerAttacker, gCurrMovePos)) if (MOVE_IS_PERMANENT(gBattlerAttacker, gCurrMovePos))
{ {
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_PPMOVE1_BATTLE + gCurrMovePos, 0, BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_PPMOVE1_BATTLE + gCurrMovePos, 0,
sizeof(gBattleMons[gBattlerAttacker].pp[gCurrMovePos]), sizeof(gBattleMons[gBattlerAttacker].pp[gCurrMovePos]),
&gBattleMons[gBattlerAttacker].pp[gCurrMovePos]); &gBattleMons[gBattlerAttacker].pp[gCurrMovePos]);
MarkBattlerForControllerExec(gBattlerAttacker); MarkBattlerForControllerExec(gBattlerAttacker);
@@ -1784,7 +1784,7 @@ static void Cmd_attackanimation(void)
multihit = gMultiHitCounter; multihit = gMultiHitCounter;
} }
BtlController_EmitMoveAnimation(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gCurrentMove, gBattleScripting.animTurn, gBattleMovePower, gBattleMoveDamage, gBattleMons[gBattlerAttacker].friendship, &gDisableStructs[gBattlerAttacker], multihit); BtlController_EmitMoveAnimation(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, gCurrentMove, gBattleScripting.animTurn, gBattleMovePower, gBattleMoveDamage, gBattleMons[gBattlerAttacker].friendship, &gDisableStructs[gBattlerAttacker], multihit);
gBattleScripting.animTurn++; gBattleScripting.animTurn++;
gBattleScripting.animTargetsHit++; gBattleScripting.animTargetsHit++;
MarkBattlerForControllerExec(gBattlerAttacker); MarkBattlerForControllerExec(gBattlerAttacker);
@@ -1829,7 +1829,7 @@ static void Cmd_healthbarupdate(void)
else else
healthValue = maxPossibleDmgValue; healthValue = maxPossibleDmgValue;
BtlController_EmitHealthBarUpdate(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, healthValue); BtlController_EmitHealthBarUpdate(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, healthValue);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER && gBattleMoveDamage > 0) if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER && gBattleMoveDamage > 0)
@@ -1971,7 +1971,7 @@ static void Cmd_datahpupdate(void)
gHitMarker &= ~HITMARKER_PASSIVE_DAMAGE; gHitMarker &= ~HITMARKER_PASSIVE_DAMAGE;
// Send updated HP // Send updated HP
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_HP_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].hp), &gBattleMons[gActiveBattler].hp); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_HP_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].hp), &gBattleMons[gActiveBattler].hp);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
} }
@@ -2009,11 +2009,11 @@ static void Cmd_effectivenesssound(void)
switch (gMoveResultFlags & (u8)(~MOVE_RESULT_MISSED)) switch (gMoveResultFlags & (u8)(~MOVE_RESULT_MISSED))
{ {
case MOVE_RESULT_SUPER_EFFECTIVE: case MOVE_RESULT_SUPER_EFFECTIVE:
BtlController_EmitPlaySE(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, SE_SUPER_EFFECTIVE); BtlController_EmitPlaySE(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, SE_SUPER_EFFECTIVE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
break; break;
case MOVE_RESULT_NOT_VERY_EFFECTIVE: case MOVE_RESULT_NOT_VERY_EFFECTIVE:
BtlController_EmitPlaySE(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, SE_NOT_EFFECTIVE); BtlController_EmitPlaySE(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, SE_NOT_EFFECTIVE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
break; break;
case MOVE_RESULT_DOESNT_AFFECT_FOE: case MOVE_RESULT_DOESNT_AFFECT_FOE:
@@ -2026,17 +2026,17 @@ static void Cmd_effectivenesssound(void)
default: default:
if (gMoveResultFlags & MOVE_RESULT_SUPER_EFFECTIVE) if (gMoveResultFlags & MOVE_RESULT_SUPER_EFFECTIVE)
{ {
BtlController_EmitPlaySE(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, SE_SUPER_EFFECTIVE); BtlController_EmitPlaySE(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, SE_SUPER_EFFECTIVE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
else if (gMoveResultFlags & MOVE_RESULT_NOT_VERY_EFFECTIVE) else if (gMoveResultFlags & MOVE_RESULT_NOT_VERY_EFFECTIVE)
{ {
BtlController_EmitPlaySE(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, SE_NOT_EFFECTIVE); BtlController_EmitPlaySE(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, SE_NOT_EFFECTIVE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
else if (!(gMoveResultFlags & (MOVE_RESULT_DOESNT_AFFECT_FOE | MOVE_RESULT_FAILED))) else if (!(gMoveResultFlags & (MOVE_RESULT_DOESNT_AFFECT_FOE | MOVE_RESULT_FAILED)))
{ {
BtlController_EmitPlaySE(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, SE_EFFECTIVE); BtlController_EmitPlaySE(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, SE_EFFECTIVE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
break; break;
@@ -2149,7 +2149,7 @@ static void Cmd_printselectionstring(void)
{ {
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
BtlController_EmitPrintSelectionString(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, T2_READ_16(gBattlescriptCurrInstr + 1)); BtlController_EmitPrintSelectionString(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, T2_READ_16(gBattlescriptCurrInstr + 1));
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 3; gBattlescriptCurrInstr += 3;
@@ -2199,7 +2199,7 @@ static void Cmd_printselectionstringfromtable(void)
ptr += gBattleCommunication[MULTISTRING_CHOOSER]; ptr += gBattleCommunication[MULTISTRING_CHOOSER];
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
BtlController_EmitPrintSelectionString(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, *ptr); BtlController_EmitPrintSelectionString(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, *ptr);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 5; gBattlescriptCurrInstr += 5;
@@ -2485,7 +2485,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleCommunication[MOVE_EFFECT_BYTE]]; gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleCommunication[MOVE_EFFECT_BYTE]];
gActiveBattler = gEffectBattler; gActiveBattler = gEffectBattler;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gEffectBattler].status1), &gBattleMons[gEffectBattler].status1); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gEffectBattler].status1), &gBattleMons[gEffectBattler].status1);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT) if (gHitMarker & HITMARKER_STATUS_ABILITY_EFFECT)
@@ -2787,11 +2787,11 @@ void SetMoveEffect(bool8 primary, u8 certain)
gBattleMons[gBattlerTarget].item = ITEM_NONE; gBattleMons[gBattlerTarget].item = ITEM_NONE;
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_HELDITEM_BATTLE, 0, sizeof(gLastUsedItem), &gLastUsedItem); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_HELDITEM_BATTLE, 0, sizeof(gLastUsedItem), &gLastUsedItem);
MarkBattlerForControllerExec(gBattlerAttacker); MarkBattlerForControllerExec(gBattlerAttacker);
gActiveBattler = gBattlerTarget; gActiveBattler = gBattlerTarget;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].item), &gBattleMons[gBattlerTarget].item); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].item), &gBattleMons[gBattlerTarget].item);
MarkBattlerForControllerExec(gBattlerTarget); MarkBattlerForControllerExec(gBattlerTarget);
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
@@ -2829,7 +2829,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
gBattleMons[gBattlerTarget].status1 &= ~STATUS1_PARALYSIS; gBattleMons[gBattlerTarget].status1 &= ~STATUS1_PARALYSIS;
gActiveBattler = gBattlerTarget; gActiveBattler = gBattlerTarget;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
@@ -3036,7 +3036,7 @@ static void Cmd_tryfaintmon(void)
BattleScriptPush(gBattlescriptCurrInstr); BattleScriptPush(gBattlescriptCurrInstr);
gBattlescriptCurrInstr = BattleScript_GrudgeTakesPp; gBattlescriptCurrInstr = BattleScript_GrudgeTakesPp;
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, moveIndex + REQUEST_PPMOVE1_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].pp[moveIndex]), &gBattleMons[gActiveBattler].pp[moveIndex]); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, moveIndex + REQUEST_PPMOVE1_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].pp[moveIndex]), &gBattleMons[gActiveBattler].pp[moveIndex]);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
PREPARE_MOVE_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerAttacker].moves[moveIndex]) PREPARE_MOVE_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerAttacker].moves[moveIndex])
@@ -3054,7 +3054,7 @@ static void Cmd_dofaintanimation(void)
if (gBattleControllerExecFlags == 0) if (gBattleControllerExecFlags == 0)
{ {
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
BtlController_EmitFaintAnimation(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitFaintAnimation(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 2; gBattlescriptCurrInstr += 2;
} }
@@ -3069,7 +3069,7 @@ static void Cmd_cleareffectsonfaint(void)
if (!(gBattleTypeFlags & BATTLE_TYPE_ARENA) || gBattleMons[gActiveBattler].hp == 0) if (!(gBattleTypeFlags & BATTLE_TYPE_ARENA) || gBattleMons[gActiveBattler].hp == 0)
{ {
gBattleMons[gActiveBattler].status1 = 0; gBattleMons[gActiveBattler].status1 = 0;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
@@ -3438,7 +3438,7 @@ static void Cmd_getexp(void)
gBattleResources->beforeLvlUp->stats[STAT_SPDEF] = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPDEF); gBattleResources->beforeLvlUp->stats[STAT_SPDEF] = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPDEF);
gActiveBattler = gBattleStruct->expGetterBattlerId; gActiveBattler = gBattleStruct->expGetterBattlerId;
BtlController_EmitExpUpdate(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gBattleStruct->expGetterMonId, gBattleMoveDamage); BtlController_EmitExpUpdate(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, gBattleStruct->expGetterMonId, gBattleMoveDamage);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
gBattleScripting.getexpState++; gBattleScripting.getexpState++;
@@ -3937,7 +3937,7 @@ static void Cmd_healthbar_update(void)
else else
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
BtlController_EmitHealthBarUpdate(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gBattleMoveDamage); BtlController_EmitHealthBarUpdate(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, gBattleMoveDamage);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 2; gBattlescriptCurrInstr += 2;
} }
@@ -4012,7 +4012,7 @@ static void Cmd_playanimation(void)
|| gBattlescriptCurrInstr[2] == B_ANIM_SNATCH_MOVE || gBattlescriptCurrInstr[2] == B_ANIM_SNATCH_MOVE
|| gBattlescriptCurrInstr[2] == B_ANIM_SUBSTITUTE_FADE) || gBattlescriptCurrInstr[2] == B_ANIM_SUBSTITUTE_FADE)
{ {
BtlController_EmitBattleAnimation(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gBattlescriptCurrInstr[2], *argumentPtr); BtlController_EmitBattleAnimation(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, gBattlescriptCurrInstr[2], *argumentPtr);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 7; gBattlescriptCurrInstr += 7;
} }
@@ -4026,7 +4026,7 @@ static void Cmd_playanimation(void)
|| gBattlescriptCurrInstr[2] == B_ANIM_SANDSTORM_CONTINUES || gBattlescriptCurrInstr[2] == B_ANIM_SANDSTORM_CONTINUES
|| gBattlescriptCurrInstr[2] == B_ANIM_HAIL_CONTINUES) || gBattlescriptCurrInstr[2] == B_ANIM_HAIL_CONTINUES)
{ {
BtlController_EmitBattleAnimation(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gBattlescriptCurrInstr[2], *argumentPtr); BtlController_EmitBattleAnimation(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, gBattlescriptCurrInstr[2], *argumentPtr);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 7; gBattlescriptCurrInstr += 7;
} }
@@ -4036,7 +4036,7 @@ static void Cmd_playanimation(void)
} }
else else
{ {
BtlController_EmitBattleAnimation(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gBattlescriptCurrInstr[2], *argumentPtr); BtlController_EmitBattleAnimation(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, gBattlescriptCurrInstr[2], *argumentPtr);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 7; gBattlescriptCurrInstr += 7;
} }
@@ -4056,7 +4056,7 @@ static void Cmd_playanimation_var(void)
|| *animationIdPtr == B_ANIM_SNATCH_MOVE || *animationIdPtr == B_ANIM_SNATCH_MOVE
|| *animationIdPtr == B_ANIM_SUBSTITUTE_FADE) || *animationIdPtr == B_ANIM_SUBSTITUTE_FADE)
{ {
BtlController_EmitBattleAnimation(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, *animationIdPtr, *argumentPtr); BtlController_EmitBattleAnimation(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, *animationIdPtr, *argumentPtr);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 10; gBattlescriptCurrInstr += 10;
} }
@@ -4069,7 +4069,7 @@ static void Cmd_playanimation_var(void)
|| *animationIdPtr == B_ANIM_SANDSTORM_CONTINUES || *animationIdPtr == B_ANIM_SANDSTORM_CONTINUES
|| *animationIdPtr == B_ANIM_HAIL_CONTINUES) || *animationIdPtr == B_ANIM_HAIL_CONTINUES)
{ {
BtlController_EmitBattleAnimation(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, *animationIdPtr, *argumentPtr); BtlController_EmitBattleAnimation(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, *animationIdPtr, *argumentPtr);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 10; gBattlescriptCurrInstr += 10;
} }
@@ -4079,7 +4079,7 @@ static void Cmd_playanimation_var(void)
} }
else else
{ {
BtlController_EmitBattleAnimation(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, *animationIdPtr, *argumentPtr); BtlController_EmitBattleAnimation(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, *animationIdPtr, *argumentPtr);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 10; gBattlescriptCurrInstr += 10;
} }
@@ -4195,7 +4195,7 @@ static void Cmd_playstatchangeanimation(void)
} }
else if (changeableStatsCount != 0 && !gBattleScripting.statAnimPlayed) else if (changeableStatsCount != 0 && !gBattleScripting.statAnimPlayed)
{ {
BtlController_EmitBattleAnimation(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, B_ANIM_STATS_CHANGE, statAnimId); BtlController_EmitBattleAnimation(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, B_ANIM_STATS_CHANGE, statAnimId);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
if (gBattlescriptCurrInstr[3] & STAT_CHANGE_MULTIPLE_STATS && changeableStatsCount > 1) if (gBattlescriptCurrInstr[3] & STAT_CHANGE_MULTIPLE_STATS && changeableStatsCount > 1)
gBattleScripting.statAnimPlayed = TRUE; gBattleScripting.statAnimPlayed = TRUE;
@@ -4264,7 +4264,7 @@ static void Cmd_moveend(void)
{ {
gBattleMons[gBattlerTarget].status1 &= ~STATUS1_FREEZE; gBattleMons[gBattlerTarget].status1 &= ~STATUS1_FREEZE;
gActiveBattler = gBattlerTarget; gActiveBattler = gBattlerTarget;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].status1), &gBattleMons[gBattlerTarget].status1); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].status1), &gBattleMons[gBattlerTarget].status1);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_DefrostedViaFireMove; gBattlescriptCurrInstr = BattleScript_DefrostedViaFireMove;
@@ -4343,7 +4343,7 @@ static void Cmd_moveend(void)
&& gHitMarker & HITMARKER_NO_ANIMATIONS) && gHitMarker & HITMARKER_NO_ANIMATIONS)
{ {
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
BtlController_EmitSpriteInvisibility(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, TRUE); BtlController_EmitSpriteInvisibility(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, TRUE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattleScripting.moveendState++; gBattleScripting.moveendState++;
return; return;
@@ -4356,7 +4356,7 @@ static void Cmd_moveend(void)
|| WasUnableToUseMove(gBattlerAttacker)) || WasUnableToUseMove(gBattlerAttacker))
{ {
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
BtlController_EmitSpriteInvisibility(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, FALSE); BtlController_EmitSpriteInvisibility(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, FALSE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gStatuses3[gBattlerAttacker] &= ~STATUS3_SEMI_INVULNERABLE; gStatuses3[gBattlerAttacker] &= ~STATUS3_SEMI_INVULNERABLE;
gSpecialStatuses[gBattlerAttacker].restoredBattlerSprite = 1; gSpecialStatuses[gBattlerAttacker].restoredBattlerSprite = 1;
@@ -4370,7 +4370,7 @@ static void Cmd_moveend(void)
&& !(gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE)) && !(gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE))
{ {
gActiveBattler = gBattlerTarget; gActiveBattler = gBattlerTarget;
BtlController_EmitSpriteInvisibility(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, FALSE); BtlController_EmitSpriteInvisibility(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, FALSE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gStatuses3[gBattlerTarget] &= ~STATUS3_SEMI_INVULNERABLE; gStatuses3[gBattlerTarget] &= ~STATUS3_SEMI_INVULNERABLE;
gBattleScripting.moveendState++; gBattleScripting.moveendState++;
@@ -4597,7 +4597,7 @@ static void Cmd_returnatktoball(void)
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
if (!(gHitMarker & HITMARKER_FAINTED(gActiveBattler))) if (!(gHitMarker & HITMARKER_FAINTED(gActiveBattler)))
{ {
BtlController_EmitReturnMonToBall(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, FALSE); BtlController_EmitReturnMonToBall(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, FALSE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
@@ -4612,7 +4612,7 @@ static void Cmd_getswitchedmondata(void)
gBattlerPartyIndexes[gActiveBattler] = *(gBattleStruct->monToSwitchIntoId + gActiveBattler); gBattlerPartyIndexes[gActiveBattler] = *(gBattleStruct->monToSwitchIntoId + gActiveBattler);
BtlController_EmitGetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_ALL_BATTLE, gBitTable[gBattlerPartyIndexes[gActiveBattler]]); BtlController_EmitGetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_ALL_BATTLE, gBitTable[gBattlerPartyIndexes[gActiveBattler]]);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 2; gBattlescriptCurrInstr += 2;
@@ -4688,7 +4688,7 @@ static void Cmd_switchinanim(void)
gAbsentBattlerFlags &= ~(gBitTable[gActiveBattler]); gAbsentBattlerFlags &= ~(gBitTable[gActiveBattler]);
BtlController_EmitSwitchInAnim(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gBattlerPartyIndexes[gActiveBattler], gBattlescriptCurrInstr[2]); BtlController_EmitSwitchInAnim(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, gBattlerPartyIndexes[gActiveBattler], gBattlescriptCurrInstr[2]);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 3; gBattlescriptCurrInstr += 3;
@@ -4858,7 +4858,7 @@ static void ChooseMonToSendOut(u8 slotId)
*(gBattleStruct->monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; *(gBattleStruct->monToSwitchIntoId + gActiveBattler) = PARTY_SIZE;
gBattleStruct->field_93 &= ~(gBitTable[gActiveBattler]); gBattleStruct->field_93 &= ~(gBitTable[gActiveBattler]);
BtlController_EmitChoosePokemon(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, PARTY_ACTION_SEND_OUT, slotId, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]); BtlController_EmitChoosePokemon(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, PARTY_ACTION_SEND_OUT, slotId, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
@@ -4885,7 +4885,7 @@ static void Cmd_openpartyscreen(void)
{ {
gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler); gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
BtlController_EmitLinkStandbyMsg(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE); BtlController_EmitLinkStandbyMsg(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement) else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement)
@@ -4896,7 +4896,7 @@ static void Cmd_openpartyscreen(void)
} }
else else
{ {
BtlController_EmitLinkStandbyMsg(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE); BtlController_EmitLinkStandbyMsg(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
} }
@@ -4914,7 +4914,7 @@ static void Cmd_openpartyscreen(void)
{ {
gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler); gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
BtlController_EmitCantSwitch(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitCantSwitch(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement) else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement)
@@ -4924,7 +4924,7 @@ static void Cmd_openpartyscreen(void)
} }
else else
{ {
BtlController_EmitLinkStandbyMsg(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE); BtlController_EmitLinkStandbyMsg(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
flags |= 1; flags |= 1;
} }
@@ -4936,7 +4936,7 @@ static void Cmd_openpartyscreen(void)
{ {
gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler); gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
BtlController_EmitCantSwitch(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitCantSwitch(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement) else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement)
@@ -4946,7 +4946,7 @@ static void Cmd_openpartyscreen(void)
} }
else if (!(flags & 1)) else if (!(flags & 1))
{ {
BtlController_EmitLinkStandbyMsg(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE); BtlController_EmitLinkStandbyMsg(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
} }
@@ -4957,7 +4957,7 @@ static void Cmd_openpartyscreen(void)
{ {
gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler); gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
BtlController_EmitCantSwitch(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitCantSwitch(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement) else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement)
@@ -4967,7 +4967,7 @@ static void Cmd_openpartyscreen(void)
} }
else else
{ {
BtlController_EmitLinkStandbyMsg(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE); BtlController_EmitLinkStandbyMsg(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
flags |= 2; flags |= 2;
} }
@@ -4979,7 +4979,7 @@ static void Cmd_openpartyscreen(void)
{ {
gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler); gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
BtlController_EmitCantSwitch(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitCantSwitch(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement) else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement)
@@ -4989,7 +4989,7 @@ static void Cmd_openpartyscreen(void)
} }
else if (!(flags & 2)) else if (!(flags & 2))
{ {
BtlController_EmitLinkStandbyMsg(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE); BtlController_EmitLinkStandbyMsg(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
} }
@@ -5005,7 +5005,7 @@ static void Cmd_openpartyscreen(void)
else else
gActiveBattler = 0; gActiveBattler = 0;
BtlController_EmitLinkStandbyMsg(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE); BtlController_EmitLinkStandbyMsg(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
@@ -5021,7 +5021,7 @@ static void Cmd_openpartyscreen(void)
else else
gActiveBattler = 1; gActiveBattler = 1;
BtlController_EmitLinkStandbyMsg(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE); BtlController_EmitLinkStandbyMsg(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
} }
@@ -5042,7 +5042,7 @@ static void Cmd_openpartyscreen(void)
{ {
gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler); gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
BtlController_EmitCantSwitch(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitCantSwitch(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement) else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement)
@@ -5058,7 +5058,7 @@ static void Cmd_openpartyscreen(void)
{ {
gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler); gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
BtlController_EmitCantSwitch(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitCantSwitch(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement) else if (!gSpecialStatuses[gActiveBattler].faintedHasReplacement)
@@ -5117,7 +5117,7 @@ static void Cmd_openpartyscreen(void)
*(gBattleStruct->monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; *(gBattleStruct->monToSwitchIntoId + gActiveBattler) = PARTY_SIZE;
gBattleStruct->field_93 &= ~(gBitTable[gActiveBattler]); gBattleStruct->field_93 &= ~(gBitTable[gActiveBattler]);
BtlController_EmitChoosePokemon(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, hitmarkerFaintBits, *(gBattleStruct->monToSwitchIntoId + BATTLE_PARTNER(gActiveBattler)), ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]); BtlController_EmitChoosePokemon(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, hitmarkerFaintBits, *(gBattleStruct->monToSwitchIntoId + BATTLE_PARTNER(gActiveBattler)), ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 6; gBattlescriptCurrInstr += 6;
@@ -5131,7 +5131,7 @@ static void Cmd_openpartyscreen(void)
{ {
if (gActiveBattler != battlerId) if (gActiveBattler != battlerId)
{ {
BtlController_EmitLinkStandbyMsg(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE); BtlController_EmitLinkStandbyMsg(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
} }
@@ -5142,7 +5142,7 @@ static void Cmd_openpartyscreen(void)
if (gAbsentBattlerFlags & gBitTable[gActiveBattler]) if (gAbsentBattlerFlags & gBitTable[gActiveBattler])
gActiveBattler ^= BIT_FLANK; gActiveBattler ^= BIT_FLANK;
BtlController_EmitLinkStandbyMsg(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE); BtlController_EmitLinkStandbyMsg(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
} }
@@ -5301,7 +5301,7 @@ static void Cmd_switchineffects(void)
static void Cmd_trainerslidein(void) static void Cmd_trainerslidein(void)
{ {
gActiveBattler = GetBattlerAtPosition(gBattlescriptCurrInstr[1]); gActiveBattler = GetBattlerAtPosition(gBattlescriptCurrInstr[1]);
BtlController_EmitTrainerSlide(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitTrainerSlide(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 2; gBattlescriptCurrInstr += 2;
@@ -5310,7 +5310,7 @@ static void Cmd_trainerslidein(void)
static void Cmd_playse(void) static void Cmd_playse(void)
{ {
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
BtlController_EmitPlaySE(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, T2_READ_16(gBattlescriptCurrInstr + 1)); BtlController_EmitPlaySE(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, T2_READ_16(gBattlescriptCurrInstr + 1));
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 3; gBattlescriptCurrInstr += 3;
@@ -5319,7 +5319,7 @@ static void Cmd_playse(void)
static void Cmd_fanfare(void) static void Cmd_fanfare(void)
{ {
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
BtlController_EmitPlayFanfareOrBGM(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, T2_READ_16(gBattlescriptCurrInstr + 1), FALSE); BtlController_EmitPlayFanfareOrBGM(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, T2_READ_16(gBattlescriptCurrInstr + 1), FALSE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 3; gBattlescriptCurrInstr += 3;
@@ -5328,7 +5328,7 @@ static void Cmd_fanfare(void)
static void Cmd_playfaintcry(void) static void Cmd_playfaintcry(void)
{ {
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
BtlController_EmitFaintingCry(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitFaintingCry(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 2; gBattlescriptCurrInstr += 2;
@@ -5337,7 +5337,7 @@ static void Cmd_playfaintcry(void)
static void Cmd_endlinkbattle(void) static void Cmd_endlinkbattle(void)
{ {
gActiveBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); gActiveBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
BtlController_EmitEndLinkBattle(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gBattleOutcome); BtlController_EmitEndLinkBattle(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, gBattleOutcome);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 1; gBattlescriptCurrInstr += 1;
@@ -5346,7 +5346,7 @@ static void Cmd_endlinkbattle(void)
static void Cmd_returntoball(void) static void Cmd_returntoball(void)
{ {
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
BtlController_EmitReturnMonToBall(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, TRUE); BtlController_EmitReturnMonToBall(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, TRUE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 2; gBattlescriptCurrInstr += 2;
@@ -5565,7 +5565,7 @@ static void Cmd_hitanimation(void)
} }
else if (!(gHitMarker & HITMARKER_IGNORE_SUBSTITUTE) || !(gBattleMons[gActiveBattler].status2 & STATUS2_SUBSTITUTE) || gDisableStructs[gActiveBattler].substituteHP == 0) else if (!(gHitMarker & HITMARKER_IGNORE_SUBSTITUTE) || !(gBattleMons[gActiveBattler].status2 & STATUS2_SUBSTITUTE) || gDisableStructs[gActiveBattler].substituteHP == 0)
{ {
BtlController_EmitHitAnimation(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitHitAnimation(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 2; gBattlescriptCurrInstr += 2;
} }
@@ -5652,7 +5652,7 @@ static void Cmd_updatebattlermoves(void)
switch (gBattleCommunication[0]) switch (gBattleCommunication[0])
{ {
case 0: case 0:
BtlController_EmitGetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_ALL_BATTLE, 0); BtlController_EmitGetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_ALL_BATTLE, 0);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattleCommunication[0]++; gBattleCommunication[0]++;
break; break;
@@ -5725,7 +5725,7 @@ static void Cmd_drawpartystatussummary(void)
} }
} }
BtlController_EmitDrawPartyStatusSummary(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, hpStatuses, 1); BtlController_EmitDrawPartyStatusSummary(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, hpStatuses, 1);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 2; gBattlescriptCurrInstr += 2;
@@ -5734,7 +5734,7 @@ static void Cmd_drawpartystatussummary(void)
static void Cmd_hidepartystatussummary(void) static void Cmd_hidepartystatussummary(void)
{ {
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
BtlController_EmitHidePartyStatusSummary(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitHidePartyStatusSummary(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 2; gBattlescriptCurrInstr += 2;
@@ -5759,7 +5759,7 @@ static void Cmd_statusanimation(void)
&& gDisableStructs[gActiveBattler].substituteHP == 0 && gDisableStructs[gActiveBattler].substituteHP == 0
&& !(gHitMarker & HITMARKER_NO_ANIMATIONS)) && !(gHitMarker & HITMARKER_NO_ANIMATIONS))
{ {
BtlController_EmitStatusAnimation(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, FALSE, gBattleMons[gActiveBattler].status1); BtlController_EmitStatusAnimation(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, FALSE, gBattleMons[gActiveBattler].status1);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
gBattlescriptCurrInstr += 2; gBattlescriptCurrInstr += 2;
@@ -5778,7 +5778,7 @@ static void Cmd_status2animation(void)
&& gDisableStructs[gActiveBattler].substituteHP == 0 && gDisableStructs[gActiveBattler].substituteHP == 0
&& !(gHitMarker & HITMARKER_NO_ANIMATIONS)) && !(gHitMarker & HITMARKER_NO_ANIMATIONS))
{ {
BtlController_EmitStatusAnimation(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, TRUE, gBattleMons[gActiveBattler].status2 & wantedToAnimate); BtlController_EmitStatusAnimation(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, TRUE, gBattleMons[gActiveBattler].status2 & wantedToAnimate);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
gBattlescriptCurrInstr += 6; gBattlescriptCurrInstr += 6;
@@ -5797,7 +5797,7 @@ static void Cmd_chosenstatusanimation(void)
&& gDisableStructs[gActiveBattler].substituteHP == 0 && gDisableStructs[gActiveBattler].substituteHP == 0
&& !(gHitMarker & HITMARKER_NO_ANIMATIONS)) && !(gHitMarker & HITMARKER_NO_ANIMATIONS))
{ {
BtlController_EmitStatusAnimation(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gBattlescriptCurrInstr[2], wantedStatus); BtlController_EmitStatusAnimation(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, gBattlescriptCurrInstr[2], wantedStatus);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
gBattlescriptCurrInstr += 7; gBattlescriptCurrInstr += 7;
@@ -5908,7 +5908,7 @@ static void Cmd_removeitem(void)
*usedHeldItem = gBattleMons[gActiveBattler].item; *usedHeldItem = gBattleMons[gActiveBattler].item;
gBattleMons[gActiveBattler].item = ITEM_NONE; gBattleMons[gActiveBattler].item = ITEM_NONE;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].item), &gBattleMons[gActiveBattler].item); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].item), &gBattleMons[gActiveBattler].item);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 2; gBattlescriptCurrInstr += 2;
@@ -6217,7 +6217,7 @@ static void Cmd_setatktoplayer0(void)
static void Cmd_makevisible(void) static void Cmd_makevisible(void)
{ {
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
BtlController_EmitSpriteInvisibility(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, FALSE); BtlController_EmitSpriteInvisibility(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, FALSE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 2; gBattlescriptCurrInstr += 2;
@@ -6431,7 +6431,7 @@ static void Cmd_various(void)
gDisableStructs[1].truantSwitchInHack = 1; gDisableStructs[1].truantSwitchInHack = 1;
break; break;
case VARIOUS_EMIT_YESNOBOX: case VARIOUS_EMIT_YESNOBOX:
BtlController_EmitYesNoBox(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitYesNoBox(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
break; break;
case VARIOUS_DRAW_ARENA_REF_TEXT_BOX: case VARIOUS_DRAW_ARENA_REF_TEXT_BOX:
@@ -6456,7 +6456,7 @@ static void Cmd_various(void)
gActiveBattler = 1; gActiveBattler = 1;
if (gBattleMons[gActiveBattler].hp != 0) if (gBattleMons[gActiveBattler].hp != 0)
{ {
BtlController_EmitReturnMonToBall(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, FALSE); BtlController_EmitReturnMonToBall(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, FALSE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
break; break;
@@ -6466,7 +6466,7 @@ static void Cmd_various(void)
gActiveBattler = 3; gActiveBattler = 3;
if (gBattleMons[gActiveBattler].hp != 0) if (gBattleMons[gActiveBattler].hp != 0)
{ {
BtlController_EmitReturnMonToBall(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, FALSE); BtlController_EmitReturnMonToBall(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, FALSE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
} }
@@ -6491,7 +6491,7 @@ static void Cmd_various(void)
gBattleOutcome = B_OUTCOME_MON_TELEPORTED; gBattleOutcome = B_OUTCOME_MON_TELEPORTED;
break; break;
case VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC: case VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC:
BtlController_EmitPlayFanfareOrBGM(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, MUS_VICTORY_TRAINER, TRUE); BtlController_EmitPlayFanfareOrBGM(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, MUS_VICTORY_TRAINER, TRUE);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
break; break;
} }
@@ -6552,7 +6552,7 @@ static void Cmd_tryexplosion(void)
// Success, no battlers with Damp. Drop user's HP bar to 0 // Success, no battlers with Damp. Drop user's HP bar to 0
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
gBattleMoveDamage = gBattleMons[gActiveBattler].hp; gBattleMoveDamage = gBattleMons[gActiveBattler].hp;
BtlController_EmitHealthBarUpdate(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, INSTANT_HP_BAR_DROP); BtlController_EmitHealthBarUpdate(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, INSTANT_HP_BAR_DROP);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
@@ -6581,7 +6581,7 @@ static void Cmd_setatkhptozero(void)
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
gBattleMons[gActiveBattler].hp = 0; gBattleMons[gActiveBattler].hp = 0;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_HP_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].hp), &gBattleMons[gActiveBattler].hp); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_HP_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].hp), &gBattleMons[gActiveBattler].hp);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
@@ -6777,7 +6777,7 @@ static void Cmd_trysetrest(void)
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_REST; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_REST;
gBattleMons[gBattlerTarget].status1 = STATUS1_SLEEP_TURN(3); gBattleMons[gBattlerTarget].status1 = STATUS1_SLEEP_TURN(3);
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 5; gBattlescriptCurrInstr += 5;
} }
@@ -7727,7 +7727,7 @@ static void Cmd_updatestatusicon(void)
if (gBattlescriptCurrInstr[1] != BS_ATTACKER_WITH_PARTNER) if (gBattlescriptCurrInstr[1] != BS_ATTACKER_WITH_PARTNER)
{ {
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
BtlController_EmitStatusIconUpdate(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gBattleMons[gActiveBattler].status1, gBattleMons[gActiveBattler].status2); BtlController_EmitStatusIconUpdate(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, gBattleMons[gActiveBattler].status1, gBattleMons[gActiveBattler].status2);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 2; gBattlescriptCurrInstr += 2;
} }
@@ -7736,7 +7736,7 @@ static void Cmd_updatestatusicon(void)
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
if (!(gAbsentBattlerFlags & gBitTable[gActiveBattler])) if (!(gAbsentBattlerFlags & gBitTable[gActiveBattler]))
{ {
BtlController_EmitStatusIconUpdate(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gBattleMons[gActiveBattler].status1, gBattleMons[gActiveBattler].status2); BtlController_EmitStatusIconUpdate(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, gBattleMons[gActiveBattler].status1, gBattleMons[gActiveBattler].status2);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE))
@@ -7744,7 +7744,7 @@ static void Cmd_updatestatusicon(void)
gActiveBattler = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gBattlerAttacker))); gActiveBattler = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gBattlerAttacker)));
if (!(gAbsentBattlerFlags & gBitTable[gActiveBattler])) if (!(gAbsentBattlerFlags & gBitTable[gActiveBattler]))
{ {
BtlController_EmitStatusIconUpdate(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gBattleMons[gActiveBattler].status1, gBattleMons[gActiveBattler].status2); BtlController_EmitStatusIconUpdate(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, gBattleMons[gActiveBattler].status1, gBattleMons[gActiveBattler].status2);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
} }
@@ -7822,7 +7822,7 @@ static void Cmd_transformdataexecution(void)
} }
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
BtlController_EmitResetActionMoveSelection(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, RESET_MOVE_SELECTION); BtlController_EmitResetActionMoveSelection(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, RESET_MOVE_SELECTION);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TRANSFORMED; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TRANSFORMED;
} }
@@ -8202,7 +8202,7 @@ static void Cmd_copymovepermanently(void)
} }
movePpData.ppBonuses = gBattleMons[gBattlerAttacker].ppBonuses; movePpData.ppBonuses = gBattleMons[gBattlerAttacker].ppBonuses;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_MOVES_PP_BATTLE, 0, sizeof(movePpData), &movePpData); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_MOVES_PP_BATTLE, 0, sizeof(movePpData), &movePpData);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
PREPARE_MOVE_BUFFER(gBattleTextBuff1, gLastPrintedMoves[gBattlerTarget]) PREPARE_MOVE_BUFFER(gBattleTextBuff1, gLastPrintedMoves[gBattlerTarget])
@@ -8370,7 +8370,7 @@ static void Cmd_tryspiteppreduce(void)
if (!(gDisableStructs[gActiveBattler].mimickedMoves & gBitTable[i]) if (!(gDisableStructs[gActiveBattler].mimickedMoves & gBitTable[i])
&& !(gBattleMons[gActiveBattler].status2 & STATUS2_TRANSFORMED)) && !(gBattleMons[gActiveBattler].status2 & STATUS2_TRANSFORMED))
{ {
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_PPMOVE1_BATTLE + i, 0, sizeof(gBattleMons[gActiveBattler].pp[i]), &gBattleMons[gActiveBattler].pp[i]); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_PPMOVE1_BATTLE + i, 0, sizeof(gBattleMons[gActiveBattler].pp[i]), &gBattleMons[gActiveBattler].pp[i]);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
@@ -8481,7 +8481,7 @@ static void Cmd_healpartystatus(void)
if (toHeal) if (toHeal)
{ {
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, toHeal, sizeof(zero), &zero); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, toHeal, sizeof(zero), &zero);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
@@ -9106,7 +9106,7 @@ static void Cmd_trymemento(void)
// Success, drop user's HP bar to 0 // Success, drop user's HP bar to 0
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
gBattleMoveDamage = gBattleMons[gActiveBattler].hp; gBattleMoveDamage = gBattleMons[gActiveBattler].hp;
BtlController_EmitHealthBarUpdate(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, INSTANT_HP_BAR_DROP); BtlController_EmitHealthBarUpdate(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, INSTANT_HP_BAR_DROP);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 5; gBattlescriptCurrInstr += 5;
} }
@@ -9146,7 +9146,7 @@ static void Cmd_cureifburnedparalysedorpoisoned(void)
gBattleMons[gBattlerAttacker].status1 = 0; gBattleMons[gBattlerAttacker].status1 = 0;
gBattlescriptCurrInstr += 5; gBattlescriptCurrInstr += 5;
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].status1), &gBattleMons[gActiveBattler].status1);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
else else
@@ -9268,11 +9268,11 @@ static void Cmd_tryswapitems(void)
gBattleMons[gBattlerTarget].item = oldItemAtk; gBattleMons[gBattlerTarget].item = oldItemAtk;
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_HELDITEM_BATTLE, 0, sizeof(*newItemAtk), newItemAtk); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_HELDITEM_BATTLE, 0, sizeof(*newItemAtk), newItemAtk);
MarkBattlerForControllerExec(gBattlerAttacker); MarkBattlerForControllerExec(gBattlerAttacker);
gActiveBattler = gBattlerTarget; gActiveBattler = gBattlerTarget;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].item), &gBattleMons[gBattlerTarget].item); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gBattlerTarget].item), &gBattleMons[gBattlerTarget].item);
MarkBattlerForControllerExec(gBattlerTarget); MarkBattlerForControllerExec(gBattlerTarget);
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerTarget]) + 0) = 0; *(u8 *)((u8 *)(&gBattleStruct->choicedMove[gBattlerTarget]) + 0) = 0;
@@ -9618,7 +9618,7 @@ static void Cmd_switchoutabilities(void)
{ {
case ABILITY_NATURAL_CURE: case ABILITY_NATURAL_CURE:
gBattleMons[gActiveBattler].status1 = 0; gBattleMons[gActiveBattler].status1 = 0;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE,
gBitTable[*(gBattleStruct->battlerPartyIndexes + gActiveBattler)], gBitTable[*(gBattleStruct->battlerPartyIndexes + gActiveBattler)],
sizeof(gBattleMons[gActiveBattler].status1), sizeof(gBattleMons[gActiveBattler].status1),
&gBattleMons[gActiveBattler].status1); &gBattleMons[gActiveBattler].status1);
@@ -9758,7 +9758,7 @@ static void Cmd_docastformchangeanimation(void)
if (gBattleMons[gActiveBattler].status2 & STATUS2_SUBSTITUTE) if (gBattleMons[gActiveBattler].status2 & STATUS2_SUBSTITUTE)
*(&gBattleStruct->formToChangeInto) |= CASTFORM_SUBSTITUTE; *(&gBattleStruct->formToChangeInto) |= CASTFORM_SUBSTITUTE;
BtlController_EmitBattleAnimation(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, B_ANIM_CASTFORM_CHANGE, gBattleStruct->formToChangeInto); BtlController_EmitBattleAnimation(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, B_ANIM_CASTFORM_CHANGE, gBattleStruct->formToChangeInto);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
@@ -9840,7 +9840,7 @@ static void Cmd_tryrecycleitem(void)
*usedHeldItem = ITEM_NONE; *usedHeldItem = ITEM_NONE;
gBattleMons[gActiveBattler].item = gLastUsedItem; gBattleMons[gActiveBattler].item = gLastUsedItem;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].item), &gBattleMons[gActiveBattler].item); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_HELDITEM_BATTLE, 0, sizeof(gBattleMons[gActiveBattler].item), &gBattleMons[gActiveBattler].item);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 5; gBattlescriptCurrInstr += 5;
@@ -9937,13 +9937,13 @@ static void Cmd_handleballthrow(void)
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) if (gBattleTypeFlags & BATTLE_TYPE_TRAINER)
{ {
BtlController_EmitBallThrowAnim(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, BALL_TRAINER_BLOCK); BtlController_EmitBallThrowAnim(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, BALL_TRAINER_BLOCK);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr = BattleScript_TrainerBallBlock; gBattlescriptCurrInstr = BattleScript_TrainerBallBlock;
} }
else if (gBattleTypeFlags & BATTLE_TYPE_WALLY_TUTORIAL) else if (gBattleTypeFlags & BATTLE_TYPE_WALLY_TUTORIAL)
{ {
BtlController_EmitBallThrowAnim(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, BALL_3_SHAKES_SUCCESS); BtlController_EmitBallThrowAnim(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, BALL_3_SHAKES_SUCCESS);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr = BattleScript_WallyBallThrow; gBattlescriptCurrInstr = BattleScript_WallyBallThrow;
} }
@@ -10031,7 +10031,7 @@ static void Cmd_handleballthrow(void)
if (odds > 254) // mon caught if (odds > 254) // mon caught
{ {
BtlController_EmitBallThrowAnim(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, BALL_3_SHAKES_SUCCESS); BtlController_EmitBallThrowAnim(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, BALL_3_SHAKES_SUCCESS);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr = BattleScript_SuccessBallThrow; gBattlescriptCurrInstr = BattleScript_SuccessBallThrow;
SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_POKEBALL, &gLastUsedItem); SetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerTarget]], MON_DATA_POKEBALL, &gLastUsedItem);
@@ -10053,7 +10053,7 @@ static void Cmd_handleballthrow(void)
if (gLastUsedItem == ITEM_MASTER_BALL) if (gLastUsedItem == ITEM_MASTER_BALL)
shakes = BALL_3_SHAKES_SUCCESS; // why calculate the shakes before that check? shakes = BALL_3_SHAKES_SUCCESS; // why calculate the shakes before that check?
BtlController_EmitBallThrowAnim(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, shakes); BtlController_EmitBallThrowAnim(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, shakes);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
if (shakes == BALL_3_SHAKES_SUCCESS) // mon caught, copy of the code above if (shakes == BALL_3_SHAKES_SUCCESS) // mon caught, copy of the code above
@@ -10342,7 +10342,7 @@ static void Cmd_finishturn(void)
static void Cmd_trainerslideout(void) static void Cmd_trainerslideout(void)
{ {
gActiveBattler = GetBattlerAtPosition(gBattlescriptCurrInstr[1]); gActiveBattler = GetBattlerAtPosition(gBattlescriptCurrInstr[1]);
BtlController_EmitTrainerSlideBack(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER); BtlController_EmitTrainerSlideBack(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 2; gBattlescriptCurrInstr += 2;
+12 -12
View File
@@ -759,7 +759,7 @@ void PressurePPLose(u8 target, u8 attacker, u16 move)
if (MOVE_IS_PERMANENT(attacker, moveIndex)) if (MOVE_IS_PERMANENT(attacker, moveIndex))
{ {
gActiveBattler = attacker; gActiveBattler = attacker;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_PPMOVE1_BATTLE + moveIndex, 0, 1, &gBattleMons[gActiveBattler].pp[moveIndex]); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_PPMOVE1_BATTLE + moveIndex, 0, 1, &gBattleMons[gActiveBattler].pp[moveIndex]);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
} }
@@ -791,7 +791,7 @@ void PressurePPLoseOnUsingImprison(u8 attacker)
if (imprisonPos != MAX_MON_MOVES && MOVE_IS_PERMANENT(attacker, imprisonPos)) if (imprisonPos != MAX_MON_MOVES && MOVE_IS_PERMANENT(attacker, imprisonPos))
{ {
gActiveBattler = attacker; gActiveBattler = attacker;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_PPMOVE1_BATTLE + imprisonPos, 0, 1, &gBattleMons[gActiveBattler].pp[imprisonPos]); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_PPMOVE1_BATTLE + imprisonPos, 0, 1, &gBattleMons[gActiveBattler].pp[imprisonPos]);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
} }
@@ -822,7 +822,7 @@ void PressurePPLoseOnUsingPerishSong(u8 attacker)
if (perishSongPos != MAX_MON_MOVES && MOVE_IS_PERMANENT(attacker, perishSongPos)) if (perishSongPos != MAX_MON_MOVES && MOVE_IS_PERMANENT(attacker, perishSongPos))
{ {
gActiveBattler = attacker; gActiveBattler = attacker;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_PPMOVE1_BATTLE + perishSongPos, 0, 1, &gBattleMons[gActiveBattler].pp[perishSongPos]); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_PPMOVE1_BATTLE + perishSongPos, 0, 1, &gBattleMons[gActiveBattler].pp[perishSongPos]);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
} }
@@ -905,7 +905,7 @@ bool8 WasUnableToUseMove(u8 battler)
void PrepareStringBattle(u16 stringId, u8 battler) void PrepareStringBattle(u16 stringId, u8 battler)
{ {
gActiveBattler = battler; gActiveBattler = battler;
BtlController_EmitPrintString(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, stringId); BtlController_EmitPrintString(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, stringId);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
@@ -1634,7 +1634,7 @@ u8 DoBattlerEndTurnEffects(void)
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = 1;
BattleScriptExecute(BattleScript_MonWokeUpInUproar); BattleScriptExecute(BattleScript_MonWokeUpInUproar);
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
break; break;
} }
@@ -1759,7 +1759,7 @@ u8 DoBattlerEndTurnEffects(void)
{ {
CancelMultiTurnMoves(gActiveBattler); CancelMultiTurnMoves(gActiveBattler);
gBattleMons[gActiveBattler].status1 |= STATUS1_SLEEP_TURN((Random() & 3) + 2); // 2-5 turns of sleep gBattleMons[gActiveBattler].status1 |= STATUS1_SLEEP_TURN((Random() & 3) + 2); // 2-5 turns of sleep
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gEffectBattler = gActiveBattler; gEffectBattler = gActiveBattler;
BattleScriptExecute(BattleScript_YawnMakesAsleep); BattleScriptExecute(BattleScript_YawnMakesAsleep);
@@ -2269,7 +2269,7 @@ u8 AtkCanceller_UnableToUseMove(void)
if (effect == 2) if (effect == 2)
{ {
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
return effect; return effect;
@@ -2633,7 +2633,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE; // fix nightmare glitch gBattleMons[battler].status2 &= ~STATUS2_NIGHTMARE; // fix nightmare glitch
gBattleScripting.battler = gActiveBattler = battler; gBattleScripting.battler = gActiveBattler = battler;
BattleScriptPushCursorAndCallback(BattleScript_ShedSkinActivates); BattleScriptPushCursorAndCallback(BattleScript_ShedSkinActivates);
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[battler].status1); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[battler].status1);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
effect++; effect++;
} }
@@ -2945,7 +2945,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
gBattlescriptCurrInstr = BattleScript_AbilityCuredStatus; gBattlescriptCurrInstr = BattleScript_AbilityCuredStatus;
gBattleScripting.battler = battler; gBattleScripting.battler = battler;
gActiveBattler = battler; gActiveBattler = battler;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
return effect; return effect;
} }
@@ -3373,7 +3373,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
PREPARE_MOVE_BUFFER(gBattleTextBuff1, move); PREPARE_MOVE_BUFFER(gBattleTextBuff1, move);
BattleScriptExecute(BattleScript_BerryPPHealEnd2); BattleScriptExecute(BattleScript_BerryPPHealEnd2);
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, i + REQUEST_PPMOVE1_BATTLE, 0, 1, &changedPP); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, i + REQUEST_PPMOVE1_BATTLE, 0, 1, &changedPP);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
effect = ITEM_PP_CHANGE; effect = ITEM_PP_CHANGE;
} }
@@ -3608,7 +3608,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
switch (effect) switch (effect)
{ {
case ITEM_STATUS_CHANGE: case ITEM_STATUS_CHANGE:
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[battlerId].status1); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[battlerId].status1);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
break; break;
case ITEM_PP_CHANGE: case ITEM_PP_CHANGE:
@@ -3759,7 +3759,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gBattleScripting.battler = battlerId; gBattleScripting.battler = battlerId;
gPotentialItemEffectBattler = battlerId; gPotentialItemEffectBattler = battlerId;
gActiveBattler = battlerId; gActiveBattler = battlerId;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
break; break;
} }
+1 -1
View File
@@ -204,7 +204,7 @@ u32 BattlePalace_TryEscapeStatus(u8 battlerId)
if (effect == 2) if (effect == 2)
{ {
gActiveBattler = battlerId; gActiveBattler = battlerId;
BtlController_EmitSetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1); BtlController_EmitSetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
+1 -1
View File
@@ -5074,7 +5074,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
temp2 = gActiveBattler; temp2 = gActiveBattler;
gActiveBattler = battlerId; gActiveBattler = battlerId;
BtlController_EmitGetMonData(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, REQUEST_ALL_BATTLE, 0); BtlController_EmitGetMonData(BATTLELINKCOMMTYPE_ENGINE_TO_CONTROLLER, REQUEST_ALL_BATTLE, 0);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gActiveBattler = temp2; gActiveBattler = temp2;
} }