summaryrefslogtreecommitdiff
path: root/src/object
diff options
context:
space:
mode:
authorjorun <contact@jorun.dev>2021-11-30 14:13:29 +0100
committerjorun <contact@jorun.dev>2021-11-30 14:13:29 +0100
commita1944ca979d4856f96f0756b937eb7995f4acdda (patch)
treedc380001a4e7ed66151cf5bb1a03f0a6a8afe5ef /src/object
parentbe225739118600bb45e2dd89bb49ec2cc2edac77 (diff)
moved fireplace.c into object folder
Diffstat (limited to 'src/object')
-rw-r--r--src/object/fireplace.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/object/fireplace.c b/src/object/fireplace.c
new file mode 100644
index 00000000..65725729
--- /dev/null
+++ b/src/object/fireplace.c
@@ -0,0 +1,50 @@
+#include "entity.h"
+#include "functions.h"
+#include "player.h"
+#include "script.h"
+#include "flags.h"
+#include "room.h"
+
+extern void (*gUnk_08123D98[])(Entity *);
+
+void sub_0809B7A0(Entity *e);
+void sub_0809B7DC(Entity *this);
+void sub_0809B7C0(Entity *this);
+
+void Fireplace(Entity *e) {
+ gUnk_08123D98[e->action](e);
+}
+
+void sub_0809B708(Entity *this) {
+ this->action = 1;
+ this->spriteSettings.draw = 1;
+ this->speed = 0x80;
+ if (CheckFlags(this->field_0x86.HWORD)) {
+ sub_0809B7DC(this);
+ DeleteThisEntity();
+ } else {
+ sub_0807B7D8(0x30b, TILE(this->x.HALF.HI, this->y.HALF.HI), 2);
+ SetTile(0x4061, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer);
+ }
+ sub_0809B7A0(this);
+}
+
+void sub_0809B7A0(Entity *this) {
+ sub_0809B7C0(this);
+ if (this->actionDelay) {
+ SetFlag(this->field_0x86.HWORD);
+ DeleteThisEntity();
+ }
+}
+
+void sub_0809B7C0(Entity *this) {
+ if (GetTileTypeByEntity(this) - 0x4061 > 1) {
+ sub_0809B7DC(this);
+ }
+}
+
+void sub_0809B7DC(Entity *this) {
+ sub_0807B7D8(0xc3 << 2, TILE(this->x.HALF.HI, this->y.HALF.HI), 2);
+ SetTile(0x4062, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer);
+ this->actionDelay = 1;
+}