diff options
author | ProjectRevoTPP <projectrevotpp@hotmail.com> | 2017-11-25 02:42:34 -0500 |
---|---|---|
committer | ProjectRevoTPP <projectrevotpp@hotmail.com> | 2017-11-25 02:42:34 -0500 |
commit | bd45e6acb85fe854f58db5aa99f4004379765513 (patch) | |
tree | a4d58cc8ab37dec959602bb5e08a29c22ac7091f /src/anim/whip.c | |
parent | 75cef1d9b80094ef5b875efac3ae0f0cb1ada165 (diff) |
split battle_anim_80CA710.c (todo: split asm)
Diffstat (limited to 'src/anim/whip.c')
-rwxr-xr-x | src/anim/whip.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/anim/whip.c b/src/anim/whip.c new file mode 100755 index 000000000..3aa0758a9 --- /dev/null +++ b/src/anim/whip.c @@ -0,0 +1,46 @@ +#include "global.h" +#include "rom_8077ABC.h" +#include "trig.h" +#include "battle_anim.h" +#include "sound.h" + +extern s16 gBattleAnimArgs[]; +extern u8 gBattleAnimBankAttacker; +extern u8 gBattleAnimBankTarget; + +// whip (does a hitting animation that uses a rotating sprite to invoke the sprite getting hit.) +// Used by Slam and Vine Whip. + +void sub_80CC810(struct Sprite* sprite) +{ + if (sprite->animEnded) + move_anim_8072740(sprite); +} + +// unused, beta effect for diagonal sprite movement? +void sub_80CC82C(struct Sprite* sprite) +{ + if (GetBankSide(gBattleAnimBankAttacker) != 0) + { + sprite->pos1.x -= gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + } + else + { + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + } + + sprite->callback = sub_8078600; + StoreSpriteCallbackInData(sprite, move_anim_8072740); +} + +void sub_80CC884(struct Sprite* sprite) +{ + if (GetBankSide(gBattleAnimBankAttacker) == 0) + StartSpriteAnim(sprite, 1); + + sprite->callback = sub_80CC810; + sub_807867C(sprite, gBattleAnimArgs[0]); + sprite->pos1.y += gBattleAnimArgs[1]; +} |