blob: acf4f4babb063e513b52578ec5a136aac1d87c94 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
|
#include "global.h"
#include "entity.h"
#include "player.h"
#include "manager.h"
#include "flags.h"
#include "area.h"
#include "functions.h"
void sub_08058398(ManagerA*);
void sub_080583EC(ManagerA*);
void sub_08058408(ManagerA*);
void sub_08058514(ManagerA*);
void sub_080585B0(ManagerA*);
void (*const gUnk_081081F4[])(ManagerA*) = { sub_08058398, sub_080583EC, sub_08058408, sub_08058514, sub_080585B0 };
void sub_08058380(ManagerA* this) {
gUnk_081081F4[this->manager.action](this);
}
void sub_08058398(ManagerA* 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->manager, 0x06);
if (this->unk_3e == 0) {
this->manager.action = 2;
} else {
this->manager.action = 1;
}
}
void sub_080583EC(ManagerA* this) {
if (CheckFlags(this->unk_3e) != 0) {
this->manager.action = 2;
sub_08058408(this);
}
}
extern void sub_0805E544(void);
u32 sub_0805848C(ManagerA*);
void sub_080585DC(ManagerA*);
void sub_08058408(ManagerA* 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->manager.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->manager.action = 3;
this->manager.unk_0d = 0;
this->manager.unk_0e = 0x1e;
return;
case 3:
this->manager.action = 4;
this->manager.unk_0d = tmp2;
sub_080186C0(this->unk_36);
return;
}
}
u32 sub_0805848C(ManagerA* this) {
switch (gPlayerState.field_0xa8 - 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(ManagerA* this) {
switch (this->manager.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->manager.unk_0d++;
this->manager.unk_0e = 0x1E;
return;
case 0:
case 2:
if (((--this->manager.unk_0e) << 0x18) == 0) {
this->manager.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(ManagerA* this) {
if (gArea.field_0x28 != 0xFF) {
DeleteThisEntity();
}
if (CheckFlags(this->unk_3c)) {
sub_0801855C();
DeleteThisEntity();
}
}
void sub_080585DC(ManagerA* this) {
if (CheckFlags(this->unk_3c)) {
DeleteThisEntity();
}
}
|