Skip to content

Commit

Permalink
d_a_bk work
Browse files Browse the repository at this point in the history
  • Loading branch information
LagoLunatic committed Oct 15, 2024
1 parent d0990e3 commit c6bd52f
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 13 deletions.
4 changes: 2 additions & 2 deletions include/d/actor/d_a_bk.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class bk_class : public fopEn_enemy_c {
/* 0x11B4 */ u8 m11B4[0x11C0 - 0x11B4];
/* 0x11C0 */ cXyz m11C0;
/* 0x11CC */ cXyz m11CC;
/* 0x11D8 */ u8 m11D8[0x11E4 - 0x11D8];
/* 0x11D8 */ cXyz m11D8;
/* 0x11E4 */ cXyz m11E4;
/* 0x11F0 */ u8 m11F0;
/* 0x11F1 */ u8 m11F1;
Expand Down Expand Up @@ -192,7 +192,7 @@ class bkHIO_c : public JORReflexible {
m0A6 = 0x0;
m0A8[0] = 1.0f;
m0A8[1] = 1.0f;
m0A8[2] = 1.0f;
m0A8[2] = 0.5f;
m0A8[3] = 1.0f;
m0A8[4] = 1.0f;
m0A8[5] = 1.0f;
Expand Down
8 changes: 5 additions & 3 deletions include/f_op/f_op_scene_mng.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ void fopScnM_Management(void);
void fopScnM_Init(void);

inline u32 fpcM_LayerID(const void* pProc) {
return fpcBs_Is_JustOfType(g_fpcNd_type, ((base_process_class*)pProc)->mSubType) != FALSE ?
((scene_class*)pProc)->base.mLayer.mLayerID :
0xFFFFFFFF;
if (fpcBs_Is_JustOfType(g_fpcNd_type, ((base_process_class*)pProc)->mSubType)) {
return ((scene_class*)pProc)->base.mLayer.mLayerID;
} else {
return fpcLy_NONE_e;
}
}

inline layer_class * fpcM_Layer(const void* pProc) {
Expand Down
84 changes: 81 additions & 3 deletions src/d/actor/d_a_bk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2352,7 +2352,31 @@ static void b_nige(bk_class* i_this) {

/* 00008470-00008580 .text defence__FP8bk_class */
static void defence(bk_class* i_this) {
/* Nonmatching */
i_this->dr.m710 = 1;
i_this->dr.m4D0 = i_this->m0332;
cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->dr.m4D0, 4, 0x400);

switch (i_this->dr.m004) {
case 0:
i_this->dr.m004 = 1;
anm_init(i_this, BK_BCK_BK_BOUGYO1, 0.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f, -1);
i_this->speedF = 0.0f;
// Fall-through
case 1:
i_this->m0F14.SetR(60.0f);
i_this->m11D8 = i_this->m11CC;
if (i_this->m0300[1] == 0) {
if (cM_rndF(1.0f) < 0.5f) {
i_this->dr.mState = 5;
i_this->dr.m004 = 0;
} else {
i_this->dr.mState = 4;
i_this->m0300[1] = 0;
i_this->dr.m004 = 0;
}
}
break;
}
}

/* 00008580-00008654 .text oshi__FP8bk_class */
Expand Down Expand Up @@ -2410,7 +2434,37 @@ static void yogan_fail(bk_class* i_this) {

/* 000090E0-0000924C .text water_fail__FP8bk_class */
static void water_fail(bk_class* i_this) {
/* Nonmatching */
i_this->dr.m71E = 5;
i_this->m030E = 5;
fopAcM_OffStatus(i_this, 0);
i_this->attention_info.flags = 0;
i_this->speedF = 0.0f;

switch (i_this->dr.m004) {
case 0:
anm_init(i_this, BK_BCK_BK_NIGERU, 5.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, BK_BAS_BK_NIGERU);
i_this->dr.m004 = 1;
fopAcM_monsSeStart(i_this, JA_SE_CV_BK_SURPRISE, 0);
i_this->dr.m458.y = 0.0f;
i_this->dr.m44C.y = 0.0f;
i_this->dr.m480 = 0;
if (i_this->m0B30 != 0) {
i_this->m0B34 = 1;
}
i_this->m0300[3] = 120;
// Fall-through
case 1:
i_this->speed.y = 0.0f;
i_this->current.pos.y -= 1.0f;
cLib_addCalcAngleS2(&i_this->current.angle.x, 0, 8, 0x800);
if (i_this->m0300[3] == 0) {
fopAcM_delete(i_this);
if (i_this->m02B8 != 0) {
dComIfGs_onSwitch(i_this->m02B8, i_this->current.roomNo);
}
}
break;
}
}

/* 0000924C-00009944 .text wepon_search__FP8bk_class */
Expand All @@ -2435,7 +2489,31 @@ static void carry_drop(bk_class* i_this) {

/* 00009DF0-00009F1C .text d_mahi__FP8bk_class */
static void d_mahi(bk_class* i_this) {
/* Nonmatching */
switch (i_this->dr.m004) {
case 0:
i_this->dr.m004 = 1;
anm_init(i_this, BK_BCK_BK_SUWARI, 20.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f, BK_BAS_BK_SUWARI);
i_this->m0300[0] = 100;
// Fall-through
case 1:
if (i_this->m0300[0] <= 80 && i_this->m0300[0] >= 40) {
if (i_this->m0300[0] == 80) {
enemy_piyo_set(i_this);
}
fopAcM_seStart(i_this, JA_SE_CM_MD_PIYO, 0);
}
i_this->speedF = 0.0f;
if (i_this->m0300[0] == 30) {
i_this->dr.m49E = 0xF;
}
if (i_this->m0300[0] == 0) {
i_this->dr.mState = 0;
path_check(i_this, 0);
wait_set(i_this);
i_this->dr.m004 = 2;
}
break;
}
}

/* 00009F1C-0000A350 .text tubo_wait__FP8bk_class */
Expand Down
10 changes: 5 additions & 5 deletions src/d/actor/d_a_lbridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void daLbridge_c::CreateInit() {
mAppearEventIdx = dComIfGp_evmng_getEventIdx("EFFAPPEAR");
mDisappearEventIdx = dComIfGp_evmng_getEventIdx("BRIDGE_DISAPPEAR");

if (fopAcM_isSwitch(this, mSwitchNo) != FALSE || mSwitchNo == 0xFF) {
if (fopAcM_isSwitch(this, mSwitchNo) || mSwitchNo == 0xFF) {
dComIfG_Bgsp()->Regist(mpBgW, this);
set_mtx();

Expand Down Expand Up @@ -186,20 +186,20 @@ void daLbridge_c::sw_check() {
/* 00000A6C-00000C18 .text demo__11daLbridge_cFv */
void daLbridge_c::demo() {
if (eventInfo.checkCommandDemoAccrpt()) {
if (dComIfGp_evmng_startCheck(mAppearEventIdx) != FALSE && unk31C == 1) {
if (dComIfGp_evmng_startCheck(mAppearEventIdx) && unk31C == 1) {
unk31C = 0;
}

if (dComIfGp_evmng_startCheck(mDisappearEventIdx) != FALSE && unk31C == 2) {
if (dComIfGp_evmng_startCheck(mDisappearEventIdx) && unk31C == 2) {
unk31C = 0;
}

if (dComIfGp_evmng_endCheck(mAppearEventIdx) != FALSE) {
if (dComIfGp_evmng_endCheck(mAppearEventIdx)) {
dComIfGp_event_reset();
dComIfGs_onEventBit(0xE01U);
}

if (dComIfGp_evmng_endCheck(mDisappearEventIdx) != FALSE) {
if (dComIfGp_evmng_endCheck(mDisappearEventIdx)) {
dComIfGp_event_reset();
dComIfGs_onEventBit(0xF40U);
}
Expand Down

0 comments on commit c6bd52f

Please sign in to comment.