summaryrefslogtreecommitdiff
path: root/src/object/objectAF.c
diff options
context:
space:
mode:
authornotyouraveragehooman <65437533+notyouraveragehooman@users.noreply.github.com>2020-07-15 01:40:49 -0700
committerGitHub <noreply@github.com>2020-07-15 01:40:49 -0700
commit6b01f03ce6e5e7e54fa48917574b0c4cf66c5a3d (patch)
tree5b5aa98a20542432c8e9b0ce3c42180eb8c91a9f /src/object/objectAF.c
parentf89035be43b3c4dc7dcf511fd774679a8e74b140 (diff)
parent4b1bbd23e915f9d7a532c34359d7f7369190c5f5 (diff)
Merge branch 'master' into master
Diffstat (limited to 'src/object/objectAF.c')
-rw-r--r--src/object/objectAF.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/object/objectAF.c b/src/object/objectAF.c
new file mode 100644
index 00000000..0415398b
--- /dev/null
+++ b/src/object/objectAF.c
@@ -0,0 +1,56 @@
+#include "global.h"
+#include "entity.h"
+
+extern void sub_080A0640(Entity*);
+extern void PositionRelative(Entity*, Entity*, s32, s32);
+extern void CopyPosition(Entity*, Entity*);
+
+extern void (*const gUnk_081248C4[])(Entity*);
+
+void ObjectAF(Entity* this) {
+ gUnk_081248C4[this->action](this);
+}
+
+void sub_080A05A4(Entity* this) {
+ if ((this->entityType).form != 2) {
+ this->action = 1;
+ this->spritePriority.b0 = 6;
+ sub_080A0640(this);
+ InitializeAnimation(this, 1);
+ } else {
+ this->action = 2;
+ this->y.HALF.HI++;
+ this->height.HALF.HI = 0;
+ this->spriteOffsetY--;
+ InitializeAnimation(this, 3);
+ }
+}
+
+void sub_080A05F4(Entity* this) {
+ if (this->parent == NULL) {
+ this->action = 2;
+ InitializeAnimation(this, 2);
+ } else {
+ if (this->parent->field_0x4 == NULL) {
+ DeleteThisEntity();
+ }
+ sub_080A0640(this);
+ GetNextFrame(this);
+ }
+}
+
+void sub_080A0624(Entity* this) {
+ GetNextFrame(this);
+ if ((this->frames.b.f3) != 0) {
+ DeleteThisEntity();
+ }
+}
+
+void sub_080A0640(Entity* this) {
+ if (this->entityType.form == 0) {
+ PositionRelative(*(Entity**)(this->parent->otherEntity + 0x4), this, 0, 0x80000);
+ } else {
+ CopyPosition(this->parent, this);
+ }
+ this->height.HALF.HI = 0;
+} \ No newline at end of file