Use B_SIDE constants

Also includes a CHAR_X constant use for X items
This commit is contained in:
GriffinR 2019-09-04 17:06:59 -04:00 committed by GitHub
parent 5f457dd459
commit 4a0cad80b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 11 deletions

View File

@ -1841,7 +1841,7 @@ void LaunchBattleAnimation(const u8 *const animsTable[], u16 tableId, bool8 isMo
UpdateOamPriorityInAllHealthboxes(0);
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
{
if (GetBattlerSide(i) != 0)
if (GetBattlerSide(i) != B_SIDE_PLAYER)
gAnimBattlerSpecies[i] = GetMonData(&gEnemyParty[gBattlerPartyIndexes[i]], MON_DATA_SPECIES);
else
gAnimBattlerSpecies[i] = GetMonData(&gPlayerParty[gBattlerPartyIndexes[i]], MON_DATA_SPECIES);

View File

@ -3560,7 +3560,7 @@ void sub_8100640(struct Sprite* sprite)
else
battler = gBattleAnimTarget;
if (GetBattlerSide(battler) != 0)
if (GetBattlerSide(battler) != B_SIDE_PLAYER)
{
sprite->data[4] = 0;
sprite->data[2] = gBattleAnimArgs[3];
@ -3731,7 +3731,7 @@ static void sub_81009DC(struct Sprite* sprite)
void sub_81009F8(struct Sprite* sprite)
{
if (GetBattlerSide(gBattleAnimAttacker) != 0)
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
{
sprite->pos1.x -= gBattleAnimArgs[0];
sprite->pos1.y += gBattleAnimArgs[1];
@ -3828,7 +3828,7 @@ void sub_8100B88(struct Sprite* sprite)
sprite->pos1.x = a;
sprite->pos1.y = b;
if (GetBattlerSide(gBattleAnimTarget) == 0)
if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
sprite->pos1.y += 8;
sprite->callback = AnimSliceStep;

View File

@ -1479,7 +1479,7 @@ void AnimSonicBoomProjectile(struct Sprite *sprite)
{
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
}
else if (GetBattlerSide(gBattleAnimAttacker) != 0)
else if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
{
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
gBattleAnimArgs[1] = -gBattleAnimArgs[1];

View File

@ -5592,7 +5592,7 @@ static void HandleAction_UseItem(void)
else
{
PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_ATK)
PREPARE_STRING_BUFFER(gBattleTextBuff2, 0xD2)
PREPARE_STRING_BUFFER(gBattleTextBuff2, CHAR_X)
while (!((*(gBattleStruct->AI_itemFlags + (gBattlerAttacker >> 1))) & 1))
{

View File

@ -949,7 +949,7 @@ static u16 sub_8109930(u8 spriteId)
{
u16 var1 = gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y + gSprites[spriteId].centerToCornerVecY;
if (GetBattlerSide(gBattleAnimAttacker) == 0)
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
{
var1 = ((var1 << 16) + 0x4A0000) >> 16;
}
@ -1059,7 +1059,7 @@ static void sub_8109AFC(struct Sprite *sprite)
StartSpriteAnim(sprite, gBattleAnimArgs[2]);
sprite->data[7] = gBattleAnimArgs[2];
if (GetBattlerSide(gBattleAnimAttacker) != 0)
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
{
sprite->data[4] = 4;
}
@ -1073,7 +1073,7 @@ static void sub_8109AFC(struct Sprite *sprite)
break;
case 1:
sprite->data[1] += 192;
if (GetBattlerSide(gBattleAnimAttacker) != 0)
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
{
sprite->pos2.y = -(sprite->data[1] >> 8);
}
@ -1181,7 +1181,7 @@ void sub_8109DBC(u8 taskId)
{
struct Task *task = &gTasks[taskId];
task->data[12] = !GetBattlerSide(gBattleAnimAttacker) ? 1 : -1;
task->data[12] = !GetBattlerSide(gBattleAnimAttacker) ? B_SIDE_OPPONENT : -1;
task->data[13] = IsBattlerSpriteVisible(gBattleAnimTarget ^ 2) + 1;
task->data[14] = GetAnimBattlerSpriteId(1);
task->data[15] = GetAnimBattlerSpriteId(3);

View File

@ -735,7 +735,7 @@ void AnimSwirlingSnowball_Step2(struct Sprite *sprite)
void AnimSwirlingSnowball_Step3(struct Sprite *sprite)
{
s16 tempVar;
tempVar = GetBattlerSide(gBattleAnimAttacker) != 0 ? 20 : -20;
tempVar = GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER ? 20 : -20;
if (sprite->data[5] <= 31)
{