diff options
| author | Tal Hayon <talhayon1@gmail.com> | 2022-03-16 14:50:28 +0200 |
|---|---|---|
| committer | Tal Hayon <talhayon1@gmail.com> | 2022-03-18 13:38:17 +0200 |
| commit | d93dfd2c59bdbb986e22a8420b5ea85768c4d080 (patch) | |
| tree | 733f03efd910a69412aefe8e1838674ade8c0bf9 /src/object/object98.c | |
| parent | c8547ffe35e5fa601cf6b0307bf6566a33074456 (diff) | |
Decompile object98
Diffstat (limited to 'src/object/object98.c')
| -rw-r--r-- | src/object/object98.c | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/object/object98.c b/src/object/object98.c new file mode 100644 index 00000000..798836dc --- /dev/null +++ b/src/object/object98.c @@ -0,0 +1,68 @@ +#define NENT_DEPRECATED +#include "entity.h" +#include "projectile.h" +#include "room.h" +#include "functions.h" + +typedef struct { + Entity base; + u8 filler[0xC]; + u16 unk74; + u16 unk76; + u8 filler2[0x6]; + u8 unk7e; +} Object98Entity; + +void sub_0809E360(Object98Entity*); +void sub_0809E3E4(Object98Entity*); + +void Object98(Entity* this) { + static void (*const actionFuncs[])(Object98Entity*) = { + sub_0809E360, + sub_0809E3E4, + }; + + actionFuncs[this->action]((Object98Entity*)this); +} + +void sub_0809E360(Object98Entity* this) { + u32 bVar1; + Entity* projEnt; + u32 index; + + if (8 < super->actionDelay) { + super->actionDelay = 8; + } + + if (0x48 - super->actionDelay > gEntCount) { + for (index = 0; index < super->actionDelay; index++) { + projEnt = CreateProjectile(GURUGURU_BAR_PROJECTILE); + projEnt->actionDelay = 14 + 12 * index; + projEnt->parent = super; + } + + super->action = 1; + bVar1 = this->unk7e; + this->unk76 = bVar1 << 8; + super->animationState = bVar1 << 6; + SetDefaultPriority(super, 0); + if (super->type != 0) { + super->child = (Entity*)GetCurrentRoomProperty(super->type); + sub_080A2CC0(super, (u16**)&super->child, &this->unk74); + } + } +} + +void sub_0809E3E4(Object98Entity* this) { + this->unk76 += super->type2; + super->animationState = this->unk76 >> 2; + if (super->type != 0) { + if ((super->direction & 0x80) == 0) { + LinearMoveUpdate(super); + } + + if (--this->unk74 == 0) { + sub_080A2CC0(super, (u16**)&super->child, &this->unk74); + } + } +} |
