From ae2602b5a576c2bcbea1c978b7943ce3c747e329 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 8 Nov 2021 11:46:38 -0500 Subject: [PATCH] Add missing BATTLER_COORD usage --- src/battle_anim_effects_1.c | 57 ++++++++++---------- src/battle_anim_effects_2.c | 104 ++++++++++++++++++------------------ src/battle_anim_effects_3.c | 76 +++++++++++++------------- src/battle_anim_electric.c | 4 +- src/battle_anim_fight.c | 52 +++++++++--------- src/battle_anim_fire.c | 12 ++--- src/battle_anim_flying.c | 30 +++++------ src/battle_anim_ghost.c | 38 ++++++------- src/battle_anim_ground.c | 28 +++++----- src/battle_anim_poison.c | 4 +- src/battle_anim_psychic.c | 4 +- src/battle_anim_rock.c | 12 ++--- src/battle_anim_water.c | 42 +++++++-------- 13 files changed, 231 insertions(+), 232 deletions(-) diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 1966250ad..9d1842176 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -2548,7 +2548,7 @@ static void AnimPetalDanceSmallFlower(struct Sprite* sprite) sprite->data[1] = sprite->x; sprite->data[2] = sprite->x; sprite->data[3] = sprite->y; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) + gBattleAnimArgs[2]; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[2]; InitAnimLinearTranslation(sprite); sprite->data[5] = 0x40; sprite->callback = AnimPetalDanceSmallFlower_Step; @@ -2971,8 +2971,8 @@ static void AnimIngrainOrb(struct Sprite* sprite) { if (!sprite->data[0]) { - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) + gBattleAnimArgs[0]; - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + gBattleAnimArgs[1]; + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) + gBattleAnimArgs[0]; + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y) + gBattleAnimArgs[1]; sprite->data[1] = gBattleAnimArgs[2]; sprite->data[2] = gBattleAnimArgs[3]; sprite->data[3] = gBattleAnimArgs[4]; @@ -3309,8 +3309,8 @@ void AnimTask_LeafBlade(u8 taskId) struct Task *task = &gTasks[taskId]; task->data[4] = GetBattlerSpriteSubpriority(gBattleAnimTarget) - 1; - task->data[6] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - task->data[7] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + task->data[6] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + task->data[7] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); task->data[10] = GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_WIDTH); task->data[11] = GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_HEIGHT); task->data[5] = (GetBattlerSide(gBattleAnimTarget) == B_SIDE_OPPONENT) ? 1 : -1; @@ -3601,11 +3601,11 @@ static void AnimFlyingParticle(struct Sprite* sprite) sprite->oam.priority = GetBattlerSpriteBGPriority(battler) + 1; break; case 2: - sprite->y = GetBattlerSpriteCoord(battler, 3) + gBattleAnimArgs[0]; + sprite->y = GetBattlerSpriteCoord(battler, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[0]; sprite->oam.priority = GetBattlerSpriteBGPriority(battler); break; case 3: - sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[0]; + sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[0]; GetAnimBattlerSpriteId(ANIM_TARGET); sprite->oam.priority = GetBattlerSpriteBGPriority(battler) + 1; break; @@ -3681,13 +3681,13 @@ static void AnimNeedleArmSpike(struct Sprite* sprite) { if (gBattleAnimArgs[0] == 0) { - a = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - b = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + a = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + b = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); } else { - a = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - b = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + a = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + b = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); } sprite->data[0] = gBattleAnimArgs[4]; @@ -3790,8 +3790,8 @@ static void AnimFlickeringPunch(struct Sprite* sprite) // arg 2: slice direction; 0 = right-to-left, 1 = left-to-right static void AnimCuttingSlice(struct Sprite* sprite) { - sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, 0); - sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, 1); + sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); + sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y); if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) sprite->y += 8; @@ -3816,32 +3816,31 @@ static void AnimCuttingSlice(struct Sprite* sprite) static void AnimAirCutterSlice(struct Sprite* sprite) { - u8 a; - u8 b; + u8 x, y; switch (gBattleAnimArgs[3]) { case 1: - a = GetBattlerSpriteCoord(BATTLE_PARTNER(gBattleAnimTarget), 0); - b = GetBattlerSpriteCoord(BATTLE_PARTNER(gBattleAnimTarget), 1); + x = GetBattlerSpriteCoord(BATTLE_PARTNER(gBattleAnimTarget), BATTLER_COORD_X); + y = GetBattlerSpriteCoord(BATTLE_PARTNER(gBattleAnimTarget), BATTLER_COORD_Y); break; case 2: - a = GetBattlerSpriteCoord(gBattleAnimTarget, 0); - b = GetBattlerSpriteCoord(gBattleAnimTarget, 1); + x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); + y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y); if (IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimTarget))) { - a = (GetBattlerSpriteCoord(BATTLE_PARTNER(gBattleAnimTarget), 0) + a) / 2; - b = (GetBattlerSpriteCoord(BATTLE_PARTNER(gBattleAnimTarget), 1) + b) / 2; + x = (GetBattlerSpriteCoord(BATTLE_PARTNER(gBattleAnimTarget), BATTLER_COORD_X) + x) / 2; + y = (GetBattlerSpriteCoord(BATTLE_PARTNER(gBattleAnimTarget), BATTLER_COORD_Y) + y) / 2; } break; case 0: default: - a = GetBattlerSpriteCoord(gBattleAnimTarget, 0); - b = GetBattlerSpriteCoord(gBattleAnimTarget, 1); + x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); + y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y); break; } - sprite->x = a; - sprite->y = b; + sprite->x = x; + sprite->y = y; if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) sprite->y += 8; @@ -3956,8 +3955,8 @@ static void AnimProtect(struct Sprite* sprite) if (IsContest()) gBattleAnimArgs[1] += 8; - sprite->x = GetBattlerSpriteCoord2(gBattleAnimAttacker, 0) + gBattleAnimArgs[0]; - sprite->y = GetBattlerSpriteCoord2(gBattleAnimAttacker, 1) + gBattleAnimArgs[1]; + sprite->x = GetBattlerSpriteCoord2(gBattleAnimAttacker, BATTLER_COORD_X) + gBattleAnimArgs[0]; + sprite->y = GetBattlerSpriteCoord2(gBattleAnimAttacker, BATTLER_COORD_Y) + gBattleAnimArgs[1]; if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER || IsContest()) sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimAttacker) + 1; else @@ -4016,8 +4015,8 @@ static void AnimProtect_Step(struct Sprite *sprite) static void AnimMilkBottle(struct Sprite* sprite) { - sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + 0xFFE8; + sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + 0xFFE8; sprite->data[0] = 0; sprite->data[1] = 0; sprite->data[2] = 0; diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index e25c71007..fcdb56a10 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -1329,8 +1329,8 @@ static void AnimVibrateBattlerBack_Step(struct Sprite *sprite) static void AnimVibrateBattlerBack(struct Sprite *sprite) { u8 spriteId; - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); spriteId = gBattlerSpriteIds[gBattleAnimTarget]; if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) sprite->x -= gBattleAnimArgs[0]; @@ -1498,8 +1498,8 @@ static void AnimSonicBoomProjectile(struct Sprite *sprite) } InitSpritePosToAnimAttacker(sprite, TRUE); - targetXPos = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[2]; - targetYPos = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; + targetXPos = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + gBattleAnimArgs[2]; + targetYPos = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[3]; rotation = ArcTan2Neg(targetXPos - sprite->x, targetYPos - sprite->y); rotation += 0xF000; if (IsContest()) @@ -1772,8 +1772,8 @@ static void AnimCoinThrow(struct Sprite *sprite) u16 var; InitSpritePosToAnimAttacker(sprite, TRUE); - r6 = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - r7 = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; + r6 = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + r7 = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[3]; if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; @@ -2467,7 +2467,7 @@ static void AnimTask_SketchDrawMon_Step(u8 taskId) static void AnimPencil(struct Sprite *sprite) { - sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, 0) - 16; + sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X) - 16; sprite->y = GetBattlerYCoordWithElevation(gBattleAnimTarget) + 16; sprite->data[0] = 0; sprite->data[1] = 0; @@ -2555,9 +2555,9 @@ static void AnimBlendThinRing(struct Sprite *sprite) { SetAverageBattlerPositions(battler, r4, &sp0, &sp1); if (r4 == 0) - r4 = GetBattlerSpriteCoord(battler, 0); + r4 = GetBattlerSpriteCoord(battler, BATTLER_COORD_X); else - r4 = GetBattlerSpriteCoord(battler, 2); + r4 = GetBattlerSpriteCoord(battler, BATTLER_COORD_X_2); if (GetBattlerSide(battler) != B_SIDE_PLAYER) gBattleAnimArgs[0] -= (sp0 - r4) - gBattleAnimArgs[0]; // This is weird. @@ -2580,14 +2580,14 @@ static void AnimHyperVoiceRing_WaitEnd(struct Sprite *sprite) static void AnimHyperVoiceRing(struct Sprite *sprite) { - u16 r9 = 0; - u16 r6 = 0; - s16 sp0 = 0; - s16 sp1 = 0; - u8 sp4; + u16 startX = 0; + u16 startY = 0; + s16 x = 0; + s16 y = 0; + u8 yCoordType; u8 battler1; u8 battler2; - u8 r10; + u8 xCoordType; if (gBattleAnimArgs[5] == 0) { @@ -2602,18 +2602,18 @@ static void AnimHyperVoiceRing(struct Sprite *sprite) if (!gBattleAnimArgs[6]) { - r10 = 0; - sp4 = 1; + xCoordType = BATTLER_COORD_X; + yCoordType = BATTLER_COORD_Y; } else { - r10 = 2; - sp4 = 3; + xCoordType = BATTLER_COORD_X_2; + yCoordType = BATTLER_COORD_Y_PIC_OFFSET; } if (GetBattlerSide(battler1) != B_SIDE_PLAYER) { - r9 = GetBattlerSpriteCoord(battler1, r10) + gBattleAnimArgs[0]; + startX = GetBattlerSpriteCoord(battler1, xCoordType) + gBattleAnimArgs[0]; if (IsBattlerSpriteVisible(BATTLE_PARTNER(battler2))) sprite->subpriority = gSprites[gBattlerSpriteIds[BATTLE_PARTNER(battler2)]].subpriority - 1; else @@ -2621,7 +2621,7 @@ static void AnimHyperVoiceRing(struct Sprite *sprite) } else { - r9 = GetBattlerSpriteCoord(battler1, r10) - gBattleAnimArgs[0]; + startX = GetBattlerSpriteCoord(battler1, xCoordType) - gBattleAnimArgs[0]; if (!IsContest() && IsBattlerSpriteVisible(BATTLE_PARTNER(battler1))) { if (gSprites[gBattlerSpriteIds[battler1]].x < gSprites[gBattlerSpriteIds[BATTLE_PARTNER(battler1)]].x) @@ -2636,27 +2636,27 @@ static void AnimHyperVoiceRing(struct Sprite *sprite) } - r6 = GetBattlerSpriteCoord(battler1, sp4) + gBattleAnimArgs[1]; + startY = GetBattlerSpriteCoord(battler1, yCoordType) + gBattleAnimArgs[1]; if (!IsContest() && IsBattlerSpriteVisible(BATTLE_PARTNER(battler2))) { - SetAverageBattlerPositions(battler2, gBattleAnimArgs[6], &sp0, &sp1); + SetAverageBattlerPositions(battler2, gBattleAnimArgs[6], &x, &y); } else { - sp0 = GetBattlerSpriteCoord(battler2, r10); - sp1 = GetBattlerSpriteCoord(battler2, sp4); + x = GetBattlerSpriteCoord(battler2, xCoordType); + y = GetBattlerSpriteCoord(battler2, yCoordType); } if (GetBattlerSide(battler2)) - sp0 += gBattleAnimArgs[3]; + x += gBattleAnimArgs[3]; else - sp0 -= gBattleAnimArgs[3]; + x -= gBattleAnimArgs[3]; - sp1 += gBattleAnimArgs[4]; - sprite->x = sprite->data[1] = r9; - sprite->y = sprite->data[3] = r6; - sprite->data[2] = sp0; - sprite->data[4] = sp1; + y += gBattleAnimArgs[4]; + sprite->x = sprite->data[1] = startX; + sprite->y = sprite->data[3] = startY; + sprite->data[2] = x; + sprite->data[4] = y; sprite->data[0] = gBattleAnimArgs[0]; InitAnimLinearTranslation(sprite); sprite->callback = AnimHyperVoiceRing_WaitEnd; @@ -2923,8 +2923,8 @@ void AnimTask_SpeedDust(u8 taskId) task->data[7] = 0; task->data[8] = 0; task->data[13] = 0; - task->data[14] = GetBattlerSpriteCoord(gBattleAnimAttacker, ANIM_ATTACKER); - task->data[15] = GetBattlerSpriteCoord(gBattleAnimAttacker, ANIM_TARGET); + task->data[14] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X); + task->data[15] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y); task->func = AnimTask_SpeedDust_Step; } @@ -3047,8 +3047,8 @@ static void AnimHealBellMusicNote(struct Sprite *sprite) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[4]; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 0) + gBattleAnimArgs[2]; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + gBattleAnimArgs[3]; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X) + gBattleAnimArgs[2]; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y) + gBattleAnimArgs[3]; sprite->callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); SetMusicNotePalette(sprite, gBattleAnimArgs[5], gBattleAnimArgs[6]); @@ -3165,9 +3165,9 @@ static void AnimRedHeartProjectile(struct Sprite *sprite) InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = 95; sprite->data[1] = sprite->x; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->data[3] = sprite->y; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); InitAnimLinearTranslation(sprite); sprite->callback = AnimRedHeartProjectile_Step; } @@ -3402,8 +3402,8 @@ static void AnimTask_ScaryFace_Step(u8 taskId) // arg 1: initial wave offset static void AnimOrbitFast(struct Sprite *sprite) { - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->affineAnimPaused = 1; sprite->data[0] = gBattleAnimArgs[0]; sprite->data[1] = gBattleAnimArgs[1]; @@ -3453,8 +3453,8 @@ static void AnimOrbitFast_Step(struct Sprite *sprite) // arg 0: initial wave offset static void AnimOrbitScatter(struct Sprite *sprite) { - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[0] = Sin(gBattleAnimArgs[0], 10); sprite->data[1] = Cos(gBattleAnimArgs[0], 7); sprite->callback = AnimOrbitScatter_Step; @@ -3479,8 +3479,8 @@ static void AnimSpitUpOrb_Step(struct Sprite *sprite) static void AnimSpitUpOrb(struct Sprite *sprite) { - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[0] = Sin(gBattleAnimArgs[0], 10); sprite->data[1] = Cos(gBattleAnimArgs[0], 7); sprite->data[2] = gBattleAnimArgs[1]; @@ -3617,13 +3617,13 @@ static void AnimMovementWaves(struct Sprite *sprite) { if (!gBattleAnimArgs[0]) { - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); } else { - sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); } if (!gBattleAnimArgs[1]) @@ -3671,8 +3671,8 @@ static void AnimJaggedMusicNote(struct Sprite *sprite) if (GetBattlerSide(battler) == B_SIDE_OPPONENT) gBattleAnimArgs[1] *= -1; - sprite->x = GetBattlerSpriteCoord(battler, 2) + gBattleAnimArgs[1]; - sprite->y = GetBattlerSpriteCoord(battler, 3) + gBattleAnimArgs[2]; + sprite->x = GetBattlerSpriteCoord(battler, BATTLER_COORD_X_2) + gBattleAnimArgs[1]; + sprite->y = GetBattlerSpriteCoord(battler, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[2]; sprite->data[0] = 0; sprite->data[1] = (u16)sprite->x << 3; sprite->data[2] = (u16)sprite->y << 3; @@ -3804,8 +3804,8 @@ static void AnimGuardRing(struct Sprite *sprite) } else { - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + 40; + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X); + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y) + 40; } sprite->data[0] = 13; diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 6bf53c5d6..cd8051998 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -1211,8 +1211,8 @@ static void AnimBlackSmoke_Step(struct Sprite *sprite) void AnimTask_SmokescreenImpact(u8 taskId) { SmokescreenImpact( - GetBattlerSpriteCoord(gBattleAnimTarget, 2) + 8, - GetBattlerSpriteCoord(gBattleAnimTarget, 3) + 8, + GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + 8, + GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + 8, 0); DestroyAnimVisualTask(taskId); } @@ -1247,8 +1247,8 @@ static void AnimWhiteHalo_Step2(struct Sprite *sprite) static void AnimTealAlert(struct Sprite *sprite) { u16 rotation; - u8 x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - u8 y = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + u8 x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + u8 y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); InitSpritePosToAnimTarget(sprite, TRUE); @@ -1608,8 +1608,8 @@ static void AnimClappingHand(struct Sprite *sprite) { if (gBattleAnimArgs[3] == 0) { - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X); + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y); } sprite->x += gBattleAnimArgs[0]; @@ -1710,13 +1710,13 @@ static void AnimRapidSpin(struct Sprite *sprite) { if (gBattleAnimArgs[0] == 0) { - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0) + gBattleAnimArgs[1]; - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X) + gBattleAnimArgs[1]; + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y); } else { - sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, 0) + gBattleAnimArgs[1]; - sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, 1); + sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X) + gBattleAnimArgs[1]; + sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y); } sprite->y2 = gBattleAnimArgs[2]; @@ -1896,8 +1896,8 @@ void AnimTask_TormentAttacker(u8 taskId) task->data[0] = 0; task->data[1] = 0; - task->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - task->data[3] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + task->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + task->data[3] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); task->data[4] = 32; task->data[5] = -20; task->data[6] = 0; @@ -2038,8 +2038,8 @@ static void AnimTriAttackTriangle(struct Sprite *sprite) sprite->x2 = 0; sprite->y2 = 0; sprite->data[0] = 20; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); sprite->callback = StartAnimLinearTranslation; } } @@ -2066,8 +2066,8 @@ static void AnimBatonPassPokeball(struct Sprite *sprite) switch (sprite->data[0]) { case 0: - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL); sprite->data[1] = 256; sprite->data[2] = 256; @@ -2222,7 +2222,7 @@ static void AnimSwallowBlueOrb(struct Sprite *sprite) case 0: InitSpritePosToAnimAttacker(sprite, FALSE); sprite->data[1] = 0x900; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[0]++; break; case 1: @@ -2476,8 +2476,8 @@ static void AnimGreenStar(struct Sprite *sprite) if (xOffset > 31) xOffset = 32 - xOffset; - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0) + xOffset; - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + 32; + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X) + xOffset; + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y) + 32; sprite->data[1] = gBattleAnimArgs[0]; sprite->data[2] = gBattleAnimArgs[1]; @@ -3246,8 +3246,8 @@ void AnimTask_RolePlaySilhouette(u8 taskId) } } - coord1 = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); - coord2 = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); + coord1 = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X); + coord2 = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y); spriteId = CreateAdditionalMonSpriteForMoveAnim(species, isBackPic, 0, coord1 + xOffset, coord2, 5, personality, otId, gBattleAnimTarget, TRUE); gSprites[spriteId].oam.priority = priority; @@ -4165,7 +4165,7 @@ static void AnimSmellingSaltsHand(struct Sprite *sprite) sprite->oam.tileNum += 16; sprite->data[6] = gBattleAnimArgs[2]; sprite->data[7] = gBattleAnimArgs[1] == 0 ? -1 : 1; - sprite->y = GetBattlerSpriteCoord(battler, 3); + sprite->y = GetBattlerSpriteCoord(battler, BATTLER_COORD_Y_PIC_OFFSET); if (gBattleAnimArgs[1] == 0) { sprite->oam.matrixNum |= ST_OAM_HFLIP; @@ -4280,12 +4280,12 @@ static void AnimSmellingSaltExclamation(struct Sprite *sprite) { if (gBattleAnimArgs[0] == ANIM_ATTACKER) { - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); sprite->y = GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_TOP); } else { - sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->y = GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_TOP); } @@ -4426,9 +4426,9 @@ void AnimTask_HelpingHandAttackerMovement(u8 taskId) { if (IsDoubleBattle() == TRUE) { - int x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); - int y = GetBattlerSpriteCoord(BATTLE_PARTNER(gBattleAnimAttacker), 0); - if (x > y) + int attackerX = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X); + int partnerX = GetBattlerSpriteCoord(BATTLE_PARTNER(gBattleAnimAttacker), BATTLER_COORD_X); + if (attackerX > partnerX) task->data[14] = 1; else task->data[14] = -1; @@ -4566,24 +4566,24 @@ static void AnimForesightMagnifyingGlass_Step(struct Sprite *sprite) sprite->data[6] = 0; case 0: case 4: - x = GetBattlerSpriteCoordAttr(sprite->data[7], 5) - 4; - y = GetBattlerSpriteCoordAttr(sprite->data[7], 3) - 4; + x = GetBattlerSpriteCoordAttr(sprite->data[7], BATTLER_COORD_ATTR_RIGHT) - 4; + y = GetBattlerSpriteCoordAttr(sprite->data[7], BATTLER_COORD_ATTR_BOTTOM) - 4; break; case 1: - x = GetBattlerSpriteCoordAttr(sprite->data[7], 5) - 4; - y = GetBattlerSpriteCoordAttr(sprite->data[7], 2) + 4; + x = GetBattlerSpriteCoordAttr(sprite->data[7], BATTLER_COORD_ATTR_RIGHT) - 4; + y = GetBattlerSpriteCoordAttr(sprite->data[7], BATTLER_COORD_ATTR_TOP) + 4; break; case 2: - x = GetBattlerSpriteCoordAttr(sprite->data[7], 4) + 4; - y = GetBattlerSpriteCoordAttr(sprite->data[7], 3) - 4; + x = GetBattlerSpriteCoordAttr(sprite->data[7], BATTLER_COORD_ATTR_LEFT) + 4; + y = GetBattlerSpriteCoordAttr(sprite->data[7], BATTLER_COORD_ATTR_BOTTOM) - 4; break; case 3: - x = GetBattlerSpriteCoordAttr(sprite->data[7], 4) + 4; - y = GetBattlerSpriteCoordAttr(sprite->data[7], 2) - 4; + x = GetBattlerSpriteCoordAttr(sprite->data[7], BATTLER_COORD_ATTR_LEFT) + 4; + y = GetBattlerSpriteCoordAttr(sprite->data[7], BATTLER_COORD_ATTR_TOP) - 4; break; case 5: - x = GetBattlerSpriteCoord(sprite->data[7], 2); - y = GetBattlerSpriteCoord(sprite->data[7], 3); + x = GetBattlerSpriteCoord(sprite->data[7], BATTLER_COORD_X_2); + y = GetBattlerSpriteCoord(sprite->data[7], BATTLER_COORD_Y_PIC_OFFSET); break; } @@ -4814,7 +4814,7 @@ static void AnimBlockX(struct Sprite *sprite) y = -96; } - sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); sprite->y2 = y; sprite->callback = AnimBlockX_Step; } diff --git a/src/battle_anim_electric.c b/src/battle_anim_electric.c index a9a876920..bd527d244 100644 --- a/src/battle_anim_electric.c +++ b/src/battle_anim_electric.c @@ -682,8 +682,8 @@ static void AnimElectricity(struct Sprite *sprite) // The vertical falling thunder bolt used in Thunder Wave/Shock/Bolt void AnimTask_ElectricBolt(u8 taskId) { - gTasks[taskId].data[0] = GetBattlerSpriteCoord(gBattleAnimTarget, 0) + gBattleAnimArgs[0]; - gTasks[taskId].data[1] = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + gBattleAnimArgs[1]; + gTasks[taskId].data[0] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X) + gBattleAnimArgs[0]; + gTasks[taskId].data[1] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + gBattleAnimArgs[1]; gTasks[taskId].data[2] = gBattleAnimArgs[2]; gTasks[taskId].func = AnimTask_ElectricBolt_Step; } diff --git a/src/battle_anim_fight.c b/src/battle_anim_fight.c index 47bb9312f..76cefcd2c 100644 --- a/src/battle_anim_fight.c +++ b/src/battle_anim_fight.c @@ -478,8 +478,8 @@ static void AnimFistOrFootRandomPos(struct Sprite *sprite) gBattleAnimArgs[2] = Random2() % 5; StartSpriteAnim(sprite, gBattleAnimArgs[2]); - sprite->x = GetBattlerSpriteCoord(battler, 2); - sprite->y = GetBattlerSpriteCoord(battler, 3); + sprite->x = GetBattlerSpriteCoord(battler, BATTLER_COORD_X_2); + sprite->y = GetBattlerSpriteCoord(battler, BATTLER_COORD_Y_PIC_OFFSET); xMod = GetBattlerSpriteCoordAttr(battler, BATTLER_COORD_ATTR_WIDTH) / 2; yMod = GetBattlerSpriteCoordAttr(battler, BATTLER_COORD_ATTR_HEIGHT) / 4; @@ -646,8 +646,8 @@ static void AnimStompFoot_Step(struct Sprite *sprite) if (--sprite->data[0] == -1) { sprite->data[0] = 6; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); sprite->callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(sprite, AnimStompFoot_End); @@ -691,13 +691,13 @@ static void AnimBrickBreakWall(struct Sprite *sprite) { if (gBattleAnimArgs[0] == ANIM_ATTACKER) { - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X); + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y); } else { - sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, 0); - sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, 1); + sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); + sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y); } sprite->x += gBattleAnimArgs[1]; @@ -745,13 +745,13 @@ static void AnimBrickBreakWallShard(struct Sprite *sprite) { if (gBattleAnimArgs[0] == ANIM_ATTACKER) { - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0) + gBattleAnimArgs[2]; - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + gBattleAnimArgs[3]; + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X) + gBattleAnimArgs[2]; + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y) + gBattleAnimArgs[3]; } else { - sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, 0) + gBattleAnimArgs[2]; - sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + gBattleAnimArgs[3]; + sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X) + gBattleAnimArgs[2]; + sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + gBattleAnimArgs[3]; } sprite->oam.tileNum += gBattleAnimArgs[1] * 16; @@ -796,8 +796,8 @@ static void AnimSuperpowerOrb(struct Sprite *sprite) { if (gBattleAnimArgs[0] == ANIM_ATTACKER) { - sprite->x = GetBattlerSpriteCoord(gBattlerAttacker, 2); - sprite->y = GetBattlerSpriteCoord(gBattlerAttacker, 3); + sprite->x = GetBattlerSpriteCoord(gBattlerAttacker, BATTLER_COORD_X_2); + sprite->y = GetBattlerSpriteCoord(gBattlerAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimAttacker); sprite->data[7] = gBattleAnimTarget; } @@ -821,9 +821,9 @@ static void AnimSuperpowerOrb_Step(struct Sprite *sprite) sprite->data[0] = 16; sprite->data[1] = sprite->x; - sprite->data[2] = GetBattlerSpriteCoord(sprite->data[7], 2); + sprite->data[2] = GetBattlerSpriteCoord(sprite->data[7], BATTLER_COORD_X_2); sprite->data[3] = sprite->y; - sprite->data[4] = GetBattlerSpriteCoord(sprite->data[7], 3); + sprite->data[4] = GetBattlerSpriteCoord(sprite->data[7], BATTLER_COORD_Y_PIC_OFFSET); InitAnimLinearTranslation(sprite); StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); @@ -865,10 +865,10 @@ static void AnimSuperpowerRock_Step1(struct Sprite *sprite) } else { - s16 pos0 = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - s16 pos1 = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); - s16 pos2 = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - s16 pos3 = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + s16 pos0 = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + s16 pos1 = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); + s16 pos2 = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + s16 pos3 = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[0] = pos2 - pos0; sprite->data[1] = pos3 - pos1; @@ -899,8 +899,8 @@ static void AnimSuperpowerFireball(struct Sprite *sprite) if (gBattleAnimArgs[0] == ANIM_ATTACKER) { - sprite->x = GetBattlerSpriteCoord(gBattlerAttacker, 2); - sprite->y = GetBattlerSpriteCoord(gBattlerAttacker, 3); + sprite->x = GetBattlerSpriteCoord(gBattlerAttacker, BATTLER_COORD_X_2); + sprite->y = GetBattlerSpriteCoord(gBattlerAttacker, BATTLER_COORD_Y_PIC_OFFSET); battler = gBattleAnimTarget; sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimAttacker); } @@ -917,9 +917,9 @@ static void AnimSuperpowerFireball(struct Sprite *sprite) sprite->data[0] = 16; sprite->data[1] = sprite->x; - sprite->data[2] = GetBattlerSpriteCoord(battler, 2); + sprite->data[2] = GetBattlerSpriteCoord(battler, BATTLER_COORD_X_2); sprite->data[3] = sprite->y; - sprite->data[4] = GetBattlerSpriteCoord(battler, 3); + sprite->data[4] = GetBattlerSpriteCoord(battler, BATTLER_COORD_Y_PIC_OFFSET); InitAnimLinearTranslation(sprite); StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); @@ -938,8 +938,8 @@ static void AnimArmThrustHit(struct Sprite *sprite) { u8 turn; - sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[1] = gBattleAnimArgs[3]; sprite->data[2] = gBattleAnimArgs[0]; sprite->data[3] = gBattleAnimArgs[1]; diff --git a/src/battle_anim_fire.c b/src/battle_anim_fire.c index 912391280..e06ebca7b 100644 --- a/src/battle_anim_fire.c +++ b/src/battle_anim_fire.c @@ -665,9 +665,9 @@ static void AnimFireRing_Step1(struct Sprite *sprite) { sprite->data[0] = 0x19; sprite->data[1] = sprite->x; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->data[3] = sprite->y; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); InitAnimLinearTranslation(sprite); @@ -681,8 +681,8 @@ static void AnimFireRing_Step2(struct Sprite *sprite) { sprite->data[0] = 0; - sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); sprite->y2 = 0; sprite->x2 = 0; @@ -1101,9 +1101,9 @@ static void AnimWillOWispOrb(struct Sprite *sprite) sprite->data[0] = 256; sprite->data[1] = sprite->x; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->data[3] = sprite->y; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); InitAnimLinearTranslationWithSpeed(sprite); sprite->callback = AnimWillOWispOrb_Step; diff --git a/src/battle_anim_flying.c b/src/battle_anim_flying.c index b1098ad80..3c6341faa 100644 --- a/src/battle_anim_flying.c +++ b/src/battle_anim_flying.c @@ -895,8 +895,8 @@ static void AnimFallingFeather_Step(struct Sprite *sprite) static void AnimUnusedBubbleThrow(struct Sprite *sprite) { sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget); - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->callback = TranslateAnimSpriteToTargetMonLocation; } @@ -955,8 +955,8 @@ void AnimTask_DrillPeckHitSplats(u8 task) gBattleAnimArgs[3] = 3; CreateSpriteAndAnimate(&gFlashingHitSplatSpriteTemplate, - GetBattlerSpriteCoord(gBattleAnimTarget, 2), - GetBattlerSpriteCoord(gBattleAnimTarget, 3), + GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2), + GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET), 3); } @@ -987,7 +987,7 @@ static void AnimBounceBallLand(struct Sprite *sprite) switch (sprite->data[0]) { case 0: - sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, 1); + sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y); sprite->y2 = -sprite->y - 32; sprite->data[0]++; break; @@ -1056,13 +1056,13 @@ static void AnimDiveWaterSplash(struct Sprite *sprite) case 0: if (!gBattleAnimArgs[0]) { - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X); + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y); } else { - sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, 0); - sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, 1); + sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); + sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y); } sprite->data[1] = 0x200; @@ -1123,13 +1123,13 @@ static void AnimSprayWaterDroplet(struct Sprite *sprite) if (gBattleAnimArgs[1] == 0) { - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + 32; + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X); + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y) + 32; } else { - sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, 0); - sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + 32; + sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); + sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + 32; } sprite->callback = AnimSprayWaterDroplet_Step; @@ -1190,8 +1190,8 @@ static void AnimSkyAttackBird(struct Sprite *sprite) s16 posx = sprite->x; s16 posy = sprite->y; - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[4] = sprite->x << 4; sprite->data[5] = sprite->y << 4; diff --git a/src/battle_anim_ghost.c b/src/battle_anim_ghost.c index 16daa4219..c6005ebc2 100644 --- a/src/battle_anim_ghost.c +++ b/src/battle_anim_ghost.c @@ -222,9 +222,9 @@ static void AnimConfuseRayBallBounce(struct Sprite *sprite) InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[1] = sprite->x; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->data[3] = sprite->y; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); InitAnimLinearTranslationWithSpeed(sprite); sprite->callback = AnimConfuseRayBallBounce_Step1; sprite->data[6] = 16; @@ -400,8 +400,8 @@ static void AnimShadowBall(struct Sprite *sprite) s16 oldPosX = sprite->x; s16 oldPosY = sprite->y; - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[0] = 0; sprite->data[1] = gBattleAnimArgs[0]; sprite->data[2] = gBattleAnimArgs[1]; @@ -431,8 +431,8 @@ static void AnimShadowBall_Step(struct Sprite *sprite) sprite->data[2] -= 1; if (sprite->data[2] > 0) break; - sprite->data[1] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->data[1] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[4] = sprite->x << 4; sprite->data[5] = sprite->y << 4; sprite->data[6] = ((sprite->data[1] - sprite->x) << 4) / sprite->data[3]; @@ -447,8 +447,8 @@ static void AnimShadowBall_Step(struct Sprite *sprite) sprite->data[3] -= 1; if (sprite->data[3] > 0) break; - sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[0] += 1; break; case 3: @@ -747,17 +747,17 @@ static void AnimDestinyBondWhiteShadow(struct Sprite *sprite) if (gBattleAnimArgs[0] == 0) { - battler1X = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); - battler1Y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + 28; - battler2X = GetBattlerSpriteCoord(gBattleAnimTarget, 0); - battler2Y = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + 28; + battler1X = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X); + battler1Y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y) + 28; + battler2X = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); + battler2Y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + 28; } else { - battler1X = GetBattlerSpriteCoord(gBattleAnimTarget, 0); - battler1Y = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + 28; - battler2X = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); - battler2Y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + 28; + battler1X = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); + battler1Y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + 28; + battler2X = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X); + battler2Y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y) + 28; } yDiff = battler2Y - battler1Y; @@ -807,7 +807,7 @@ void AnimTask_DestinyBondWhiteShadow(u8 taskId) task->data[9] = 16; task->data[10] = gBattleAnimArgs[0]; - baseX = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + baseX = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); baseY = GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_BOTTOM); if (!IsContest()) { @@ -820,7 +820,7 @@ void AnimTask_DestinyBondWhiteShadow(u8 taskId) spriteId = CreateSprite(&gDestinyBondWhiteShadowSpriteTemplate, baseX, baseY, 55); if (spriteId != MAX_SPRITES) { - x = GetBattlerSpriteCoord(battler, 2); + x = GetBattlerSpriteCoord(battler, BATTLER_COORD_X_2); y = GetBattlerSpriteCoordAttr(battler, BATTLER_COORD_ATTR_BOTTOM); gSprites[spriteId].data[0] = baseX << 4; gSprites[spriteId].data[1] = baseY << 4; @@ -1175,7 +1175,7 @@ void AnimTask_GrudgeFlames(u8 taskId) task->data[0] = 0; task->data[1] = 16; - task->data[9] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + task->data[9] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); task->data[10] = GetBattlerYCoordWithElevation(gBattleAnimAttacker); task->data[11] = (GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_WIDTH) / 2) + 8; task->data[7] = 0; diff --git a/src/battle_anim_ground.c b/src/battle_anim_ground.c index 81b3d160f..0e581035e 100644 --- a/src/battle_anim_ground.c +++ b/src/battle_anim_ground.c @@ -141,11 +141,11 @@ const struct SpriteTemplate gDirtMoundSpriteTemplate = // a boomerang. After hitting the target mon, it comes back to the user. static void AnimBonemerangProjectile(struct Sprite *sprite) { - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[0] = 20; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[5] = -40; InitAnimArcTranslation(sprite); sprite->callback = AnimBonemerangProjectile_Step; @@ -160,8 +160,8 @@ static void AnimBonemerangProjectile_Step(struct Sprite *sprite) sprite->y2 = 0; sprite->x2 = 0; sprite->data[0] = 20; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[5] = 40; InitAnimArcTranslation(sprite); sprite->callback = AnimBonemerangProjectile_End; @@ -188,8 +188,8 @@ static void AnimBoneHitProjectile(struct Sprite *sprite) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[4]; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[2]; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + gBattleAnimArgs[2]; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[3]; sprite->callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } @@ -207,8 +207,8 @@ static void AnimDirtScatter(struct Sprite *sprite) InitSpritePosToAnimAttacker(sprite, 1); - targetXPos = GetBattlerSpriteCoord2(gBattleAnimTarget, 2); - targetYPos = GetBattlerSpriteCoord2(gBattleAnimTarget, 3); + targetXPos = GetBattlerSpriteCoord2(gBattleAnimTarget, BATTLER_COORD_X_2); + targetYPos = GetBattlerSpriteCoord2(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); xOffset = Random2() & 0x1F; yOffset = Random2() & 0x1F; @@ -234,8 +234,8 @@ static void AnimMudSportDirt(struct Sprite *sprite) sprite->oam.tileNum++; if (gBattleAnimArgs[0] == 0) { - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) + gBattleAnimArgs[1]; - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) + gBattleAnimArgs[2]; + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) + gBattleAnimArgs[1]; + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[1] > 0 ? 1 : -1; sprite->callback = AnimMudSportDirtRising; } @@ -518,7 +518,7 @@ void AnimDirtPlumeParticle(struct Sprite *sprite) gBattleAnimArgs[2] *= -1; } - sprite->x = GetBattlerSpriteCoord(battler, 2) + xOffset; + sprite->x = GetBattlerSpriteCoord(battler, BATTLER_COORD_X_2) + xOffset; sprite->y = GetBattlerYCoordWithElevation(battler) + 30; sprite->data[0] = gBattleAnimArgs[5]; sprite->data[2] = sprite->x + gBattleAnimArgs[2]; @@ -549,7 +549,7 @@ static void AnimDigDirtMound(struct Sprite *sprite) else battler = gBattleAnimTarget; - sprite->x = GetBattlerSpriteCoord(battler, 0) - 16 + (gBattleAnimArgs[1] * 32); + sprite->x = GetBattlerSpriteCoord(battler, BATTLER_COORD_X) - 16 + (gBattleAnimArgs[1] * 32); sprite->y = GetBattlerYCoordWithElevation(battler) + 32; sprite->oam.tileNum += gBattleAnimArgs[1] * 8; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); diff --git a/src/battle_anim_poison.c b/src/battle_anim_poison.c index 6dedbd955..664df389d 100644 --- a/src/battle_anim_poison.c +++ b/src/battle_anim_poison.c @@ -193,8 +193,8 @@ static void AnimSludgeProjectile(struct Sprite *sprite) InitSpritePosToAnimAttacker(sprite, 1); sprite->data[0] = gBattleAnimArgs[2]; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[5] = -30; InitAnimArcTranslation(sprite); diff --git a/src/battle_anim_psychic.c b/src/battle_anim_psychic.c index c98f311bd..a7faa7658 100644 --- a/src/battle_anim_psychic.c +++ b/src/battle_anim_psychic.c @@ -650,8 +650,8 @@ static void AnimQuestionMark(struct Sprite *sprite) if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) x = -x; - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) + x; - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) + y; + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) + x; + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET) + y; if (sprite->y < 16) sprite->y = 16; diff --git a/src/battle_anim_rock.c b/src/battle_anim_rock.c index 905f51a79..f1dc4b734 100644 --- a/src/battle_anim_rock.c +++ b/src/battle_anim_rock.c @@ -564,10 +564,10 @@ void AnimTask_Rollout(u8 taskId) task = &gTasks[taskId]; - var0 = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - var1 = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + 24; - var2 = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - var3 = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + 24; + var0 = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + var1 = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y) + 24; + var2 = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + var3 = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + 24; if (BATTLE_PARTNER(gBattleAnimAttacker) == gBattleAnimTarget) var3 = var1; @@ -787,8 +787,8 @@ static void AnimRockBlastRock(struct Sprite *sprite) static void AnimRockScatter(struct Sprite *sprite) { - sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, 0); - sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, 1); + sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); + sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y); sprite->x += gBattleAnimArgs[0]; sprite->y += gBattleAnimArgs[1]; diff --git a/src/battle_anim_water.c b/src/battle_anim_water.c index 50918a24e..3d6733d47 100644 --- a/src/battle_anim_water.c +++ b/src/battle_anim_water.c @@ -517,23 +517,23 @@ static void AnimWaterBubbleProjectile(struct Sprite *sprite) if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) { - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) - gBattleAnimArgs[0]; - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) + gBattleAnimArgs[1]; + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) - gBattleAnimArgs[0]; + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[1]; sprite->animPaused = TRUE; } else { - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) + gBattleAnimArgs[0]; - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) + gBattleAnimArgs[1]; + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) + gBattleAnimArgs[0]; + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[1]; sprite->animPaused = TRUE; } if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[6]; sprite->data[1] = sprite->x; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->data[3] = sprite->y; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); InitAnimLinearTranslation(sprite); spriteId = CreateInvisibleSpriteWithCallback(SpriteCallbackDummy); sprite->data[5] = spriteId; @@ -595,9 +595,9 @@ static void AnimAuroraBeamRings(struct Sprite *sprite) unkArg = gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[4]; sprite->data[1] = sprite->x; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + unkArg; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + unkArg; sprite->data[3] = sprite->y; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[3]; InitAnimLinearTranslation(sprite); sprite->callback = AnimAuroraBeamRings_Step; sprite->affineAnimPaused = TRUE; @@ -650,9 +650,9 @@ static void AnimToTargetInSinWave(struct Sprite *sprite) InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = 30; sprite->data[1] = sprite->x; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->data[3] = sprite->y; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); InitAnimLinearTranslation(sprite); sprite->data[5] = 0xD200 / sprite->data[0]; sprite->data[7] = gBattleAnimArgs[3]; @@ -705,8 +705,8 @@ static void AnimHydroCannonCharge(struct Sprite *sprite) { u8 priority; - sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); - sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X); + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y); sprite->y2 = -10; priority = GetBattlerSpriteSubpriority(gBattleAnimAttacker); if (!IsContest()) @@ -752,14 +752,14 @@ static void AnimHydroCannonBeam(struct Sprite *sprite) else animType = FALSE; if ((u8)gBattleAnimArgs[5] == 0) - coordType = 3; + coordType = BATTLER_COORD_Y_PIC_OFFSET; else - coordType = 1; + coordType = BATTLER_COORD_Y; InitSpritePosToAnimAttacker(sprite, animType); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[4]; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[2]; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + gBattleAnimArgs[2]; sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, coordType) + gBattleAnimArgs[3]; sprite->callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); @@ -1167,8 +1167,8 @@ static u8 GetWaterSpoutPowerForAnim(void) static void CreateWaterSpoutLaunchDroplets(struct Task *task, u8 taskId) { s16 i; - s16 attackerCoordX = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - s16 attackerCoordY = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + s16 attackerCoordX = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + s16 attackerCoordY = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); s16 trigIndex = 172; u8 subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) - 1; s16 increment = 4 - task->data[1]; @@ -1341,8 +1341,8 @@ void AnimTask_WaterSport(u8 taskId) { struct Task *task = &gTasks[taskId]; - task->data[3] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - task->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + task->data[3] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + task->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); task->data[7] = (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) ? 1 : -1; if (IsContest()) task->data[7] *= -1; @@ -1514,8 +1514,8 @@ static void AnimWaterPulseRingBubble(struct Sprite *sprite) void AnimWaterPulseRing(struct Sprite *sprite) { InitSpritePosToAnimAttacker(sprite, TRUE); - sprite->data[1] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->data[1] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[3] = gBattleAnimArgs[2]; sprite->data[4] = gBattleAnimArgs[3]; sprite->callback = AnimWaterPulseRing_Step;