summaryrefslogtreecommitdiff
path: root/src/battle/anim/moon.c
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2017-11-26 21:18:19 -0800
committerGitHub <noreply@github.com>2017-11-26 21:18:19 -0800
commite6500d12a21e9833e08ad25cc6a76b075cff42dd (patch)
treeebd886d19c3a3257b21590d558ec724ca7d6e849 /src/battle/anim/moon.c
parent0793afb9e8eeb508375344ca683f97bbc797771a (diff)
parent85dc553b949b05ec4fdc0e223c29161465a132b7 (diff)
Merge pull request #473 from ProjectRevoTPP/split_80C
split battle_anim_80CA710
Diffstat (limited to 'src/battle/anim/moon.c')
-rwxr-xr-xsrc/battle/anim/moon.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/battle/anim/moon.c b/src/battle/anim/moon.c
new file mode 100755
index 000000000..e2a31d14d
--- /dev/null
+++ b/src/battle/anim/moon.c
@@ -0,0 +1,39 @@
+#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;
+
+static void sub_80CE354(struct Sprite* sprite);
+
+// moon (shows a moon image.)
+// Used in Moonlight.
+
+void sub_80CE30C(struct Sprite* sprite)
+{
+ if (NotInBattle())
+ {
+ sprite->pos1.x = 0x30;
+ sprite->pos1.y = 0x28;
+ }
+ else
+ {
+ sprite->pos1.x = gBattleAnimArgs[0];
+ sprite->pos1.y = gBattleAnimArgs[1];
+ }
+
+ sprite->oam.shape = 0;
+ sprite->oam.size = 3;
+ sprite->data[0] = 0;
+ sprite->callback = sub_80CE354;
+}
+
+void sub_80CE354(struct Sprite* sprite)
+{
+ if (sprite->data[0])
+ move_anim_8072740(sprite);
+}