mirror of
https://github.com/zeldaret/tmc
synced 2026-08-27 16:37:14 -04:00
51 lines
1.3 KiB
C
51 lines
1.3 KiB
C
#include "object.h"
|
|
#include "functions.h"
|
|
|
|
void sub_0809B7A0(Entity* this);
|
|
void sub_0809B7DC(Entity* this);
|
|
void sub_0809B7C0(Entity* this);
|
|
void sub_0809B708(Entity* this);
|
|
|
|
void Fireplace(Entity* e) {
|
|
static void (*const actionFuncs[])(Entity*) = {
|
|
sub_0809B708,
|
|
sub_0809B7A0,
|
|
};
|
|
actionFuncs[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->timer) {
|
|
SetFlag(this->field_0x86.HWORD);
|
|
DeleteThisEntity();
|
|
}
|
|
}
|
|
|
|
void sub_0809B7C0(Entity* this) {
|
|
u32 tileType = GetTileTypeByEntity(this);
|
|
if (tileType != 0x4061 && tileType != 0x4062) {
|
|
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->timer = 1;
|
|
}
|