summaryrefslogtreecommitdiff
path: root/src/object
diff options
context:
space:
mode:
authorTal Hayon <talhayon1@gmail.com>2022-01-09 05:33:37 +0200
committerTal Hayon <talhayon1@gmail.com>2022-01-09 05:33:37 +0200
commit0b448940d5fbcef1ba0809f2d7d1964e9d5e59d2 (patch)
tree7dbcf2fbd51a5d3a517098a11032d0526a5c4c45 /src/object
parentdd6953fac902288cf4f4c52a6029c647a6b1798e (diff)
Decompile barrelInside
Diffstat (limited to 'src/object')
-rw-r--r--src/object/barrelInside.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/object/barrelInside.c b/src/object/barrelInside.c
new file mode 100644
index 00000000..a235f4f5
--- /dev/null
+++ b/src/object/barrelInside.c
@@ -0,0 +1,30 @@
+#include "entity.h"
+
+extern u8 gUnk_08120C80[];
+extern u8 gUnk_08120C92[];
+
+void BarrelInside(Entity* this) {
+ u8* ptr;
+ if (this->action == 0) {
+ this->action = 1;
+ this->spriteSettings.draw = 1;
+ this->frameIndex = this->type;
+ this->actionDelay = 0x10;
+ this->field_0xf = 1;
+ ptr = gUnk_08120C80 + this->type * 3;
+ this->spriteRendering.b3 = *ptr;
+ this->spritePriority.b0 = *(ptr + 1);
+ this->spriteOrientation.flipY = *(ptr + 2);
+ }
+
+ if (this->type == 4) {
+ if (--this->actionDelay == 0) {
+ u32 tmp;
+ this->actionDelay = 0x10;
+ this->frameIndex = gUnk_08120C92[this->field_0xf++];
+ if (this->field_0xf == 3) {
+ this->field_0xf = 0;
+ }
+ }
+ }
+}