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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
|
//
// Generated by dtk
// Translation Unit: d_a_arrow_iceeff.cpp
//
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_arrow_iceeff.h"
#include "m_Do/m_Do_mtx.h"
#include "f_op/f_op_actor_mng.h"
#include "d/d_com_inf_game.h"
#include "d/actor/d_a_player_main.h"
#include "d/actor/d_a_arrow.h"
/* 000000EC-0000010C .text CheckCreateHeap__FP10fopAc_ac_c */
static BOOL CheckCreateHeap(fopAc_ac_c* i_this) {
return static_cast<daArrow_Iceeff_c*>(i_this)->CreateHeap();
}
/* 0000010C-00000324 .text CreateHeap__16daArrow_Iceeff_cFv */
BOOL daArrow_Iceeff_c::CreateHeap() {
J3DModelData* modelData;
if(field_0xA38 == 0) {
modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Link", dRes_INDEX_LINK_BDL_GICER00_e));
JUT_ASSERT(87, modelData != NULL);
for(int i = 0; i < 30; i++) {
field_0x298[i] = mDoExt_J3DModel__create(modelData, 0, 0x11020203);
if(field_0x298[i] == 0) {
return false;
}
}
}
else {
modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes("Link", dRes_INDEX_LINK_BDL_GICER01_e));
JUT_ASSERT(98, modelData != NULL);
mpModel = mDoExt_J3DModel__create(modelData, 0, 0x11020203);
if(mpModel == NULL) {
return false;
}
J3DAnmTransform* bck = static_cast<J3DAnmTransform*>(dComIfG_getObjectRes("Link", dRes_INDEX_LINK_BCK_GICER01_e));
JUT_ASSERT(107, bck != NULL);
if(!mBck.init(modelData, bck, true, J3DFrameCtrl::EMode_NONE)) {
return false;
}
}
return true;
}
/* 00000324-000005E4 .text CreateInit__16daArrow_Iceeff_cFv */
void daArrow_Iceeff_c::CreateInit() {
if(field_0xA38 == 0) {
for(int i = 0; i < 30; i++) {
fopAcM_SetMtx(this, field_0x298[i]->getBaseTRMtx());
field_0x8B4[i].setall(cM_rndF(4.5f) + 6.2999997f);
f32 temp = 180.0f * i / 30.0f;
s16 angle = cM_rndF(0x10000);
mDoMtx_stack_c::ZrotS(cM_rndF(0x10000));
mDoMtx_stack_c::XrotM(cM_rndF(0x10000));
mDoMtx_stack_c::YrotM(cM_rndF(0x10000));
mDoMtx_stack_c::transM(temp * cM_ssin(angle), temp * cM_scos(angle), 0.0f);
mDoMtx_stack_c::ZrotM(current.angle.z);
mDoMtx_stack_c::XrotM(current.angle.x);
mDoMtx_stack_c::YrotM(current.angle.y);
cMtx_copy(mDoMtx_stack_c::get(), field_0x314[i]);
}
}
else {
current.angle.y = cM_rndF(0x10000);
}
fopAcM_setCullSizeBox(this, -100.0f, -100.0f, -100.0f, 100.0f, 100.0f, 100.0f);
fopAcM_setCullSizeFar(this, 1.0f);
set_mtx();
field_0xA30 = 0;
field_0xA34 = 0.0f;
if(field_0xA38 == 0) {
field_0xA1C = daPy_getPlayerLinkActorClass()->getIceParticleBtk();
}
else {
field_0xA1C = daPy_getPlayerLinkActorClass()->getIceWaterParticleBtk();
}
field_0xA1C->setFrame(field_0xA34);
field_0xA3C = 1;
}
/* 000005E4-0000073C .text set_mtx__16daArrow_Iceeff_cFv */
void daArrow_Iceeff_c::set_mtx() {
if(field_0xA38 == 0) {
for(int i = 0; i < 30; i++) {
field_0x298[i]->setBaseScale(field_0x8B4[i]);
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::ZXYrotM(current.angle.x, current.angle.y, 0);
mDoMtx_stack_c::concat(field_0x314[i]);
field_0x298[i]->setBaseTRMtx(mDoMtx_stack_c::get());
}
}
else {
scale.setall(1.0f);
mpModel->setBaseScale(scale);
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::YrotM(current.angle.y);
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
}
}
cPhs_State daArrow_Iceeff_c::_create() {
fopAcM_ct(this, daArrow_Iceeff_c);
void* arrow = fopAcM_SearchByID(parentActorID);
if(arrow == 0) {
return cPhs_ERROR_e;
}
else {
if(fopAcM_GetParam(arrow) == 4) {
field_0xA38 = 1;
}
else {
field_0xA38 = 0;
}
if(!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0xD5E0)) {
return cPhs_ERROR_e;
}
CreateInit();
return cPhs_COMPLEATE_e;
}
}
/* 0000073C-00000854 .text daArrow_Iceeff_Create__FPv */
static cPhs_State daArrow_Iceeff_Create(void* i_this) {
return static_cast<daArrow_Iceeff_c*>(i_this)->_create();
}
bool daArrow_Iceeff_c::_delete() {
return true;
}
/* 00000938-00000940 .text daArrow_Iceeff_Delete__FPv */
static BOOL daArrow_Iceeff_Delete(void* i_this) {
return static_cast<daArrow_Iceeff_c*>(i_this)->_delete();
}
bool daArrow_Iceeff_c::_draw() {
s32 temp = field_0xA30;
if(30 < temp) {
temp = 30;
}
field_0xA1C->setFrame(field_0xA34);
dComIfGd_setListP1();
g_env_light.settingTevStruct(TEV_TYPE_BG0, ¤t.pos, &tevStr);
if(field_0xA38 == 0) {
for(int i = 0; i < temp; i++) {
g_env_light.setLightTevColorType(field_0x298[i], &tevStr);
if(field_0xA3C == 1) {
mDoExt_modelUpdateDL(field_0x298[i]);
}
}
}
else {
g_env_light.setLightTevColorType(mpModel, &tevStr);
J3DModelData* mdl_data = mpModel->getModelData();
mBck.entry(mdl_data);
if(field_0xA3C == 1) {
mDoExt_modelUpdateDL(mpModel);
}
mBck.remove(mpModel->getModelData());
}
dComIfGd_setList();
return true;
}
/* 00000940-00000A98 .text daArrow_Iceeff_Draw__FPv */
static BOOL daArrow_Iceeff_Draw(void* i_this) {
return static_cast<daArrow_Iceeff_c*>(i_this)->_draw();
}
/* 00000A98-00000ABC .text daArrow_Iceeff_Execute__FPv */
static BOOL daArrow_Iceeff_Execute(void* i_this) {
return static_cast<daArrow_Iceeff_c*>(i_this)->_execute();
}
/* 00000ABC-00001050 .text _execute__16daArrow_Iceeff_cFv */
bool daArrow_Iceeff_c::_execute() {
static cXyz ripple_scale(1.0f, 1.0f, 1.0f);
daArrow_c* arrow = static_cast<daArrow_c*>(fopAcM_SearchByID(parentActorID));
if(field_0xA38 == 0) {
if(arrow == 0) {
dComIfGp_particle_setP1(dPa_name::ID_IT_JN_ARWICE_OUT00, ¤t.pos, ¤t.angle);
fopAcM_delete(this);
return true;
}
current.pos = arrow->field_0x6a8;
current.angle = arrow->shape_angle;
if(field_0xA30 == 0) {
fopAcM_seStartCurrent(this, JA_SE_OBJ_MINI_ICE, 0);
}
if(field_0xA30 >= 30) {
field_0xA34 += 1.0f;
if(field_0xA34 >= field_0xA1C->getFrameMax()) {
field_0xA34 = field_0xA1C->getFrameMax();
}
}
if(field_0xA30 < 0x3C) {
field_0xA30++;
}
else {
dComIfGp_particle_setP1(dPa_name::ID_IT_JN_ARWICE_OUT00, ¤t.pos, ¤t.angle);
fopAcM_seStartCurrent(this, JA_SE_OBJ_MINI_ICE_BREAK, 0);
fopAcM_delete(arrow);
fopAcM_delete(this);
}
}
else {
mBck.play();
f32 waterY;
fopAcM_getWaterY(¤t.pos, &waterY);
current.pos.y = waterY;
if(field_0xA30 == 0) {
csXyz angle;
angle.set(-0x4000, 0, 0);
JPABaseEmitter* ptcl = dComIfGp_particle_setP1(dPa_name::ID_IT_JN_ARWI_HITA00, ¤t.pos, &angle);
if(ptcl) {
JGeometry::TVec3<f32> scale(0.5f, 0.5f, 0.5f);
ptcl->setGlobalScale(scale);
ptcl->setRate(50.0f);
ptcl->setGlobalAlpha(0x80);
}
fopAcM_seStartCurrent(this, JA_SE_OBJ_MINI_ICE, 0);
}
field_0xA34 += 1.0f;
if(field_0xA34 >= field_0xA1C->getFrameMax()) {
field_0xA34 = field_0xA1C->getFrameMax();
}
if(field_0xA30 < 300) {
field_0xA30++;
}
else {
fopAcM_delete(this);
}
if(field_0xA30 == 0x23) {
JPABaseEmitter* ptcl = dComIfGp_particle_setSingleRipple(dPa_name::ID_IT_JN_WP_HAMON01, ¤t.pos, NULL, &ripple_scale);
if(ptcl) {
ptcl->setGlobalParticleScale(0.67f, 0.67f);
}
}
else if(field_0xA30 == 0x28) {
JPABaseEmitter* ptcl = dComIfGp_particle_setP1(dPa_name::ID_IT_JN_ARWICE_OUT00, ¤t.pos);
if(ptcl) {
ptcl->setAwayFromCenterSpeed(25.0f);
ptcl->setAwayFromAxisSpeed(5.0f);
ptcl->setDirectionalSpeed(5.0f);
JGeometry::TVec3<f32> scale1(0.5f, 1.0f, 0.5f);
ptcl->setEmitterScale(scale1);
ptcl->setGlobalParticleScale(0.33f, 0.33f);
}
dComIfGp_particle_setSingleRipple(dPa_name::ID_IT_JN_WP_HAMON03, ¤t.pos, NULL, &ripple_scale);
fopAcM_seStartCurrent(this, JA_SE_OBJ_MINI_ICE_BREAK, 0);
field_0xA3C = 0;
}
}
set_mtx();
return true;
}
/* 00001050-00001058 .text daArrow_Iceeff_IsDelete__FPv */
static BOOL daArrow_Iceeff_IsDelete(void*) {
return true;
}
static actor_method_class daArrow_IceeffMethodTable = {
(process_method_func)daArrow_Iceeff_Create,
(process_method_func)daArrow_Iceeff_Delete,
(process_method_func)daArrow_Iceeff_Execute,
(process_method_func)daArrow_Iceeff_IsDelete,
(process_method_func)daArrow_Iceeff_Draw,
};
actor_process_profile_definition g_profile_ARROW_ICEEFF = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 0x0009,
/* List Prio */ fpcPi_CURRENT_e,
/* Proc Name */ fpcNm_ARROW_ICEEFF_e,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(daArrow_Iceeff_c),
/* Size Other */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopAc_Method.base,
/* Draw Prio */ fpcDwPi_ARROW_ICEEFF_e,
/* Actor SubMtd */ &daArrow_IceeffMethodTable,
/* Status */ fopAcStts_UNK4000_e | fopAcStts_UNK40000_e,
/* Group */ fopAc_ACTOR_e,
/* Cull Type */ fopAc_CULLBOX_CUSTOM_e,
};
|