d_a_boko start

This commit is contained in:
LagoLunatic
2024-04-17 13:35:53 -04:00
parent a116292705
commit c93901ce2c
5 changed files with 249 additions and 55 deletions
+40 -23
View File
@@ -9,12 +9,18 @@
#include "m_Do/m_Do_ext.h"
#include "SSystem/SComponent/c_phase.h"
class dBgS_ObjLinChk;
struct ke_c_s {
};
class daBoko_c : public fopAc_ac_c {
public:
typedef BOOL (daBoko_c::*ProcFunc_t)();
daBoko_c();
static Vec m_top_offset[6];
static Vec m_blur_root_offset[6];
static Vec m_root_offset[6];
@@ -25,50 +31,54 @@ public:
static f32 m_blur_rate[6];
static u8 m_se_type[6];
static dBgS_ObjGndChk m_ground_check;
static dBgS_ObjLinChk m_line_check;
f32 getCpsR() { return m_cps_r[fopAcM_GetParam(this)]; }
s32 getAtPoint() { return m_at_point[fopAcM_GetParam(this)]; }
u32 getAtType() { return m_at_type[fopAcM_GetParam(this)]; }
void getBlurRate() {}
f32 getCpsR() { return m_cps_r[fopAcM_GetParam(this)]; }
void getFlameTimer() {}
void getJumpBlurRate() {}
void getNowMode() {}
f32 getJumpBlurRate() { return m_jump_blur_rate[fopAcM_GetParam(this)]; }
f32 getBlurRate() { return m_blur_rate[fopAcM_GetParam(this)]; }
u8 getSeType() { return m_se_type[fopAcM_GetParam(this)]; }
void getFlameTimer() {}
void getNowMode() {}
void setNowMode(int) {}
void moveStateInit(f32 speedForward, f32 speedY, s16 angleY) {
speed.y = speedY;
speedF = speedForward;
current.angle.y = angleY;
}
void onFloorFlg() {}
void onFloorFlg() {} // maybe: m2BC = 1;
void setMatrix(Mtx mtx) {
if (mpModel) {
mpModel->setBaseTRMtx(mtx);
}
}
void setNowMode(int) {}
void setRotAngleSpeed(s16 speed) { m2C2 = speed; }
void setThrow(s16) {}
void setThrow(s16) {} // maybe m2BA
void getTopPos(cXyz *);
void getBlurRootPos(cXyz *);
void getTopPos(cXyz*);
void getBlurRootPos(cXyz*);
void keDraw();
void keCalc1(ke_c_s*, int);
void keCalc();
BOOL draw();
void setTopRootPos(int);
void setBaseMatrix();
void checkNoDraw();
BOOL checkNoDraw();
void setFlameEffect();
void setRoomInfo();
void setThrowReverse(short);
void procWait_init();
void procWait();
void procMove_init();
void procMove();
void procThrow();
void procCarry();
void setThrowReverse(s16);
BOOL procWait_init();
BOOL procWait();
BOOL procMove_init();
BOOL procMove();
BOOL procThrow();
BOOL procCarry();
BOOL execute();
void bokoDelete();
void createHeap();
BOOL createHeap();
s32 create();
public:
@@ -77,7 +87,7 @@ public:
/* 0x29C */ mDoExt_brkAnm mBrkAnm;
/* 0x2B4 */ u8 m2B4[0x2B8 - 0x2B4];
/* 0x2B8 */ u8 mCurrentAction;
/* 0x2B9 */ u8 m2B9[0x2BA - 0x2B9];
/* 0x2B9 */ u8 m2B9;
/* 0x2BA */ u8 m2BA;
/* 0x2BB */ u8 m2BB;
/* 0x2BC */ u8 m2BC;
@@ -87,14 +97,15 @@ public:
/* 0x2C4 */ s16 m2C4;
/* 0x2C6 */ u8 m2C6[0x2C8 - 0x2C6];
/* 0x2C8 */ s16 m2C8;
/* 0x2CA */ u8 m2CA[0x2D0 - 0x2CA];
/* 0x2CA */ s16 m2CA;
/* 0x2CC */ u8 m2CC[0x2D0 - 0x2CC];
/* 0x2D0 */ cXyz m2D0;
/* 0x2DC */ u8 m2DC[0x2F4 - 0x2DC];
/* 0x2F4 */ cXyz m2F4;
/* 0x300 */ LIGHT_INFLUENCE mLight;
/* 0x320 */ cXyz m320;
/* 0x32C */ dPa_followEcallBack mParticleCallBack;
/* 0x340 */ dBgS_Acch mAcch;
/* 0x340 */ dBgS_ObjAcch mAcch;
/* 0x504 */ dBgS_AcchCir mAcchCir;
/* 0x544 */ dCcD_Stts mStts;
/* 0x580 */ dCcD_Sph mSph;
@@ -103,7 +114,13 @@ public:
/* 0x7E8 */ Mtx mAlphaModelMtx[2];
/* 0x848 */ u8 m848[0x8A8 - 0x848];
/* 0x8A8 */ mDoExt_3DlineMat0_c* mpLineMat;
/* 0x8AC */ int (daBoko_c::*mCurrentProc)();
/* 0x8AC */ ProcFunc_t mCurrentProc;
};
class daBoko_HIO_c0 {
public:
static const s16 throw_timer;
static const f32 throw_speed;
};
#endif /* D_A_BOKO_H */
+1 -1
View File
@@ -1052,7 +1052,7 @@ public:
void resetCurse();
void checkLightHit();
void setSwordAtCollision();
void getBlurTopRate();
f32 getBlurTopRate();
void setCollision();
void setAttentionPos();
int setRoomInfo();
+1
View File
@@ -38,6 +38,7 @@ class J2DOrthoGraph;
enum daPy__PlayerStatus0 {
daPyStts0_UNK1_e = 0x00000001,
daPyStts0_UNK10_e = 0x00000010,
daPyStts0_UNK80_e = 0x00000080,
daPyStts0_UNK100_e = 0x00000100,
daPyStts0_BOW_AIM_e = 0x00001000,
daPyStts0_SWORD_SWING_e = 0x00008000,
+180 -29
View File
@@ -4,12 +4,24 @@
//
#include "d/actor/d_a_boko.h"
#include "dolphin/types.h"
#include "d/d_com_inf_game.h"
#include "d/d_procname.h"
#include "d/d_bg_s_lin_chk.h"
static u8 dummy_bss[0x4C];
static cXyz l_break_particle_offset(0.0f, 0.0f, 30.0f);
dBgS_ObjGndChk daBoko_c::m_ground_check;
dBgS_ObjLinChk daBoko_c::m_line_check;
const s16 daBoko_HIO_c0::throw_timer = 2;
const f32 daBoko_HIO_c0::throw_speed = 70.0f;
static u8 l_HIO;
/* 000000EC-0000017C .text keDraw__8daBoko_cFv */
void daBoko_c::keDraw() {
/* Nonmatching */
mpLineMat->update(0xA, 1.25f, (GXColor){0xFF, 0x64, 0x00, 0xFF}, 2, &tevStr);
dComIfGd_set3DlineMat(mpLineMat);
}
@@ -29,8 +41,8 @@ BOOL daBoko_c::draw() {
}
/* 00000DC4-00000DE4 .text daBoko_Draw__FP8daBoko_c */
static BOOL daBoko_Draw(daBoko_c*) {
/* Nonmatching */
static BOOL daBoko_Draw(daBoko_c* i_this) {
return i_this->draw();
}
/* 00000DE4-00000EB0 .text setTopRootPos__8daBoko_cFi */
@@ -44,8 +56,8 @@ void daBoko_c::setBaseMatrix() {
}
/* 00000F60-00000FA4 .text checkNoDraw__8daBoko_cFv */
void daBoko_c::checkNoDraw() {
/* Nonmatching */
BOOL daBoko_c::checkNoDraw() {
return m2B9 || mCurrentAction == 4 || (mCurrentAction == 3 && dComIfGp_checkPlayerStatus0(0, daPyStts0_UNK80_e));
}
/* 00000FA4-00001340 .text setFlameEffect__8daBoko_cFv */
@@ -55,42 +67,150 @@ void daBoko_c::setFlameEffect() {
/* 00001340-000013CC .text setRoomInfo__8daBoko_cFv */
void daBoko_c::setRoomInfo() {
/* Nonmatching */
int roomNo;
if (mAcch.GetGroundH() != -1e9f) {
roomNo = dComIfG_Bgsp()->GetRoomId(mAcch.m_gnd);
tevStr.mEnvrIdxOverride = dComIfG_Bgsp()->GetPolyColor(mAcch.m_gnd);
} else {
roomNo = dComIfGp_roomControl_getStayNo();
}
current.roomNo = tevStr.mRoomNo = roomNo;
mStts.SetRoomId(roomNo);
}
/* 000013CC-0000155C .text setThrowReverse__8daBoko_cFs */
void daBoko_c::setThrowReverse(short) {
void daBoko_c::setThrowReverse(s16) {
/* Nonmatching */
}
/* 0000155C-000015E0 .text procWait_init__8daBoko_cFv */
void daBoko_c::procWait_init() {
/* Nonmatching */
BOOL daBoko_c::procWait_init() {
speedF = 0.0f;
m2C0 = 0;
m2C2 = 0;
mCurrentProc = &daBoko_c::procWait;
cLib_onBit<u32>(attention_info.flags, fopAc_Attn_ACTION_CARRY_e);
mCurrentAction = 0;
fopAcM_cancelCarryNow(this);
gravity = -3.0f;
return TRUE;
}
/* 000015E0-000016E4 .text procWait__8daBoko_cFv */
void daBoko_c::procWait() {
/* Nonmatching */
BOOL daBoko_c::procWait() {
if (fopAcM_checkCarryNow(this)) {
gravity = 0.0f;
mCurrentProc = &daBoko_c::procCarry;
speedF = 0.0f;
speed = cXyz::Zero;
if (mCurrentAction != 3) {
mCurrentAction = 2;
}
cLib_offBit<u32>(attention_info.flags, fopAc_Attn_ACTION_CARRY_e);
m2BC = 0;
procCarry();
} else if (m2BC == 0) {
fopAcM_posMoveF(this, NULL);
mAcch.CrrPos(*dComIfG_Bgsp());
if (!mAcch.ChkGroundHit()) {
procMove_init();
}
setRoomInfo();
setBaseMatrix();
}
return TRUE;
}
/* 000016E4-0000175C .text procMove_init__8daBoko_cFv */
void daBoko_c::procMove_init() {
/* Nonmatching */
BOOL daBoko_c::procMove_init() {
mCurrentProc = &daBoko_c::procMove;
mCurrentAction = 1;
fopAcM_setCarryNow(this, FALSE);
cLib_offBit<u32>(attention_info.flags, fopAc_Attn_ACTION_CARRY_e);
m2BB = 0x14;
m2BC = 0;
return TRUE;
}
/* 0000175C-00001E94 .text procMove__8daBoko_cFv */
void daBoko_c::procMove() {
BOOL daBoko_c::procMove() {
/* Nonmatching */
}
/* 00001E94-000021B8 .text procThrow__8daBoko_cFv */
void daBoko_c::procThrow() {
BOOL daBoko_c::procThrow() {
/* Nonmatching */
}
/* 000021B8-00002624 .text procCarry__8daBoko_cFv */
void daBoko_c::procCarry() {
/* Nonmatching */
BOOL daBoko_c::procCarry() {
if (fopAcM_checkCarryNow(this) || m2BA == 0) {
mDoMtx_multVecZero(mpModel->getBaseTRMtx(), &current.pos);
mDoMtx_MtxToRot(mpModel->getBaseTRMtx(), &shape_angle);
}
fopAc_ac_c* link = dComIfGp_getLinkPlayer();
cXyz linkFootPos(link->current.pos.x, link->current.pos.y + 5.0f, link->current.pos.z);
if (!fopAcM_checkCarryNow(this)) {
fopAcM_setCarryNow(this, FALSE);
setTopRootPos(1);
if (m2BA != 0) {
mCurrentProc = &daBoko_c::procThrow;
mCurrentAction = 6;
gravity = 0.0f;
shape_angle.x = m2CA;
shape_angle.y = link->shape_angle.y;
current.angle.y = shape_angle.y;
speedF = 70.0f * cM_scos(shape_angle.x);
speed.y = -70.0f * cM_ssin(shape_angle.x);
m2C8 = 2;
m2BA = 0;
mCps.ResetAtHit();
m_line_check.Set(&linkFootPos, &current.pos, this);
if (dComIfG_Bgsp()->LineCross(&m_line_check)) {
current.pos = m_line_check.GetCross();
cM3dGPla* triPla = dComIfG_Bgsp()->GetTriPla(m_line_check);
current.pos += *triPla->GetNP() * 10.0f;
setThrowReverse(cM_atan2s(triPla->GetNP()->x, triPla->GetNP()->z));
} else {
procThrow();
}
} else if (m2BC != 0) {
if (shape_angle.z >= 0x4000) {
shape_angle.z = 0;
shape_angle.x += 0x8000;
shape_angle.y += 0x8000;
}
procWait_init();
} else {
current.angle.y = shape_angle.y + 0x8000;
if (mCurrentAction == 3) {
m_line_check.Set(&linkFootPos, &current.pos, this);
if (dComIfG_Bgsp()->LineCross(&m_line_check)) {
current.pos = m_line_check.GetCross();
}
}
procMove_init();
int i;
for (i = 0; i < 3; i++) {
m_ground_check.SetPos(&current.pos);
if (dComIfG_Bgsp()->GroundCross(&m_ground_check) != -1e9f) {
break;
}
current.pos.x -= 50.0f * cM_ssin(shape_angle.y);
current.pos.z -= 50.0f * cM_scos(shape_angle.y);
}
if (i == 3) {
current.pos = linkFootPos;
current.pos.y = 50.0f;
}
old.pos = current.pos;
current.pos.y -= 5.0f;
m2C0 = 0;
gravity = -3.0f;
procMove();
}
}
return TRUE;
}
/* 00002624-00002A04 .text execute__8daBoko_cFv */
@@ -99,13 +219,13 @@ BOOL daBoko_c::execute() {
}
/* 00002A04-00002A24 .text daBoko_Execute__FP8daBoko_c */
static BOOL daBoko_Execute(daBoko_c*) {
/* Nonmatching */
static BOOL daBoko_Execute(daBoko_c* i_this) {
return i_this->execute();
}
/* 00002A24-00002A2C .text daBoko_IsDelete__FP8daBoko_c */
static BOOL daBoko_IsDelete(daBoko_c*) {
/* Nonmatching */
static BOOL daBoko_IsDelete(daBoko_c* i_this) {
return TRUE;
}
/* 00002A2C-00002AA4 .text bokoDelete__8daBoko_cFv */
@@ -114,26 +234,57 @@ void daBoko_c::bokoDelete() {
}
/* 00002AA4-00002AC8 .text daBoko_Delete__FP8daBoko_c */
static BOOL daBoko_Delete(daBoko_c*) {
/* Nonmatching */
static BOOL daBoko_Delete(daBoko_c* i_this) {
i_this->bokoDelete();
return TRUE;
}
/* 00002AC8-00002AE8 .text daBoko_createHeap__FP10fopAc_ac_c */
static BOOL daBoko_createHeap(fopAc_ac_c*) {
/* Nonmatching */
static BOOL daBoko_createHeap(fopAc_ac_c* i_this) {
return static_cast<daBoko_c*>(i_this)->createHeap();
}
/* 00002AE8-00002CFC .text createHeap__8daBoko_cFv */
void daBoko_c::createHeap() {
BOOL daBoko_c::createHeap() {
/* Nonmatching */
}
/* 00002DE4-00003154 .text create__8daBoko_cFv */
s32 daBoko_c::create() {
/* Nonmatching */
fopAcM_SetupActor(this, daBoko_c);
}
/* 00003154-000032F0 .text __ct__8daBoko_cFv */
daBoko_c::daBoko_c() {
}
/* 00003824-00003844 .text daBoko_Create__FP10fopAc_ac_c */
static s32 daBoko_Create(fopAc_ac_c*) {
/* Nonmatching */
static s32 daBoko_Create(fopAc_ac_c* i_this) {
return static_cast<daBoko_c*>(i_this)->create();
}
static actor_method_class l_daBoko_Method = {
(process_method_func)daBoko_Create,
(process_method_func)daBoko_Delete,
(process_method_func)daBoko_Execute,
(process_method_func)daBoko_IsDelete,
(process_method_func)daBoko_Draw,
};
actor_process_profile_definition g_profile_BOKO = {
/* LayerID */ fpcLy_CURRENT_e,
/* ListID */ 9,
/* ListPrio */ fpcLy_CURRENT_e,
/* ProcName */ PROC_BOKO,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(daBoko_c),
/* SizeOther */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopAc_Method.base,
/* Priority */ 0x01A0,
/* Actor SubMtd */ &l_daBoko_Method,
/* Status */ fopAcStts_CULL_e | fopAcStts_UNK4000_e | fopAcStts_UNK40000_e,
/* Group */ fopAc_ACTOR_e,
/* CullType */ fopAc_CULLBOX_CUSTOM_e,
};
+27 -2
View File
@@ -2844,8 +2844,33 @@ void daPy_lk_c::setSwordAtCollision() {
}
/* 8011D6C4-8011D788 .text getBlurTopRate__9daPy_lk_cFv */
void daPy_lk_c::getBlurTopRate() {
/* Nonmatching */
f32 daPy_lk_c::getBlurTopRate() {
if (mCurProc == daPyProc_DEMO_LAST_COMBO_e) {
return 0.0f;
}
if (mHeldItemType == 0x103) {
if (checkNormalSwordEquip()) {
return 0.5f;
} else {
return 1.0f;
}
}
if (mHeldItemType == 0x101) {
if (mActorKeepEquip.getActor() == NULL) {
return 0.0f;
} else {
daBoko_c* boko = (daBoko_c*)mActorKeepEquip.getActor();
if (mCurProc == daPyProc_JUMP_CUT_e || mCurProc == daPyProc_JUMP_CUT_LAND_e) {
return boko->getJumpBlurRate();
} else {
return boko->getBlurRate();
}
}
}
return 0.0f;
}
/* 8011D788-8011EC0C .text setCollision__9daPy_lk_cFv */