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
|
/**
* @file d_a_coach_fire.cpp
*
*/
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_coach_fire.h"
CoachFireAttr const daCoachFire_c::M_attr = {
50.0f, // radius
4.0f, // field_0x04
36, // field_0x08
255, // colorR
100, // colorG
0, // colorB
700.0f, // pow
};
void daCoachFire_c::create_init() {
fopAcM_setStageLayer(this);
fopAcM_setCullSizeBox(this, -100.0, -10.0, -100.0, 100.0, 200.0, 100.0);
attention_info.flags = fopAc_AttnFlag_CHECK_e | fopAc_AttnFlag_LOCK_e;
attention_info.distances[fopAc_attn_LOCK_e] = 0x24;
attention_info.distances[fopAc_attn_CHECK_e] = 0x22;
mLightInfluence.mPosition = current.pos;
mLightInfluence.mColor.r = attr().colorR;
mLightInfluence.mColor.g = attr().colorG;
mLightInfluence.mColor.b = attr().colorB;
mLightInfluence.mPow = attr().pow;
dKy_plight_set(&mLightInfluence);
mpMtx = NULL;
initBaseMtx();
initCcSphere();
}
void daCoachFire_c::initBaseMtx() {
daNpcCoach_c* coach = (daNpcCoach_c*)fpcM_SearchByID(parentActorID);
if (coach != NULL) {
mPos = current.pos;
mpMtx = coach->getCoachMtx();
}
setBaseMtx();
}
void daCoachFire_c::setBaseMtx() {
if (mpMtx != NULL) {
mDoMtx_stack_c::copy(*mpMtx);
mDoMtx_stack_c::multVec(&mPos, ¤t.pos);
attention_info.position = current.pos;
eyePos = current.pos;
}
}
void daCoachFire_c::initCcSphere() {
static const dCcD_SrcSph ccSphSrc = {
{
{0, {{AT_TYPE_0, 0, 0}, {0x00010000, 0x11}, 0}}, // mObj
{dCcD_SE_NONE, 0, 0, 0, 0}, // mGObjAt
{dCcD_SE_NONE, 0, 0, 0, 0x4}, // mGObjTg
{0}, // mGObjCo
}, // mObjInf
{{{0.0f, 0.0f, 0.0f}, 50.0f}} // mSph
}; // mSphAttr
mStts.Init(0xFF, 0xFF, this);
mSph.Set(ccSphSrc);
mSph.SetStts(&mStts);
mSph.SetC(current.pos);
mSph.SetR(attr().radius);
}
int daCoachFire_c::draw() {
mParticleKey = dComIfGp_particle_set(mParticleKey, 0x8113, ¤t.pos, NULL, NULL, NULL, 0xFF,
NULL, -1, NULL, NULL, NULL);
JPABaseEmitter* emitter = dComIfGp_particle_getEmitter(mParticleKey);
if (emitter != NULL) {
speed = current.pos - old.pos;
speed.y = 0.0f;
speed *= 0.9f;
emitter->setParticleCallBackPtr(dPa_control_c::getParticleTracePCB());
emitter->setUserWork((uintptr_t)(&speed));
}
return 1;
}
static int daCoachFire_Draw(daCoachFire_c* i_this) {
return i_this->draw();
}
void daCoachFire_c::setCcSphere() {
if (noHitTimer != 0) {
mSph.ClrTgHit();
} else {
mSph.SetC(current.pos);
dComIfG_Ccsp()->Set(&mSph);
}
}
int daCoachFire_c::execute() {
daNpcCoach_c* coach = (daNpcCoach_c*)fpcM_SearchByID(parentActorID);
if (noHitTimer > 0) {
noHitTimer = noHitTimer - 1;
}
if (mSph.ChkTgHit() && noHitTimer == 0) {
if (coach != NULL) {
coach->deleteFireArrow(fopAcM_GetID(this));
}
setNoHitTimer();
}
if (coach != NULL && coach->checkCoachBlazing()) {
dAttention_c* attn = dComIfGp_getAttention();
if (attn->LockonTruth()) {
if (attn->LockonTarget(0) != this) {
if (coach->deleteFireArrowFromList(fopAcM_GetID(this)) != false) {
fopAcM_delete(this);
}
}
} else if (coach->deleteFireArrowFromList(fopAcM_GetID(this)) != false) {
fopAcM_delete(this);
}
}
if (mpMtx != NULL) {
mDoMtx_stack_c::copy(*mpMtx);
mDoMtx_stack_c::multVec(&mPos, ¤t.pos);
attention_info.position = current.pos;
eyePos = current.pos;
}
setCcSphere();
mLightInfluence.mPosition = current.pos;
return 1;
}
static int daCoachFire_Execute(daCoachFire_c* i_this) {
return i_this->execute();
}
static bool daCoachFire_IsDelete(daCoachFire_c* i_this) {
return true;
}
daCoachFire_c::~daCoachFire_c() {
dKy_plight_cut(&mLightInfluence);
}
static int daCoachFire_Delete(daCoachFire_c* i_this) {
i_this->~daCoachFire_c();
return 1;
}
static int daCoachFire_Create(fopAc_ac_c* i_this) {
fopAcM_ct(i_this, daCoachFire_c);
static_cast<daCoachFire_c*>(i_this)->create_init();
return cPhs_COMPLEATE_e;
}
static char* stringBase_80658454 = "Coach";
static actor_method_class l_daCoachFire_Method = {
(process_method_func)daCoachFire_Create, (process_method_func)daCoachFire_Delete,
(process_method_func)daCoachFire_Execute, (process_method_func)daCoachFire_IsDelete,
(process_method_func)daCoachFire_Draw,
};
actor_process_profile_definition g_profile_COACH_FIRE = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 3,
/* List Prio */ fpcPi_CURRENT_e,
/* Proc Name */ fpcNm_COACH_FIRE_e,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(daCoachFire_c),
/* Size Other */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopAc_Method.base,
/* Draw Prio */ fpcDwPi_COACH_FIRE_e,
/* Actor SubMtd */ &l_daCoachFire_Method,
/* Status */ fopAcStts_UNK_0x40000_e | fopAcStts_UNK_0x4000_e,
/* Group */ fopAc_ACTOR_e,
/* Cull Type */ fopAc_CULLBOX_CUSTOM_e,
};
|