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
|
/*
* d_a_obj_bombf.cpp
* Bomb Flower
*/
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_obj_bombf.h"
#include "f_pc/f_pc_name.h"
static const char l_arcName[] = "Bombf";
bool daObjBombf_c::createHeap() {
field_0x570 = mDoExt_J3DModel__create((J3DModelData*)dComIfG_getObjectRes(l_arcName, 4),
0x80000, 0x11000084);
return (field_0x570 != NULL);
}
static bool daObjBombf_createHeap(fopAc_ac_c* i_this) {
return static_cast<daObjBombf_c*>(i_this)->createHeap();
}
int daObjBombf_c::create() {
fopAcM_ct(this, daObjBombf_c);
int phase = dComIfG_resLoad(&field_0x568, l_arcName);
if (phase == cPhs_COMPLEATE_e) {
if (!fopAcM_entrySolidHeap(this, (heapCallbackFunc)daObjBombf_createHeap, 0x820)) {
return cPhs_ERROR_e;
}
fopAcM_SetMtx(this, field_0x570->getBaseTRMtx());
tevStr.room_no = fopAcM_GetRoomNo(this);
attention_info.position = current.pos;
eyePos = attention_info.position;
field_0x574 = 0xffffffff;
setMatrix();
fopAcM_SetMin(this, -75.0f, 0.0f, -75.0f);
fopAcM_SetMax(this, 75.0f, 30.0f, 75.0f);
}
return phase;
}
static int daObjBombf_Create(fopAc_ac_c* i_this) {
return static_cast<daObjBombf_c*>(i_this)->create();
}
daObjBombf_c::~daObjBombf_c() {
dComIfG_resDelete(&field_0x568, l_arcName);
}
static int daObjBombf_Delete(daObjBombf_c* i_this) {
i_this->~daObjBombf_c();
return 1;
}
void daObjBombf_c::setMatrix() {
mDoMtx_stack_c::transS(current.pos.x, current.pos.y + field_0x584, current.pos.z);
mDoMtx_stack_c::ZXYrotM(shape_angle.x, shape_angle.y, shape_angle.z);
MTXCopy(mDoMtx_stack_c::now, field_0x570->mBaseTransformMtx);
}
static const Vec bombOffset = {0.0f, 7.0f, 0.0f};
int daObjBombf_c::execute() {
u32 uVar;
cXyz vStack;
setMatrix();
if (field_0x574 == -1) {
if (field_0x578 != 0) {
field_0x578--;
} else {
mDoMtx_multVec(field_0x570->getBaseTRMtx(), &bombOffset, &vStack);
fopAc_ac_c* bomb_actor =
dBomb_c::createFlowerBomb(&vStack, &shape_angle, fopAcM_GetRoomNo(this));
field_0x574 = fopAcM_GetID(bomb_actor);
}
} else {
fopAc_ac_c* actor = fopAcM_SearchByID(field_0x574);
if (actor == NULL) {
field_0x574 = -1;
field_0x578 = 150;
} else if (dBomb_c::checkFlowerBombWait(actor)) {
mDoMtx_multVec(field_0x570->getBaseTRMtx(), &bombOffset, &actor->current.pos);
}
}
return 1;
}
static int daObjBombf_Execute(daObjBombf_c* i_this) {
return i_this->execute();
}
int daObjBombf_c::draw() {
g_env_light.settingTevStruct(0, ¤t.pos, &tevStr);
g_env_light.setLightTevColorType_MAJI(field_0x570, &tevStr);
mDoExt_modelUpdateDL(field_0x570);
return 1;
}
static int daObjBombf_Draw(daObjBombf_c* i_this) {
return i_this->draw();
}
static actor_method_class l_daObjBombf_Method = {
(process_method_func)daObjBombf_Create, (process_method_func)daObjBombf_Delete,
(process_method_func)daObjBombf_Execute, (process_method_func)NULL,
(process_method_func)daObjBombf_Draw,
};
actor_process_profile_definition g_profile_Obj_Bombf = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 7,
/* List Prio */ fpcPi_CURRENT_e,
/* Proc Name */ fpcNm_Obj_Bombf_e,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(daObjBombf_c),
/* Size Other */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopAc_Method.base,
/* Draw Prio */ fpcDwPi_Obj_Bombf_e,
/* Actor SubMtd */ &l_daObjBombf_Method,
/* Status */ fopAcStts_UNK_0x40000_e | fopAcStts_CULL_e,
/* Group */ fopAc_ENV_e,
/* Cull Type */ fopAc_CULLBOX_CUSTOM_e,
};
|