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
|
/**
* d_a_obj_lbox.cpp
* Object - Unused Block (HIO Label is "Block for boss battle")
*/
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_obj_lbox.h"
#include "SSystem/SComponent/c_math.h"
#include "d/d_com_inf_game.h"
#include "f_op/f_op_actor_mng.h"
#include "m_Do/m_Do_hostIO.h"
static u8 hio_set;
static daObj_Lbox_HIO_c l_HIO;
daObj_Lbox_HIO_c::daObj_Lbox_HIO_c() {
field_0x4 = -1;
mSize = 2.0f;
mHeight = 0.0f;
}
static int daObj_Lbox_Draw(obj_lbox_class* i_this) {
g_env_light.settingTevStruct(16, &i_this->current.pos, &i_this->tevStr);
g_env_light.setLightTevColorType_MAJI(i_this->mpModel, &i_this->tevStr);
mDoExt_modelUpdateDL(i_this->mpModel);
return 1;
}
static void action(obj_lbox_class* i_this) {
switch (i_this->field_0x57a) {
case 2:
break;
case 0:
i_this->current.pos.x = 0.0f;
i_this->current.pos.y = 4500.0f;
i_this->current.pos.z = -3450.0f;
if (i_this->mSph.ChkTgHit()) {
i_this->field_0x57a = 1;
i_this->field_0x57c = 0;
fopAcM_seStart(i_this, JA_SE_CM_MAGBALL_BOUND, 0);
i_this->field_0x57e[0] = 20;
}
break;
case 1:
if (i_this->field_0x57e[0] == 0) {
i_this->speed.y -= 5.0f;
i_this->shape_angle.z = 0.0f;
} else if (i_this->field_0x57e[0] < 0xf) {
i_this->shape_angle.z = cM_ssin(i_this->field_0x578 * 13000) * 200.0f;
i_this->speed.y -= 0.1f;
}
i_this->current.pos.y += i_this->speed.y;
if (i_this->mObjAcch.ChkGroundHit()) {
dComIfGp_getVibration().StartShock(5, 15, cXyz(0.0f, 1.0f, 0.0f));
fopAcM_seStart(i_this, Z2SE_EN_FM_FOOTNOTE, 0);
i_this->field_0x57a = 2;
i_this->field_0x57c = 0;
fopAcM_effSmokeSet1(&i_this->field_0xa84, &i_this->field_0xa88, &i_this->current.pos,
&i_this->shape_angle, 3.5f, &i_this->tevStr, 1);
}
break;
}
fopAcM_OffStatus(i_this, 0);
i_this->attention_info.flags = 0;
i_this->mObjAcch.CrrPos(dComIfG_Bgsp());
mDoMtx_stack_c::transS(i_this->current.pos.x, i_this->current.pos.y, i_this->current.pos.z);
mDoMtx_stack_c::YrotM(i_this->shape_angle.y);
mDoMtx_stack_c::ZrotM(i_this->shape_angle.z);
mDoMtx_stack_c::scaleM(l_HIO.mSize, l_HIO.mSize, l_HIO.mSize);
i_this->mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
MTXCopy(mDoMtx_stack_c::get(), i_this->mMtx);
i_this->mpBgW->Move();
cXyz cStack_48(i_this->current.pos);
cStack_48.y += 50.0f * l_HIO.mSize;
if (i_this->field_0x57a != 0) {
cStack_48.y += 20000.0f;
}
i_this->mSph.SetC(cStack_48);
i_this->mSph.SetR(150.0f * l_HIO.mSize);
dComIfG_Ccsp()->Set(&i_this->mSph);
i_this->eyePos = i_this->current.pos;
i_this->attention_info.position = i_this->eyePos;
}
static int daObj_Lbox_Execute(obj_lbox_class* i_this) {
i_this->field_0x578++;
for (int i = 0; i < 2; i++) {
if (i_this->field_0x57e[i] != 0) {
i_this->field_0x57e[i]--;
}
}
action(i_this);
return 1;
}
static int daObj_Lbox_IsDelete(obj_lbox_class* i_this) {
return 1;
}
static int daObj_Lbox_Delete(obj_lbox_class* i_this) {
fopAcM_GetID(i_this);
dComIfG_resDelete(&i_this->mPhaseReq, "Obj_lbox");
if (i_this->field_0xa8c != 0) {
hio_set = 0;
}
dComIfG_Bgsp().Release(i_this->mpBgW);
return 1;
}
static int useHeapInit(fopAc_ac_c* i_this) {
obj_lbox_class* a_this = static_cast<obj_lbox_class*>(i_this);
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("Obj_lbox", 4);
JUT_ASSERT(478, modelData != NULL);
a_this->mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084);
if (a_this->mpModel == NULL) {
return 0;
}
a_this->mpBgW = new dBgW();
if (a_this->mpBgW == NULL) {
return 0;
}
cBgD_t* dzb = (cBgD_t*)dComIfG_getObjectRes("Obj_lbox", 7);
if (a_this->mpBgW->Set(dzb, 1, &a_this->mMtx) == true) {
return 0;
}
a_this->mpBgW->SetCrrFunc(dBgS_MoveBGProc_Typical);
return 1;
}
static cPhs_Step daObj_Lbox_Create(fopAc_ac_c* i_this) {
static dCcD_SrcSph cc_sph_src = {
{
{0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x0}}, // mObj
{dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt
{dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg
{0x0}, // mGObjCo
}, // mObjInf
{
{{0.0f, 0.0f, 0.0f}, 40.0f} // mSph
} // mSphAttr
};
obj_lbox_class* a_this = static_cast<obj_lbox_class*>(i_this);
fopAcM_ct(a_this, obj_lbox_class);
cPhs_Step step = dComIfG_resLoad(&a_this->mPhaseReq, "Obj_lbox");
if (step == cPhs_COMPLEATE_e) {
a_this->mParam = fopAcM_GetParam(i_this);
if (a_this->mParam == 0xFF) {
a_this->mParam = 0;
}
if (!fopAcM_entrySolidHeap(a_this, useHeapInit, 0x4b000)) {
return cPhs_ERROR_e;
}
if (dComIfG_Bgsp().Regist(a_this->mpBgW, a_this)) {
return cPhs_ERROR_e;
}
if (hio_set == 0) {
a_this->field_0xa8c = 1;
hio_set = 1;
l_HIO.field_0x4 = -1;
}
fopAcM_SetMtx(a_this, a_this->mpModel->getBaseTRMtx());
fopAcM_SetMin(a_this, -200.0f, -3000.0f, -200.0f);
fopAcM_SetMax(a_this, 200.0f, 3000.0f, 200.0f);
a_this->mStts.Init(0xff, 0, a_this);
a_this->mSph.Set(cc_sph_src);
a_this->mSph.SetStts(&a_this->mStts);
a_this->mObjAcch.Set(fopAcM_GetPosition_p(a_this), fopAcM_GetOldPosition_p(a_this), a_this, 1,
&a_this->mAcchCir, fopAcM_GetSpeed_p(a_this), NULL, NULL);
a_this->mAcchCir.SetWall(50.0f, 50.0f);
a_this->attention_info.distances[fopAc_attn_BATTLE_e] = 0x16;
daObj_Lbox_Execute(a_this);
}
return step;
}
static actor_method_class l_daObj_Lbox_Method = {
(process_method_func)daObj_Lbox_Create, (process_method_func)daObj_Lbox_Delete,
(process_method_func)daObj_Lbox_Execute, (process_method_func)daObj_Lbox_IsDelete,
(process_method_func)daObj_Lbox_Draw};
actor_process_profile_definition g_profile_OBJ_LBOX = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 3,
/* List Prio */ fpcPi_CURRENT_e,
/* Proc Name */ fpcNm_OBJ_LBOX_e,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(obj_lbox_class),
/* Size Other */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopAc_Method.base,
/* Draw Prio */ fpcDwPi_OBJ_LBOX_e,
/* Actor SubMtd */ &l_daObj_Lbox_Method,
/* Status */ fopAcStts_UNK_0x40000_e | fopAcStts_CULL_e,
/* Group */ fopAc_ACTOR_e,
/* Cull Type */ fopAc_CULLBOX_CUSTOM_e,
};
|