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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
|
//
// Generated by dtk
// Translation Unit: d_a_wbird.cpp
//
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_wbird.h"
#include "d/d_com_inf_game.h"
#include "d/d_kankyo_wether.h"
#include "SSystem/SComponent/c_angle.h"
#include "d/actor/d_a_player.h"
const char daWbird_c::M_arcname[] = "Wbird";
/* 00000078-000000AC .text calcMtx__9daWbird_cFv */
void daWbird_c::calcMtx() {
eyePos = current.pos;
attention_info.position = current.pos;
}
/* 000000AC-00000324 .text setStartPos__9daWbird_cFv */
void daWbird_c::setStartPos() {
daPy_py_c* player = daPy_getPlayerActorClass();
cXyz *wind = dKyw_get_wind_vec();
dScnKy_env_light_c& envLight = dKy_getEnvlight();
cSGlobe globe(*wind);
cSAngle angle(globe.U());
s32 a = globe.U() - player->current.angle.y;
s32 transformedResult = a > cSAngle::_0.Val();
if (transformedResult != 0) {
angle += cSAngle::_90;
}
else {
angle -= cSAngle::_90;
}
current.pos = player->current.pos;
current.pos.x += (angle.Cos() * 20.0f);
current.pos.z += (angle.Sin() * 20.0f);
home.pos = current.pos;
current.pos.y += 150.0f;
cXyz sp18;
sp18.x = cM_scos(envLight.mWind.mTactWindAngleX) * cM_scos((u16)envLight.mWind.mTactWindAngleY);
sp18.y = cM_ssin(envLight.mWind.mTactWindAngleX);
sp18.z = cM_scos(envLight.mWind.mTactWindAngleX) * cM_ssin((u16)envLight.mWind.mTactWindAngleY);
int iVar5 = cM_atan2s(sp18.x, sp18.z);
current.angle.y = iVar5;
shape_angle.y = iVar5;
field_0x29E = 80;
speed.x = sp18.x * 40.0f;
speed.z = sp18.z * 40.0f;
float fVar1 = field_0x29E * 0.5f;
current.pos.z = current.pos.z - fVar1 * speed.z;
current.pos.x = current.pos.x - fVar1 * speed.x;
field_0x29E = field_0x29E + 60;
field_0x2A0 = 1.0f;
current.pos.y += field_0x2A0 * fVar1 * fVar1 * 0.5f;
speed.y = -(field_0x2A0 * fVar1);
}
/* 00000324-00000388 .text CreateInit__9daWbird_cFv */
BOOL daWbird_c::CreateInit() {
tevStr.mRoomNo = current.roomNo;
setAction(3);
fopAcM_orderChangeEvent(this, "TACT_WINDOW", 0, -1);
field_0x29E = 0;
calcMtx();
return TRUE;
}
/* 00000388-000003E0 .text create__9daWbird_cFv */
cPhs_State daWbird_c::create() {
fopAcM_ct(this, daWbird_c);
CreateInit();
return cPhs_COMPLEATE_e;
}
/* 000003E0-000003E4 .text actionWait__9daWbird_cFv */
void daWbird_c::actionWait() {
}
/* 000003E4-00000474 .text actionEnd__9daWbird_cFv */
void daWbird_c::actionEnd() {
if (dComIfGp_evmng_endCheck(mEventIdx)){
dComIfGp_event_reset();
fopAcM_delete(this);
} else {
dComIfGp_evmng_cutEnd(dComIfGp_evmng_getMyStaffId("WINDMAN"));
}
}
/* 00000474-000005DC .text actionMove__9daWbird_cFv */
void daWbird_c::actionMove() {
daPy_py_c* player = (daPy_py_c*)daPy_getPlayerActorClass();
if(field_0x29D){
field_0x29D = false;
mDoAud_seStart(JA_SE_TAKT_WIND_DEMO);
}
if (field_0x29E > 0) {
field_0x29E--;
if (field_0x29E > 60) {
fopAcM_posMove(this, NULL);
speed.y = speed.y + field_0x2A0;
}
if (field_0x29E < 15) {
dKyw_custom_windpower(0.0f);
}
if (field_0x29E == 70) {
dKyw_tact_wind_set_go();
}
} else {
dComIfGp_evmng_cutEnd(dComIfGp_evmng_getMyStaffId("WINDMAN"));
player->changeDemoMoveAngle(mAngle);
setAction(1);
mDoAud_seStart(JA_SE_TAKT_WIND_END);
}
}
/* 000005DC-00000850 .text actionSelect__9daWbird_cFv */
void daWbird_c::actionSelect() {
short sVar2 = field_0x29E;
if (sVar2 == 10) {
dComIfGp_setOperateWindOn();
mDoAud_seStart(JA_SE_TAKT_WIND_DISP);
field_0x29E++;
} else if(sVar2 > 10){
mDoAud_seStart(JA_SE_SYS_WTAKT_WIND_AMB);
switch (dComIfGp_getOperateWind()) {
case 1: {
mDoAud_seStart(JA_SE_TAKT_WIND_DECIDE);
setStartPos();
setAction(2);
daPy_py_c* player = daPy_getPlayerActorClass();
sVar2 = current.angle.y + 0x7fff;
mAngle = player->shape_angle.y;
player->setPlayerPosAndAngle(&player->current.pos, sVar2);
if(dComIfGp_checkPlayerStatus0(0, daPyStts0_SHIP_RIDE_e)){
mEventIdx = dComIfGp_evmng_getEventIdx("TACT_WINDOW2_SHIP");
} else{
mEventIdx = dComIfGp_evmng_getEventIdx("TACT_WINDOW2");
}
fopAcM_orderChangeEventId(this, mEventIdx, 0, 0xFFFF);
player = daPy_getPlayerActorClass();
player->cancelOriginalDemo();
dKyw_custom_windpower(1.0f);
field_0x29D = true;
break;
}
case 0 : {
mDoAud_seStart(JA_SE_TAKT_WIND_CANCEL);
dComIfGp_event_reset();
fopAcM_delete(this);
break;
}
}
}
else {
field_0x29E++;
}
}
BOOL daWbird_c::draw(){
return TRUE;
}
BOOL daWbird_c::execute(){
switch(mAction) {
case 3:
actionSelect();
break;
case 2:
actionMove();
break;
case 1:
actionEnd();
break;
default:
actionWait();
break;
}
calcMtx();
return TRUE;
}
/* 00000850-00000858 .text daWbird_Draw__FP9daWbird_c */
static BOOL daWbird_Draw(daWbird_c* i_this) {
return i_this->draw();
}
/* 00000858-000008D0 .text daWbird_Execute__FP9daWbird_c */
static BOOL daWbird_Execute(daWbird_c* i_this) {
return i_this->execute();
}
/* 000008D0-000008D8 .text daWbird_IsDelete__FP9daWbird_c */
static BOOL daWbird_IsDelete(daWbird_c*) {
return TRUE;
}
/* 000008D8-00000908 .text daWbird_Delete__FP9daWbird_c */
static BOOL daWbird_Delete(daWbird_c* i_this) {
i_this->~daWbird_c();
return TRUE;
}
/* 00000908-00000928 .text daWbird_Create__FP10fopAc_ac_c */
static cPhs_State daWbird_Create(fopAc_ac_c* i_this) {
daWbird_c* a_this = (daWbird_c*)i_this;
return a_this->create();
}
static actor_method_class l_daWbird_Method = {
(process_method_func)daWbird_Create,
(process_method_func)daWbird_Delete,
(process_method_func)daWbird_Execute,
(process_method_func)daWbird_IsDelete,
(process_method_func)daWbird_Draw,
};
actor_process_profile_definition g_profile_WBIRD = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 0x0007,
/* List Prio */ fpcPi_CURRENT_e,
/* Proc Name */ fpcNm_WBIRD_e,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(daWbird_c),
/* Size Other */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopAc_Method.base,
/* Draw Prio */ fpcDwPi_WBIRD_e,
/* Actor SubMtd */ &l_daWbird_Method,
/* Status */ fopAcStts_UNK4000_e | fopAcStts_UNK40000_e,
/* Group */ fopAc_ACTOR_e,
/* Cull Type */ fopAc_CULLBOX_6_e,
};
|