mirror of
https://github.com/zeldaret/tmc
synced 2026-08-06 09:53:50 -04:00
manager26.c: ok
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
#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;
|
||||
|
||||
typedef struct {
|
||||
u8 unk_00;
|
||||
u8 unk_01;
|
||||
u8 unk_02;
|
||||
u8 unk_03;
|
||||
u16 unk_04;
|
||||
u16 unk_06;
|
||||
} UnkManager26HelperStruct;
|
||||
|
||||
extern void (* const gUnk_08108D04[])(Manager26*);
|
||||
|
||||
extern void * GetCurrentRoomProperty(u32);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user