summaryrefslogtreecommitdiff
path: root/src/anim/anger.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/anger.c
parent75cef1d9b80094ef5b875efac3ae0f0cb1ada165 (diff)
split battle_anim_80CA710.c (todo: split asm)
Diffstat (limited to 'src/anim/anger.c')
-rwxr-xr-xsrc/anim/anger.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/anim/anger.c b/src/anim/anger.c
new file mode 100755
index 000000000..8962e0855
--- /dev/null
+++ b/src/anim/anger.c
@@ -0,0 +1,34 @@
+#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;
+
+// anger (anger emotes, usually above the Pokemon's head, indicating annoyed emotions.)
+// Used in Frustration, Rage, Swagger, Torment, and Taunt.
+
+void sub_80D09C0(struct Sprite* sprite)
+{
+ u8 bank;
+ if (gBattleAnimArgs[0] == 0)
+ bank = gBattleAnimBankAttacker;
+ else
+ bank = gBattleAnimBankTarget;
+
+ if (GetBankSide(bank) == 1)
+ {
+ gBattleAnimArgs[1] *= -1;
+ }
+
+ sprite->pos1.x = sub_8077ABC(bank, 2) + gBattleAnimArgs[1];
+ sprite->pos1.y = sub_8077ABC(bank, 3) + gBattleAnimArgs[2];
+ if (sprite->pos1.y <= 7)
+ sprite->pos1.y = 8;
+
+ StoreSpriteCallbackInData(sprite, move_anim_8074EE0);
+ sprite->callback = sub_80785E4;
+}