diff options
| author | octorock <79596758+octorock@users.noreply.github.com> | 2021-04-30 18:04:29 +0200 |
|---|---|---|
| committer | octorock <79596758+octorock@users.noreply.github.com> | 2021-05-02 23:44:15 +0200 |
| commit | 5ad4559642c4e192fff84fd01a8b6a4ac3d39c57 (patch) | |
| tree | 4383105c26bb05789f796efa3821a9345d112729 /src | |
| parent | fce8ef7f9b0fc3815d8db43d240f4363b2c50961 (diff) | |
Decompile npc26
Diffstat (limited to 'src')
| -rw-r--r-- | src/npc/npc26.c | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/src/npc/npc26.c b/src/npc/npc26.c new file mode 100644 index 00000000..18157cb9 --- /dev/null +++ b/src/npc/npc26.c @@ -0,0 +1,66 @@ +#include "global.h" +#include "entity.h" +#include "functions.h" +#include "script.h" + +static void (*const gUnk_081106D4[])(Entity*); +static void (*const gUnk_081106E0[])(Entity*); + +void NPC26(Entity* this) { + if ((this->flags & 2) != 0) { + gUnk_081106E0[this->action](this); + } else { + gUnk_081106D4[this->action](this); + sub_0806ED78(this); + } +} + +static void sub_080669B8(Entity* this) { + this->action = 1; + this->spriteSettings.b.draw = 1; + InitAnimationForceUpdate(this, 2); + sub_08078778(this); +} + +static void sub_080669DC(Entity* this) { + s32 sVar1; + s32 sVar2; + + sVar1 = sub_0806ED9C(this, 0x28, 0x28); + if (sVar1 < 0) { + sVar1 = 2; + } else { + if (this->field_0xf == 0) { + this->field_0xf = 0x10; + } else { + this->field_0xf = this->field_0xf - 1; + sVar1 = this->animIndex; + } + } + sVar2 = sub_0806F078(this, sVar1); + if (sVar2 == 0) { + UpdateAnimationSingleFrame(this); + } + if (this->interactType != 0) { + this->action = 2; + this->interactType = 0; + } +} + +static void sub_08066A30(Entity* this) { + this->action = 1; +} + +static void sub_08066A38(Entity* this) { + this->action = 1; + this->spriteSettings.b.draw = 1; + sub_0807DD50(this); +} + +static void sub_08066A50(Entity* this) { + sub_0807DD94(this, NULL); +} + +static void (*const gUnk_081106D4[])(Entity*) = { sub_080669B8, sub_080669DC, sub_08066A30 }; + +static void (*const gUnk_081106E0[])(Entity*) = { sub_08066A38, sub_08066A50 };
\ No newline at end of file |
