Clean up battle anim effects file

This commit is contained in:
DizzyEggg 2019-07-30 15:08:49 +02:00
parent bcb17af751
commit 7133f5db94
2 changed files with 25 additions and 40 deletions

View File

@ -5315,21 +5315,19 @@ static void sub_8102D8C(s16 a, s16 b, s16* c, s16* d, s8 e)
static void sub_8102DE4(struct Sprite* sprite)
{
int b;
s16 a;
int c;
s16 y, yDelta;
u8 index;
sprite->data[0]++;
b = sprite->data[0] * 5 - ((sprite->data[0] * 5 / 256) << 8);
yDelta = sprite->data[0] * 5 - ((sprite->data[0] * 5 / 256) << 8);
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->pos2.y = Sin(b, 15);
a = (u16)sprite->pos1.y;
c = (u16)sprite->pos1.x;
sprite->pos2.y = Sin(yDelta, 15);
if ((u32)((c + 16) << 16) > (0x110) << 16 || a < -16 || a > 0x80)
y = sprite->pos1.y;
if (sprite->pos1.x < -16 || sprite->pos1.x > 256 || y < -16 || y > 128)
{
DestroySpriteAndMatrix(sprite);
}
@ -5350,12 +5348,8 @@ static void sub_8102DE4(struct Sprite* sprite)
void sub_8102EB0(struct Sprite* sprite)
{
int a;
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT)
{
a = gBattleAnimArgs[1];
*(u16 *)&gBattleAnimArgs[1] = -a;
}
gBattleAnimArgs[1] *= -1;
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) + gBattleAnimArgs[1];
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) + gBattleAnimArgs[2];
@ -5541,8 +5535,8 @@ static void sub_8103300(struct Sprite* sprite)
static void sub_8103320(struct Sprite* sprite)
{
s16 temp;
s16 temp2;
s16 x1, x2;
sprite->data[1] += 4;
if (sprite->data[1] > 254)
{
@ -5564,20 +5558,21 @@ static void sub_8103320(struct Sprite* sprite)
if (sprite->data[1] > 0x9F)
sprite->subpriority = sprite->data[2];
temp = gSineTable[sprite->data[1]];
sprite->pos2.x = (temp2 = temp >> 3) + (temp2 >> 1);
x1 = gSineTable[sprite->data[1]];
x2 = x1 >> 3;
sprite->pos2.x = (x1 >> 3) + (x2 >> 1);
}
void sub_8103390(struct Sprite* sprite)
{
u8 bank;
u8 battler;
if (gBattleAnimArgs[0] == 0)
bank = gBattleAnimAttacker;
battler = gBattleAnimAttacker;
else
bank = gBattleAnimTarget;
battler = gBattleAnimTarget;
sub_810310C(bank, sprite);
if (GetBattlerSide(bank) == B_SIDE_PLAYER)
sub_810310C(battler, sprite);
if (GetBattlerSide(battler) == B_SIDE_PLAYER)
{
StartSpriteAnim(sprite, 0);
sprite->data[0] = 2;

View File

@ -2504,13 +2504,10 @@ void sub_815BE04(struct Sprite *sprite)
static void sub_815BF44(struct Sprite *sprite)
{
int var0;
s8 var1;
var0 = (u16)sprite->data[2] + (u16)sprite->data[3];
var1 = var0 >> 8;
sprite->pos2.y -= var1;
sprite->data[3] = var0 & 0xFF;
s16 delta = sprite->data[3] + sprite->data[2];
sprite->pos2.y -= delta >> 8;
sprite->data[3] += sprite->data[2];
sprite->data[3] &= 0xFF;
if (sprite->data[4] == 0 && sprite->pos2.y < -8)
{
gSprites[sprite->data[6]].invisible = 0;
@ -2543,19 +2540,12 @@ static void sub_815BFF4(struct Sprite *sprite)
static void sub_815C050(struct Sprite *sprite)
{
u16 d2;
register u16 d3 asm("r1");
int var0;
s8 var1;
if (!sprite->invisible)
{
d2 = sprite->data[2];
d3 = sprite->data[3];
var0 = d2 + d3;
var1 = var0 >> 8;
sprite->pos2.y -= var1;
sprite->data[3] = var0 & 0xFF;
s16 delta = sprite->data[3] + sprite->data[2];
sprite->pos2.y -= delta >> 8;
sprite->data[3] += sprite->data[2];
sprite->data[3] &= 0xFF;
if (--sprite->data[1] == -1)
{
sprite->invisible = 1;