diff options
| author | Ibot02 <jtp.jtp@gmx.de> | 2021-01-22 00:51:17 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-22 00:51:17 +0100 |
| commit | 4120161dece358f27f337cea5f5e362b7a07c321 (patch) | |
| tree | 06313e9970bf0b4f0b6120581cacaf2c09404995 /src | |
| parent | 02632295f2280366b1fbcd9d3015bed4eb4f8d37 (diff) | |
| parent | 468746bf6debf8687556280c8557cad5cd9732e4 (diff) | |
Merge pull request #112 from Ibot02/manager26
Manager26.c: ok
Diffstat (limited to 'src')
| -rw-r--r-- | src/manager/manager26.c | 95 | ||||
| -rw-r--r-- | src/manager/manager27.c | 18 |
2 files changed, 110 insertions, 3 deletions
diff --git a/src/manager/manager26.c b/src/manager/manager26.c new file mode 100644 index 00000000..dda5761c --- /dev/null +++ b/src/manager/manager26.c @@ -0,0 +1,95 @@ +#include "global.h" +#include "manager.h" +#include "entity.h" +#include "flags.h" +#include "room.h" +#include "functions.h" + +typedef struct { + Manager manager; + u8 unk_20[0x8]; + u8 unk_28; + u8 unk_29; + u16 unk_2a; +} Manager26; + +void sub_0805C6D0(Manager26*); +void sub_0805C7A0(Manager26*); +void sub_0805C7C4(Manager26*); + +void (* const gUnk_08108D04[])(Manager26*) = { + sub_0805C6D0, + sub_0805C7A0, + sub_0805C7C4 +}; + +void sub_0805C7CC(Manager26*); + +void sub_0805C6B8(Manager26* this) { + gUnk_08108D04[this->manager.action](this); +} + +void sub_0805C6D0(Manager26* this) { + UnkManager26HelperStruct* tmp = GetCurrentRoomProperty(this->manager.unk_0a); + if (!tmp) { + DeleteManager(&this->manager); + return; + } + this->unk_2a = gRoomControls.roomOriginY + this->manager.unk_0e; + this->manager.unk_0e = 0; + this->unk_28 = 0; + this->unk_29 = 0; + while (tmp->unk_00 != 0xFF && this->manager.unk_0e < 0x20) { + Entity* obj; + obj = CreateObject(0x4C, tmp->unk_01, tmp->unk_02); + if (obj) { + obj->actionDelay = tmp->unk_03; + obj->x.HALF.HI = gRoomControls.roomOriginX + tmp->unk_04; + obj->y.HALF.HI = gRoomControls.roomOriginY + tmp->unk_06; + obj->parent = (Entity*) this; + obj->collisionLayer = 1; + obj->field_0x82.HALF.HI = this->manager.unk_0e; + obj->field_0x82.HALF.LO = tmp->unk_00; + this->unk_29 |= 1 << this->manager.unk_0e; + } + tmp++; + this->manager.unk_0e++; + } + if (this->manager.unk_0b == 0xFF) { + this->manager.action = 2; + } else { + if (CheckLocalFlag(this->manager.unk_0b)) { + this->manager.action = 2; + } else { + this->manager.action = 1; + } + } +} + +void sub_0805C7A0(Manager26* this) { + if (this->unk_28 == this->unk_29) { + this->manager.action = 2; + SetLocalFlag(this->manager.unk_0b); + } + sub_0805C7CC(this); +} + +void sub_0805C7C4(Manager26* this) { + sub_0805C7CC(this); +} + +void sub_0805C7CC(Manager26* this) { + if (gPlayerState.flags.all & 0x80) { + if (gPlayerEntity.y.HALF.HI < this->unk_2a + 0x10) { + this->manager.unk_0d = 1; + } else { + this->manager.unk_0d = 0; + } + } else { + if (gPlayerEntity.y.HALF.HI < this->unk_2a + 0x28) { + this->manager.unk_0d = 3; + } else { + this->manager.unk_0d = 2; + } + } +} diff --git a/src/manager/manager27.c b/src/manager/manager27.c index 13e3c09b..641fdc9b 100644 --- a/src/manager/manager27.c +++ b/src/manager/manager27.c @@ -5,9 +5,22 @@ extern u32 sub_0805C920(Entity*); extern void LoadPaletteGroup(u32); -extern void (*const gUnk_08108D10[])(Entity*); -extern u8 gUnk_08108D20[]; +void sub_0805C874(Entity*); +void sub_0805C894(Entity*); +void sub_0805C8B4(Entity*); +void sub_0805C908(Entity*); + +void (*const gUnk_08108D10[])(Entity*) = { + sub_0805C874, + sub_0805C894, + sub_0805C8B4, + sub_0805C908 +}; + +const u8 gUnk_08108D20[] = { + 0x6F, 0x70, 0x71, 0x72, 0x71, 0x70 +}; void Manager27(Entity* this) { @@ -33,7 +46,6 @@ void sub_0805C874(Entity* this) { } void sub_0805C894(Entity* this) { - if (sub_0805C920(this)) { this->action = 2; this->actionDelay = 1; |
