diff options
Diffstat (limited to 'src/battle_anim_ghost.c')
-rw-r--r-- | src/battle_anim_ghost.c | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/src/battle_anim_ghost.c b/src/battle_anim_ghost.c index e7cd4b253..03a003c60 100644 --- a/src/battle_anim_ghost.c +++ b/src/battle_anim_ghost.c @@ -221,9 +221,9 @@ static void AnimConfuseRayBallBounce(struct Sprite *sprite) { InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[2]; - sprite->data[1] = sprite->pos1.x; + sprite->data[1] = sprite->x; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - sprite->data[3] = sprite->pos1.y; + sprite->data[3] = sprite->y; sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); InitAnimLinearTranslationWithSpeed(sprite); sprite->callback = AnimConfuseRayBallBounce_Step1; @@ -243,8 +243,8 @@ static void AnimConfuseRayBallBounce_Step1(struct Sprite *sprite) return; } - sprite->pos2.x += Sin(sprite->data[5], 10); - sprite->pos2.y += Cos(sprite->data[5], 15); + sprite->x2 += Sin(sprite->data[5], 10); + sprite->y2 += Cos(sprite->data[5], 15); r2 = sprite->data[5]; sprite->data[5] = (sprite->data[5] + 5) & 0xFF; r0 = sprite->data[5]; @@ -261,8 +261,8 @@ static void AnimConfuseRayBallBounce_Step2(struct Sprite *sprite) s16 r0; sprite->data[0] = 1; AnimTranslateLinear(sprite); - sprite->pos2.x += Sin(sprite->data[5], 10); - sprite->pos2.y += Cos(sprite->data[5], 15); + sprite->x2 += Sin(sprite->data[5], 10); + sprite->y2 += Cos(sprite->data[5], 15); r2 = sprite->data[5]; sprite->data[5] = (sprite->data[5] + 5) & 0xFF; @@ -318,8 +318,8 @@ static void AnimConfuseRayBallSpiral(struct Sprite *sprite) static void AnimConfuseRayBallSpiral_Step(struct Sprite *sprite) { u16 temp1; - sprite->pos2.x = Sin(sprite->data[0], 32); - sprite->pos2.y = Cos(sprite->data[0], 8); + sprite->x2 = Sin(sprite->data[0], 32); + sprite->y2 = Cos(sprite->data[0], 8); temp1 = sprite->data[0] - 65; if (temp1 <= 130) sprite->oam.priority = 2; @@ -327,7 +327,7 @@ static void AnimConfuseRayBallSpiral_Step(struct Sprite *sprite) sprite->oam.priority = 1; sprite->data[0] = (sprite->data[0] + 19) & 0xFF; sprite->data[2] += 80; - sprite->pos2.y += sprite->data[2] >> 8; + sprite->y2 += sprite->data[2] >> 8; sprite->data[7] += 1; if (sprite->data[7] == 61) DestroyAnimSprite(sprite); @@ -397,19 +397,19 @@ static void AnimTask_NightShadeClone_Step2(u8 taskId) // arg 2: duration step 3 (center -> target) static void AnimShadowBall(struct Sprite *sprite) { - s16 oldPosX = sprite->pos1.x; - s16 oldPosY = sprite->pos1.y; + s16 oldPosX = sprite->x; + s16 oldPosY = sprite->y; - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); sprite->data[0] = 0; sprite->data[1] = gBattleAnimArgs[0]; sprite->data[2] = gBattleAnimArgs[1]; sprite->data[3] = gBattleAnimArgs[2]; - sprite->data[4] = sprite->pos1.x << 4; - sprite->data[5] = sprite->pos1.y << 4; - sprite->data[6] = ((oldPosX - sprite->pos1.x) << 4) / (gBattleAnimArgs[0] << 1); - sprite->data[7] = ((oldPosY - sprite->pos1.y) << 4) / (gBattleAnimArgs[0] << 1); + sprite->data[4] = sprite->x << 4; + sprite->data[5] = sprite->y << 4; + sprite->data[6] = ((oldPosX - sprite->x) << 4) / (gBattleAnimArgs[0] << 1); + sprite->data[7] = ((oldPosY - sprite->y) << 4) / (gBattleAnimArgs[0] << 1); sprite->callback = AnimShadowBall_Step; } @@ -420,8 +420,8 @@ static void AnimShadowBall_Step(struct Sprite *sprite) case 0: sprite->data[4] += sprite->data[6]; sprite->data[5] += sprite->data[7]; - sprite->pos1.x = sprite->data[4] >> 4; - sprite->pos1.y = sprite->data[5] >> 4; + sprite->x = sprite->data[4] >> 4; + sprite->y = sprite->data[5] >> 4; sprite->data[1] -= 1; if (sprite->data[1] > 0) break; @@ -433,22 +433,22 @@ static void AnimShadowBall_Step(struct Sprite *sprite) break; sprite->data[1] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); - sprite->data[4] = sprite->pos1.x << 4; - sprite->data[5] = sprite->pos1.y << 4; - sprite->data[6] = ((sprite->data[1] - sprite->pos1.x) << 4) / sprite->data[3]; - sprite->data[7] = ((sprite->data[2] - sprite->pos1.y) << 4) / sprite->data[3]; + sprite->data[4] = sprite->x << 4; + sprite->data[5] = sprite->y << 4; + sprite->data[6] = ((sprite->data[1] - sprite->x) << 4) / sprite->data[3]; + sprite->data[7] = ((sprite->data[2] - sprite->y) << 4) / sprite->data[3]; sprite->data[0] += 1; break; case 2: sprite->data[4] += sprite->data[6]; sprite->data[5] += sprite->data[7]; - sprite->pos1.x = sprite->data[4] >> 4; - sprite->pos1.y = sprite->data[5] >> 4; + sprite->x = sprite->data[4] >> 4; + sprite->y = sprite->data[5] >> 4; sprite->data[3] -= 1; if (sprite->data[3] > 0) break; - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, 3); sprite->data[0] += 1; break; case 3: @@ -648,7 +648,7 @@ static void AnimTask_SpiteTargetShadow_Step1(u8 taskId) task->data[15]++; break; case 2: - startLine = gSprites[task->data[13]].pos1.y + gSprites[task->data[13]].pos2.y - 32; + startLine = gSprites[task->data[13]].y + gSprites[task->data[13]].y2 - 32; if (startLine < 0) startLine = 0; @@ -770,8 +770,8 @@ static void AnimDestinyBondWhiteShadow(struct Sprite *sprite) sprite->data[6] = battler2Y; sprite->data[7] = sprite->data[4] / 2; sprite->oam.priority = 2; - sprite->pos1.x = battler1X; - sprite->pos1.y = battler1Y; + sprite->x = battler1X; + sprite->y = battler1Y; sprite->callback = AnimDestinyBondWhiteShadow_Step; sprite->invisible = TRUE; } @@ -782,8 +782,8 @@ static void AnimDestinyBondWhiteShadow_Step(struct Sprite *sprite) { sprite->data[0] += sprite->data[2]; sprite->data[1] += sprite->data[3]; - sprite->pos1.x = sprite->data[0] >> 4; - sprite->pos1.y = sprite->data[1] >> 4; + sprite->x = sprite->data[0] >> 4; + sprite->y = sprite->data[1] >> 4; if (--sprite->data[4] == 0) sprite->data[0] = 0; } @@ -1047,7 +1047,7 @@ static void AnimCurseNail(struct Sprite *sprite) xDelta2 = 2; } - sprite->pos1.x += xDelta; + sprite->x += xDelta; sprite->data[1] = xDelta2; sprite->data[0] = 60; sprite->callback = AnimCurseNail_Step1; @@ -1063,12 +1063,12 @@ static void AnimCurseNail_Step1(struct Sprite *sprite) } else { - sprite->pos2.x += sprite->data[1]; - var0 = sprite->pos2.x + 7; + sprite->x2 += sprite->data[1]; + var0 = sprite->x2 + 7; if (var0 > 14) { - sprite->pos1.x += sprite->pos2.x; - sprite->pos2.x = 0; + sprite->x += sprite->x2; + sprite->x2 = 0; sprite->oam.tileNum += 8; if (++sprite->data[2] == 3) { @@ -1125,13 +1125,13 @@ static void AnimGhostStatusSprite(struct Sprite *sprite) u16 coeffB; u16 coeffA; - sprite->pos2.x = Sin(sprite->data[0], 12); + sprite->x2 = Sin(sprite->data[0], 12); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) - sprite->pos2.x = -sprite->pos2.x; + sprite->x2 = -sprite->x2; sprite->data[0] = (sprite->data[0] + 6) & 0xFF; sprite->data[1] += 0x100; - sprite->pos2.y = -(sprite->data[1] >> 8); + sprite->y2 = -(sprite->data[1] >> 8); sprite->data[7]++; if (sprite->data[7] == 1) @@ -1284,7 +1284,7 @@ static void AnimGrudgeFlame(struct Sprite *sprite) sprite->data[2] -= 2; sprite->data[2] &= 0xFF; - sprite->pos2.x = Sin(sprite->data[2], sprite->data[3]); + sprite->x2 = Sin(sprite->data[2], sprite->data[3]); index = sprite->data[2] - 65; if (index < 127) @@ -1294,7 +1294,7 @@ static void AnimGrudgeFlame(struct Sprite *sprite) sprite->data[5]++; sprite->data[6] = (sprite->data[5] * 8) & 0xFF; - sprite->pos2.y = Sin(sprite->data[6], 7); + sprite->y2 = Sin(sprite->data[6], 7); if (gTasks[sprite->data[0]].data[8]) { gTasks[sprite->data[0]].data[7]--; @@ -1312,7 +1312,7 @@ static void AnimMonMoveCircular(struct Sprite *sprite) sprite->data[3] = gBattleAnimArgs[1]; sprite->callback = AnimMonMoveCircular_Step; - gSprites[sprite->data[5]].pos1.y += 8; + gSprites[sprite->data[5]].y += 8; } static void AnimMonMoveCircular_Step(struct Sprite *sprite) @@ -1320,17 +1320,17 @@ static void AnimMonMoveCircular_Step(struct Sprite *sprite) if (sprite->data[3]) { sprite->data[3]--; - gSprites[sprite->data[5]].pos2.x = Sin(sprite->data[0], sprite->data[1]); - gSprites[sprite->data[5]].pos2.y = Cos(sprite->data[0], sprite->data[1]); + gSprites[sprite->data[5]].x2 = Sin(sprite->data[0], sprite->data[1]); + gSprites[sprite->data[5]].y2 = Cos(sprite->data[0], sprite->data[1]); sprite->data[0] += sprite->data[2]; if (sprite->data[0] > 255) sprite->data[0] -= 256; } else { - gSprites[sprite->data[5]].pos2.x = 0; - gSprites[sprite->data[5]].pos2.y = 0; - gSprites[sprite->data[5]].pos1.y -= 8; + gSprites[sprite->data[5]].x2 = 0; + gSprites[sprite->data[5]].y2 = 0; + gSprites[sprite->data[5]].y -= 8; sprite->callback = DestroySpriteAndMatrix; } } |