managerA.c ok

This commit is contained in:
Ibot02
2020-08-09 12:13:02 +02:00
parent b3dc734ad8
commit a609afcf83
4 changed files with 144 additions and 245 deletions
+135 -6
View File
@@ -1,15 +1,19 @@
#include "global.h"
#include "entity.h"
#include "link.h"
#include "manager.h"
#include "flags.h"
#include "area.h"
extern void (*gUnk_081081F4[])(Entity*);
void sub_08058380(Entity* this) {
gUnk_081081F4[this->action](this);
extern void (*gUnk_081081F4[])(Manager*);
void sub_08058380(Manager* this) {
gUnk_081081F4[this->unk_0c](this);
}
extern u32 CheckFlags(u32);
extern void DeleteThisEntity();
extern void sub_0805E3A0(Manager*, u32);
void sub_08058398(Manager* this) {
@@ -29,7 +33,8 @@ void sub_08058398(Manager* this) {
}
}
extern void sub_08058408(Manager* this);
void sub_08058408(Manager*);
void sub_080583EC(Manager* this) {
if (CheckFlags(this->unk_3e) != 0) {
@@ -37,3 +42,127 @@ void sub_080583EC(Manager* this) {
sub_08058408(this);
}
}
extern u32 CheckPlayerInRegion(u32, u32, u32, u32);
extern void sub_0805E544(void);
extern void sub_08078A90(u32);
extern void sub_08078AA8(u32, u32);
extern void sub_080186C0(u16);
extern void sub_08078B48(void);
u32 sub_0805848C(Manager*);
void sub_080585DC(Manager*);
void sub_08058408(Manager* this){
u32 tmp2;
tmp2 = (gLinkState.flags.all & 0x08);
if (tmp2 != 0) return;
if (!CheckPlayerInRegion(this->unk_20, this->unk_22, this->unk_24, this->unk_26)) return;
switch (this->unk_0a) {
case 1:
return;
case 2:
sub_080585DC(this);
if ((gLinkState.flags.all & 0x80) == 0) return;
case 0:
default:
sub_080585DC(this);
if (sub_0805848C(this) == 0) return;
sub_08078A90(3);
sub_08078B48();
sub_0805E544();
this->unk_0c = 3;
this->unk_0d = 0;
this->unk_0e = 0x1e;
return;
case 3:
this->unk_0c = 4;
this->unk_0d = tmp2;
sub_080186C0(this->unk_36);
return;
}
}
u32 sub_0805848C(Manager* this) {
switch (gLinkState.field_0xa8[0]-5) {
case 0:
case 2:
case 3:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
case 22:
case 23:
return 0;
case 1:
case 4:
case 20:
case 21:
default:
return 1;
}
}
extern void UnfreezeTime(void);
void sub_08058514(Manager* this) {
switch (this->unk_0d) {
case 1:
if ((gLinkState.flags.all & 0x1235) != 0)
return;
if (gLinkEntity.height.HALF.HI != 0)
return;
gLinkState.jumpStatus = 0;
sub_08078AA8(this->unk_36, this->unk_35);
this->unk_0d++;
this->unk_0e = 0x1E;
return;
case 0:
case 2:
if (((--this->unk_0e)<<0x18) == 0) {
this->unk_0d++;
}
return;
case 3:
if (gLinkEntity.action != 1 && gLinkEntity.action != 9) return;
gLinkState.field_0x8b = 1;
UnfreezeTime();
SetFlag(this->unk_3c);
DeleteThisEntity();
return;
default:
return;
}
}
extern void sub_0801855C(void);
void sub_080585B0(Manager* this) {
if (gArea.filler4[0] != 0xFF) {
DeleteThisEntity();
}
if (CheckFlags(this->unk_3c)) {
sub_0801855C();
DeleteThisEntity();
}
}
void sub_080585DC(Manager* this) {
if (CheckFlags(this->unk_3c)) {
DeleteThisEntity();
}
}