summaryrefslogtreecommitdiff
path: root/src/anim/angel.c
diff options
context:
space:
mode:
authorProjectRevoTPP <projectrevotpp@hotmail.com>2017-11-25 02:42:34 -0500
committerProjectRevoTPP <projectrevotpp@hotmail.com>2017-11-25 02:42:34 -0500
commitbd45e6acb85fe854f58db5aa99f4004379765513 (patch)
treea4d58cc8ab37dec959602bb5e08a29c22ac7091f /src/anim/angel.c
parent75cef1d9b80094ef5b875efac3ae0f0cb1ada165 (diff)
split battle_anim_80CA710.c (todo: split asm)
Diffstat (limited to 'src/anim/angel.c')
-rwxr-xr-xsrc/anim/angel.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/anim/angel.c b/src/anim/angel.c
new file mode 100755
index 000000000..916ebfdfd
--- /dev/null
+++ b/src/anim/angel.c
@@ -0,0 +1,37 @@
+#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;
+
+// angel (a little angel descends from somewhere towards a position)
+// Used in Sweet Kiss.
+
+void sub_80D2938(struct Sprite* sprite)
+{
+ s16 r5;
+ if (sprite->data[0] == 0)
+ {
+ sprite->pos1.x += gBattleAnimArgs[0];
+ sprite->pos1.y += gBattleAnimArgs[1];
+ }
+
+ sprite->data[0]++;
+ r5 = (sprite->data[0] * 10) & 0xFF;
+ sprite->pos2.x = Sin(r5, 0x50) >> 8;
+ if (sprite->data[0] <= 0x4F)
+ sprite->pos2.y = (sprite->data[0] / 2) + (Cos(r5, 0x50) >> 8);
+
+ if (sprite->data[0] > 0x5A)
+ {
+ sprite->data[2]++;
+ sprite->pos2.x -= sprite->data[2] / 2;
+ }
+
+ if (sprite->data[0] > 0x64)
+ move_anim_8072740(sprite);
+}