mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-07 03:54:58 -04:00
+120
-52
@@ -46,16 +46,6 @@ const daNpcAshB_HIOParam daNpcAshB_Param_c::m = {
|
||||
400.0f, // field_0x6c
|
||||
};
|
||||
|
||||
#if DEBUG
|
||||
daNpcAshB_HIO_c::daNpcAshB_HIO_c() {
|
||||
m = daNpcAshB_Param_c::m;
|
||||
}
|
||||
|
||||
void daNpcAshB_HIO_c::genMessage(JORMContext* ctext) {
|
||||
// TODO
|
||||
}
|
||||
#endif
|
||||
|
||||
NPC_ASHB_HIO_CLASS l_HIO;
|
||||
|
||||
/* 80962438-80962534 000020 00FC+00 1/2 0/0 0/0 .data l_bckGetParamList */
|
||||
@@ -96,6 +86,18 @@ static char* l_evtNames[2] = {
|
||||
/* 809625A0-809625A4 -00001 0004+00 0/2 0/0 0/0 .data l_myName */
|
||||
static char* l_myName = "AshB";
|
||||
|
||||
#if DEBUG
|
||||
daNpcAshB_HIO_c::daNpcAshB_HIO_c() {
|
||||
m = daNpcAshB_Param_c::m;
|
||||
}
|
||||
|
||||
void daNpcAshB_HIO_c::genMessage(JORMContext* ctext) {
|
||||
// Post-conversation follow-up distance
|
||||
ctext->genSlider("会話後追従距離", &m.field_0x6c, 0.0f, 2000.0f, 0, NULL, 0xFFFF, 0xFFFF, 0x200, 24);
|
||||
daNpcF_commonGenMessage(ctext, &m.common);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 809625B0-809625C8 000198 0018+00 1/2 0/0 0/0 .data mEvtSeqList__11daNpcAshB_c */
|
||||
daNpcAshB_c::EventFn daNpcAshB_c::mEvtSeqList[2] = {
|
||||
NULL,
|
||||
@@ -114,6 +116,12 @@ daNpcAshB_c::~daNpcAshB_c() {
|
||||
if (heap != NULL) {
|
||||
mAnm_p->stopZelAnime();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
if (mpHIO) {
|
||||
mpHIO->removeHIO();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* 8095E224-8095E4A0 0004C4 027C+00 1/1 0/0 0/0 .text Create__11daNpcAshB_cFv */
|
||||
@@ -148,6 +156,11 @@ cPhs__Step daNpcAshB_c::Create() {
|
||||
fopAcM_SetMtx(this, mAnm_p->getModel()->getBaseTRMtx());
|
||||
fopAcM_setCullSizeBox(this, -100.0f, -50.0f, -100.0f, 100.0f, 220.0f, 100.0f);
|
||||
mCreatureSound.init(¤t.pos, &eyePos, 3, 1);
|
||||
#if DEBUG
|
||||
mpHIO = &l_HIO;
|
||||
// Ash (cold climate model)
|
||||
mpHIO->entryHIO("アッシュ(寒冷地仕様)");
|
||||
#endif
|
||||
mAcchCir.SetWall(mpHIO->m.common.width, mpHIO->m.common.knee_length);
|
||||
mAcch.Set(fopAcM_GetPosition_p(this), fopAcM_GetOldPosition_p(this), this, 1,
|
||||
&mAcchCir, fopAcM_GetSpeed_p(this), fopAcM_GetAngle_p(this),
|
||||
@@ -176,10 +189,14 @@ cPhs__Step daNpcAshB_c::Create() {
|
||||
|
||||
/* 8095E4A0-8095E758 000740 02B8+00 1/1 0/0 0/0 .text CreateHeap__11daNpcAshB_cFv */
|
||||
BOOL daNpcAshB_c::CreateHeap() {
|
||||
J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes(l_arcNames[0], 28));
|
||||
mAnm_p = new mDoExt_McaMorfSO(modelData, NULL, NULL, NULL, -1, 1.0f, 0, -1, &mCreatureSound,
|
||||
0x80000, 0x11020284);
|
||||
if (mAnm_p != NULL && mAnm_p->mpModel == NULL) {
|
||||
J3DModelData* mdlData_p = NULL;
|
||||
J3DModel* model = NULL;
|
||||
mdlData_p = static_cast<J3DModelData*>(dComIfG_getObjectRes(l_arcNames[0], 28));
|
||||
JUT_ASSERT(332, NULL != mdlData_p);
|
||||
u32 sp_0x18 = 0x11020284;
|
||||
mAnm_p = new mDoExt_McaMorfSO(mdlData_p, NULL, NULL, NULL, -1, 1.0f, 0, -1, &mCreatureSound,
|
||||
0x80000, sp_0x18);
|
||||
if (mAnm_p != NULL && mAnm_p->getModel() == NULL) {
|
||||
mAnm_p->stopZelAnime();
|
||||
mAnm_p = NULL;
|
||||
}
|
||||
@@ -187,9 +204,9 @@ BOOL daNpcAshB_c::CreateHeap() {
|
||||
return false;
|
||||
}
|
||||
|
||||
J3DModel* model = mAnm_p->getModel();
|
||||
for (u16 jointNo = 0; jointNo < modelData->getJointNum(); jointNo++) {
|
||||
modelData->getJointNodePointer(jointNo)->setCallBack(ctrlJointCallBack);
|
||||
model = mAnm_p->getModel();
|
||||
for (u16 jointNo = 0; jointNo < mdlData_p->getJointNum(); jointNo++) {
|
||||
mdlData_p->getJointNodePointer(jointNo)->setCallBack(ctrlJointCallBack);
|
||||
}
|
||||
model->setUserArea((uintptr_t)this);
|
||||
|
||||
@@ -197,9 +214,9 @@ BOOL daNpcAshB_c::CreateHeap() {
|
||||
if (mpMatAnm == NULL) {
|
||||
return false;
|
||||
} else {
|
||||
mpModel = mDoExt_J3DModel__create(
|
||||
static_cast<J3DModelData*>(dComIfG_getObjectRes(l_arcNames[0], 29)), 0x80000,
|
||||
0x11000084);
|
||||
mdlData_p = (J3DModelData*) dComIfG_getObjectRes(l_arcNames[0], 29);
|
||||
JUT_ASSERT(366, NULL != mdlData_p);
|
||||
mpModel = mDoExt_J3DModel__create(mdlData_p, 0x80000, 0x11000084);
|
||||
if (mpModel == NULL) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -215,6 +232,7 @@ BOOL daNpcAshB_c::CreateHeap() {
|
||||
|
||||
/* 8095E914-8095E948 000BB4 0034+00 1/1 0/0 0/0 .text Delete__11daNpcAshB_cFv */
|
||||
int daNpcAshB_c::Delete() {
|
||||
fopAcM_RegisterDeleteID(this, "NPC_ASHB");
|
||||
this->~daNpcAshB_c();
|
||||
return 1;
|
||||
}
|
||||
@@ -227,7 +245,8 @@ int daNpcAshB_c::Execute() {
|
||||
|
||||
/* 8095E96C-8095E9C8 000C0C 005C+00 1/1 0/0 0/0 .text Draw__11daNpcAshB_cFv */
|
||||
int daNpcAshB_c::Draw() {
|
||||
mAnm_p->getModel()->getModelData()->getMaterialNodePointer(2)->setMaterialAnm(mpMatAnm);
|
||||
J3DModelData* model_data = mAnm_p->getModel()->getModelData();
|
||||
model_data->getMaterialNodePointer(2)->setMaterialAnm(mpMatAnm);
|
||||
draw(false, false, mpHIO->m.common.real_shadow_size, NULL, false);
|
||||
return 1;
|
||||
}
|
||||
@@ -235,7 +254,8 @@ int daNpcAshB_c::Draw() {
|
||||
/* 8095E9C8-8095EB94 000C68 01CC+00 1/1 0/0 0/0 .text
|
||||
* ctrlJoint__11daNpcAshB_cFP8J3DJointP8J3DModel */
|
||||
bool daNpcAshB_c::ctrlJoint(J3DJoint* i_joint, J3DModel* i_model) {
|
||||
int jointNo = i_joint->getJntNo();
|
||||
J3DJoint* my_joint = i_joint;
|
||||
int jointNo = my_joint->getJntNo();
|
||||
int lookatJoints[3] = {1, 9, 10};
|
||||
|
||||
if (jointNo == 0) {
|
||||
@@ -271,7 +291,8 @@ bool daNpcAshB_c::ctrlJoint(J3DJoint* i_joint, J3DModel* i_model) {
|
||||
/* 8095EB94-8095EBB4 000E34 0020+00 1/1 0/0 0/0 .text
|
||||
* createHeapCallBack__11daNpcAshB_cFP10fopAc_ac_c */
|
||||
BOOL daNpcAshB_c::createHeapCallBack(fopAc_ac_c* i_this) {
|
||||
return static_cast<daNpcAshB_c*>(i_this)->CreateHeap();
|
||||
daNpcAshB_c* a_this = static_cast<daNpcAshB_c*>(i_this);
|
||||
return a_this->CreateHeap();
|
||||
}
|
||||
|
||||
/* 8095EBB4-8095EC00 000E54 004C+00 1/1 0/0 0/0 .text ctrlJointCallBack__11daNpcAshB_cFP8J3DJointi
|
||||
@@ -288,28 +309,67 @@ BOOL daNpcAshB_c::ctrlJointCallBack(J3DJoint* i_joint, int param_1) {
|
||||
}
|
||||
|
||||
inline void daNpcAshB_c::setLookMode(int i_lookMode) {
|
||||
if (i_lookMode != mLookMode) {
|
||||
if (i_lookMode >= 0 && i_lookMode < 5 && i_lookMode != mLookMode) {
|
||||
mLookMode = i_lookMode;
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
static s16 dummy_lit_120628(int sel) {
|
||||
const s16 arr[2] = {0x00C8, 0x00FF};
|
||||
return arr[sel];
|
||||
}
|
||||
|
||||
static s16 dummy_lit_120631(int sel) {
|
||||
const s16 arr[2] = {0xC800, 0x00FF};
|
||||
return arr[sel];
|
||||
}
|
||||
|
||||
static s16 dummy_lit_120638(int sel) {
|
||||
const s16 arr[2] = {0x0000, 0xC8FF};
|
||||
return arr[sel];
|
||||
}
|
||||
|
||||
static s16 dummy_lit_120641(int sel) {
|
||||
const s16 arr[2] = {0x0000, 0xC8FF};
|
||||
return arr[sel];
|
||||
}
|
||||
|
||||
static s16 dummy_lit_120644(int sel) {
|
||||
const s16 arr[2] = {0x0000, 0xC8FF};
|
||||
return arr[sel];
|
||||
}
|
||||
|
||||
static s16 dummy_lit_120647(int sel) {
|
||||
const s16 arr[2] = {0x8080, 0x80A0};
|
||||
return arr[sel];
|
||||
}
|
||||
|
||||
static s16 dummy_lit_120650(int sel) {
|
||||
const s16 arr[2] = {0x8080, 0x80A0};
|
||||
return arr[sel];
|
||||
}
|
||||
#endif
|
||||
|
||||
inline BOOL daNpcAshB_c::chkFindPlayer() {
|
||||
BOOL ret;
|
||||
if (!chkActorInSight(daPy_getPlayerActorClass(), mpHIO->m.common.fov)) {
|
||||
mActorMngr[0].remove();
|
||||
ret = false;
|
||||
} else {
|
||||
if (mActorMngr[0].getActorP() == NULL) {
|
||||
ret = chkPlayerInSpeakArea(this);
|
||||
} else {
|
||||
ret = chkPlayerInTalkArea(this);
|
||||
}
|
||||
if (ret) {
|
||||
mActorMngr[0].entry(daPy_getPlayerActorClass());
|
||||
} else {
|
||||
mActorMngr[0].remove();
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL ret = FALSE;
|
||||
if (mActorMngr[0].getActorP() == NULL) {
|
||||
ret = chkPlayerInSpeakArea(this);
|
||||
} else {
|
||||
ret = chkPlayerInTalkArea(this);
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
mActorMngr[0].entry(daPy_getPlayerActorClass());
|
||||
} else {
|
||||
mActorMngr[0].remove();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -456,13 +516,10 @@ bool daNpcAshB_c::setExpressionAnm(int i_idx, bool i_modify) {
|
||||
}
|
||||
mAnmFlags &= ~ANM_EXPRESSION_FLAGS;
|
||||
|
||||
J3DAnmTransform* bckAnm;
|
||||
if (l_bckGetParamList[i_idx].fileIdx >= 0) {
|
||||
bckAnm = getTrnsfrmKeyAnmP(l_arcNames[l_bckGetParamList[i_idx].arcIdx],
|
||||
l_bckGetParamList[i_idx].fileIdx);
|
||||
} else {
|
||||
bckAnm = NULL;
|
||||
}
|
||||
J3DAnmTransform* bckAnm = (l_bckGetParamList[i_idx].fileIdx >= 0) ?
|
||||
getTrnsfrmKeyAnmP(l_arcNames[l_bckGetParamList[i_idx].arcIdx],
|
||||
l_bckGetParamList[i_idx].fileIdx)
|
||||
: NULL;
|
||||
|
||||
s32 attr = l_bckGetParamList[i_idx].attr;
|
||||
bool res = false;
|
||||
@@ -507,6 +564,7 @@ bool daNpcAshB_c::setExpressionAnm(int i_idx, bool i_modify) {
|
||||
return true;
|
||||
}
|
||||
|
||||
OS_REPORT("%s: 表情Bckアニメーションの登録に失敗しました!\n", __FILE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -527,6 +585,8 @@ bool daNpcAshB_c::setExpressionBtp(int i_idx) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
OS_REPORT("%s: 表情Btpアニメーションの登録に失敗しました!\n", __FILE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -560,7 +620,6 @@ void daNpcAshB_c::setMotionAnm(int i_idx, f32 i_morf) {
|
||||
mAnmFlags &= 0xffffffc0;
|
||||
if (i_idx == 12) {
|
||||
bool unused_bool = setExpressionBtp(1);
|
||||
(void)unused_bool;
|
||||
}
|
||||
|
||||
if (morfAnm && setMcaMorfAnm(morfAnm, 1.0f, i_morf, oiVar5, 0, -1)) {
|
||||
@@ -589,8 +648,8 @@ void daNpcAshB_c::reset() {
|
||||
mpActionFn = NULL;
|
||||
mLookMode = -1;
|
||||
mMode = 0;
|
||||
current.pos = home.pos;
|
||||
old.pos = current.pos;
|
||||
current.pos.set(home.pos);
|
||||
old.pos.set(current.pos);
|
||||
current.angle.set(0, home.angle.y, 0);
|
||||
old.angle = current.angle;
|
||||
shape_angle = current.angle;
|
||||
@@ -659,7 +718,6 @@ bool daNpcAshB_c::step(s16 i_targetAngle, int param_2, f32 i_rate) {
|
||||
}
|
||||
|
||||
/* 8095F2C4-8095FC70 001564 09AC+00 4/0 0/0 0/0 .text wait__11daNpcAshB_cFPv */
|
||||
// NONMATCHING - regalloc
|
||||
bool daNpcAshB_c::wait(void* param_0) {
|
||||
switch (mMode) {
|
||||
case 0:
|
||||
@@ -681,7 +739,7 @@ bool daNpcAshB_c::wait(void* param_0) {
|
||||
if (fopAcM_seenPlayerAngleY(this) > res) {
|
||||
field_0xdea = fopAcM_searchPlayerAngleY(this);
|
||||
}
|
||||
} else if (step(mCurAngle.y, 1, 15.0f)) {
|
||||
} else if (step(field_0xdea, 1, 15.0f)) {
|
||||
setExpression(EXPR_EXPLAIN_B, -1.0f);
|
||||
setMotion(MOT_WAIT_A, -1.0f, false);
|
||||
mTurnMode = 0;
|
||||
@@ -716,7 +774,7 @@ bool daNpcAshB_c::wait(void* param_0) {
|
||||
/* dSv_event_flag_c::F_0335 - Snowpeak mountain - Obtained scribble from Ashei at mountain
|
||||
* pass */
|
||||
if (!daNpcF_chkEvtBit(0x14F) && field_0xded == 0 && !daPy_py_c::checkNowWolf()) {
|
||||
f32 res = pow(600.0f, 2.0f);
|
||||
f32 res = std::pow(600.0f, 2.0f);
|
||||
if (fopAcM_searchPlayerDistanceXZ2(this) <= res) {
|
||||
daNpcF_offTmpBit(0xb);
|
||||
daNpcF_offTmpBit(0xc);
|
||||
@@ -903,7 +961,6 @@ bool daNpcAshB_c::talk(void* param_0) {
|
||||
}
|
||||
|
||||
/* 809602E0-809604C8 002580 01E8+00 1/0 0/0 0/0 .text demo__11daNpcAshB_cFPv */
|
||||
// NONMATCHING - extra instruction at dComIfGp_event_runCheck() causing regalloc issues?
|
||||
bool daNpcAshB_c::demo(void* param_0) {
|
||||
dEvent_manager_c& evtmgr = dComIfGp_getEventManager();
|
||||
BOOL r26 = FALSE;
|
||||
@@ -916,7 +973,14 @@ bool daNpcAshB_c::demo(void* param_0) {
|
||||
// fallthrough
|
||||
|
||||
case 2:
|
||||
if (dComIfGp_event_runCheck() != FALSE && !eventInfo.checkCommandTalk()) {
|
||||
#if VERSION != VERSION_SHIELD_DEBUG
|
||||
// TODO: gameInfo fake match to force reuse of pointer
|
||||
dComIfG_play_c* play = &g_dComIfG_gameInfo.play;
|
||||
if (play->getEvent().runCheck() && !eventInfo.checkCommandTalk())
|
||||
#else
|
||||
if (dComIfGp_event_runCheck() && !eventInfo.checkCommandTalk())
|
||||
#endif
|
||||
{
|
||||
s32 staff_id = evtmgr.getMyStaffId(l_myName, NULL, 0);
|
||||
if (staff_id != -1) {
|
||||
mStaffID = staff_id;
|
||||
@@ -929,7 +993,11 @@ bool daNpcAshB_c::demo(void* param_0) {
|
||||
|
||||
if (eventInfo.checkCommandDemoAccrpt() && mEventIdx != -1 && evtmgr.endCheck(mEventIdx))
|
||||
{
|
||||
#if VERSION != VERSION_SHIELD_DEBUG
|
||||
play->getEvent().reset();
|
||||
#else
|
||||
dComIfGp_event_reset();
|
||||
#endif
|
||||
mOrderEvtNo = 0;
|
||||
mEventIdx = -1;
|
||||
setAction(&daNpcAshB_c::wait);
|
||||
|
||||
Reference in New Issue
Block a user