diff options
author | PikalaxALT <PikalaxALT@users.noreply.github.com> | 2019-07-30 14:58:32 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-30 14:58:32 -0400 |
commit | 0aacbca46b932c24e8a055f35525182b8887e7b2 (patch) | |
tree | a90578e985d74cda346df1b6dcba70c2ad4a1f1d /src/battle_anim_effects_1.c | |
parent | cb4ba655608f4b4eded9d49a11f45c8fa316702a (diff) | |
parent | 7133f5db9441df75b14a48aea199174b2aa68e95 (diff) |
Merge pull request #759 from DizzyEggg/fix_funcs
Some nonmatchings and fakematches
Diffstat (limited to 'src/battle_anim_effects_1.c')
-rw-r--r-- | src/battle_anim_effects_1.c | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 15b73a1e0..b3a67a509 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -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; |