mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-02-04 10:20:01 +01:00
Use gBattlerPositions constants
This commit is contained in:
parent
4a0cad80b0
commit
c647a8329f
@ -1646,7 +1646,7 @@ void sub_8103CF0(u8 taskId)
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((gBattlerPositions[gBattleAnimTarget] & 1) == 0)
|
||||
if ((gBattlerPositions[gBattleAnimTarget] & BIT_SIDE) == B_SIDE_PLAYER)
|
||||
{
|
||||
gTasks[taskId].data[4] = 1;
|
||||
gBattleAnimArgs[0] = -gBattleAnimArgs[0];
|
||||
|
@ -234,16 +234,16 @@ static void InitSinglePlayerBtlControllers(void)
|
||||
gBattleMainFunc = BeginBattleIntro;
|
||||
|
||||
gBattlerControllerFuncs[0] = SetControllerToRecordedPlayer;
|
||||
gBattlerPositions[0] = 0;
|
||||
gBattlerPositions[0] = B_POSITION_PLAYER_LEFT;
|
||||
|
||||
gBattlerControllerFuncs[1] = SetControllerToOpponent;
|
||||
gBattlerPositions[1] = 1;
|
||||
gBattlerPositions[1] = B_POSITION_OPPONENT_LEFT;
|
||||
|
||||
gBattlerControllerFuncs[2] = SetControllerToRecordedPlayer;
|
||||
gBattlerPositions[2] = 2;
|
||||
gBattlerPositions[2] = B_POSITION_PLAYER_RIGHT;
|
||||
|
||||
gBattlerControllerFuncs[3] = SetControllerToOpponent;
|
||||
gBattlerPositions[3] = 3;
|
||||
gBattlerPositions[3] = B_POSITION_OPPONENT_RIGHT;
|
||||
|
||||
gBattlersCount = MAX_BATTLERS_COUNT;
|
||||
|
||||
@ -524,12 +524,12 @@ static void InitLinkBtlControllers(void)
|
||||
{
|
||||
case 0:
|
||||
case 3:
|
||||
gBattlerPositions[gLinkPlayers[i].id] = 0;
|
||||
gBattlerPositions[gLinkPlayers[i].id] = B_POSITION_PLAYER_LEFT;
|
||||
gBattlerPartyIndexes[gLinkPlayers[i].id] = 0;
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
gBattlerPositions[gLinkPlayers[i].id] = 2;
|
||||
gBattlerPositions[gLinkPlayers[i].id] = B_POSITION_PLAYER_RIGHT;
|
||||
gBattlerPartyIndexes[gLinkPlayers[i].id] = 3;
|
||||
break;
|
||||
}
|
||||
@ -544,12 +544,12 @@ static void InitLinkBtlControllers(void)
|
||||
{
|
||||
case 0:
|
||||
case 3:
|
||||
gBattlerPositions[gLinkPlayers[i].id] = 0;
|
||||
gBattlerPositions[gLinkPlayers[i].id] = B_POSITION_PLAYER_LEFT;
|
||||
gBattlerPartyIndexes[gLinkPlayers[i].id] = 0;
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
gBattlerPositions[gLinkPlayers[i].id] = 2;
|
||||
gBattlerPositions[gLinkPlayers[i].id] = B_POSITION_PLAYER_RIGHT;
|
||||
gBattlerPartyIndexes[gLinkPlayers[i].id] = 3;
|
||||
break;
|
||||
}
|
||||
@ -561,12 +561,12 @@ static void InitLinkBtlControllers(void)
|
||||
{
|
||||
case 0:
|
||||
case 3:
|
||||
gBattlerPositions[gLinkPlayers[i].id] = 1;
|
||||
gBattlerPositions[gLinkPlayers[i].id] = B_POSITION_OPPONENT_LEFT;
|
||||
gBattlerPartyIndexes[gLinkPlayers[i].id] = 0;
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
gBattlerPositions[gLinkPlayers[i].id] = 3;
|
||||
gBattlerPositions[gLinkPlayers[i].id] = B_POSITION_OPPONENT_RIGHT;
|
||||
gBattlerPartyIndexes[gLinkPlayers[i].id] = 3;
|
||||
break;
|
||||
}
|
||||
|
@ -779,7 +779,7 @@ bool8 BattleInitAllSprites(u8 *state1, u8 *battlerId)
|
||||
break;
|
||||
case 4:
|
||||
InitBattlerHealthboxCoords(*battlerId);
|
||||
if (gBattlerPositions[*battlerId] <= 1)
|
||||
if (gBattlerPositions[*battlerId] <= B_POSITION_OPPONENT_LEFT)
|
||||
DummyBattleInterfaceFunc(gHealthboxSpriteIds[*battlerId], FALSE);
|
||||
else
|
||||
DummyBattleInterfaceFunc(gHealthboxSpriteIds[*battlerId], TRUE);
|
||||
|
@ -1217,10 +1217,10 @@ static bool8 SetupContestGraphics(u8 *stateVar)
|
||||
CreateApplauseMeterSprite();
|
||||
sub_80DC5E8();
|
||||
sub_80DC7EC();
|
||||
gBattlerPositions[0] = 0;
|
||||
gBattlerPositions[1] = 1;
|
||||
gBattlerPositions[2] = 3;
|
||||
gBattlerPositions[3] = 2;
|
||||
gBattlerPositions[0] = B_POSITION_PLAYER_LEFT;
|
||||
gBattlerPositions[1] = B_POSITION_OPPONENT_LEFT;
|
||||
gBattlerPositions[2] = B_POSITION_OPPONENT_RIGHT;
|
||||
gBattlerPositions[3] = B_POSITION_PLAYER_RIGHT;
|
||||
gBattleTypeFlags = 0;
|
||||
gBattlerAttacker = 2;
|
||||
gBattlerTarget = 3;
|
||||
|
@ -1181,7 +1181,7 @@ void sub_8109DBC(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
task->data[12] = !GetBattlerSide(gBattleAnimAttacker) ? B_SIDE_OPPONENT : -1;
|
||||
task->data[12] = !GetBattlerSide(gBattleAnimAttacker) ? 1 : -1;
|
||||
task->data[13] = IsBattlerSpriteVisible(gBattleAnimTarget ^ 2) + 1;
|
||||
task->data[14] = GetAnimBattlerSpriteId(1);
|
||||
task->data[15] = GetAnimBattlerSpriteId(3);
|
||||
|
@ -1190,12 +1190,12 @@ void InitPoisonGasCloudAnim(struct Sprite *sprite)
|
||||
if (GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) < GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2))
|
||||
sprite->data[7] = 0x8000;
|
||||
|
||||
if (!(gBattlerPositions[gBattleAnimTarget] & 1))
|
||||
if ((gBattlerPositions[gBattleAnimTarget] & BIT_SIDE) == B_SIDE_PLAYER)
|
||||
{
|
||||
gBattleAnimArgs[1] = -gBattleAnimArgs[1];
|
||||
gBattleAnimArgs[3] = -gBattleAnimArgs[3];
|
||||
|
||||
if ((sprite->data[7] & 0x8000) && !(gBattlerPositions[gBattleAnimAttacker] & 1))
|
||||
if ((sprite->data[7] & 0x8000) && (gBattlerPositions[gBattleAnimAttacker] & BIT_SIDE) == B_SIDE_PLAYER)
|
||||
sprite->subpriority = gSprites[GetAnimBattlerSpriteId(ANIM_TARGET)].subpriority + 1;
|
||||
|
||||
sprite->data[6] = 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user