summaryrefslogtreecommitdiff
path: root/src/object
diff options
context:
space:
mode:
authorTal Hayon <talhayon1@gmail.com>2022-03-16 15:17:11 +0200
committerTal Hayon <talhayon1@gmail.com>2022-03-18 13:38:17 +0200
commitdd131b7aa0c5e7443c4eb9eee69279981944be1c (patch)
tree2989ab3a331a12f0155171faa697b1e88b02bb1c /src/object
parent38c07b5092890b9a6f528c8784ad20b0951bfffb (diff)
Decompile objectA6
Diffstat (limited to 'src/object')
-rw-r--r--src/object/objectA6.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/object/objectA6.c b/src/object/objectA6.c
new file mode 100644
index 00000000..fc77a54e
--- /dev/null
+++ b/src/object/objectA6.c
@@ -0,0 +1,51 @@
+#define NENT_DEPRECATED
+#include "entity.h"
+#include "flags.h"
+#include "hitbox.h"
+#include "effects.h"
+
+typedef struct {
+ Entity base;
+ u8 filler[0x1E];
+ u16 objFlags;
+} ObjectA6Entity;
+
+void sub_0809F920(ObjectA6Entity*);
+void sub_0809F964(ObjectA6Entity*);
+
+void ObjectA6(Entity* this) {
+ static void (*const actionFuncs[])(ObjectA6Entity*) = {
+ sub_0809F920,
+ sub_0809F964,
+ };
+
+ actionFuncs[this->action]((ObjectA6Entity*)this);
+}
+
+void sub_0809F920(ObjectA6Entity* this) {
+ if (CheckFlags(this->objFlags)) {
+ DeleteThisEntity();
+ }
+
+ super->action = 1;
+ COLLISION_ON(super);
+ super->field_0x3c = 7;
+ super->hurtType = 0x48;
+ super->hitType = 1;
+ super->flags2 = 2;
+ super->hitbox = (Hitbox*)&gHitbox_0;
+}
+
+void sub_0809F964(ObjectA6Entity* this) {
+ Entity* fxEnt;
+
+ if (super->bitfield == 0xa1) {
+ fxEnt = CreateFx(super, FX_MAGIC_STORM, 0);
+ if (fxEnt != NULL) {
+ fxEnt->spritePriority.b0 = 3;
+ fxEnt->spriteOffsetY = -5;
+ }
+ SetFlag(this->objFlags);
+ DeleteThisEntity();
+ }
+}