diff options
| author | YunataSavior <58997725+YunataSavior@users.noreply.github.com> | 2026-01-20 16:28:50 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-20 16:28:50 -0800 |
| commit | 6472d5a4a6b4de68d52674509ac30b910e09d61b (patch) | |
| tree | ca9c59e34bc5755523671b2aeded46f531377e0a /src/d/actor/d_a_npc_bans.cpp | |
| parent | 1fba6e13e56dd74ca73bcfabfe2756b520fd8d7b (diff) | |
dbg npc_aru (-1 func), npc_maro, and npc_bans equiv (#3053)
* dbg npc_aru (-1 func), npc_maro, and tag_push equiv
* daNpc_Aru_c::adjustMoveDir doesn't match. I don't know how to fix it without breaking GCN
* JORM default args + PR comments
* npc_bans dbg equiv
Diffstat (limited to 'src/d/actor/d_a_npc_bans.cpp')
| -rw-r--r-- | src/d/actor/d_a_npc_bans.cpp | 161 |
1 files changed, 74 insertions, 87 deletions
diff --git a/src/d/actor/d_a_npc_bans.cpp b/src/d/actor/d_a_npc_bans.cpp index 799e62ce78..4a2418ce05 100644 --- a/src/d/actor/d_a_npc_bans.cpp +++ b/src/d/actor/d_a_npc_bans.cpp @@ -137,6 +137,51 @@ enum Type { /* 0x5 */ TYPE_DEFAULT, }; +daNpc_Bans_HIOParam const daNpc_Bans_Param_c::m = { + 200.0f, + -3.0f, + 1.0f, + 400.0f, + 255.0f, + 190.0f, + 35.0f, + 30.0f, + 0.0f, + 0.0f, + 10.0f, + -10.0f, + 30.0f, + -10.0f, + 45.0f, + -45.0f, + 0.6f, + 12.0f, + 3, + 6, + 5, + 6, + 110.0f, + 0.0f, + 0.0f, + 0.0f, + 60, + 8, + 0, + 0, + 0, + false, + false, + 4.0f, + -20.0f, + 0.0f, + -20.0f, + 20.0f, + 40.0f, + 20.0f, + 110.0f, + 10.0f, +}; + #if DEBUG daNpc_Bans_HIO_c::daNpc_Bans_HIO_c() { m = daNpc_Bans_Param_c::m; @@ -150,7 +195,7 @@ void daNpc_Bans_HIO_c::listenPropertyEvent(const JORPropertyEvent* event) { switch ((u32)event->id) { case 0x40000002: - if (jorFile.open(6, "", NULL, NULL, NULL)) { + if (jorFile.open(6, "すべてのファイル(*.*)\0*.*\0", NULL, NULL, NULL)) { memset(buffer, 0, sizeof(buffer)); len = 0; daNpcT_cmnListenPropertyEvent(buffer, &len, &m.common); @@ -325,51 +370,6 @@ daNpc_Bans_c::~daNpc_Bans_c() { deleteRes(l_loadResPtrnList[mType], (const char**)l_resNameList); } -daNpc_Bans_HIOParam const daNpc_Bans_Param_c::m = { - 200.0f, - -3.0f, - 1.0f, - 400.0f, - 255.0f, - 190.0f, - 35.0f, - 30.0f, - 0.0f, - 0.0f, - 10.0f, - -10.0f, - 30.0f, - -10.0f, - 45.0f, - -45.0f, - 0.6f, - 12.0f, - 3, - 6, - 5, - 6, - 110.0f, - 0.0f, - 0.0f, - 0.0f, - 60, - 8, - 0, - 0, - 0, - false, - false, - 4.0f, - -20.0f, - 0.0f, - -20.0f, - 20.0f, - 40.0f, - 20.0f, - 110.0f, - 10.0f, -}; - static NPC_BANS_HIO_CLASS l_HIO; cPhs__Step daNpc_Bans_c::create() { @@ -439,13 +439,11 @@ cPhs__Step daNpc_Bans_c::create() { } int daNpc_Bans_c::CreateHeap() { - J3DModelData* modelData; - int bmdIdx; - int resIdx; - u32 idx = 0; - idx = mTwilight == true ? TRUE : FALSE; - resIdx = l_bmdData[idx][1]; - bmdIdx = l_bmdData[idx][0]; + J3DModelData* modelData = NULL; + J3DModel* model = NULL; + u32 idx = mTwilight == true ? TRUE : FALSE; + int resIdx = l_bmdData[idx][1]; + int bmdIdx = l_bmdData[idx][0]; modelData = (J3DModelData*)dComIfG_getObjectRes(l_resNameList[resIdx], bmdIdx); if (modelData == NULL) { return 0; @@ -457,7 +455,7 @@ int daNpc_Bans_c::CreateHeap() { return 0; } - J3DModel* model = mpMorf[0]->getModel(); + model = mpMorf[0]->getModel(); for (u16 i = 0; i < modelData->getJointNum(); i++) { modelData->getJointNodePointer(i)->setCallBack(ctrlJointCallBack); } @@ -477,8 +475,8 @@ int daNpc_Bans_c::CreateHeap() { return 1; } - u32 uVar3 = 0x11000084; - mpScoopMorf = new mDoExt_McaMorfSO(modelData, NULL, NULL, NULL, -1, 1.0f, 0, -1, NULL, J3DMdlFlag_DifferedDLBuffer, uVar3); + uVar2 = 0x11000084; + mpScoopMorf = new mDoExt_McaMorfSO(modelData, NULL, NULL, NULL, -1, 1.0f, 0, -1, NULL, J3DMdlFlag_DifferedDLBuffer, uVar2); if (mpScoopMorf == NULL || mpScoopMorf->getModel() == NULL) { return 0; } @@ -1119,10 +1117,10 @@ bool daNpc_Bans_c::setScoopAnm(int i_idx, int i_attr, f32 i_morf) { }; J3DAnmTransform* anm = NULL; - + int my_idx = i_idx; if (mpScoopMorf != NULL) { - if (scoopAnmData[i_idx][0] > 0) { - anm = getTrnsfrmKeyAnmP(l_resNameList[scoopAnmData[i_idx][1]], scoopAnmData[i_idx][0]); + if (scoopAnmData[my_idx][0] > 0) { + anm = getTrnsfrmKeyAnmP(l_resNameList[scoopAnmData[my_idx][1]], scoopAnmData[my_idx][0]); } if (anm != NULL) { @@ -1133,12 +1131,9 @@ bool daNpc_Bans_c::setScoopAnm(int i_idx, int i_attr, f32 i_morf) { return 1; } -bool daNpc_Bans_c::afterSetMotionAnm(int i_idx, int i_attr, f32 i_morf, int param_4) { - if (mCreating == true) { - i_morf = 0.0f; - } - - return setScoopAnm(i_idx, i_attr, i_morf); +bool daNpc_Bans_c::afterSetMotionAnm(int i_idx, int i_attr, f32 i_morf, int) { + f32 morf_val = (mCreating == true) ? 0.0f : i_morf; + return setScoopAnm(i_idx, i_attr, morf_val); } BOOL daNpc_Bans_c::selectAction() { @@ -1184,43 +1179,35 @@ BOOL daNpc_Bans_c::setAction(actionFunc action) { } BOOL daNpc_Bans_c::checkPlayerIn2ndFloorOfBombShop() { - bool rv = false; - return strcmp("R_SP109", dComIfGp_getStartStageName()) == 0 && dComIfGp_roomControl_getStayNo() == 1 && 300.0f < fabsf(daPy_getPlayerActorClass()->current.pos.y - current.pos.y); } void daNpc_Bans_c::orderAngerEvt() { + daTag_EvtArea_c* actor = NULL; daPy_py_c* player = daPy_getPlayerActorClass(); if (player->checkUseKandelaar(0) && player->getKandelaarFlamePos() != NULL) { mEvtNo = EVT_ANGER; for (int i = 0; i < 2; i++) { - daTag_EvtArea_c* actor = (daTag_EvtArea_c*)mActorMngrs[i + 5].getActorP(); - bool bVar1 = false; - bool bVar2 = false; - - if (actor != NULL) { - cXyz& pos(player->current.pos); - bVar1 = true; - if (actor->chkPointInArea(pos)) { - mEvtNo = EVT_ANGER_NEAR; - break; - } + actor = (daTag_EvtArea_c*)mActorMngrs[i + 5].getActorP(); + if (actor != NULL && actor->chkPointInArea(player->current.pos)) { + mEvtNo = EVT_ANGER_NEAR; + break; } } } } fopAc_ac_c* daNpc_Bans_c::getKMsgTagP() { - f32 fVar1 = 1000000000.0f; + int reg_r29 = 0; // unused + f32 fVar1 = G_CM3D_F_INF; mFindCount = 0; mSrchName = PROC_TAG_KMSG; fopAcM_Search(srchActor, this); - int i = 0; - for (; i < mFindCount; i++) { + for (int i = 0; i < mFindCount; i++) { if (((daTag_KMsg_c*)mFindActorPtrs[i])->getType() == 1) { return mFindActorPtrs[i]; } @@ -1485,7 +1472,7 @@ int daNpc_Bans_c::cutPurchase(int i_staffId) { return rv; } -int daNpc_Bans_c::wait(void* param_1) { +int daNpc_Bans_c::wait(void*) { daNpc_Len_c* actor_p = NULL; switch (mMode) { @@ -1599,7 +1586,7 @@ int daNpc_Bans_c::wait(void* param_1) { return 1; } -int daNpc_Bans_c::tend(void* param_1) { +int daNpc_Bans_c::tend(void*) { fopAc_ac_c* actor_p = NULL; switch (mMode) { @@ -1731,7 +1718,7 @@ int daNpc_Bans_c::tend(void* param_1) { return 1; } -int daNpc_Bans_c::talk(void* param_1) { +int daNpc_Bans_c::talk(void*) { switch (mMode) { case 0: case 1: @@ -1779,7 +1766,7 @@ int daNpc_Bans_c::talk(void* param_1) { return 0; } -int daNpc_Bans_c::shop(void* param_1) { +int daNpc_Bans_c::shop(void*) { switch (mMode) { case 0: case 1: @@ -1820,7 +1807,7 @@ int daNpc_Bans_c::shop(void* param_1) { return 0; } -int daNpc_Bans_c::test(void* param_1) { +int daNpc_Bans_c::test(void*) { int rv = 0; switch (mMode) { @@ -1860,7 +1847,7 @@ static int daNpc_Bans_Draw(void* i_this) { return static_cast<daNpc_Bans_c*>(i_this)->Draw(); } -static int daNpc_Bans_IsDelete(void* i_this) { +static int daNpc_Bans_IsDelete(void*) { return 1; } |
