summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuzagar <40547781+Luzagar@users.noreply.github.com>2025-12-16 02:04:20 +0100
committerGitHub <noreply@github.com>2025-12-15 17:04:20 -0800
commit618a3783f8224e586d0aefdd57dc191ef9998492 (patch)
tree2aec2fa45254fe0137c99b752d9de5c07b0972c2 /src
parent86bf7686658d54b620647b2d92983bbbff7d5e77 (diff)
d_a_e_b +d_a_e_bi_leaf documentation (#2952)
* some e_bi documentation * fix match issue * fix error * e_bi_leaf documentation
Diffstat (limited to 'src')
-rw-r--r--src/d/actor/d_a_e_bi.cpp774
-rw-r--r--src/d/actor/d_a_e_bi_leaf.cpp60
2 files changed, 417 insertions, 417 deletions
diff --git a/src/d/actor/d_a_e_bi.cpp b/src/d/actor/d_a_e_bi.cpp
index b0ff73a993..9d62c814f2 100644
--- a/src/d/actor/d_a_e_bi.cpp
+++ b/src/d/actor/d_a_e_bi.cpp
@@ -22,7 +22,7 @@ public:
#endif
/* 爆弾虫 - Bomb Bug */
- /* 0x04 */ s8 field_0x4;
+ /* 0x04 */ s8 no;
/* 0x08 */ f32 basic_size; // 基本サイズ - Basic Size
/* 0x0C */ f32 search_range; // サーチ範囲 - Search Range
/* 0x10 */ f32 track_range; // 追尾範囲 - Track Range
@@ -56,7 +56,7 @@ enum Action {
};
daE_BI_HIO_c::daE_BI_HIO_c() {
- field_0x4 = -1;
+ no = -1;
basic_size = 1.0f;
search_range = 400.0f;
track_range = 600.0f;
@@ -65,24 +65,24 @@ daE_BI_HIO_c::daE_BI_HIO_c() {
}
static void anm_init(e_bi_class* i_this, int i_index, f32 i_morf, u8 i_attr, f32 i_rate) {
- i_this->mpModelMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("E_BI", i_index), i_attr, i_morf, i_rate, 0.0f, -1.0f);
- i_this->mAnm = i_index;
+ i_this->anm_p->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("E_BI", i_index), i_attr, i_morf, i_rate, 0.0f, -1.0f);
+ i_this->anm_no = i_index;
}
static int daE_BI_Draw(e_bi_class* i_this) {
- fopAc_ac_c* a_this = &i_this->actor;
+ fopAc_ac_c* actor = &i_this->actor;
- if (i_this->field_0xbad == 0) {
+ if (i_this->ride_time == 0) {
return 1;
}
- g_env_light.settingTevStruct(0, &a_this->current.pos, &a_this->tevStr);
- J3DModel* model = i_this->mpModelMorf->getModel();
- g_env_light.setLightTevColorType_MAJI(model, &a_this->tevStr);
+ g_env_light.settingTevStruct(0, &actor->current.pos, &actor->tevStr);
+ J3DModel* model = i_this->anm_p->getModel();
+ g_env_light.setLightTevColorType_MAJI(model, &actor->tevStr);
J3DModelData* modelData = model->getModelData();
modelData->getMaterialNodePointer(1)->getTevColor(1)->r = i_this->field_0x698;
- if (i_this->field_0x694 != 0) {
+ if (i_this->ignition_time != 0) {
model->getModelData()->getMaterialNodePointer(0)->getShape()->hide();
model->getModelData()->getMaterialNodePointer(2)->getShape()->hide();
model->getModelData()->getMaterialNodePointer(1)->getShape()->show();
@@ -94,29 +94,29 @@ static int daE_BI_Draw(e_bi_class* i_this) {
model->getModelData()->getMaterialNodePointer(3)->getShape()->hide();
}
- i_this->mpModelMorf->entryDL();
+ i_this->anm_p->entryDL();
modelData->getMaterialNodePointer(1)->getTevColor(1)->r = 0;
- cXyz i_pos;
- i_pos.set(a_this->current.pos.x, a_this->current.pos.y + 100.0f + BREG_F(18), a_this->current.pos.z);
- i_this->mShadowKey = dComIfGd_setShadow(i_this->mShadowKey, 1, model, &i_pos,
- BREG_F(19) + 800.0f, 0.0f, a_this->current.pos.y,
- i_this->mObjAcch.GetGroundH(), i_this->mObjAcch.m_gnd,
- &a_this->tevStr, 0, 1.0f,
+ cXyz pos;
+ pos.set(actor->current.pos.x, actor->current.pos.y + 100.0f + BREG_F(18), actor->current.pos.z);
+ i_this->shadow_key = dComIfGd_setShadow(i_this->shadow_key, 1, model, &pos,
+ BREG_F(19) + 800.0f, 0.0f, actor->current.pos.y,
+ i_this->ObjAcch.GetGroundH(), i_this->ObjAcch.m_gnd,
+ &actor->tevStr, 0, 1.0f,
dDlst_shadowControl_c::getSimpleTex());
return 1;
}
-static BOOL pl_check(e_bi_class* i_this, f32 param_2) {
- fopAc_ac_c* a_this = &i_this->actor;
+static BOOL pl_check(e_bi_class* i_this, f32 search_area) {
+ fopAc_ac_c* actor = &i_this->actor;
- if (i_this->field_0x5b5 == 1) {
+ if (i_this->arg1 == 1) {
return FALSE;
}
- fopAc_ac_c* player = dComIfGp_getPlayer(0);
- if (i_this->field_0x688 < param_2 && !fopAcM_otherBgCheck(a_this, player)) {
+ fopAc_ac_c* pl = dComIfGp_getPlayer(0);
+ if (i_this->dis < search_area && !fopAcM_otherBgCheck(actor, pl)) {
return TRUE;
}
@@ -124,57 +124,57 @@ static BOOL pl_check(e_bi_class* i_this, f32 param_2) {
}
static void damage_check(e_bi_class* i_this) {
- fopAc_ac_c* a_this = &i_this->actor;
- fopAc_ac_c* actor_p = dComIfGp_getPlayer(0);
- fopAc_ac_c* actor_p_2;
-
- if (i_this->field_0x692 == 0) {
- i_this->mStts.Move();
-
- if (i_this->field_0x82c.ChkAtShieldHit()) {
- i_this->mAction = 5;
- i_this->field_0x670 = 0;
- i_this->field_0x692 = 60;
- a_this->speedF = 0.0f;
- i_this->field_0x6a6 = i_this->field_0x684 + 0x8000;
- } else if (i_this->field_0x6f0.ChkTgHit()) {
- i_this->mAtInfo.mpCollider = i_this->field_0x6f0.GetTgHitObj();
- at_power_check(&i_this->mAtInfo);
- cc_at_check(a_this, &i_this->mAtInfo);
-
- if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_HOOKSHOT)) {
- actor_p = dBomb_c::createEnemyBombHookshot(&a_this->eyePos, &a_this->current.angle, fopAcM_GetRoomNo(a_this));
- if (actor_p != NULL) {
- actor_p_2 = fopAcM_SearchByID(i_this->field_0xba4);
- if (actor_p_2 != NULL) {
- actor_p_2->parentActorID = fopAcM_GetID(actor_p);
+ fopAc_ac_c* actor = &i_this->actor;
+ fopAc_ac_c* player = dComIfGp_getPlayer(0);
+ fopAc_ac_c* child_actor;
+
+ if (i_this->damage_time == 0) {
+ i_this->Stts.Move();
+
+ if (i_this->at_sph.ChkAtShieldHit()) {
+ i_this->action = 5;
+ i_this->mode = 0;
+ i_this->damage_time = 60;
+ actor->speedF = 0.0f;
+ i_this->field_0x6a6 = i_this->target_angle + 0x8000;
+ } else if (i_this->cc_cyl.ChkTgHit()) {
+ i_this->at_info.mpCollider = i_this->cc_cyl.GetTgHitObj();
+ at_power_check(&i_this->at_info);
+ cc_at_check(actor, &i_this->at_info);
+
+ if (i_this->at_info.mpCollider->ChkAtType(AT_TYPE_HOOKSHOT)) {
+ player = dBomb_c::createEnemyBombHookshot(&actor->eyePos, &actor->current.angle, fopAcM_GetRoomNo(actor));
+ if (player != NULL) {
+ child_actor = fopAcM_SearchByID(i_this->child_no);
+ if (child_actor != NULL) {
+ child_actor->parentActorID = fopAcM_GetID(player);
}
- i_this->field_0x6b0 = 1;
+ i_this->leaf_id = 1;
}
- }else if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_BOOMERANG)) {
- actor_p = dBomb_c::createEnemyBombBoomerang(&a_this->eyePos, &a_this->current.angle, fopAcM_GetRoomNo(a_this));
- if (actor_p != NULL) {
- actor_p_2 = fopAcM_SearchByID(i_this->field_0xba4);
- if (actor_p_2 != NULL) {
- actor_p_2->parentActorID = fopAcM_GetID(actor_p);
+ }else if (i_this->at_info.mpCollider->ChkAtType(AT_TYPE_BOOMERANG)) {
+ player = dBomb_c::createEnemyBombBoomerang(&actor->eyePos, &actor->current.angle, fopAcM_GetRoomNo(actor));
+ if (player != NULL) {
+ child_actor = fopAcM_SearchByID(i_this->child_no);
+ if (child_actor != NULL) {
+ child_actor->parentActorID = fopAcM_GetID(player);
}
- i_this->field_0x6b0 = 1;
+ i_this->leaf_id = 1;
}
- } else if (i_this->field_0x694 != 0 || i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_BOMB)) {
- dBomb_c::createNormalBombExplode(&a_this->eyePos);
- i_this->field_0x6b0 = 1;
+ } else if (i_this->ignition_time != 0 || i_this->at_info.mpCollider->ChkAtType(AT_TYPE_BOMB)) {
+ dBomb_c::createNormalBombExplode(&actor->eyePos);
+ i_this->leaf_id = 1;
} else {
- i_this->mAction = 5;
- i_this->field_0x670 = 0;
- i_this->field_0x692 = 60;
- a_this->speedF = 0.0f;
+ i_this->action = 5;
+ i_this->mode = 0;
+ i_this->damage_time = 60;
+ actor->speedF = 0.0f;
- if (i_this->mAtInfo.mHitType == HIT_TYPE_STUN) {
- i_this->field_0x6a6 = actor_p->shape_angle.y;
+ if (i_this->at_info.mHitType == HIT_TYPE_STUN) {
+ i_this->field_0x6a6 = player->shape_angle.y;
} else {
- i_this->field_0x6a6 = i_this->field_0x684 + 0x8000;
+ i_this->field_0x6a6 = i_this->target_angle + 0x8000;
}
}
}
@@ -188,174 +188,174 @@ static u8 l_initHIO;
static daE_BI_HIO_c l_HIO;
static void e_bi_wait(e_bi_class* i_this) {
- fopAc_ac_c* a_this = &i_this->actor;
- cXyz sp28;
+ fopAc_ac_c* actor = &i_this->actor;
+ cXyz pos;
- switch (i_this->field_0x670) {
+ switch (i_this->mode) {
case -2:
anm_init(i_this, BCK_BI_APPEAR, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f);
- i_this->field_0x670 = 1;
+ i_this->mode = 1;
break;
case 0:
anm_init(i_this, BCK_BI_WAIT01TO02, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f);
- i_this->mSound.startCreatureSound(Z2SE_EN_BI_CROUCH, 0, -1);
- i_this->field_0x670 = 1;
+ i_this->sound.startCreatureSound(Z2SE_EN_BI_CROUCH, 0, -1);
+ i_this->mode = 1;
break;
case 1:
- if (i_this->mpModelMorf->isStop()) {
- if (i_this->field_0x5b5 == 1) {
- i_this->mAction = 1;
- i_this->field_0x670 = 0;
+ if (i_this->anm_p->isStop()) {
+ if (i_this->arg1 == 1) {
+ i_this->action = 1;
+ i_this->mode = 0;
} else {
anm_init(i_this, BCK_BI_WAIT02, 2.0f, J3DFrameCtrl::EMode_LOOP, 1.0f);
- i_this->field_0x670 = 2;
- i_this->field_0x68c[0] = l_HIO.time_to_get_going;
+ i_this->mode = 2;
+ i_this->timer[0] = l_HIO.time_to_get_going;
}
}
break;
case 2:
- cLib_addCalc2(&a_this->current.pos.x, a_this->home.pos.x, 1.0f, 5.0f);
- cLib_addCalc2(&a_this->current.pos.z, a_this->home.pos.z, 1.0f, 5.0f);
- sp28 = a_this->current.pos - a_this->home.pos;
- sp28.y = 0.0f;
-
- if (sp28.abs() < 1.0f && !pl_check(i_this, l_HIO.search_range + 50.0f)) {
- i_this->mAction = 1;
- i_this->field_0x670 = 0;
- } else if (i_this->field_0x68c[0] == 0) {
- i_this->mAction = 2;
- i_this->field_0x670 = 0;
+ cLib_addCalc2(&actor->current.pos.x, actor->home.pos.x, 1.0f, 5.0f);
+ cLib_addCalc2(&actor->current.pos.z, actor->home.pos.z, 1.0f, 5.0f);
+ pos = actor->current.pos - actor->home.pos;
+ pos.y = 0.0f;
+
+ if (pos.abs() < 1.0f && !pl_check(i_this, l_HIO.search_range + 50.0f)) {
+ i_this->action = 1;
+ i_this->mode = 0;
+ } else if (i_this->timer[0] == 0) {
+ i_this->action = 2;
+ i_this->mode = 0;
}
break;
}
}
static void e_bi_up(e_bi_class* i_this) {
- fopAc_ac_c* a_this = &i_this->actor;
+ fopAc_ac_c* actor = &i_this->actor;
- switch (i_this->field_0x670) {
+ switch (i_this->mode) {
case 0:
anm_init(i_this, BCK_BI_WAIT02TO01, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f);
- i_this->mSound.startCreatureSound(Z2SE_EN_BI_STAND, 0, -1);
- i_this->field_0x670 = 1;
+ i_this->sound.startCreatureSound(Z2SE_EN_BI_STAND, 0, -1);
+ i_this->mode = 1;
break;
case 1:
- if (i_this->mpModelMorf->isStop()) {
+ if (i_this->anm_p->isStop()) {
anm_init(i_this, BCK_BI_WAIT01, 2.0f, J3DFrameCtrl::EMode_LOOP, 1.0f);
- i_this->field_0x670 = 2;
+ i_this->mode = 2;
}
break;
case 2:
if (pl_check(i_this, l_HIO.search_range)) {
- i_this->mAction = 0;
- i_this->field_0x670 = 0;
+ i_this->action = 0;
+ i_this->mode = 0;
}
break;
}
- cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->field_0x684, 4, 0x800);
- cLib_addCalcAngleS2(&a_this->shape_angle.y, a_this->current.angle.y, 4, 0x2000);
+ cLib_addCalcAngleS2(&actor->current.angle.y, i_this->target_angle, 4, 0x800);
+ cLib_addCalcAngleS2(&actor->shape_angle.y, actor->current.angle.y, 4, 0x2000);
- if (i_this->field_0x5b5 == 1 && i_this->field_0x670 >= 2) {
- fopAc_ac_c* actor_p = fopAcM_SearchByID(i_this->field_0xba8);
+ if (i_this->arg1 == 1 && i_this->mode >= 2) {
+ fopAc_ac_c* actor_p = fopAcM_SearchByID(i_this->fw_id);
if (actor_p != NULL && actor_p->field_0x567 != 0) {
- i_this->mAction = 7;
- i_this->field_0x670 = 0;
+ i_this->action = 7;
+ i_this->mode = 0;
}
}
}
static void e_bi_move(e_bi_class* i_this) {
- fopAc_ac_c* a_this = &i_this->actor;
- cXyz sp40, sp4c;
- f32 fVar1 = 0.0f;
- sp40 = a_this->home.pos - a_this->current.pos;
+ fopAc_ac_c* actor = &i_this->actor;
+ cXyz mae, ato;
+ f32 movement_spd = 0.0f;
+ mae = actor->home.pos - actor->current.pos;
- switch (i_this->field_0x670) {
+ switch (i_this->mode) {
case 0:
- if (i_this->field_0x68c[0] == 0) {
+ if (i_this->timer[0] == 0) {
anm_init(i_this, BCK_BI_MOVE, 3.0f, J3DFrameCtrl::EMode_LOOP, 3.0f);
if (!pl_check(i_this, l_HIO.track_range)) {
- i_this->field_0x670 = 5;
+ i_this->mode = 5;
} else {
- i_this->field_0x670 = 1;
+ i_this->mode = 1;
}
}
break;
case 1:
- fVar1 = l_HIO.movement_spd;
- i_this->field_0x680 = i_this->field_0x684;
+ movement_spd = l_HIO.movement_spd;
+ i_this->target = i_this->target_angle;
- if (fopAcM_searchPlayerDistance(a_this) < KREG_F(7) + 150.0f) {
- i_this->field_0x670 = 2;
+ if (fopAcM_searchPlayerDistance(actor) < KREG_F(7) + 150.0f) {
+ i_this->mode = 2;
anm_init(i_this, BCK_BI_ATTACK, 3.0f, J3DFrameCtrl::EMode_NONE, 1.0f);
- fVar1 = 0.0f;
- a_this->speedF = fVar1;
+ movement_spd = 0.0f;
+ actor->speedF = movement_spd;
} else if (!pl_check(i_this, l_HIO.track_range)) {
- i_this->field_0x670 = 5;
+ i_this->mode = 5;
}
break;
case 2:
i_this->field_0x988 = 1;
- if (i_this->mpModelMorf->isStop()) {
- i_this->field_0x670 = 0;
- i_this->field_0x68c[0] = cM_rndF(20.0f);
+ if (i_this->anm_p->isStop()) {
+ i_this->mode = 0;
+ i_this->timer[0] = cM_rndF(20.0f);
anm_init(i_this, BCK_BI_WAIT02, 3.0f, J3DFrameCtrl::EMode_LOOP, 1.0f);
}
break;
case 5:
- fVar1 = l_HIO.movement_spd;
- i_this->field_0x680 = cM_atan2s(sp40.x, sp40.z);
- sp40.y = 0.0f;
+ movement_spd = l_HIO.movement_spd;
+ i_this->target = cM_atan2s(mae.x, mae.z);
+ mae.y = 0.0f;
- if (i_this->field_0x694 == 0 && sp40.abs() < l_HIO.movement_spd * 1.5f) {
- i_this->mAction = 0;
+ if (i_this->ignition_time == 0 && mae.abs() < l_HIO.movement_spd * 1.5f) {
+ i_this->action = 0;
anm_init(i_this, BCK_BI_WAIT02, 2.0f, J3DFrameCtrl::EMode_LOOP, 1.0f);
- i_this->field_0x670 = 2;
- i_this->field_0x68c[0] = l_HIO.time_to_get_going;
+ i_this->mode = 2;
+ i_this->timer[0] = l_HIO.time_to_get_going;
} else if (pl_check(i_this, l_HIO.search_range)) {
- i_this->field_0x670 = 0;
- i_this->field_0x68c[0] = 0;
+ i_this->mode = 0;
+ i_this->timer[0] = 0;
}
break;
}
- cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->field_0x680, 2, 0x800);
- cLib_addCalc2(&a_this->speedF, fVar1, 1.0f, l_HIO.movement_spd);
- cLib_addCalcAngleS2(&a_this->shape_angle.y, a_this->current.angle.y, 4, 0x2000);
+ cLib_addCalcAngleS2(&actor->current.angle.y, i_this->target, 2, 0x800);
+ cLib_addCalc2(&actor->speedF, movement_spd, 1.0f, l_HIO.movement_spd);
+ cLib_addCalcAngleS2(&actor->shape_angle.y, actor->current.angle.y, 4, 0x2000);
}
static void e_bi_ex(e_bi_class* i_this) {
- fopAc_ac_c* a_this = &i_this->actor;
- cXyz sp48, sp54;
+ fopAc_ac_c* actor = &i_this->actor;
+ cXyz mae, ato;
- switch (i_this->field_0x670) {
+ switch (i_this->mode) {
case 0:
- i_this->field_0x670 = 1;
- i_this->field_0x694 = 160;
+ i_this->mode = 1;
+ i_this->ignition_time = 160;
anm_init(i_this, BCK_BI_BOMBPOSE, 10.0f, J3DFrameCtrl::EMode_NONE, 1.0f);
- f32 fVar1;
- fVar1 = cM_rndF(0.2f) + 0.9f;
+ f32 rnd;
+ rnd = cM_rndF(0.2f) + 0.9f;
i_this->field_0x6a2 = 0;
- i_this->field_0x6a4 = (3800.0f + JREG_F(5)) * fVar1;
- i_this->field_0x6a8 = fVar1 * 20.0f;
- a_this->speed.y = 23.0f;
+ i_this->field_0x6a4 = (3800.0f + JREG_F(5)) * rnd;
+ i_this->field_0x6a8 = rnd * 20.0f;
+ actor->speed.y = 23.0f;
break;
case 1:
- if (i_this->mObjAcch.ChkGroundHit()) {
- i_this->field_0x670 = 2;
- a_this->speed.y = 10.0f;
+ if (i_this->ObjAcch.ChkGroundHit()) {
+ i_this->mode = 2;
+ actor->speed.y = 10.0f;
}
// fallthrough
case 2:
@@ -365,31 +365,31 @@ static void e_bi_ex(e_bi_class* i_this) {
}
cMtx_YrotS(*calc_mtx, i_this->field_0x6a6);
- sp48.x = 0.0f;
- sp48.y = 0.0f;
- sp48.z = i_this->field_0x6a8;
- MtxPosition(&sp48, &sp54);
- a_this->current.pos += sp54;
+ mae.x = 0.0f;
+ mae.y = 0.0f;
+ mae.z = i_this->field_0x6a8;
+ MtxPosition(&mae, &ato);
+ actor->current.pos += ato;
i_this->field_0x6a2 += i_this->field_0x6a4;
- if (i_this->field_0x694 != 0) {
- i_this->field_0x694--;
- i_this->mSound.startCreatureSoundLevel(Z2SE_OBJ_BOMB_IGNITION, 0, -1);
+ if (i_this->ignition_time != 0) {
+ i_this->ignition_time--;
+ i_this->sound.startCreatureSoundLevel(Z2SE_OBJ_BOMB_IGNITION, 0, -1);
i_this->field_0x696 += (s16) 0x1100;
- if (i_this->field_0x694 < 45) {
+ if (i_this->ignition_time < 45) {
i_this->field_0x696 += (s16) 0x1100;
- if (i_this->field_0x694 < 30) {
+ if (i_this->ignition_time < 30) {
i_this->field_0x696 += (s16) 0x1100;
}
}
i_this->field_0x698 = 128.0f - cM_scos(i_this->field_0x696) * 127.0f;
- if (i_this->field_0x694 == 0) {
- dBomb_c::createNormalBombExplode(&a_this->eyePos);
- i_this->field_0x6b0 = 1;
+ if (i_this->ignition_time == 0) {
+ dBomb_c::createNormalBombExplode(&actor->eyePos);
+ i_this->leaf_id = 1;
}
static u16 ex_eff_id[5] = {
@@ -401,105 +401,105 @@ static void e_bi_ex(e_bi_class* i_this) {
};
for (int i = 0; i < 5; i++) {
- i_this->field_0xbc4[i] = dComIfGp_particle_set(i_this->field_0xbc4[i], ex_eff_id[i], &a_this->current.pos, &a_this->tevStr,
- &a_this->shape_angle, NULL, 0xFF, NULL, -1, NULL, NULL, NULL);
- JPABaseEmitter* emitter = dComIfGp_particle_getEmitter(i_this->field_0xbc4[i]);
+ i_this->ex_eff[i] = dComIfGp_particle_set(i_this->ex_eff[i], ex_eff_id[i], &actor->current.pos, &actor->tevStr,
+ &actor->shape_angle, NULL, 0xFF, NULL, -1, NULL, NULL, NULL);
+ JPABaseEmitter* emitter = dComIfGp_particle_getEmitter(i_this->ex_eff[i]);
if (emitter != NULL) {
- MTXCopy(i_this->mpModelMorf->getModel()->getAnmMtx(0), *calc_mtx);
+ MTXCopy(i_this->anm_p->getModel()->getAnmMtx(0), *calc_mtx);
emitter->setGlobalRTMatrix(*calc_mtx);
}
}
}
- cLib_addCalcAngleS2(&a_this->shape_angle.y, a_this->current.angle.y, 4, 0x2000);
+ cLib_addCalcAngleS2(&actor->shape_angle.y, actor->current.angle.y, 4, 0x2000);
}
static void e_bi_water(e_bi_class* i_this) {
- fopAc_ac_c* a_this = &i_this->actor;
- cXyz sp34, sp40;
- sp34 = a_this->home.pos - a_this->current.pos;
+ fopAc_ac_c* actor = &i_this->actor;
+ cXyz mae, ato;
+ mae = actor->home.pos - actor->current.pos;
- switch (i_this->field_0x670) {
+ switch (i_this->mode) {
case 0:
anm_init(i_this, BCK_BI_MOVE, 3.0f, J3DFrameCtrl::EMode_LOOP, 3.0f);
- i_this->field_0x670 = 1;
- i_this->field_0x68c[0] = 20;
- a_this->speed.y = 0.0f;
+ i_this->mode = 1;
+ i_this->timer[0] = 20;
+ actor->speed.y = 0.0f;
// fallthrough
case 1:
- if (i_this->field_0x68c[0] == 0) {
- i_this->mpModelMorf->setPlaySpeed(0.0f);
- a_this->current.pos.y += a_this->speed.y;
- a_this->speed.y -= 0.1f;
+ if (i_this->timer[0] == 0) {
+ i_this->anm_p->setPlaySpeed(0.0f);
+ actor->current.pos.y += actor->speed.y;
+ actor->speed.y -= 0.1f;
- if (a_this->speed.y < -2.0f) {
- a_this->speed.y = -2.0f;
+ if (actor->speed.y < -2.0f) {
+ actor->speed.y = -2.0f;
}
- cLib_addCalc0(&a_this->scale.x, 1.0f, 0.02f);
- cLib_addCalcAngleS2(&a_this->shape_angle.x, 0x7FFF, 0x10, 0x800);
+ cLib_addCalc0(&actor->scale.x, 1.0f, 0.02f);
+ cLib_addCalcAngleS2(&actor->shape_angle.x, 0x7FFF, 0x10, 0x800);
- if (a_this->scale.x < 0.01f) {
- i_this->field_0x6b0 = 1;
+ if (actor->scale.x < 0.01f) {
+ i_this->leaf_id = 1;
}
}
break;
}
- a_this->current.pos.x += a_this->speed.x;
- a_this->current.pos.z += a_this->speed.z;
+ actor->current.pos.x += actor->speed.x;
+ actor->current.pos.z += actor->speed.z;
- i_this->mObjAcch.CrrPos(dComIfG_Bgsp());
- a_this->speed.x *= 0.9f;
- a_this->speed.z *= 0.9f;
+ i_this->ObjAcch.CrrPos(dComIfG_Bgsp());
+ actor->speed.x *= 0.9f;
+ actor->speed.z *= 0.9f;
- cXyz sp4c(a_this->current.pos);
- sp4c.y = i_this->field_0x6ac;
+ cXyz pos(actor->current.pos);
+ pos.y = i_this->water_offset;
- if (fabsf(sp4c.y - a_this->current.pos.y) < 70.0f) {
- fopAcM_effHamonSet(&i_this->field_0xbe8, &sp4c, KREG_F(2) + 1.0f, 0.2f);
+ if (fabsf(pos.y - actor->current.pos.y) < 70.0f) {
+ fopAcM_effHamonSet(&i_this->field_0xbe8, &pos, KREG_F(2) + 1.0f, 0.2f);
}
}
static void e_bi_disap(e_bi_class* i_this) {
- fopAc_ac_c* a_this = &i_this->actor;
+ fopAc_ac_c* actor = &i_this->actor;
- switch (i_this->field_0x670) {
+ switch (i_this->mode) {
case 0:
anm_init(i_this, BCK_BI_APPEAR, 10.0f, J3DFrameCtrl::EMode_NONE, 0.0f);
- i_this->field_0x660 = 40.0f;
- i_this->field_0x670 = 1;
- i_this->field_0x68c[0] = 10;
+ i_this->disap_time = 40.0f;
+ i_this->mode = 1;
+ i_this->timer[0] = 10;
break;
case 1:
- if (i_this->field_0x68c[0] == 0) {
- i_this->field_0x660 -= 1.0f;
+ if (i_this->timer[0] == 0) {
+ i_this->disap_time -= 1.0f;
- if (i_this->field_0x660 < 0.0f) {
- fopAcM_delete(a_this);
+ if (i_this->disap_time < 0.0f) {
+ fopAcM_delete(actor);
return;
}
}
break;
}
- i_this->mpModelMorf->setFrame(i_this->field_0x660);
+ i_this->anm_p->setFrame(i_this->disap_time);
}
static BOOL water_check(e_bi_class* i_this) {
- fopAc_ac_c* a_this = &i_this->actor;
- Vec i_pos;
+ fopAc_ac_c* actor = &i_this->actor;
+ Vec vec;
dBgS_ObjGndChk_Spl gnd_chk_spl;
- i_pos.x = a_this->current.pos.x;
- i_pos.y = a_this->current.pos.y + 300.0f;
- i_pos.z = a_this->current.pos.z;
- gnd_chk_spl.SetPos(&i_pos);
- i_this->field_0x6ac = dComIfG_Bgsp().GroundCross(&gnd_chk_spl);
+ vec.x = actor->current.pos.x;
+ vec.y = actor->current.pos.y + 300.0f;
+ vec.z = actor->current.pos.z;
+ gnd_chk_spl.SetPos(&vec);
+ i_this->water_offset = dComIfG_Bgsp().GroundCross(&gnd_chk_spl);
- if (i_this->field_0x6ac > a_this->current.pos.y + 50.0f) {
+ if (i_this->water_offset > actor->current.pos.y + 50.0f) {
return TRUE;
}
@@ -507,12 +507,12 @@ static BOOL water_check(e_bi_class* i_this) {
}
static void action(e_bi_class* i_this) {
- fopAc_ac_c* a_this = &i_this->actor;
+ fopAc_ac_c* actor = &i_this->actor;
fopAc_ac_c* player = dComIfGp_getPlayer(0);
- cXyz sp9c, spa8;
+ cXyz mae, ato;
- i_this->field_0x684 = fopAcM_searchPlayerAngleY(a_this);
- i_this->field_0x688 = (a_this->home.pos - player->current.pos).abs();
+ i_this->target_angle = fopAcM_searchPlayerAngleY(actor);
+ i_this->dis = (actor->home.pos - player->current.pos).abs();
damage_check(i_this);
@@ -521,7 +521,7 @@ static void action(e_bi_class* i_this) {
s8 bVar3 = 0;
s8 bVar4 = 1;
- switch (i_this->mAction) {
+ switch (i_this->action) {
case ACTION_WAIT:
e_bi_wait(i_this);
bVar3 = 1;
@@ -554,11 +554,11 @@ static void action(e_bi_class* i_this) {
break;
}
- if (fopAcM_GetRoomNo(a_this) == 3) {
+ if (fopAcM_GetRoomNo(actor) == 3) {
dBgS_LinChk lin_chk;
- sp9c = player->current.pos;
- sp9c.y += 150.0f;
- lin_chk.Set(&sp9c, &a_this->eyePos, a_this);
+ mae = player->current.pos;
+ mae.y += 150.0f;
+ lin_chk.Set(&mae, &actor->eyePos, actor);
if (dComIfG_Bgsp().LineCross(&lin_chk)) {
bVar1 = 0;
@@ -566,67 +566,67 @@ static void action(e_bi_class* i_this) {
}
if (bVar1 != 0) {
- fopAcM_OnStatus(a_this, 0);
- cLib_onBit<u32>(a_this->attention_info.flags, fopAc_AttnFlag_BATTLE_e);
+ fopAcM_OnStatus(actor, 0);
+ cLib_onBit<u32>(actor->attention_info.flags, fopAc_AttnFlag_BATTLE_e);
} else {
- fopAcM_OffStatus(a_this, 0);
- a_this->attention_info.flags = 0;
+ fopAcM_OffStatus(actor, 0);
+ actor->attention_info.flags = 0;
}
if (bVar2 != 0) {
- cXyz* ccMoveP = i_this->mStts.GetCCMoveP();
+ cXyz* ccMoveP = i_this->Stts.GetCCMoveP();
if (ccMoveP != NULL) {
- a_this->current.pos.x += ccMoveP->x * 0.5f;
- a_this->current.pos.y += ccMoveP->y * 0.5f;
- a_this->current.pos.z += ccMoveP->z * 0.5f;
+ actor->current.pos.x += ccMoveP->x * 0.5f;
+ actor->current.pos.y += ccMoveP->y * 0.5f;
+ actor->current.pos.z += ccMoveP->z * 0.5f;
}
- cMtx_YrotS(*calc_mtx, a_this->current.angle.y);
- sp9c.x = 0.0f;
- sp9c.y = 0.0f;
- sp9c.z = a_this->speedF;
- MtxPosition(&sp9c, &spa8);
- a_this->speed.x = spa8.x;
- a_this->speed.z = spa8.z;
- a_this->current.pos += a_this->speed;
- a_this->speed.y -= 5.0f;
- i_this->mObjAcch.CrrPos(dComIfG_Bgsp());
+ cMtx_YrotS(*calc_mtx, actor->current.angle.y);
+ mae.x = 0.0f;
+ mae.y = 0.0f;
+ mae.z = actor->speedF;
+ MtxPosition(&mae, &ato);
+ actor->speed.x = ato.x;
+ actor->speed.z = ato.z;
+ actor->current.pos += actor->speed;
+ actor->speed.y -= 5.0f;
+ i_this->ObjAcch.CrrPos(dComIfG_Bgsp());
}
if (bVar3 != 0) {
- cLib_onBit<u32>(a_this->attention_info.flags, fopAc_AttnFlag_CARRY_e);
+ cLib_onBit<u32>(actor->attention_info.flags, fopAc_AttnFlag_CARRY_e);
- if (fopAcM_checkCarryNow(a_this)) {
- cLib_offBit<u32>(a_this->attention_info.flags, fopAc_AttnFlag_CARRY_e);
- fopAc_ac_c* bomb_p = dBomb_c::createEnemyBomb(&a_this->current.pos, &a_this->current.angle, fopAcM_GetRoomNo(a_this));
+ if (fopAcM_checkCarryNow(actor)) {
+ cLib_offBit<u32>(actor->attention_info.flags, fopAc_AttnFlag_CARRY_e);
+ fopAc_ac_c* bomb_p = dBomb_c::createEnemyBomb(&actor->current.pos, &actor->current.angle, fopAcM_GetRoomNo(actor));
if (bomb_p == NULL) {
OS_REPORT("//////////////LEAF ID 2???\n");
} else {
- fopAc_ac_c* actor_p = fopAcM_SearchByID(i_this->field_0xba4);
+ fopAc_ac_c* actor_p = fopAcM_SearchByID(i_this->child_no);
if (actor_p != NULL) {
actor_p->parentActorID = fopAcM_GetID(bomb_p);
OS_REPORT("//////////////LEAF ID 1 %d\n", actor_p->parentActorID);
}
- i_this->field_0x6b0 = 1;
+ i_this->leaf_id = 1;
OS_REPORT("//////////////LEAF ID 1???\n");
}
}
- cLib_offBit<u32>(a_this->attention_info.flags, fopAc_AttnFlag_BATTLE_e);
+ cLib_offBit<u32>(actor->attention_info.flags, fopAc_AttnFlag_BATTLE_e);
} else {
- cLib_offBit<u32>(a_this->attention_info.flags, fopAc_AttnFlag_CARRY_e);
- cLib_onBit<u32>(a_this->attention_info.flags, fopAc_AttnFlag_BATTLE_e);
+ cLib_offBit<u32>(actor->attention_info.flags, fopAc_AttnFlag_CARRY_e);
+ cLib_onBit<u32>(actor->attention_info.flags, fopAc_AttnFlag_BATTLE_e);
}
if (bVar4 != 0 && water_check(i_this)) {
- i_this->mAction = 6;
- i_this->field_0x670 = 0;
- a_this->current.pos.y = i_this->field_0x6ac - (WREG_F(11) + 50.0f);
- cXyz i_pos(a_this->current.pos);
+ i_this->action = 6;
+ i_this->mode = 0;
+ actor->current.pos.y = i_this->water_offset - (WREG_F(11) + 50.0f);
+ cXyz pos(actor->current.pos);
static cXyz sc(0.8f, 0.8f, 0.8f);
static u16 w_eff_id[4] = {
@@ -634,16 +634,16 @@ static void action(e_bi_class* i_this) {
};
for (int i = 0; i < 4; i++) {
- i_this->field_0xbd8[i] = dComIfGp_particle_set(i_this->field_0xbd8[i], w_eff_id[i], &i_pos, &a_this->tevStr,
- &a_this->shape_angle, &sc, 0xFF, NULL,
+ i_this->w_eff[i] = dComIfGp_particle_set(i_this->w_eff[i], w_eff_id[i], &pos, &actor->tevStr,
+ &actor->shape_angle, &sc, 0xFF, NULL,
-1, NULL, NULL, NULL);
}
- i_this->mSound.startCreatureSound(Z2SE_CM_BODYFALL_WATER_S, 0, -1);
+ i_this->sound.startCreatureSound(Z2SE_CM_BODYFALL_WATER_S, 0, -1);
}
- cXyz i_effSize(0.75f, 0.75f, 0.75f);
- setMidnaBindEffect(&i_this->actor, &i_this->mSound, &a_this->eyePos, &i_effSize);
+ cXyz eff_size(0.75f, 0.75f, 0.75f);
+ setMidnaBindEffect(&i_this->actor, &i_this->sound, &actor->eyePos, &eff_size);
}
static void* s_fw_sub(void* i_actor, void* i_data) {
@@ -658,71 +658,71 @@ static void* s_fw_sub(void* i_actor, void* i_data) {
}
static void ride_movebg_init(e_bi_class* i_this) {
- fopAc_ac_c* a_this = &i_this->actor;
- cXyz sp74, sp80;
- Vec i_pos;
+ fopAc_ac_c* actor = &i_this->actor;
+ cXyz mae, ato;
+ Vec vec;
dBgS_ObjGndChk obj_gnd_chk;
- i_pos.x = a_this->current.pos.x;
- i_pos.y = a_this->current.pos.y + 200.0f;
- i_pos.z = a_this->current.pos.z;
+ vec.x = actor->current.pos.x;
+ vec.y = actor->current.pos.y + 200.0f;
+ vec.z = actor->current.pos.z;
- obj_gnd_chk.SetPos(&i_pos);
- i_pos.y = dComIfG_Bgsp().GroundCross(&obj_gnd_chk);
- a_this->current.pos.y = i_pos.y;
+ obj_gnd_chk.SetPos(&vec);
+ vec.y = dComIfG_Bgsp().GroundCross(&obj_gnd_chk);
+ actor->current.pos.y = vec.y;
- fopAc_ac_c* actor_p = (fopAc_ac_c*)fpcM_Search(s_fw_sub, a_this);
- if (actor_p != NULL) {
- sp74 = a_this->current.pos - actor_p->current.pos;
- cMtx_YrotS(*calc_mtx, -actor_p->shape_angle.y);
- MtxPosition(&sp74, &i_this->field_0xbb0);
- i_this->field_0xba8 = fopAcM_GetID(actor_p);
- i_this->field_0xbad++;
+ fopAc_ac_c* fw_p = (fopAc_ac_c*)fpcM_Search(s_fw_sub, actor);
+ if (fw_p != NULL) {
+ mae = actor->current.pos - fw_p->current.pos;
+ cMtx_YrotS(*calc_mtx, -fw_p->shape_angle.y);
+ MtxPosition(&mae, &i_this->field_0xbb0);
+ i_this->fw_id = fopAcM_GetID(fw_p);
+ i_this->ride_time++;
}
}
static int daE_BI_Execute(e_bi_class* i_this) {
- fopAc_ac_c* a_this = &i_this->actor;
+ fopAc_ac_c* actor = &i_this->actor;
- if (i_this->field_0x5b4 == 53) {
+ if (i_this->arg0 == 53) {
return 1;
}
- if (i_this->field_0xbad == 0) {
- if (i_this->field_0x5b5 == 1) {
+ if (i_this->ride_time == 0) {
+ if (i_this->arg1 == 1) {
if (i_this->field_0xbac == 0) {
ride_movebg_init(i_this);
} else {
i_this->field_0xbac -= 1;
}
} else {
- i_this->mObjAcch.CrrPos(dComIfG_Bgsp());
- i_this->field_0xbad++;
+ i_this->ObjAcch.CrrPos(dComIfG_Bgsp());
+ i_this->ride_time++;
}
}
- if (i_this->field_0xbad == 0) {
+ if (i_this->ride_time == 0) {
return 1;
}
- cXyz sp60, sp6c;
+ cXyz mae, ato;
- i_this->field_0x66c++;
+ i_this->counter++;
for (int i = 0; i < 3; i++) {
- if (i_this->field_0x68c[i] != 0) {
- i_this->field_0x68c[i]--;
+ if (i_this->timer[i] != 0) {
+ i_this->timer[i]--;
}
}
- if (i_this->field_0x692 != 0) {
- i_this->field_0x692--;
+ if (i_this->damage_time != 0) {
+ i_this->damage_time--;
}
action(i_this);
- if (i_this->field_0x5b5 == 1) {
- obj_fw_class* fw_p = (obj_fw_class*)fopAcM_SearchByID(i_this->field_0xba8);
+ if (i_this->arg1 == 1) {
+ obj_fw_class* fw_p = (obj_fw_class*)fopAcM_SearchByID(i_this->fw_id);
if (fw_p != NULL) {
mDoMtx_stack_c::transS(fw_p->actor.current.pos.x, fw_p->actor.current.pos.y + fw_p->field_0x594 + fw_p->field_0x588, fw_p->actor.current.pos.z);
mDoMtx_stack_c::YrotM(fw_p->field_0x5a0);
@@ -733,14 +733,14 @@ static int daE_BI_Execute(e_bi_class* i_this) {
mDoMtx_stack_c::ZrotM(fw_p->actor.shape_angle.z);
mDoMtx_stack_c::transM(i_this->field_0xbb0.x, i_this->field_0xbb0.y, i_this->field_0xbb0.z);
- sp60.set(0.0f, 0.0f, 0.0f);
- mDoMtx_stack_c::multVec(&sp60, &a_this->current.pos);
- a_this->home.pos = a_this->current.pos;
+ mae.set(0.0f, 0.0f, 0.0f);
+ mDoMtx_stack_c::multVec(&mae, &actor->current.pos);
+ actor->home.pos = actor->current.pos;
}
} else {
- mDoMtx_stack_c::transS(a_this->current.pos.x, a_this->current.pos.y, a_this->current.pos.z);
+ mDoMtx_stack_c::transS(actor->current.pos.x, actor->current.pos.y, actor->current.pos.z);
- if (i_this->mAction == 5) {
+ if (i_this->action == 5) {
mDoMtx_stack_c::transM(0.0f, JREG_F(8) + 27.0f, 0.0f);
mDoMtx_stack_c::YrotM(i_this->field_0x6a6);
mDoMtx_stack_c::XrotM(i_this->field_0x6a2);
@@ -748,86 +748,86 @@ static int daE_BI_Execute(e_bi_class* i_this) {
mDoMtx_stack_c::transM(0.0f, -(JREG_F(8) + 27.0f), 0.0f);
}
- mDoMtx_stack_c::YrotM(a_this->shape_angle.y);
- mDoMtx_stack_c::XrotM(a_this->shape_angle.x);
- mDoMtx_stack_c::ZrotM(a_this->shape_angle.z);
+ mDoMtx_stack_c::YrotM(actor->shape_angle.y);
+ mDoMtx_stack_c::XrotM(actor->shape_angle.x);
+ mDoMtx_stack_c::ZrotM(actor->shape_angle.z);
}
- mDoMtx_stack_c::scaleM(l_HIO.basic_size * a_this->scale.x, l_HIO.basic_size * a_this->scale.x, l_HIO.basic_size * a_this->scale.x);
- J3DModel* model = i_this->mpModelMorf->getModel();
+ mDoMtx_stack_c::scaleM(l_HIO.basic_size * actor->scale.x, l_HIO.basic_size * actor->scale.x, l_HIO.basic_size * actor->scale.x);
+ J3DModel* model = i_this->anm_p->getModel();
model->setBaseTRMtx(mDoMtx_stack_c::get());
- i_this->mpModelMorf->play(0, dComIfGp_getReverb(fopAcM_GetRoomNo(a_this)));
+ i_this->anm_p->play(0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor)));
- if (i_this->mAnm == BCK_BI_MOVE && (i_this->mpModelMorf->checkFrame(0.0f) || i_this->mpModelMorf->checkFrame(7.5f))) {
- i_this->mSound.startCreatureSound(Z2SE_EN_BI_FOOTNOTE, 0, -1);
+ if (i_this->anm_no == BCK_BI_MOVE && (i_this->anm_p->checkFrame(0.0f) || i_this->anm_p->checkFrame(7.5f))) {
+ i_this->sound.startCreatureSound(Z2SE_EN_BI_FOOTNOTE, 0, -1);
}
- if ((i_this->mAnm == BCK_BI_WAIT01 || i_this->mAnm == BCK_BI_WAIT02) && i_this->mpModelMorf->checkFrame(2.0f)) {
- i_this->mSound.startCreatureSound(Z2SE_EN_BI_WAIT, 0, -1);
+ if ((i_this->anm_no == BCK_BI_WAIT01 || i_this->anm_no == BCK_BI_WAIT02) && i_this->anm_p->checkFrame(2.0f)) {
+ i_this->sound.startCreatureSound(Z2SE_EN_BI_WAIT, 0, -1);
}
- if (i_this->mAnm == BCK_BI_APPEAR) {
- if (i_this->mpModelMorf->checkFrame(26.0f)) {
- i_this->mSound.startCreatureSound(Z2SE_EN_BI_APPEAR, 0, -1);
+ if (i_this->anm_no == BCK_BI_APPEAR) {
+ if (i_this->anm_p->checkFrame(26.0f)) {
+ i_this->sound.startCreatureSound(Z2SE_EN_BI_APPEAR, 0, -1);
}
- if (i_this->mpModelMorf->checkFrame(7.0f) || i_this->mpModelMorf->checkFrame(18.0f)) {
- i_this->mSound.startCreatureSound(Z2SE_EN_BI_FOOTNOTE, 0, -1);
+ if (i_this->anm_p->checkFrame(7.0f) || i_this->anm_p->checkFrame(18.0f)) {
+ i_this->sound.startCreatureSound(Z2SE_EN_BI_FOOTNOTE, 0, -1);
}
}
- if (i_this->mAnm == BCK_BI_ATTACK && i_this->mpModelMorf->checkFrame(8.0f)) {
- i_this->mSound.startCreatureSound(Z2SE_EN_BI_ATTACK, 0, -1);
+ if (i_this->anm_no == BCK_BI_ATTACK && i_this->anm_p->checkFrame(8.0f)) {
+ i_this->sound.startCreatureSound(Z2SE_EN_BI_ATTACK, 0, -1);
}
- i_this->mpModelMorf->modelCalc();
+ i_this->anm_p->modelCalc();
MTXCopy(model->getAnmMtx(0), *calc_mtx);
- sp60.set(KREG_F(0) + 15.0f, KREG_F(1), KREG_F(2));
- MtxPosition(&sp60, &a_this->eyePos);
- a_this->attention_info.position = a_this->eyePos;
- a_this->attention_info.position.y += KREG_F(3) + 45.0f;
+ mae.set(KREG_F(0) + 15.0f, KREG_F(1), KREG_F(2));
+ MtxPosition(&mae, &actor->eyePos);
+ actor->attention_info.position = actor->eyePos;
+ actor->attention_info.position.y += KREG_F(3) + 45.0f;
- f32 fVar1 = 0.0f;
+ f32 center = 0.0f;
if (dComIfGp_checkPlayerStatus0(0, fopAcM_STATUS_UNK_0x80000)) {
- fVar1 = 100.0f;
+ center = 100.0f;
}
- sp6c = a_this->current.pos;
+ ato = actor->current.pos;
- if (i_this->field_0x692 != 0) {
- sp6c.x += -20000.0f;
+ if (i_this->damage_time != 0) {
+ ato.x += -20000.0f;
}
- i_this->field_0x6f0.SetC(sp6c);
- i_this->field_0x6f0.SetR(XREG_F(1) + 25.0f + fVar1);
+ i_this->cc_cyl.SetC(ato);
+ i_this->cc_cyl.SetR(XREG_F(1) + 25.0f + center);
- if (i_this->mAction == 2) {
- i_this->field_0x6f0.SetH(JREG_F(13) + 120.0f);
+ if (i_this->action == 2) {
+ i_this->cc_cyl.SetH(JREG_F(13) + 120.0f);
} else {
- sp60.set(0.0f, 0.0f, 0.0f);
- MtxPosition(&sp60, &sp6c);
- f32 fVar2 = fabsf(sp6c.y - a_this->current.pos.y);
- i_this->field_0x6f0.SetH(XREG_F(0) + 90.0f + fVar2 + fVar1);
+ mae.set(0.0f, 0.0f, 0.0f);
+ MtxPosition(&mae, &ato);
+ f32 fVar2 = fabsf(ato.y - actor->current.pos.y);
+ i_this->cc_cyl.SetH(XREG_F(0) + 90.0f + fVar2 + center);
}
- dComIfG_Ccsp()->Set(&i_this->field_0x6f0);
+ dComIfG_Ccsp()->Set(&i_this->cc_cyl);
- sp60.set(0.0f, 0.0f, 0.0f);
+ mae.set(0.0f, 0.0f, 0.0f);
MTXCopy(model->getAnmMtx(0), *calc_mtx);
- MtxPosition(&sp60, &sp6c);
+ MtxPosition(&mae, &ato);
if (i_this->field_0x988 == 0) {
- sp6c.x += 17000.0f;
+ ato.x += 17000.0f;
} else {
i_this->field_0x988 = 0;
}
- i_this->field_0x82c.SetC(sp6c);
- i_this->field_0x82c.SetR(XREG_F(12) + 30.0f);
- dComIfG_Ccsp()->Set(&i_this->field_0x82c);
+ i_this->at_sph.SetC(ato);
+ i_this->at_sph.SetR(XREG_F(12) + 30.0f);
+ dComIfG_Ccsp()->Set(&i_this->at_sph);
- if (i_this->field_0x6b0 != 0) {
- fopAcM_delete(a_this);
+ if (i_this->leaf_id != 0) {
+ fopAcM_delete(actor);
}
return 1;
@@ -838,49 +838,49 @@ static int daE_BI_IsDelete(e_bi_class* i_this) {
}
static int daE_BI_Delete(e_bi_class* i_this) {
- fopAc_ac_c* a_this = &i_this->actor;
+ fopAc_ac_c* actor = &i_this->actor;
- dComIfG_resDelete(&i_this->mPhase, "E_BI");
+ dComIfG_resDelete(&i_this->phase, "E_BI");
- if (i_this->field_0xbfc != 0) {
+ if (i_this->hio_init != 0) {
l_initHIO = 0;
}
- if (a_this->heap != NULL) {
- i_this->mpModelMorf->stopZelAnime();
+ if (actor->heap != NULL) {
+ i_this->anm_p->stopZelAnime();
}
return 1;
}
-static int useHeapInit(fopAc_ac_c* a_this) {
- e_bi_class* i_this = (e_bi_class*)a_this;
+static int useHeapInit(fopAc_ac_c* actor) {
+ e_bi_class* i_this = (e_bi_class*)actor;
- i_this->mpModelMorf = new mDoExt_McaMorfSO((J3DModelData*)dComIfG_getObjectRes("E_BI", BMDR_BI), NULL, NULL,
+ i_this->anm_p = new mDoExt_McaMorfSO((J3DModelData*)dComIfG_getObjectRes("E_BI", BMDR_BI), NULL, NULL,
(J3DAnmTransform*)dComIfG_getObjectRes("E_BI", BCK_BI_WAIT01), 2, 1.0f, 0, -1,
- &i_this->mSound, 0x80000, 0x11000084);
- if (i_this->mpModelMorf == NULL || i_this->mpModelMorf->getModel() == NULL) {
+ &i_this->sound, 0x80000, 0x11000084);
+ if (i_this->anm_p == NULL || i_this->anm_p->getModel() == NULL) {
return 0;
}
return 1;
}
-static cPhs__Step daE_BI_Create(fopAc_ac_c* a_this) {
- fopAcM_ct(a_this, e_bi_class);
- e_bi_class* i_this = (e_bi_class*)a_this;
+static cPhs__Step daE_BI_Create(fopAc_ac_c* actor) {
+ fopAcM_ct(actor, e_bi_class);
+ e_bi_class* i_this = (e_bi_class*)actor;
- cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, "E_BI");
+ cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->phase, "E_BI");
if (phase == cPhs_COMPLEATE_e) {
- OS_REPORT("E_BI PARAM %x\n", fopAcM_GetParam(a_this));
+ OS_REPORT("E_BI PARAM %x\n", fopAcM_GetParam(actor));
- i_this->field_0x5b4 = fopAcM_GetParam(a_this);
- i_this->field_0x5b5 = fopAcM_GetParam(a_this) >> 8;
- i_this->field_0x5b6 = fopAcM_GetParam(a_this) >> 16;
+ i_this->arg0 = fopAcM_GetParam(actor);
+ i_this->arg1 = fopAcM_GetParam(actor) >> 8;
+ i_this->arg2 = fopAcM_GetParam(actor) >> 16;
OS_REPORT("E_BI//////////////E_BI SET 1 !!\n");
- if (!fopAcM_entrySolidHeap(a_this, useHeapInit, 0x27A0)) {
+ if (!fopAcM_entrySolidHeap(actor, useHeapInit, 0x27A0)) {
OS_REPORT("//////////////E_BI SET NON !!\n");
return cPhs_ERROR_e;
@@ -892,22 +892,22 @@ static cPhs__Step daE_BI_Create(fopAc_ac_c* a_this) {
return cPhs_ERROR_e;
}
- if (i_this->field_0x5b4 == 53) {
+ if (i_this->arg0 == 53) {
return phase;
}
if (l_initHIO == 0) {
- i_this->field_0xbfc = 1;
+ i_this->hio_init = 1;
l_initHIO = 1;
- l_HIO.field_0x4 = -1;
+ l_HIO.no = -1;
}
- a_this->attention_info.flags = fopAc_AttnFlag_BATTLE_e;
- fopAcM_SetMtx(a_this, i_this->mpModelMorf->getModel()->getBaseTRMtx());
- fopAcM_SetMin(a_this, -200.0f, -200.0f, -200.0f);
- fopAcM_SetMax(a_this, 200.0f, 200.0f, 200.0f);
- a_this->health = 30;
- a_this->field_0x560 = 30;
+ actor->attention_info.flags = fopAc_AttnFlag_BATTLE_e;
+ fopAcM_SetMtx(actor, i_this->anm_p->getModel()->getBaseTRMtx());
+ fopAcM_SetMin(actor, -200.0f, -200.0f, -200.0f);
+ fopAcM_SetMax(actor, 200.0f, 200.0f, 200.0f);
+ actor->health = 30;
+ actor->field_0x560 = 30;
static dCcD_SrcCyl cc_cyl_src = {
{
@@ -935,47 +935,47 @@ static cPhs__Step daE_BI_Create(fopAc_ac_c* a_this) {
} // mSphAttr
};
- i_this->mStts.Init(100, 0, a_this);
- i_this->field_0x6f0.Set(cc_cyl_src);
- i_this->field_0x6f0.SetStts(&i_this->mStts);
- i_this->field_0x82c.Set(at_sph_src);
- i_this->field_0x82c.SetStts(&i_this->mStts);
+ i_this->Stts.Init(100, 0, actor);
+ i_this->cc_cyl.Set(cc_cyl_src);
+ i_this->cc_cyl.SetStts(&i_this->Stts);
+ i_this->at_sph.Set(at_sph_src);
+ i_this->at_sph.SetStts(&i_this->Stts);
- i_this->mObjAcch.Set(fopAcM_GetPosition_p(a_this), fopAcM_GetOldPosition_p(a_this), a_this, 1, &i_this->mAcchCir,
- fopAcM_GetSpeed_p(a_this), NULL, NULL);
- i_this->mAcchCir.SetWall(30.0f, 30.0f);
+ i_this->ObjAcch.Set(fopAcM_GetPosition_p(actor), fopAcM_GetOldPosition_p(actor), actor, 1, &i_this->AcchCir,
+ fopAcM_GetSpeed_p(actor), NULL, NULL);
+ i_this->AcchCir.SetWall(30.0f, 30.0f);
- i_this->mSound.init(&a_this->current.pos, &a_this->eyePos, 3, 1);
- i_this->mAtInfo.mpSound = &i_this->mSound;
- i_this->mAtInfo.mPowerType = 1;
- i_this->mSound.setEnemyName("E_bi");
+ i_this->sound.init(&actor->current.pos, &actor->eyePos, 3, 1);
+ i_this->at_info.mpSound = &i_this->sound;
+ i_this->at_info.mPowerType = 1;
+ i_this->sound.setEnemyName("E_bi");
- i_this->field_0x66c = cM_rndF(65535.0f);
- a_this->attention_info.distances[fopAc_attn_CARRY_e] = 42;
+ i_this->counter = cM_rndF(65535.0f);
+ actor->attention_info.distances[fopAc_attn_CARRY_e] = 42;
- if (i_this->field_0x5b4 != 1) {
- if (i_this->field_0x5b5 == 1) {
+ if (i_this->arg0 != 1) {
+ if (i_this->arg1 == 1) {
i_this->field_0xbac = 10;
} else {
- cXyz sp38(a_this->current.pos);
- sp38.y += 100.0f;
+ cXyz pos(actor->current.pos);
+ pos.y += 100.0f;
- if (fopAcM_gc_c::gndCheck(&sp38)) {
- a_this->current.pos.y = fopAcM_gc_c::getGroundY();
- a_this->home.pos.y = a_this->current.pos.y;
+ if (fopAcM_gc_c::gndCheck(&pos)) {
+ actor->current.pos.y = fopAcM_gc_c::getGroundY();
+ actor->home.pos.y = actor->current.pos.y;
}
}
- i_this->field_0xba4 = fopAcM_createChild(PROC_E_BI_LEAF, fopAcM_GetID(a_this), i_this->field_0x5b5, &a_this->current.pos,
- fopAcM_GetRoomNo(a_this), &a_this->shape_angle, NULL, -1, NULL);
+ i_this->child_no = fopAcM_createChild(PROC_E_BI_LEAF, fopAcM_GetID(actor), i_this->arg1, &actor->current.pos,
+ fopAcM_GetRoomNo(actor), &actor->shape_angle, NULL, -1, NULL);
} else {
- i_this->field_0x670 = -2;
- i_this->field_0xba4 = a_this->parentActorID;
+ i_this->mode = -2;
+ i_this->child_no = actor->parentActorID;
}
- if (fopAcM_GetRoomNo(a_this) == 50) {
- a_this->attention_info.flags = fopAc_AttnFlag_BATTLE_e;
- a_this->attention_info.distances[fopAc_attn_BATTLE_e] = 22;
+ if (fopAcM_GetRoomNo(actor) == 50) {
+ actor->attention_info.flags = fopAc_AttnFlag_BATTLE_e;
+ actor->attention_info.distances[fopAc_attn_BATTLE_e] = 22;
}
daE_BI_Execute(i_this);
diff --git a/src/d/actor/d_a_e_bi_leaf.cpp b/src/d/actor/d_a_e_bi_leaf.cpp
index 1f5ad45f58..8dd49e1444 100644
--- a/src/d/actor/d_a_e_bi_leaf.cpp
+++ b/src/d/actor/d_a_e_bi_leaf.cpp
@@ -9,62 +9,62 @@
#include "d/d_com_inf_game.h"
static int daE_BI_LEAF_Draw(e_bi_leaf_class* i_this) {
- if (i_this->field_0x5b4 == 1) {
+ if (i_this->type == 1) {
return 1;
}
g_env_light.settingTevStruct(0, &i_this->current.pos, &i_this->tevStr);
- g_env_light.setLightTevColorType_MAJI(i_this->mpModel, &i_this->tevStr);
- mDoExt_modelUpdateDL(i_this->mpModel);
+ g_env_light.setLightTevColorType_MAJI(i_this->model, &i_this->tevStr);
+ mDoExt_modelUpdateDL(i_this->model);
return 1;
}
static void action(e_bi_leaf_class* i_this) {
- switch (i_this->mAction) {
+ switch (i_this->action) {
case 0:
- if (i_this->mTimer == 0) {
+ if (i_this->timer == 0) {
fopAc_ac_c* parent_p = fopAcM_SearchByID(i_this->parentActorID);
if (parent_p == NULL) {
OS_REPORT("//////////////LEAF ID 2 %d\n", i_this->parentActorID);
if (fopAcM_GetRoomNo(i_this) == 50) {
- i_this->mTimer = 90;
+ i_this->timer = 90;
} else {
- i_this->mTimer = 60;
+ i_this->timer = 60;
}
- i_this->mAction = 1;
+ i_this->action = 1;
}
}
break;
case 1:
- if (i_this->mTimer == 0) {
- i_this->mAction = 0;
+ if (i_this->timer == 0) {
+ i_this->action = 0;
i_this->parentActorID =
- fopAcM_createChild(PROC_E_BI, fopAcM_GetID(i_this), (i_this->field_0x5b4 << 8) | 1,
+ fopAcM_createChild(PROC_E_BI, fopAcM_GetID(i_this), (i_this->type << 8) | 1,
&i_this->current.pos, fopAcM_GetRoomNo(i_this),
&i_this->current.angle, NULL, -1, NULL);
- i_this->mTimer = 20;
+ i_this->timer = 20;
}
break;
}
}
static int daE_BI_LEAF_Execute(e_bi_leaf_class* i_this) {
- if (i_this->mTimer != 0) {
- i_this->mTimer--;
+ if (i_this->timer != 0) {
+ i_this->timer--;
}
action(i_this);
- if (i_this->field_0x5b4 == 1) {
+ if (i_this->type == 1) {
return 1;
}
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);
- i_this->mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
+ i_this->model->setBaseTRMtx(mDoMtx_stack_c::get());
return 1;
}
@@ -73,19 +73,19 @@ static int daE_BI_LEAF_IsDelete(e_bi_leaf_class* i_this) {
}
static int daE_BI_LEAF_Delete(e_bi_leaf_class* i_this) {
- dComIfG_resDelete(&i_this->mPhase, "E_BI");
+ dComIfG_resDelete(&i_this->phase, "E_BI");
return 1;
}
-static int useHeapInit(fopAc_ac_c* i_this) {
- e_bi_leaf_class* a_this = static_cast<e_bi_leaf_class*>(i_this);
+static int useHeapInit(fopAc_ac_c* actor) {
+ e_bi_leaf_class* i_this = static_cast<e_bi_leaf_class*>(actor);
- if (a_this->field_0x5b4 != 1) {
+ if (i_this->type != 1) {
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("E_BI", 15);
JUT_ASSERT(0, modelData != NULL);
- a_this->mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084);
- if (a_this->mpModel == NULL) {
+ i_this->model = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084);
+ if (i_this->model == NULL) {
return 0;
}
}
@@ -93,24 +93,24 @@ static int useHeapInit(fopAc_ac_c* i_this) {
return 1;
}
-static int daE_BI_LEAF_Create(fopAc_ac_c* i_this) {
- e_bi_leaf_class* a_this = static_cast<e_bi_leaf_class*>(i_this);
- fopAcM_ct(a_this, e_bi_leaf_class);
+static int daE_BI_LEAF_Create(fopAc_ac_c* actor) {
+ e_bi_leaf_class* i_this = static_cast<e_bi_leaf_class*>(actor);
+ fopAcM_ct(i_this, e_bi_leaf_class);
- int phase_state = dComIfG_resLoad(&a_this->mPhase, "E_BI");
+ int phase_state = dComIfG_resLoad(&i_this->phase, "E_BI");
if (phase_state == cPhs_COMPLEATE_e) {
- a_this->field_0x5b4 = fopAcM_GetParam(a_this) & 0xFF;
+ i_this->type = fopAcM_GetParam(i_this) & 0xFF;
OS_REPORT("E_BI_LEAF//////////////E_BI_LEAF SET 1 !!\n");
- if (!fopAcM_entrySolidHeap(a_this, useHeapInit, 0xA00)) {
+ if (!fopAcM_entrySolidHeap(i_this, useHeapInit, 0xA00)) {
OS_REPORT("//////////////E_BI_LEAF SET NON !!\n");
return cPhs_ERROR_e;
}
OS_REPORT("//////////////E_BI_LEAF SET 2 !!\n");
- fopAcM_SetMtx(a_this, a_this->mpModel->getBaseTRMtx());
- daE_BI_LEAF_Execute(a_this);
+ fopAcM_SetMtx(i_this, i_this->model->getBaseTRMtx());
+ daE_BI_LEAF_Execute(i_this);
}
return phase_state;