summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornotyouraveragehooman <65437533+notyouraveragehooman@users.noreply.github.com>2020-08-09 16:19:14 -0700
committerGitHub <noreply@github.com>2020-08-09 16:19:14 -0700
commit001845ba3a226c33ceb7479c1cf8bc5fa182700a (patch)
treed313765680f2b94719806d221bef34f5d74d01db /src
parent72118a5ce9565791d15eae725185470e4a7b157b (diff)
parent0934bc5301844a3fc95696d8d0e1c2899b8b74a9 (diff)
Merge pull request #50 from Ibot02:master
managerA.c ok
Diffstat (limited to 'src')
-rw-r--r--src/manager/managerA.c168
1 files changed, 168 insertions, 0 deletions
diff --git a/src/manager/managerA.c b/src/manager/managerA.c
new file mode 100644
index 00000000..699c5634
--- /dev/null
+++ b/src/manager/managerA.c
@@ -0,0 +1,168 @@
+#include "global.h"
+#include "entity.h"
+#include "player.h"
+#include "manager.h"
+#include "flags.h"
+#include "area.h"
+
+
+extern void (*gUnk_081081F4[])(Manager*);
+
+void sub_08058380(Manager* this) {
+ gUnk_081081F4[this->unk_0c](this);
+}
+
+
+
+extern void sub_0805E3A0(Manager*, u32);
+
+void sub_08058398(Manager* this) {
+
+ if (CheckFlags(this->unk_3c) != 0) {
+ DeleteThisEntity();
+ }
+ this->unk_24 = this->unk_3a<<3;
+ this->unk_26 = this->unk_3b<<3;
+ this->unk_20 = this->unk_24 + (this->unk_38<<4);
+ this->unk_22 = this->unk_26 + (this->unk_39<<4);
+ sub_0805E3A0(this, 0x06);
+ if (this->unk_3e == 0) {
+ this->unk_0c = 2;
+ } else {
+ this->unk_0c = 1;
+ }
+}
+
+
+void sub_08058408(Manager*);
+
+void sub_080583EC(Manager* this) {
+ if (CheckFlags(this->unk_3e) != 0) {
+ this->unk_0c = 2;
+ 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 = (gPlayerState.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 ((gPlayerState.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 (gPlayerState.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 ((gPlayerState.flags.all & 0x1235) != 0)
+ return;
+ if (gPlayerEntity.height.HALF.HI != 0)
+ return;
+ gPlayerState.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 (gPlayerEntity.action != 1 && gPlayerEntity.action != 9) return;
+ gPlayerState.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();
+ }
+}