summaryrefslogtreecommitdiff
path: root/src/object/fan.c
diff options
context:
space:
mode:
authortheo3 <arisstephenson2@gmail.com>2020-07-13 15:27:20 -0700
committertheo3 <arisstephenson2@gmail.com>2020-07-13 15:27:20 -0700
commit62ddaaa5f6fe2dc2aaa2dd002d4ce0b1d61a3cc9 (patch)
treed625ad1b183fc6aa5b56c00ce6573ef850679731 /src/object/fan.c
parentc47f16e5e7b0abb010133b3ee1a58099d8b8915d (diff)
add subdirs
Diffstat (limited to 'src/object/fan.c')
-rw-r--r--src/object/fan.c86
1 files changed, 86 insertions, 0 deletions
diff --git a/src/object/fan.c b/src/object/fan.c
new file mode 100644
index 00000000..481e3887
--- /dev/null
+++ b/src/object/fan.c
@@ -0,0 +1,86 @@
+#include "global.h"
+#include "entity.h"
+#include "flags.h"
+
+extern void sub_0809EE34(Entity*);
+extern void sub_0809EFB0(Entity*);
+extern void sub_0809EE08(Entity*);
+extern void sub_0809F08C(void);
+extern void sub_0809EE44(Entity*);
+extern void sub_0809EE24(Entity*);
+
+extern void (*const gUnk_081243D4[])(Entity*);
+
+void Fan(Entity *this)
+{
+ gUnk_081243D4[this->action](this);
+}
+
+void sub_0809ED30(Entity *this)
+{
+ this->direction = (this->entityType.form ^ 2) << 3;
+ sub_0809EE34(this);
+ sub_0809EFB0(this);
+ InitializeAnimation(this, this->entityType.form);
+}
+
+void sub_0809ED54(Entity *this)
+{
+ u16 uVar1;
+ u32 iVar2;
+
+ if (((this->cutsceneBeh.HWORD == 0) || CheckFlags(this->cutsceneBeh.HWORD)) &&
+ ((this->entityType.parameter != 1 ||
+ (--this->field_0x74 == 0)))) {
+ sub_0809EE08(this);
+ }
+}
+
+void sub_0809ED88(Entity *this)
+{
+ sub_0809F08C();
+ sub_0809EE44(this);
+ if (this->field_0x86 != 0) {
+ if (this->cutsceneBeh.HWORD == this->field_0x86) {
+ if (CheckFlags(this->cutsceneBeh.HWORD)) {
+ return;
+ }
+ }
+ else if (!CheckFlags(this->cutsceneBeh.HWORD)) {
+ return;
+ }
+ sub_0809EE24(this);
+ }
+ else if (((this->entityType).parameter == 1) &&
+ (--this->field_0x74 == 0)) {
+ sub_0809EE24(this);
+ }
+}
+
+void sub_0809EDE4(Entity *this)
+{
+ sub_0809F08C();
+ sub_0809EE44(this);
+ if (this->frames.b.f3) {
+ sub_0809EE34(this);
+ }
+}
+
+void sub_0809EE08(Entity *this)
+{
+ this->action = 2;
+ this->field_0x74 = *((u8 *)&this->field_0x7c + 3) << 2;
+ InitializeAnimation(this, this->entityType.form);
+}
+
+void sub_0809EE24(Entity *this)
+{
+ this->action = 3;
+ InitializeAnimation(this, this->entityType.form + 4);
+}
+
+void sub_0809EE34(Entity *this)
+{
+ this->action = 1;
+ this->field_0x74 = this->actionDelay << 2;
+} \ No newline at end of file