summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYunataSavior <58997725+YunataSavior@users.noreply.github.com>2025-07-13 08:08:32 -0700
committerGitHub <noreply@github.com>2025-07-13 18:08:32 +0300
commit9c48ec0905a67ae2f4b1bba67e6ea28b373932e8 (patch)
tree71dc401f759a58be6b55e978db6e1b2c8b160742 /src
parentd4768a864e174a45e8be066657990b29c53079b5 (diff)
Major npc wrestler cleanup (#2531)
Diffstat (limited to 'src')
-rw-r--r--src/d/actor/d_a_npc_wrestler.cpp2229
1 files changed, 1094 insertions, 1135 deletions
diff --git a/src/d/actor/d_a_npc_wrestler.cpp b/src/d/actor/d_a_npc_wrestler.cpp
index dbface4135..46c0da8387 100644
--- a/src/d/actor/d_a_npc_wrestler.cpp
+++ b/src/d/actor/d_a_npc_wrestler.cpp
@@ -12,6 +12,7 @@
#include "f_op/f_op_actor_mng.h"
#include "d/d_camera.h"
#include "m_Do/m_Do_graphic.h"
+#include "d/d_meter2_info.h"
UNK_REL_DATA;
@@ -217,10 +218,10 @@ static int l_bmdGetParamList[5] = {
};
/* 80B41E44-80B4203C 00004C 01F8+00 1/0 0/0 0/0 .data l_BouBckParamList */
-static int l_BouBckParamList[63][2] = {
+static daNpc_GetParam1 l_BouBckParamList[63] = {
{-1, 2}, {BCK_BOUS_F_DOWN, 2}, {BCK_BOUS_F_HEAD_UP, 0},
{BCK_BOUS_F_LOSE, 0}, {BCK_BOUS_F_LOSE2, 0}, {BCK_BOUS_F_PULLBACK, 0},
- {BCK_BOUS_F_PUNCH, 0}, {BCK_BOUS_F_PUNCH_SHOCK, 0}, {BCK_BOUS_F_PUNCH_SHOCK, 0},
+ {BCK_BOUS_F_PUNCH, 0}, {BCK_BOUS_F_PUNCH_SHOCK, 0}, {BCK_BOUS_F_PUNCHMISS_TACKLESHOCK, 0},
{BCK_BOUS_F_PUNCHSHOCK_RETURN, 0}, {BCK_BOUS_F_PUSHBACK, 0}, {BCK_BOUS_F_STAGGER, 2},
{BCK_BOUS_F_TACKLE, 0}, {BCK_BOUS_F_TACKLE_B, 0}, {BCK_BOUS_F_TACKLE_MISS, 0},
{BCK_BOUS_F_TACKLE_SHOCK, 0}, {BCK_BOUS_F_TACKLE_STAGGER, 2}, {BCK_BOUS_F_TACKLE_WAIT, 2},
@@ -242,7 +243,7 @@ static int l_BouBckParamList[63][2] = {
};
/* 80B4203C-80B42150 000244 0114+00 1/0 0/0 0/0 .data l_BouFaceParamList */
-static int l_BouFaceParamList[23][3] = {
+static daNpc_GetParam2 l_BouFaceParamList[23] = {
{-1, 0x44, 2}, {7, 0x45, 2}, {8, 0x46, 0},
{9, 0x47, 0}, {10, 0x48, 0}, {11, 0x49, 0},
{12, 0x4A, 0}, {13, 0x4B, 0}, {14, 0x4C, 0},
@@ -254,7 +255,7 @@ static int l_BouFaceParamList[23][3] = {
};
/* 80B42150-80B42208 000358 00B8+00 1/0 0/0 0/0 .data l_BouBtpParamList */
-static int l_BouBtpParamList[23][2] = {
+static daNpc_GetParam1 l_BouBtpParamList[23] = {
{BTP_BOUS, 2}, {BTP_BOUS_F_DOWN, 0},
{BTP_BOUS_F_HEAD_UP, 0}, {BTP_BOUS_F_LOSE, 0},
{BTP_BOUS_F_LOSE2, 0}, {BTP_BOUS_F_PULLBACK, 0},
@@ -270,16 +271,16 @@ static int l_BouBtpParamList[23][2] = {
};
/* 80B42208-80B42210 000410 0008+00 1/0 0/0 0/0 .data l_BouBtkParamList */
-static int l_BouBtkParamList[1][2] = {
+static daNpc_GetParam1 l_BouBtkParamList[1] = {
{BTK_BOUS, 2},
};
/* 80B42210-80B42220 -00001 0010+00 1/0 0/0 0/0 .data l_BouAnmParamList */
-static int* l_BouAnmParamList[4] = {
- (int*)l_BouBckParamList,
- (int*)l_BouFaceParamList,
- (int*)l_BouBtpParamList,
- (int*)l_BouBtkParamList,
+static WrestlerParamList l_BouAnmParamList = {
+ l_BouBckParamList,
+ l_BouFaceParamList,
+ l_BouBtpParamList,
+ l_BouBtkParamList,
};
/* 80B42220-80B42418 000428 01F8+00 1/0 0/0 0/0 .data l_GrdBckParamList */
@@ -330,7 +331,7 @@ static daNpc_GetParam1 l_GrdBtkParamList[1] = {
};
/* 80B425EC-80B425FC -00001 0010+00 1/0 0/0 0/0 .data l_GrdAnmParamList */
-static void* l_GrdAnmParamList[4] = {
+static WrestlerParamList l_GrdAnmParamList = {
l_GrdBckParamList,
l_GrdFaceParamList,
l_GrdBtpParamList,
@@ -338,14 +339,14 @@ static void* l_GrdAnmParamList[4] = {
};
/* 80B425FC-80B42604 -00001 0008+00 0/1 0/0 0/0 .data l_anmList */
-static int* l_anmList[2] = {
- (int*)l_BouAnmParamList,
- (int*)l_GrdAnmParamList,
+static WrestlerParamList* l_anmList[2] = {
+ &l_BouAnmParamList,
+ &l_GrdAnmParamList,
};
/* 80B42604-80B42620 -00001 001C+00 2/5 0/0 0/0 .data l_evtNames */
static char* l_evtNames[7] = {
- "",
+ NULL,
"GRDS_ENTRY",
"GRDS_ENTRY2",
"GRDS_ENTRY3",
@@ -357,6 +358,9 @@ static char* l_evtNames[7] = {
/* 80B42620-80B42624 -00001 0004+00 0/2 0/0 0/0 .data l_myName */
static char* l_myName = "Wrestler";
+/* 80B42E24-80B42E28 000014 0004+00 1/1 0/0 0/0 .bss l_HIO */
+static daNpcWrestler_Param_c l_HIO;
+
/* 80B4266C-80B426C0 000874 0054+00 0/2 0/0 0/0 .data mEvtSeqList__15daNpcWrestler_c */
daNpcWrestler_c::EventFn daNpcWrestler_c::mEvtSeqList[7] = {
NULL,
@@ -461,15 +465,17 @@ const daNpcWrestler_HIOParam daNpcWrestler_Param_c::m = {
0x28,
20,
12,
- 0,
- 20.0f,
- 30.0f,
- 20.0f,
- 30.0f,
+ // Bo chances[0]:
+ 20.0f, // lateral
+ 30.0f, // hit
+ 20.0f, // tackle
+ 30.0f, // wait
+ // Bo chances[1]:
25.0f,
50.0f,
25.0f,
0.0f,
+ //
220.0f,
35.0f,
85.0f,
@@ -483,20 +489,33 @@ const daNpcWrestler_HIOParam daNpcWrestler_Param_c::m = {
30,
15,
12,
- 0,
+ // Goron chances[0]:
20.0f,
20.0f,
60.0f,
0.0f,
+ // Goron chances[1]:
20.0f,
20.0f,
- // 60.0f,
- // 0.0f,
+ 60.0f,
+ 0.0f,
};
+daNpcWrestler_c::daNpcWrestler_c() {
+ // empty function
+}
+
+daNpcWrestler_c::~daNpcWrestler_c() {
+ dComIfG_resDelete(&mPhase, l_resALink);
+ dComIfG_resDelete(&mPhase2, l_resName[mType]);
+ dComIfG_TimerDeleteRequest(9);
+ if (heap != NULL) {
+ mpMorf->stopZelAnime();
+ }
+}
+
/* 80B2F688-80B2F974 0004E8 02EC+00 1/1 0/0 0/0 .text Create__15daNpcWrestler_cFv */
cPhs__Step daNpcWrestler_c::Create() {
- // NONMATCHING
fopAcM_SetupActor(this, daNpcWrestler_c);
mType = getType();
@@ -579,6 +598,7 @@ int daNpcWrestler_c::CreateHeap() {
/* 80B2FDB0-80B2FDE4 000C10 0034+00 1/1 0/0 0/0 .text Delete__15daNpcWrestler_cFv */
int daNpcWrestler_c::Delete() {
+ fopAcM_GetID(this);
this->~daNpcWrestler_c();
return 1;
}
@@ -595,69 +615,70 @@ int daNpcWrestler_c::Draw() {
if (mWrestlerNoDraw != 0) {
return 0;
}
-
- mpMorf->getModel()->getModelData()->getMaterialNodePointer(1)->setMaterialAnm(mpMatAnm);
+
+ J3DModelData* model_data = mpMorf->getModel()->getModelData();
+ model_data->getMaterialNodePointer(1)->setMaterialAnm(mpMatAnm);
return draw(FALSE, FALSE, field_0xbdc->field_0xc, NULL, FALSE);
}
/* 80B2FE84-80B30150 000CE4 02CC+00 1/1 0/0 0/0 .text ctrlJoint__15daNpcWrestler_cFP8J3DJointP8J3DModel */
int daNpcWrestler_c::ctrlJoint(J3DJoint* i_joint, J3DModel* i_model) {
- // NONMATCHING
- int jnt_no = i_joint->getJntNo();
- int iVar1[3] = {1, 3, 4};
-
- if (jnt_no == 0) {
- mDoMtx_stack_c::copy(mpMorf->getModel()->getAnmMtx(1));
+ J3DJoint* my_joint = i_joint;
+ int jnt_no = my_joint->getJntNo();
+ int dbg_0x40 = mType == 0 ? 0 : 0;
+ int dbg_0x3c = mType == 0 ? 1 : 1;
+ int dbg_0x38 = mType == 0 ? 3 : 3;
+ int dbg_0x34 = mType == 0 ? 4 : 4;
+ int iVar1[3] = {dbg_0x3c, dbg_0x38, dbg_0x34};
+
+ if (jnt_no == dbg_0x40) {
+ mDoMtx_stack_c::copy(mpMorf->getModel()->getAnmMtx(dbg_0x3c));
mDoMtx_stack_c::multVecZero(&mLookatPos[0]);
- mDoMtx_stack_c::copy(mpMorf->getModel()->getAnmMtx(3));
+ mDoMtx_stack_c::copy(mpMorf->getModel()->getAnmMtx(dbg_0x38));
mDoMtx_stack_c::multVecZero(&mLookatPos[1]);
- mDoMtx_stack_c::copy(mpMorf->getModel()->getAnmMtx(4));
+ mDoMtx_stack_c::copy(mpMorf->getModel()->getAnmMtx(dbg_0x34));
mDoMtx_stack_c::multVecZero(&mLookatPos[2]);
}
mDoMtx_stack_c::copy(i_model->getAnmMtx(jnt_no));
-
if (mType == 0) {
switch (jnt_no) {
- case 2:
- break;
-
+ case 1:
case 3:
case 4:
setLookatMtx(jnt_no, iVar1, field_0xbd8->common.neck_rotation_ratio);
break;
- }
- } else if (jnt_no != 2) {
- switch (jnt_no) {
+
case 2:
break;
-
+ }
+ } else {
+ switch (jnt_no) {
+ case 1:
case 3:
case 4:
setLookatMtx(jnt_no, iVar1, field_0xbd8->common.neck_rotation_ratio);
break;
+
+ case 2:
+ break;
}
}
-
- if (jnt_no == 1) {
+
+ if (jnt_no == dbg_0x3c) {
mDoMtx_stack_c::YrotM(field_0x908[0].z);
mDoMtx_stack_c::ZrotM(-field_0x908[0].x);
- } else if (jnt_no == 4) {
+ } else if (jnt_no == dbg_0x34) {
mDoMtx_stack_c::YrotM(field_0x908[2].z);
mDoMtx_stack_c::ZrotM(field_0x908[2].x);
}
i_model->setAnmMtx(jnt_no, mDoMtx_stack_c::get());
- MTXCopy(mDoMtx_stack_c::get(), J3DSys::mCurrentMtx);
-
- int iVar2;
- if (mType == 0) {
- iVar2 = 8;
- } else {
- iVar2 = 7;
- }
+ cMtx_copy(mDoMtx_stack_c::get(), J3DSys::mCurrentMtx);
- if ((jnt_no == 4 || jnt_no == iVar2) && (mAnmFlags & 0x100)) {
+ int dbg_0x30 = mType == 0 ? 5 : 5;
+ int dbg_0x2c = mType == 0 ? 8 : 7;
+ if ((jnt_no == dbg_0x30 - 1 || jnt_no == dbg_0x2c) && (mAnmFlags & 0x100)) {
J3DAnmTransform* anm = mBckAnm.getBckAnm();
mBckAnm.changeBckOnly(mpMorf->getAnm());
mpMorf->changeAnm(anm);
@@ -668,7 +689,8 @@ int daNpcWrestler_c::ctrlJoint(J3DJoint* i_joint, J3DModel* i_model) {
/* 80B30150-80B30170 000FB0 0020+00 1/1 0/0 0/0 .text createHeapCallBack__15daNpcWrestler_cFP10fopAc_ac_c */
int daNpcWrestler_c::createHeapCallBack(fopAc_ac_c* a_this) {
- return ((daNpcWrestler_c*)a_this)->CreateHeap();
+ daNpcWrestler_c* i_this = (daNpcWrestler_c*)a_this;
+ return i_this->CreateHeap();
}
/* 80B30170-80B301BC 000FD0 004C+00 1/1 0/0 0/0 .text ctrlJointCallBack__15daNpcWrestler_cFP8J3DJointi */
@@ -684,25 +706,90 @@ int daNpcWrestler_c::ctrlJointCallBack(J3DJoint* i_joint, int param_2) {
}
/* 80B301BC-80B3023C 00101C 0080+00 0/0 0/0 1/1 .text checkStartUp__15daNpcWrestler_cFv */
-BOOL daNpcWrestler_c::checkStartUp() {
- // NONMATCHING
- return ((chkAction(&daNpcWrestler_c::gotoArena) >> 5) & 0xFF) && field_0xe96 == 2;
+bool daNpcWrestler_c::checkStartUp() {
+ return chkAction(&daNpcWrestler_c::gotoArena) && field_0xe96 == 2;
}
-/* 80B3023C-80B30654 00109C 0418+00 2/0 0/0 0/0 .text setExpressionAnm__15daNpcWrestler_cFib */
-bool daNpcWrestler_c::setExpressionAnm(int param_1, bool param_2) {
- // NONMATCHING
- J3DAnmTransform* anmTransform;
+/* 80B405E8-80B40B3C 011448 0554+00 1/1 0/0 0/0 .text setAttnPos__15daNpcWrestler_cFv */
+inline void daNpcWrestler_c::setAttnPos() {
+ static cXyz eyeOffset(-10.0f, 10.0f, 0.0f);
+ cXyz* attnPos = NULL;
+ cXyz sp44, sp50, sp5c;
- mAnmFlags &= 0xFFFFE03F;
+ mDoMtx_stack_c::YrotS(field_0x990);
+ cLib_addCalc2(&field_0x984[0], 0.0f, 0.1f, 125.0f);
+ cLib_addCalc2(&field_0x984[2], 0.0f, 0.1f, 125.0f);
+
+ for (int i = 0; i < 3; i++) {
+ sp50.set(0.0f, 0.0f, field_0x984[i] * cM_ssin(field_0x992));
+ mDoMtx_stack_c::multVec(&sp50, &sp5c);
+ field_0x908[i].x = -sp5c.z;
+ field_0x908[i].z = -sp5c.x;
+ }
+
+ cLib_chaseS(&field_0x992, 0, 0x555);
+ if (mLookMode == 1) {
+ for (int i = 0; i < 3; i++) {
+ mLookatAngle[i].setall(0);
+ }
+ }
+
+ setMtx();
+ lookat();
+
+ int dbg_0x20 = mType == 0 ? 4 : 4;
+ mDoMtx_stack_c::copy(mpMorf->getModel()->getAnmMtx(dbg_0x20));
+ mDoMtx_stack_c::multVecZero(&mHeadPos);
+ mDoMtx_stack_c::multVec(&eyeOffset, &eyePos);
+ eyeOffset.y = 0.0f;
+ mDoMtx_stack_c::multVec(&eyeOffset, &sp50);
+ mHeadAngle.x = cLib_targetAngleX(&mHeadPos, &sp50);
+ mHeadAngle.y = cLib_targetAngleY(&mHeadPos, &sp50);
- if (field_0xe04[param_1] >= 0) {
- anmTransform = (J3DAnmTransform*)getTrnsfrmKeyAnmP(l_resName[mType], field_0xe04[param_1]);
+ attnPos = mLookAt.getAttnPos();
+ if (attnPos != NULL) {
+ sp44 = *attnPos - eyePos;
+ mEyeAngle.y = - mLookatAngle[2].y -mCurAngle.y;
+ mEyeAngle.y += cM_atan2s(sp44.x, sp44.z);
+ mEyeAngle.x = -cM_atan2s(sp44.y, sp44.absXZ());
} else {
- anmTransform = NULL;
+ mEyeAngle.y = 0;
+ mEyeAngle.x = 0;
}
- int iVar1 = field_0xe04[param_1 + 1];
+ cXyz sp68;
+ f32 fVar1 = field_0xbd8->common.attention_offset;
+ sp44.set(0.0f, 0.0f, field_0xbdc->field_0x10);
+ mDoMtx_stack_c::transS(current.pos);
+ mDoMtx_stack_c::ZXYrotM(mCurAngle.x, mCurAngle.y, mCurAngle.z);
+ mDoMtx_stack_c::multVec(&sp44, &sp68);
+
+ if (!(chkAction(&daNpcWrestler_c::wait)
+ && chkAction(&daNpcWrestler_c::talk))) {
+ attention_info.position.set(sp68.x, sp68.y + fVar1, sp68.z);
+ } else {
+ attention_info.position.set(sp68.x, 200.0f, sp68.z);
+ }
+
+ if (chkAction(&daNpcWrestler_c::wait)
+ || chkAction(&daNpcWrestler_c::talk)) {
+ field_0xc90.SetC(sp68);
+#ifdef DEBUG
+ field_0xc90.SetH(field_0xbdc->field_0x0);
+ field_0xc90.SetR(field_0xbdc->mWallR);
+#endif
+ dComIfG_Ccsp()->Set(&field_0xc90);
+ }
+}
+
+/* 80B3023C-80B30654 00109C 0418+00 2/0 0/0 0/0 .text setExpressionAnm__15daNpcWrestler_cFib */
+inline bool daNpcWrestler_c::setExpressionAnm(int param_1, bool param_2) {
+ mAnmFlags &= 0xFFFFE03F;
+
+ J3DAnmTransform* anmTransform = (field_0xe04->bck_list[param_1].fileIdx >= 0) ?
+ (J3DAnmTransform*)getTrnsfrmKeyAnmP(l_resName[mType], field_0xe04->bck_list[param_1].fileIdx) : NULL;
+
+ int iVar1 = field_0xe04->bck_list[param_1].arcIdx;
bool bVar1 = false;
switch (param_1) {
case 0:
@@ -782,7 +869,7 @@ bool daNpcWrestler_c::setExpressionAnm(int param_1, bool param_2) {
break;
case 19:
- bVar1 = setExpressionBtp(19);
+ bVar1 = setExpressionBtp(0);
break;
case 20:
@@ -832,20 +919,17 @@ bool daNpcWrestler_c::setExpressionAnm(int param_1, bool param_2) {
return true;
}
+ // "%s: Failed to register facial expression Bck animation!\n"
+ OS_REPORT("%s: 表情Bckアニメーションの登録に失敗しました!\n", "d_a_npc_wrestler.cpp");
return false;
}
/* 80B30654-80B3074C 0014B4 00F8+00 1/0 0/0 0/0 .text setExpressionBtp__15daNpcWrestler_cFi */
-bool daNpcWrestler_c::setExpressionBtp(int param_1) {
- // NONMATCHING
- J3DAnmTexPattern* anmTexPattern;
- if (field_0xe04[2] + param_1 >= 0) {
- anmTexPattern = getTexPtrnAnmP(l_resName[mType], field_0xe04[2] + param_1);
- } else {
- anmTexPattern = NULL;
- }
+inline bool daNpcWrestler_c::setExpressionBtp(int param_1) {
+ J3DAnmTexPattern* anmTexPattern = (field_0xe04->btp_list[param_1].fileIdx >= 0) ?
+ getTexPtrnAnmP(l_resName[mType], field_0xe04->btp_list[param_1].fileIdx) : NULL;
- int iVar1 = field_0xe04[2] + param_1 + 4;
+ int iVar1 = field_0xe04->btp_list[param_1].arcIdx;
mAnmFlags &= 0xFFFFF57F;
if (anmTexPattern == NULL) {
@@ -862,31 +946,67 @@ bool daNpcWrestler_c::setExpressionBtp(int param_1) {
return 1;
}
+ // "%s: Failed to register facial BTP animation!\n"
+ OS_REPORT("%s: 表情Btpアニメーションの登録に失敗しました!\n", "d_a_npc_wrestler.cpp");
return 0;
}
+inline void daNpcWrestler_c::setBackToLiving() {
+ if (mType != 1) {
+ daPy_py_c* player = daPy_getPlayerActorClass();
+ daNpcBouS_c* bou = (daNpcBouS_c*)fpcM_SearchByID(parentActorID);
+ JUT_ASSERT(2205, bou != 0);
+
+ bou->setMessageNo(7);
+ bou->setForcibleTalk();
+ bou->onDispFlag();
+
+ s16 sVar1 = fopAcM_GetHomeAngle_p(bou)->y + 0x8000;
+ mDoMtx_stack_c::transS(fopAcM_GetPosition(bou));
+ mDoMtx_stack_c::YrotM(fopAcM_GetShapeAngle_p(bou)->y);
+ cXyz sp28(0.0f, 0.0f, field_0xbdc->field_0x1c);
+ mDoMtx_stack_c::multVec(&sp28, &sp28);
+
+ player->setPlayerPosAndAngle(&sp28, sVar1, 0);
+
+ if (mType == 0) {
+ player->setClothesChange(0);
+ OS_REPORT("リンクさん!出番です!着替えてください!\n"); // Link! It's your turn! Get changed!
+ }
+
+ if (daNpcF_chkTmpBit(0x2F)) {
+ fopAcM_onSwitch(this, 0x46);
+ }
+
+ field_0xe99 = 1;
+ }
+}
+
/* 80B3074C-80B308B0 0015AC 0164+00 1/0 0/0 0/0 .text setMotionAnm__15daNpcWrestler_cFif */
void daNpcWrestler_c::setMotionAnm(int param_1, f32 param_2) {
- // NONMATCHING
- J3DAnmTransformKey* anmTransformKey;
- J3DAnmTextureSRTKey* anmTextureSRTKey;
-
- if (field_0xe04[param_1] >= 0) {
- anmTransformKey = getTrnsfrmKeyAnmP(l_resName[mType], field_0xe04[param_1]);
- } else {
- anmTransformKey = NULL;
+ J3DAnmTransformKey* anmTransformKey = (field_0xe04->bck_list[param_1].fileIdx >= 0)?
+ getTrnsfrmKeyAnmP(l_resName[mType], field_0xe04->bck_list[param_1].fileIdx) : NULL;
+
+ J3DAnmTextureSRTKey* anmTextureSRTKey = (field_0xe04->btk_list[0].fileIdx >= 0) ?
+ getTexSRTKeyAnmP(l_resName[mType], field_0xe04->btk_list[0].fileIdx) : NULL;
+
+ int bck_arc = field_0xe04->bck_list[param_1].arcIdx;
+ int btk_arc = field_0xe04->btk_list[0].arcIdx;
+ mAnmFlags &= 0xFFFFFFC0;
+ if (anmTransformKey != NULL && setMcaMorfAnm(anmTransformKey, 1.0f, param_2,
+ bck_arc, 0, -1)) {
+ mAnmFlags |= 0x9;
+ mMotionLoops = 0;
}
- if (field_0xe04[3] >= 0) {
- anmTextureSRTKey = getTexSRTKeyAnmP(l_resName[mType], field_0xe04[3]);
- } else {
- anmTextureSRTKey = NULL;
+ if (anmTextureSRTKey != NULL && setBtkAnm(anmTextureSRTKey, mpMorf->getModel()->getModelData(),
+ 1.0f, btk_arc)) {
+ mAnmFlags |= 0x12;
}
}
/* 80B308B0-80B30AD8 001710 0228+00 1/1 0/0 0/0 .text reset__15daNpcWrestler_cFv */
void daNpcWrestler_c::reset() {
- // NONMATCHING
initialize();
mpMatAnm->initialize();
mLookAt.initialize();
@@ -905,7 +1025,7 @@ void daNpcWrestler_c::reset() {
if (mType == 1 && daNpcF_chkEvtBit(0x3F)) {
if (daNpcF_chkEvtBit(0x3E)) {
- current.pos.set(-216.2476f, -172.1f, 806.0135f);
+ current.pos.set(-216.24759f, -172.1f, 806.0135f);
old.pos = current.pos;
setAngle(0x2CD3);
home.angle.y = 0x2CD3;
@@ -918,7 +1038,7 @@ void daNpcWrestler_c::reset() {
speedF = 0.0f;
speed.setall(0.0f);
- mArenaInfo = 0;
+ mArenaInfo.chkFlag = 0;
field_0xe78 = -1;
field_0xe8c = field_0xbd8->common.morf_frame;
@@ -934,6 +1054,35 @@ void daNpcWrestler_c::reset() {
mMotionMorfOverride = 0.0f;
}
+inline void daNpcWrestler_c::setNextSumouEvent(int i_sumouEventNo) {
+ if (i_sumouEventNo == -1) {
+ i_sumouEventNo = mItemNo;
+ }
+
+ OS_REPORT("相撲イベント要求 ステータスNo=%d\n", i_sumouEventNo);
+ switch (i_sumouEventNo) {
+ case 1:
+ return;
+
+ case 2:
+ setAction(&daNpcWrestler_c::demoSumouReady);
+ return;
+
+ case 3:
+ setAction(&daNpcWrestler_c::sumouReady);
+ return;
+
+ case 4:
+ setAction(&daNpcWrestler_c::gotoLiving);
+ return;
+
+ case 5:
+ return;
+ }
+
+ setAction(&daNpcWrestler_c::wait);
+}
+
/* 80B30AD8-80B30B80 001938 00A8+00 1/1 0/0 0/0 .text setAction__15daNpcWrestler_cFM15daNpcWrestler_cFPCvPvPv_b */
inline int daNpcWrestler_c::setAction(actionFunc action) {
field_0xe96 = 3;
@@ -961,17 +1110,16 @@ static void* s_sub1(void* i_actor, void* i_data) {
/* 80B30BEC-80B30CA4 001A4C 00B8+00 2/2 0/0 0/0 .text checkArenaInfo__15daNpcWrestler_cFv */
void daNpcWrestler_c::checkArenaInfo() {
- // NONMATCHING
- daTagArena_c* arena;
- if (mArenaInfo == 0) {
- arena = (daTagArena_c*)fpcM_Search(s_sub1, this);
- if (arena != NULL) {
+ if (mArenaInfo.chkFlag == 0) {
+ base_process_class* bpc_p = fpcM_Search(s_sub1, this);
+ if (bpc_p != NULL) {
+ daTagArena_c* arena = (daTagArena_c*) bpc_p;
mArenaPos.x = arena->getArenaPos().x;
mArenaPos.y = arena->getArenaPos().y;
mArenaPos.z = arena->getArenaPos().z;
mArenaExtent = arena->getArenaExtent();
mArenaAngle = arena->getArenaAngle();
- mArenaInfo = 1;
+ mArenaInfo.chkFlag = 1;
}
}
}
@@ -1014,16 +1162,14 @@ void daNpcWrestler_c::setOnToArena(f32 param_1) {
JUT_ASSERT(2175, mArenaInfo.chkFlag);
current.pos.set(0.0f, 0.0f, -param_1);
- cXyz sp3c, sp48;
- sp48 = mArenaPos;
- mDoMtx_stack_c::transS(sp48);
+ mDoMtx_stack_c::transS(mArenaPos);
mDoMtx_stack_c::YrotM(mArenaAngle);
mDoMtx_stack_c::multVec(&current.pos, &current.pos);
old.pos.set(current.pos);
setAngle(mArenaAngle);
daPy_py_c* player = daPy_getPlayerActorClass();
- sp3c.set(0.0f, 0.0f, param_1);
+ cXyz sp3c(0.0f, 0.0f, param_1);
mDoMtx_stack_c::multVec(&sp3c, &sp3c);
player->setPlayerPosAndAngle(&sp3c, mArenaAngle + 0x8000, 0);
@@ -1039,7 +1185,7 @@ inline void daNpcWrestler_c::setLookMode(int mode) {
}
inline BOOL daNpcWrestler_c::chkFindPlayer() {
- BOOL bVar1;
+ BOOL bVar1 = FALSE;
if (mActorMngr[0].getActorP() == NULL) {
bVar1 = chkPlayerInSpeakArea(this);
} else {
@@ -1053,14 +1199,17 @@ inline BOOL daNpcWrestler_c::chkFindPlayer() {
setLookMode(0);
mActorMngr[0].remove();
}
+
+ return bVar1;
}
inline BOOL daNpcWrestler_c::step(s16 param_1, int param_2) {
if (mTurnMode == 0) {
+ s16 ang_diff = param_1 - mCurAngle.y;
if (mCurAngle.y == param_1) {
mTurnMode++;
} else if (param_2 != 0) {
- if (fabsf(cM_sht2d(param_1 - mCurAngle.y)) > 0x28) {
+ if ((int) fabsf(cM_sht2d(ang_diff)) > 40) {
setExpression(5, -1.0f);
setMotion(6, field_0xbd8->common.morf_frame, 0);
}
@@ -1084,108 +1233,372 @@ inline BOOL daNpcWrestler_c::step(s16 param_1, int param_2) {
}
}
- return (mTurnMode >> 1) - (((u32)mTurnMode & mTurnMode) >> 31);
+ return (1 < mTurnMode);
+}
+
+inline void daNpcWrestler_c::playExpression() {
+ daNpcF_anmPlayData playData0 = {0x13, field_0xbd8->common.morf_frame, 0};
+ daNpcF_anmPlayData* pDat0[1] = {&playData0};
+ daNpcF_anmPlayData playData1 = {0x17, field_0xbd8->common.morf_frame, 1};
+ daNpcF_anmPlayData* pDat1[1] = {&playData1};
+ daNpcF_anmPlayData playData2 = {0x19, field_0xbd8->common.morf_frame, 1};
+ daNpcF_anmPlayData playData3 = {0x1A, field_0xbd8->common.morf_frame, 0};
+ daNpcF_anmPlayData* pDat2[2] = {&playData2, &playData3};
+ daNpcF_anmPlayData playData4 = {0x18, field_0xbd8->common.morf_frame, 0};
+ daNpcF_anmPlayData* pDat4[1] = {&playData4};
+ daNpcF_anmPlayData playData5 = {0x1A, field_0xbd8->common.morf_frame, 0};
+ daNpcF_anmPlayData* pDat5[1] = {&playData5};
+ daNpcF_anmPlayData playData6 = {0, field_0xbd8->common.morf_frame, 0};
+ daNpcF_anmPlayData* pDat6[1] = {&playData6};
+
+ daNpcF_anmPlayData** expressionAnm[6] = {
+ pDat0,
+ pDat1,
+ pDat2,
+ pDat4,
+ pDat5,
+ pDat6,
+ };
+
+ if (mExpression >= 0 && mExpression < 6) {
+ playExpressionAnm(expressionAnm);
+ }
+}
+
+/* 80B3FCE8-80B404FC 010B48 0814+00 1/2 0/0 0/0 .text playMotion__15daNpcWrestler_cFv */
+inline void daNpcWrestler_c::playMotion() {
+ daNpcF_anmPlayData playData0 = {0x39, field_0xbd8->common.morf_frame, 0};
+ daNpcF_anmPlayData* pDat0[1] = {&playData0};
+ daNpcF_anmPlayData playData1 = {0x39, 0.0f, 0};
+ daNpcF_anmPlayData* pDat1[1] = {&playData1};
+ daNpcF_anmPlayData playData2 = {0x3A, field_0xbd8->common.morf_frame, 1};
+ daNpcF_anmPlayData playData3 = {0x3B, field_0xbd8->common.morf_frame, 0};
+ daNpcF_anmPlayData* pDat2[2] = {&playData2, &playData3};
+ daNpcF_anmPlayData playData4 = {0x3B, field_0xbd8->common.morf_frame, 0};
+ daNpcF_anmPlayData* pDat4[1] = {&playData4};
+ daNpcF_anmPlayData playData5 = {0x3C, field_0xbd8->common.morf_frame, 1};
+ daNpcF_anmPlayData playData6 = {0x3B, field_0xbd8->common.morf_frame, 0};
+ daNpcF_anmPlayData* pDat5[2] = {&playData5, &playData6};
+ daNpcF_anmPlayData playData7 = {0x3D, field_0xbd8->common.morf_frame, 1};
+ daNpcF_anmPlayData playData8 = {0x3B, field_0xbd8->common.morf_frame, 0};
+ daNpcF_anmPlayData* pDat7[2] = {&playData7, &playData8};
+ daNpcF_anmPlayData playData9 = {0x1D, 4.0f, 0};
+ daNpcF_anmPlayData* pDat9[1] = {&playData9};
+ daNpcF_anmPlayData playData10 = {0x20, field_0xbd8->common.morf_frame, 1};
+ daNpcF_anmPlayData playData11 = {0x1E, 24.0f, 0};
+ daNpcF_anmPlayData* pDat10[3] = {&playData10, &playData11, NULL};
+ daNpcF_anmPlayData playData12 = {0x21, 0.0f, 0};
+ daNpcF_anmPlayData* pDat12[1] = {&playData12};
+ daNpcF_anmPlayData playData13 = {0x22, 6.0f, 1};
+ daNpcF_anmPlayData* pDat13[2] = {&playData13, NULL};
+ daNpcF_anmPlayData playData14 = {0x23, 6.0f, 0};
+ daNpcF_anmPlayData* pDat14[1] = {&playData14};
+ daNpcF_anmPlayData playData15 = {0x24, 6.0f, 0};
+ daNpcF_anmPlayData* pDat15[1] = {&playData15};
+ daNpcF_anmPlayData playData16 = {0x25, 6.0f, 1};
+ daNpcF_anmPlayData* pDat16[2] = {&playData16, NULL};
+ daNpcF_anmPlayData playData17 = {0x29, 6.0f, 1};
+ daNpcF_anmPlayData* pDat17[2] = {&playData17, NULL};
+ daNpcF_anmPlayData playData18 = {0x30, 0.0f, 0};
+ daNpcF_anmPlayData* pDat18[1] = {&playData18};
+ daNpcF_anmPlayData playData19 = {0x26, 6.0f, 1};
+ daNpcF_anmPlayData* pDat19[2] = {&playData19, NULL};
+ daNpcF_anmPlayData playData20 = {0x27, 6.0f, 1};
+ daNpcF_anmPlayData* pDat20[2] = {&playData20, NULL};
+ daNpcF_anmPlayData playData21 = {0x28, 6.0f, 1};
+ daNpcF_anmPlayData* pDat21[2] = {&playData21, NULL};
+ daNpcF_anmPlayData playData22 = {0x2B, 6.0f, 1};
+ daNpcF_anmPlayData* pDat22[2] = {&playData22, NULL};
+ daNpcF_anmPlayData playData23 = {0x2E, 0.0f, 1};
+ daNpcF_anmPlayData* pDat23[2] = {&playData23, NULL};
+ daNpcF_anmPlayData playData24 = {0x2F, 6.0f, 1};
+ daNpcF_anmPlayData* pDat24[2] = {&playData24, NULL};
+ daNpcF_anmPlayData playData25 = {0x2C, 0.0f, 0};
+ daNpcF_anmPlayData* pDat25[1] = {&playData25};
+ daNpcF_anmPlayData playData26 = {0x2D, 6.0f, 0};
+ daNpcF_anmPlayData* pDat26[1] = {&playData26};
+ daNpcF_anmPlayData playData27 = {0x31, 6.0f, 0};
+ daNpcF_anmPlayData* pDat27[1] = {&playData27};
+ daNpcF_anmPlayData playData28 = {0x32, 6.0f, 0};
+ daNpcF_anmPlayData* pDat28[1] = {&playData28};
+ daNpcF_anmPlayData playData29 = {0x38, 0.0f, 1};
+ daNpcF_anmPlayData playData30 = {0x39, 0.0f, 0};
+ daNpcF_anmPlayData* pDat29[3] = {&playData29, &playData30, NULL};
+ daNpcF_anmPlayData playData31 = {0x34, field_0xbd8->common.morf_frame, 1};
+ daNpcF_anmPlayData playData32 = {0x36, 0.0f, 0};
+ daNpcF_anmPlayData* pDat31[3] = {&playData31, &playData32, NULL};
+ daNpcF_anmPlayData playData33 = {0x35, field_0xbd8->common.morf_frame, 1};
+ daNpcF_anmPlayData playData34 = {0x36, 0.0f, 0};
+ daNpcF_anmPlayData* pDat33[3] = {&playData33, &playData34, NULL};
+ daNpcF_anmPlayData playData35 = {0x2A, 6.0f, 1};
+ daNpcF_anmPlayData* pDat35[2] = {&playData35, NULL};
+ daNpcF_anmPlayData playData36 = {0x37, field_0xbd8->common.morf_frame, 1};
+ daNpcF_anmPlayData playData37 = {0x1B, 6.0f, 0};
+ daNpcF_anmPlayData* pDat36[2] = {&playData36, &playData37};
+
+ daNpcF_anmPlayData** motionAnm[30] = {
+ pDat0,
+ pDat1,
+ pDat2,
+ pDat4,
+ pDat5,
+ pDat7,
+ pDat9,
+ pDat10,
+ pDat12,
+ pDat13,
+ pDat14,
+ pDat15,
+ pDat16,
+ pDat17,
+ pDat18,
+ pDat19,
+ pDat20,
+ pDat21,
+ pDat22,
+ pDat23,
+ pDat24,
+ pDat25,
+ pDat26,
+ pDat27,
+ pDat28,
+ pDat29,
+ pDat31,
+ pDat33,
+ pDat35,
+ pDat36
+ };
+
+ if (mMotion >= 0 && mMotion < 30) {
+ field_0xe92 = mMotionPhase;
+ playMotionAnm(motionAnm);
+ }
+}
+
+/* 80B40B3C-80B40D1C 01199C 01E0+00 1/1 0/0 0/0 .text lookat__15daNpcWrestler_cFv */
+inline void daNpcWrestler_c::lookat() {
+ daPy_py_c* player = NULL;
+ J3DModel* model = mpMorf->getModel();
+ BOOL snap = FALSE;
+ f32 fVar1 = field_0xbd8->common.body_angleX_min;
+ f32 fVar2 = field_0xbd8->common.body_angleX_max;
+ f32 fVar3 = field_0xbd8->common.body_angleY_min;
+ f32 fVar4 = field_0xbd8->common.body_angleY_max;
+ f32 fVar5 = field_0xbd8->common.head_angleX_min;
+ f32 fVar6 = field_0xbd8->common.head_angleX_max;
+ f32 fVar7 = field_0xbd8->common.head_angleY_min;
+ f32 fVar8 = field_0xbd8->common.head_angleY_max;
+ s16 angle_delta = mCurAngle.y - mOldAngle.y;
+ cXyz lookat_pos[3] = {mLookatPos[0], mLookatPos[1], mLookatPos[2]};
+ csXyz* lookat_angle[3] = {&mLookatAngle[0], &mLookatAngle[1], &mLookatAngle[2]};
+ cXyz spe8;
+
+ switch (mLookMode) {
+ case LOOK_NONE:
+ break;
+
+ case LOOK_RESET:
+ snap = TRUE;
+ break;
+
+ case LOOK_PLAYER:
+ case LOOK_PLAYER_TALK:
+ player = daPy_getPlayerActorClass();
+
+ if (mLookMode == LOOK_PLAYER_TALK) {
+ fVar7 = -80.0f;
+ fVar8 = 80.0f;
+ }
+ }
+
+ if (player != NULL) {
+ mLookPos = player->attention_info.position;
+
+ if (mLookMode != 2 && mLookMode != 3) {
+ mLookPos.y -= 40.0f;
+ }
+
+ mLookAt.setAttnPos(&mLookPos);
+ } else {
+ mLookAt.setAttnPos(NULL);
+ }
+
+ mLookAt.setParam(fVar1, fVar2, fVar3, fVar4, 0.0f, 0.0f, 0.0f, 0.0f, fVar5, fVar6, fVar7, fVar8, mCurAngle.y, lookat_pos);
+ mLookAt.calc(this, model->getBaseTRMtx(), lookat_angle, snap, angle_delta, FALSE);
+}
+
+/* 80B33B3C-80B34654 00499C 0B18+00 1/1 0/0 0/0 .text setNextAction__15daNpcWrestler_cFv */
+inline bool daNpcWrestler_c::setNextAction() {
+ daPy_py_c* player = daPy_getPlayerActorClass();
+
+ if (mType == 1 && !player->checkEquipHeavyBoots()) {
+ if (player->checkSumouSlideLeft() || player->checkSumouSlideRight() || player->checkSumouLeftMove() || player->checkSumouRightMove()) {
+ setAction(&daNpcWrestler_c::sumouPunchChaseHit);
+ return true;
+ }
+
+ if (player->checkSumouPunchDraw()) {
+ setAction(&daNpcWrestler_c::sumouPunchDraw);
+ return true;
+ }
+
+ if (player->checkSumouTackleDraw()) {
+ setAction(&daNpcWrestler_c::sumouTackleDraw);
+ return true;
+ }
+ } else {
+ if (player->checkSumouPunchStagger() || player->checkSumouTackleStagger()) {
+ mWrestlerAction = 3;
+ setAction(&daNpcWrestler_c::sumouTackleHit);
+ player->setSumouForceTackle();
+ return true;
+ }
+
+ switch (mWrestlerAction) {
+ case 1:
+ if (player->checkSumouTackleMiss()) {
+ setAction(&daNpcWrestler_c::sumouSideStep);
+ return true;
+ }
+
+ if (player->checkSumouPunchSuccess()) {
+ setAction(&daNpcWrestler_c::sumouPunchChaseShock);
+ return true;
+ }
+
+ if (player->checkSumouSlideLeft() || player->checkSumouSlideRight()
+ || player->checkSumouLeftMove() || player->checkSumouRightMove()) {
+ setAction(&daNpcWrestler_c::sumouSideStep);
+ return true;
+ }
+ break;
+
+ case 2:
+ if (player->checkSumouSlideLeft() || player->checkSumouSlideRight()
+ || player->checkSumouLeftMove() || player->checkSumouRightMove()) {
+ setAction(&daNpcWrestler_c::sumouPunchChaseHit);
+ return true;
+ }
+
+ if (player->checkSumouPunchDraw()) {
+ setAction(&daNpcWrestler_c::sumouPunchDraw);
+ return true;
+ }
+
+ if (player->checkSumouTackleSuccess() || player->checkSumouTackleSuccessPunch()) {
+ setAction(&daNpcWrestler_c::sumouPunchMiss);
+ return true;
+ }
+ break;
+
+ case 3:
+ if (player->checkSumouSlideLeft() || player->checkSumouSlideRight()) {
+ setAction(&daNpcWrestler_c::sumouTackleMiss);
+ return true;
+ }
+
+ if (player->checkSumouPunchMiss()) {
+ setAction(&daNpcWrestler_c::sumouTackleHit);
+ return true;
+ }
+
+ if (player->checkSumouTackleDraw()) {
+ setAction(&daNpcWrestler_c::sumouTackleDraw);
+ return true;
+ }
+ break;
+
+ case 4:
+ if (player->checkSumouTackleSuccess()) {
+ setAction(&daNpcWrestler_c::sumouTackleShock);
+ return true;
+ }
+
+ if (player->checkSumouTackleMiss()) {
+ setAction(&daNpcWrestler_c::sumouSideStep);
+ return true;
+ }
+
+ if (player->checkSumouPunchSuccess()) {
+ setAction(&daNpcWrestler_c::sumouPunchShock);
+ return true;
+ }
+
+ if (player->checkSumouPunchMiss()) {
+ setAction(&daNpcWrestler_c::sumouTackleHit);
+ return true;
+ }
+ break;
+ }
+ }
+
+ return false;
}
/* 80B30F00-80B31680 001D60 0780+00 13/1 0/0 0/0 .text wait__15daNpcWrestler_cFPv */
-bool daNpcWrestler_c::wait(void* param_1) {
- // NONMATCHING
+inline bool daNpcWrestler_c::wait(void* param_1) {
switch (field_0xe96) {
- case 0:
+ case 0: {
setExpression(5, -1.0f);
setMotion(0, field_0xe8c, 0);
mTurnMode = 0;
speedF = 0.0f;
field_0xe96 = 2;
- return true;
-
- case 1:
- return true;
-
- case 2:
- if (dComIfGp_event_runCheck()) {
- if (mOrderNewEvt != 0) {
- if (dComIfGp_getEvent().isOrderOK()) {
- actionFunc action;
- if (!eventInfo.checkCommandTalk()) {
- if (!dComIfGp_event_chkTalkXY() || dComIfGp_evmng_ChkPresentEnd()) {
- if (mType == 1 && field_0xe99 == 0 && daNpcF_chkEvtBit(0x3A) && !daNpcF_chkEvtBit(0x3E) && daNpcF_chkEvtBit(0x3F)) {
- s16 sVar1;
- if (current.pos.z > 200.0f) {
- sVar1 = 3;
- } else {
- sVar1 = 4;
- }
-
- mOrderEvtNo = sVar1;
-
- changeEvent(l_resName[mType], l_evtNames[mOrderEvtNo], 1, 0xFFFF);
- action = &daNpcWrestler_c::demo;
- field_0xe96 = 3;
- if (field_0xdcc != NULL) {
- (this->*field_0xdcc)(NULL);
- }
-
- field_0xe96 = 0;
- field_0xdcc = action;
- if (field_0xdcc != NULL) {
- (this->*field_0xdcc)(NULL);
- }
-
- break;
- }
-
- action = &daNpcWrestler_c::talk;
- field_0xe96 = 3;
- if (field_0xdcc != NULL) {
- (this->*field_0xdcc)(NULL);
- }
-
- field_0xe96 = 0;
- field_0xdcc = action;
- if (field_0xdcc != NULL) {
- (this->*field_0xdcc)(NULL);
- }
+ break;
+ }
- break;
+ case 2: {
+ if (dComIfGp_event_runCheck() && (mOrderNewEvt == 0 || !dComIfGp_getEvent().isOrderOK())) {
+ actionFunc action;
+ if (eventInfo.checkCommandTalk()) {
+ if (dComIfGp_event_chkTalkXY() == 0 || dComIfGp_evmng_ChkPresentEnd()) {
+ if (mType == 1 && field_0xe99 == 0 && daNpcF_chkEvtBit(0x3A)
+ && !daNpcF_chkEvtBit(0x3E) && daNpcF_chkEvtBit(0x3F)) {
+ s16 sVar1;
+ if (current.pos.z > 200.0f) {
+ sVar1 = 3;
+ } else {
+ sVar1 = 4;
}
- } else {
- if (dComIfGp_getEventManager().getMyStaffId(l_myName, NULL, 0) != -1) {
- action = &daNpcWrestler_c::demo;
- field_0xe96 = 3;
- if (field_0xdcc != NULL) {
- (this->*field_0xdcc)(NULL);
- }
- field_0xe96 = 0;
- field_0xdcc = action;
- if (field_0xdcc != NULL) {
- (this->*field_0xdcc)(NULL);
- }
+ mOrderEvtNo = sVar1;
- break;
- }
+ changeEvent(l_resName[mType], l_evtNames[mOrderEvtNo], 1, 0xFFFF);
+ setAction(&daNpcWrestler_c::demo);
+ break;
+ } else {
+ setAction(&daNpcWrestler_c::talk);
+ break;
+ }
+ }
+ } else {
+ dEvent_manager_c& ev_mng = dComIfGp_getEventManager();
+ if (ev_mng.getMyStaffId(l_myName, NULL, 0) != -1) {
+ setAction(&daNpcWrestler_c::demo);
+ break;
+ }
+ }
+ } else {
+ mOrderEvtNo = 0;
+ if (mType == 1 && !daNpcF_chkEvtBit(0x3F)) {
+ fopAc_ac_c* actor = getEvtAreaTagP(6, 0);
+ if (actor != NULL) {
+ f32 player_dist = fopAcM_searchPlayerDistance(actor);
+ f32 scale_fact = fopAcM_GetScale_p(actor)->x * 0.5f;
+ if (player_dist < scale_fact) {
+ mOrderEvtNo = 1;
+ fopAcM_delete(actor);
}
}
}
- }
- mOrderEvtNo = 0;
- if (mType == 1 && !daNpcF_chkEvtBit(0x3F)) {
- fopAc_ac_c* actor = getEvtAreaTagP(6, 0);
- if (actor != NULL && fopAcM_searchPlayerDistance(actor) < (actor->scale.x * 0.5f)) {
- mOrderEvtNo = 1;
- fopAcM_delete(actor);
+ if (mOrderEvtNo != 0) {
+ eventInfo.setArchiveName(l_resName[mType]);
}
- }
- if (mOrderEvtNo != 0) {
- eventInfo.setArchiveName(l_resName[mType]);
+ orderEvent(field_0xe99, l_evtNames[mOrderEvtNo], 0xFFFF, 0x28, 0xFF, 1);
}
- orderEvent(field_0xe99, l_evtNames[mOrderEvtNo], 0xFFFF, 0x28, 0xFF, 1);
-
-
if (mActorMngr[0].getActorP() != NULL) {
if (!chkFindPlayer()) {
mTurnMode = 0;
@@ -1194,11 +1607,23 @@ bool daNpcWrestler_c::wait(void* param_1) {
mTurnMode = 0;
}
- if (mActorMngr[0].getActorP() == NULL && home.angle.y != mCurAngle.y && step(home.angle.y, 1) != 0) {
+ if (mActorMngr[0].getActorP() == NULL && home.angle.y != mCurAngle.y && step(home.angle.y, 1)) {
setExpression(5, -1.0f);
setMotion(0, -1.0f, 0);
mTurnMode = 0;
}
+
+ break;
+ }
+
+ case 3: {
+ break;
+ }
+
+ default: {
+ JUT_PANIC(2769, "0")
+ break;
+ }
}
return true;
@@ -1207,12 +1632,14 @@ bool daNpcWrestler_c::wait(void* param_1) {
/* 80B31680-80B316C8 0024E0 0048+00 1/0 0/0 0/0 .text setMotion__15daNpcWrestler_cFifi */
void daNpcWrestler_c::setMotion(int i_motion, f32 i_motionMorfOverride, int param_3) {
s16 motion = i_motion;
- if ((param_3 != 0 || mMotion != motion) && i_motion >= 0 && i_motion < 30) {
- mMotion = motion;
- mMotionMorfOverride = i_motionMorfOverride;
- mMotionPrevPhase = -1;
- mMotionPhase = 0;
- field_0xe92 = 0;
+ if (param_3 || mMotion != motion) {
+ if (i_motion >= 0 && i_motion < 30) {
+ mMotion = motion;
+ mMotionMorfOverride = i_motionMorfOverride;
+ mMotionPrevPhase = -1;
+ mMotionPhase = 0;
+ field_0xe92 = 0;
+ }
}
}
@@ -1227,7 +1654,7 @@ void daNpcWrestler_c::setExpression(int i_expression, f32 i_expressionMorfOvveri
}
inline bool daNpcWrestler_c::setTalkAngle() {
- s16 playerAngleY = fopAcM_searchPlayerAngleY(this);
+ s16 playerAngleY = (int) fopAcM_searchPlayerAngleY(this);
if (playerAngleY == mCurAngle.y) {
return true;
}
@@ -1258,13 +1685,12 @@ inline void daNpcWrestler_c::setExpressionTalkAfter() {
}
/* 80B316F4-80B31EB0 002554 07BC+00 3/0 0/0 0/0 .text talk__15daNpcWrestler_cFPv */
-bool daNpcWrestler_c::talk(void* param_1) {
- // NONMATCHING
+inline bool daNpcWrestler_c::talk(void* param_1) {
bool rv = false;
int i_expression, i_motion, iVar3;
switch (field_0xe96) {
- case 0:
+ case 0: {
initTalk(mMsgNo, NULL);
initTalkAngle();
mMsgTimer = 0;
@@ -1273,8 +1699,9 @@ bool daNpcWrestler_c::talk(void* param_1) {
setLookMode(3);
field_0xe96 = 2;
break;
-
- case 2:
+ }
+
+ case 2: {
if (setTalkAngle()) {
if (talkProc(NULL, 1, NULL)) {
actionFunc action;
@@ -1291,93 +1718,31 @@ bool daNpcWrestler_c::talk(void* param_1) {
field_0x9ec = true;
field_0xe8c = field_0xbd8->common.morf_frame;
- action = &daNpcWrestler_c::talk;
- field_0xe96 = 3;
- if (field_0xdcc != NULL) {
- (this->*field_0xdcc)(NULL);
- }
-
- field_0xe96 = 0;
- field_0xdcc = action;
- if (field_0xdcc != NULL) {
- (this->*field_0xdcc)(NULL);
- }
+ setAction(&daNpcWrestler_c::wait);
}
} else if (eventID == 6) {
- action = &daNpcWrestler_c::gotoArena;
- field_0xe96 = 3;
- if (field_0xdcc != NULL) {
- (this->*field_0xdcc)(NULL);
- }
-
- field_0xe96 = 0;
- field_0xdcc = action;
- if (field_0xdcc != NULL) {
- (this->*field_0xdcc)(NULL);
- }
+ setAction(&daNpcWrestler_c::gotoArena);
} else {
int choiceNo = mFlow.getChoiceNo();
- #ifdef DEBUG
- char* choice;
- if (choiceNo == 0) {
- choice = "はい";
- } else {
- choice = "いいえ";
- }
- OS_REPORT("二択分岐 %s\n", choice);
- #endif
+#ifdef DEBUG
+ // "Choice %s\n", (choiceNo == 0) ? "Yes" : "No"
+ OS_REPORT("二択分岐 %s\n", (choiceNo == 0) ? "はい" : "いいえ");
+#endif
field_0xe8c = field_0xbd8->common.morf_frame;
- int itemNo;
- if (!daNpcF_chkEvtBit(0xE7)) {
- itemNo = 1;
- } else {
- itemNo = 2;
- }
- mItemNo = itemNo;
+ mItemNo = daNpcF_chkEvtBit(0xE7) ? 2 : 1;
if (choiceNo == 0) {
if (mType == 0) {
- action = &daNpcWrestler_c::gotoArena;
- field_0xe96 = 3;
- if (field_0xdcc != NULL) {
- (this->*field_0xdcc)(NULL);
- }
-
- field_0xe96 = 0;
- field_0xdcc = action;
- if (field_0xdcc != NULL) {
- (this->*field_0xdcc)(NULL);
- } else {
- mOrderEvtNo = 5;
- changeEvent(l_resName[mType], l_evtNames[mOrderEvtNo], 1, 0xFFFF);
-
- action = &daNpcWrestler_c::demo;
- field_0xe96 = 3;
- if (field_0xdcc != NULL) {
- (this->*field_0xdcc)(NULL);
- }
-
- field_0xe96 = 0;
- field_0xdcc = action;
- if (field_0xdcc != NULL) {
- (this->*field_0xdcc)(NULL);
- }
- }
+ setAction(&daNpcWrestler_c::gotoArena);
} else {
- action = &daNpcWrestler_c::wait;
- field_0xe96 = 3;
- if (field_0xdcc != NULL) {
- (this->*field_0xdcc)(NULL);
- }
-
- field_0xe96 = 0;
- field_0xdcc = action;
- if (field_0xdcc != NULL) {
- (this->*field_0xdcc)(NULL);
- }
+ mOrderEvtNo = 5;
+ changeEvent(l_resName[mType], l_evtNames[mOrderEvtNo], 1, 0xFFFF);
+ setAction(&daNpcWrestler_c::demo);
}
- }
+ } else {
+ setAction(&daNpcWrestler_c::wait);
+ }
}
rv = true;
@@ -1393,86 +1758,74 @@ bool daNpcWrestler_c::talk(void* param_1) {
}
}
}
+
break;
+ }
- case 3:
+ case 3: {
setExpression(5, -1.0f);
if (!field_0x9ec) {
dComIfGp_event_reset();
}
+
+ break;
+ }
+
+ default: {
+ JUT_PANIC(2858, "0");
+ }
}
return rv;
}
/* 80B31EB0-80B32058 002D10 01A8+00 4/0 0/0 0/0 .text demo__15daNpcWrestler_cFPv */
-bool daNpcWrestler_c::demo(void* param_1) {
- // NONMATCHING
+inline bool daNpcWrestler_c::demo(void* param_1) {
+ // NONMATCHING - register weirdness in GCN
dEvent_manager_c* eventManager = &dComIfGp_getEventManager();
- int staffID;
switch (field_0xe96) {
case 0:
field_0xe96 = 2;
break;
- case 2:
- staffID = eventManager->getMyStaffId(l_myName, NULL, 0);
+ case 2: {
+ int staffID = eventManager->getMyStaffId(l_myName, NULL, 0);
mStaffID = staffID;
JUT_ASSERT(2886, 0 != mEvtSeqList[mOrderEvtNo]);
- if (staffID != -1 && (this->*mEvtSeqList[mOrderEvtNo])(NULL)) {
+ if (staffID != -1 && (this->*mEvtSeqList[mOrderEvtNo])(staffID)) {
eventManager->cutEnd(mStaffID);
}
if (eventInfo.checkCommandDemoAccrpt() && mEventIdx != -1 && eventManager->endCheck(mEventIdx)) {
+ u16 asdf = mOrderEvtNo;
+ (void) asdf;
dComIfGp_event_reset();
mOrderEvtNo = 0;
mEventIdx = -1;
setAction(&daNpcWrestler_c::wait);
}
+
break;
+ }
- case 3:
+ case 3: {
field_0xe8c = 20.0f;
- }
-
- return true;
-}
-
-inline void daNpcWrestler_c::setNextSumouEvent(int i_sumouEventNo) {
- if (i_sumouEventNo == -1) {
- i_sumouEventNo = mItemNo;
- }
-
- OS_REPORT("相撲イベント要求 ステータスNo=%d\n", i_sumouEventNo);
-
- switch (i_sumouEventNo) {
- case 1:
- return;
-
- case 2:
- setAction(&daNpcWrestler_c::demoSumouReady);
- return;
-
- case 3:
- setAction(&daNpcWrestler_c::sumouReady);
- return;
-
- case 4:
- setAction(&daNpcWrestler_c::gotoLiving);
- return;
+ break;
+ }
- case 5:
- return;
+ default: {
+ JUT_PANIC(2912, "0");
+ break;
+ }
}
- setAction(&daNpcWrestler_c::wait);
+ return true;
}
/* 80B32058-80B32444 002EB8 03EC+00 7/0 0/0 0/0 .text gotoArena__15daNpcWrestler_cFPv */
-bool daNpcWrestler_c::gotoArena(void* param_1) {
- // NONMATCHING
+inline bool daNpcWrestler_c::gotoArena(void* param_1) {
dCamera_c* camBody = dCam_getBody();
int iVar1;
@@ -1485,7 +1838,6 @@ bool daNpcWrestler_c::gotoArena(void* param_1) {
}
field_0xe80 = 1.0f / field_0xbd8->fade_speed;
-
mDoGph_gInf_c::fadeOut(field_0xbd8->fade_speed);
camBody->Stop();
camBody->SetTrimSize(2);
@@ -1514,56 +1866,38 @@ bool daNpcWrestler_c::gotoArena(void* param_1) {
}
break;
- case 2:
+ case 2: {
iVar1 = field_0xe80;
field_0xe80--;
if (iVar1 <= 0) {
setNextSumouEvent(-1);
}
+
+ break;
+ }
+
+ default: {
+ JUT_PANIC(2969, "0");
+ break;
+ }
}
break;
- case 3:
+ case 3: {
break;
- }
-
- return true;
-}
-
-inline void daNpcWrestler_c::setBackToLiving() {
- if (mType != 1) {
- daPy_py_c* player = daPy_getPlayerActorClass();
- daNpcBouS_c* bou = (daNpcBouS_c*)fpcM_SearchByID(parentActorID);
- JUT_ASSERT(2205, bou != 0);
-
- bou->setMessageNo(7);
- bou->setForcibleTalk();
- bou->onDispFlag();
-
- s16 sVar1 = fopAcM_GetHomeAngle_p(bou)->y + 0x8000;
- mDoMtx_stack_c::transS(fopAcM_GetPosition(bou));
- mDoMtx_stack_c::YrotM(fopAcM_GetShapeAngle_p(bou)->y);
- cXyz sp28(0.0f, 0.0f, field_0xbdc->field_0x1c);
- mDoMtx_stack_c::multVec(&sp28, &sp28);
-
- player->setPlayerPosAndAngle(&sp28, sVar1, 0);
-
- if (mType == 0) {
- player->setClothesChange(0);
- OS_REPORT("リンクさん!出番です!着替えてください!\n") // Link! It's your turn! Get changed!
}
- if (daNpcF_chkTmpBit(0x2F)) {
- fopAcM_onSwitch(this, 0x46);
+ default: {
+ JUT_PANIC(2974, "0");
+ break;
}
-
- field_0xe99 = 1;
}
+
+ return true;
}
/* 80B32444-80B32850 0032A4 040C+00 1/0 0/0 0/0 .text gotoLiving__15daNpcWrestler_cFPv */
-bool daNpcWrestler_c::gotoLiving(void* param_1) {
- // NONMATCHING
+inline bool daNpcWrestler_c::gotoLiving(void* param_1) {
dCamera_c* camBody = dCam_getBody();
int iVar1;
@@ -1593,10 +1927,8 @@ bool daNpcWrestler_c::gotoLiving(void* param_1) {
}
break;
- case 1:
- iVar1 = field_0xe80;
- field_0xe80--;
- if (iVar1 < 1) {
+ case 1: {
+ if (field_0xe80-- <= 0) {
camBody->Reset(mDemoCam.mDemoCamCenter, mDemoCam.mDemoCamEye);
camBody->Start();
dComIfGp_event_reset();
@@ -1610,11 +1942,23 @@ bool daNpcWrestler_c::gotoLiving(void* param_1) {
}
}
break;
+ }
+
+ default: {
+ JUT_PANIC(3032, "0");
+ break;
+ }
}
break;
- case 3:
+ case 3: {
+ break;
+ }
+
+ default: {
+ JUT_PANIC(3037, "0");
break;
+ }
}
return true;
@@ -1636,13 +1980,8 @@ inline void daNpcWrestler_c::initDemoCamera_ArenaSide() {
mDoMtx_stack_c::multVecZero(&mDemoCam.mDemoCamEye);
}
-inline void dMeter2Info_setMeterString(s32 i_string) {
- g_meter2_info.setMeterString(i_string);
-}
-
/* 80B32850-80B331CC 0036B0 097C+00 2/0 0/0 0/0 .text sumouReady__15daNpcWrestler_cFPv */
bool daNpcWrestler_c::sumouReady(void* param_1) {
- // NONMATCHING
daPy_py_c* player = daPy_getPlayerActorClass();
dCamera_c* camBody = dCam_getBody();
int iVar1;
@@ -1677,7 +2016,7 @@ bool daNpcWrestler_c::sumouReady(void* param_1) {
field_0xe96 = 2;
break;
- case 2:
+ case 2: {
switch (field_0xe84) {
case 0:
if (field_0xe9a == 0) {
@@ -1701,23 +2040,25 @@ bool daNpcWrestler_c::sumouReady(void* param_1) {
field_0xe84++;
// fallthrough
case 1:
- if (player->getClothesChangeWaitTimer() == 0) {
+ if (player->getClothesChangeWaitTimer()) {
+ break;
+ }
+ field_0xe84++;
+ // fallthrough
+ case 2:
+ field_0xe5e += field_0xbd8->field_0xac;
+ field_0xe54 -= fabsf(field_0xbd8->field_0xac);
+ if (field_0xe54 < fabsf(field_0xbd8->field_0xac)) {
+ field_0xe80 = 1;
field_0xe84++;
- field_0xe5e += field_0xbd8->field_0xac;
- field_0xe54 -= fabsf(field_0xbd8->field_0xac);
-
- if (field_0xe54 < fabsf(field_0xbd8->field_0xac)) {
- field_0xe80 = 1;
- field_0xe84++;
- }
-
- mDemoCamFovy = 45.0f;
- mDoMtx_stack_c::transS(mDemoCam.mDemoCamCenter);
- mDoMtx_stack_c::YrotM(field_0xe5e);
- mDemoCam.mDemoCamCenter.set(0.0f, 50.0f, -field_0xbd8->field_0xb0);
- mDoMtx_stack_c::multVec(&mDemoCam.mDemoCamEye, &mDemoCam.mDemoCamEye);
- camBody->Set(mDemoCam.mDemoCamCenter, mDemoCam.mDemoCamEye, mDemoCamFovy, 0);
}
+
+ mDemoCamFovy = 45.0f;
+ mDoMtx_stack_c::transS(mDemoCam.mDemoCamCenter);
+ mDoMtx_stack_c::YrotM(field_0xe5e);
+ mDemoCam.mDemoCamEye.set(0.0f, 50.0f, -field_0xbd8->field_0xb0);
+ mDoMtx_stack_c::multVec(&mDemoCam.mDemoCamEye, &mDemoCam.mDemoCamEye);
+ camBody->Set(mDemoCam.mDemoCamCenter, mDemoCam.mDemoCamEye, mDemoCamFovy, 0);
break;
case 3:
@@ -1735,7 +2076,7 @@ bool daNpcWrestler_c::sumouReady(void* param_1) {
} else {
mDoMtx_stack_c::transS(mDemoCam.mDemoCamCenter);
mDoMtx_stack_c::YrotM(mArenaAngle + 0x8000);
- mDemoCam.mDemoCamCenter.set(0.0f, 50.0f, -field_0xbd8->field_0xb0);
+ mDemoCam.mDemoCamEye.set(0.0f, 50.0f, -field_0xbd8->field_0xb0);
mDoMtx_stack_c::multVec(&mDemoCam.mDemoCamEye, &mDemoCam.mDemoCamEye);
camBody->Set(mDemoCam.mDemoCamCenter, mDemoCam.mDemoCamEye, mDemoCamFovy, 0);
}
@@ -1777,45 +2118,49 @@ bool daNpcWrestler_c::sumouReady(void* param_1) {
setAction(&daNpcWrestler_c::sumouWait);
}
break;
+
+ default:
+ JUT_PANIC(3181, "0");
+ break;
}
+
+ break;
+ }
+
+ case 3: {
+ break;
+ }
}
-
+
return 1;
}
inline void daNpcWrestler_c::sumouAI() {
- if (mType == 1) {
- if (!daPy_getPlayerActorClass()->checkEquipHeavyBoots()) {
- mWrestlerAction = 0;
- return;
- }
+ if (mType == 1 && !daPy_getPlayerActorClass()->checkEquipHeavyBoots()) {
+ mWrestlerAction = 0;
+ return;
}
- if (field_0xbd8->ai_action != 0) {
+ if (field_0xbd8->ai_action) {
mWrestlerAction = field_0xbd8->ai_action;
- } else {
- f32 fVar1 = cM_rnd() * 100.0f;
-
- BOOL bVar1;
- if (daNpcF_chkEvtBit(0xE9)) {
- bVar1 = TRUE;
- } else {
- bVar1 = FALSE;
- }
-
- f32 fVar2 = field_0xbdc->lateral_movement_chance;
- f32 fVar3 = fVar2 + field_0xbdc->hit_chance;
- f32 fVar4 = fVar3 + field_0xbdc->tackle_chance;
+ return;
+ }
- if (fVar1 >= 0.0f && fVar1 < fVar2) {
- mWrestlerAction = 1;
- } else if (fVar1 >= fVar2 && fVar1 < fVar3) {
- mWrestlerAction = 2;
- } else if (fVar1 >= fVar3 && fVar1 < fVar4) {
- mWrestlerAction = 3;
- } else if (fVar1 >= fVar4 && fVar1 < 100.0f) {
- mWrestlerAction = 4;
- }
+ f32 fVar1 = cM_rnd() * 100.0f;
+ // whether we're in 2nd phase or not:
+ BOOL bVar1 = daNpcF_chkEvtBit(0xE9) ? TRUE : FALSE;
+ f32 fVar2 = field_0xbdc->chances[bVar1].lateral_movement_chance;
+ f32 fVar3 = fVar2 + field_0xbdc->chances[bVar1].hit_chance;
+ f32 fVar4 = fVar3 + field_0xbdc->chances[bVar1].tackle_chance;
+
+ if (fVar1 >= 0.0f && fVar1 < fVar2) {
+ mWrestlerAction = 1;
+ } else if (fVar1 >= fVar2 && fVar1 < fVar3) {
+ mWrestlerAction = 2;
+ } else if (fVar1 >= fVar3 && fVar1 < fVar4) {
+ mWrestlerAction = 3;
+ } else if (fVar1 >= fVar4 && fVar1 < 100.0f) {
+ mWrestlerAction = 4;
}
}
@@ -1829,7 +2174,8 @@ inline void daNpcWrestler_c::correctGraspPosAngle(bool param_1) {
daPy_py_c* player = daPy_getPlayerActorClass();
cXyz sp24(0.0f, 0.0f, field_0xbdc->grapple_distance);
mDoMtx_stack_c::transS(*player->getViewerCurrentPosP());
- mDoMtx_stack_c::YrotM(mStepAngle + cLib_targetAngleY(player->getViewerCurrentPosP(), &current.pos));
+ s16 my_ang = mStepAngle + cLib_targetAngleY(player->getViewerCurrentPosP(), &current.pos);
+ mDoMtx_stack_c::YrotM(my_ang);
mDoMtx_stack_c::multVec(&sp24, &current.pos);
if (param_1) {
@@ -1837,9 +2183,21 @@ inline void daNpcWrestler_c::correctGraspPosAngle(bool param_1) {
}
}
+/* 80B339EC-80B33B3C 00484C 0150+00 13/13 0/0 0/0 .text checkOutOfArenaP__15daNpcWrestler_cFv */
+inline bool daNpcWrestler_c::checkOutOfArenaP() {
+ if (mArenaInfo.chkFlag == 0) {
+ return false;
+ }
+
+ f32 fVar1 = pow(mArenaExtent, 2.0);
+ daPy_py_c* player = daPy_getPlayerActorClass();
+ cXyz left_foot_pos = player->getLeftFootPos();
+ cXyz right_foot_pos = player->getRightFootPos();
+ return (left_foot_pos.abs2XZ(mArenaPos) > fVar1) || (right_foot_pos.abs2XZ(mArenaPos) > fVar1);
+}
+
/* 80B331CC-80B339EC 00402C 0820+00 14/0 0/0 0/0 .text sumouWait__15daNpcWrestler_cFPv */
-bool daNpcWrestler_c::sumouWait(void* param_1) {
- // NONMATCHING
+inline bool daNpcWrestler_c::sumouWait(void* param_1) {
daPy_py_c* player;
int iVar1;
@@ -1847,7 +2205,6 @@ bool daNpcWrestler_c::sumouWait(void* param_1) {
case 0:
field_0xe80 = field_0xbdc->wait_time;
field_0xe98 = 0;
-
sumouAI();
setExpression(3, -1.0f);
setMotion(8, field_0xe8c, 0);
@@ -1916,134 +2273,10 @@ bool daNpcWrestler_c::sumouWait(void* param_1) {
return true;
}
-/* 80B339EC-80B33B3C 00484C 0150+00 13/13 0/0 0/0 .text checkOutOfArenaP__15daNpcWrestler_cFv */
-bool daNpcWrestler_c::checkOutOfArenaP() {
- // NONMATCHING
- if (mArenaInfo == 0) {
- return false;
- }
-
- f32 fVar1 = pow(mArenaExtent, 2.0);
- daPy_py_c* player = daPy_getPlayerActorClass();
- if (player->getLeftFootPosP()->abs2XZ(mArenaPos) <= fVar1 && player->getRightFootPosP()->abs2XZ(mArenaPos) <= fVar1) {
- return false;
- }
-
- return true;
-}
-
-/* 80B33B3C-80B34654 00499C 0B18+00 1/1 0/0 0/0 .text setNextAction__15daNpcWrestler_cFv */
-bool daNpcWrestler_c::setNextAction() {
- // NONMATCHING
- daPy_py_c* player = daPy_getPlayerActorClass();
-
- if (mType == 1 && !player->checkEquipHeavyBoots()) {
- if (player->checkSumouSlideLeft() || player->checkSumouSlideRight() || player->checkSumouLeftMove() || player->checkSumouRightMove()) {
- setAction(&daNpcWrestler_c::sumouPunchChaseHit);
- return true;
- }
-
- if (player->checkSumouPunchDraw()) {
- setAction(&daNpcWrestler_c::sumouPunchDraw);
- return true;
- }
-
- if (player->checkSumouTackleDraw()) {
- setAction(&daNpcWrestler_c::sumouTackleDraw);
- return true;
- }
- } else {
- if (player->checkSumouPunchStagger() || player->checkSumouTackleStagger()) {
- mWrestlerAction = 3;
- setAction(&daNpcWrestler_c::sumouTackleHit);
- player->setSumouForceTackle();
- return true;
- }
-
- switch (mWrestlerAction) {
- case 1:
- if (player->checkSumouTackleMiss()) {
- setAction(&daNpcWrestler_c::sumouSideStep);
- return true;
- }
-
- if (player->checkSumouPunchSuccess()) {
- setAction(&daNpcWrestler_c::sumouPunchChaseShock);
- return true;
- }
-
- if (player->checkSumouSlideLeft() || player->checkSumouSlideRight() || player->checkSumouLeftMove() || player->checkSumouRightMove()) {
- setAction(&daNpcWrestler_c::sumouSideStep);
- return true;
- }
- break;
-
- case 2:
- if (player->checkSumouSlideLeft() || player->checkSumouSlideRight() || player->checkSumouLeftMove() || player->checkSumouRightMove()) {
- setAction(&daNpcWrestler_c::sumouPunchChaseHit);
- return true;
- }
-
- if (player->checkSumouPunchDraw()) {
- setAction(&daNpcWrestler_c::sumouPunchDraw);
- return true;
- }
-
- if (player->checkSumouTackleSuccess() || player->checkSumouTackleSuccessPunch()) {
- setAction(&daNpcWrestler_c::sumouPunchMiss);
- return true;
- }
- break;
-
- case 3:
- if (player->checkSumouSlideLeft() || player->checkSumouSlideRight()) {
- setAction(&daNpcWrestler_c::sumouTackleMiss);
- return true;
- }
-
- if (player->checkSumouPunchMiss()) {
- setAction(&daNpcWrestler_c::sumouTackleHit);
- return true;
- }
-
- if (player->checkSumouTackleDraw()) {
- setAction(&daNpcWrestler_c::sumouTackleDraw);
- return true;
- }
- break;
-
- case 4:
- if (player->checkSumouTackleSuccess()) {
- setAction(&daNpcWrestler_c::sumouTackleShock);
- return true;
- }
-
- if (player->checkSumouTackleMiss()) {
- setAction(&daNpcWrestler_c::sumouSideStep);
- return true;
- }
-
- if (player->checkSumouPunchSuccess()) {
- setAction(&daNpcWrestler_c::sumouPunchShock);
- return true;
- }
-
- if (player->checkSumouPunchMiss()) {
- setAction(&daNpcWrestler_c::sumouTackleHit);
- return true;
- }
- break;
- }
- }
-
- return false;
-}
-
/* 80B34654-80B34CD0 0054B4 067C+00 2/0 0/0 0/0 .text sumouPunchHit__15daNpcWrestler_cFPv */
-bool daNpcWrestler_c::sumouPunchHit(void* param_1) {
- // NONMATCHING
+inline bool daNpcWrestler_c::sumouPunchHit(void* param_1) {
daPy_py_c* player = daPy_getPlayerActorClass();
- int jointNo = mType != 0 ? 0x12 : 0x11;
+ int jointNo = mType == 0 ? 0x12 : 0x11;
cXyz sp2c;
switch (field_0xe96) {
@@ -2058,8 +2291,7 @@ bool daNpcWrestler_c::sumouPunchHit(void* param_1) {
field_0xdd8->becomeImmortalEmitter();
}
- field_0xde0 = NULL;
- field_0xddc = NULL;
+ field_0xddc = field_0xde0 = NULL;
field_0xe96 = 2;
break;
@@ -2098,6 +2330,7 @@ bool daNpcWrestler_c::sumouPunchHit(void* param_1) {
}
if (field_0xde0 != NULL) {
+ // FIXME: Needs to use ctor:
JGeometry::TVec3<s16> emitter_rot;
emitter_rot.x = mCurAngle.x;
emitter_rot.y = mCurAngle.y;
@@ -2114,7 +2347,7 @@ bool daNpcWrestler_c::sumouPunchHit(void* param_1) {
}
break;
- case 3:
+ case 3: {
if (field_0xdd8 != NULL) {
field_0xdd8->quitImmortalEmitter();
field_0xdd8 = NULL;
@@ -2131,10 +2364,17 @@ bool daNpcWrestler_c::sumouPunchHit(void* param_1) {
}
mDoMtx_stack_c::transS(current.pos);
- mDoMtx_stack_c::YrotM(cLib_targetAngleY(player->getViewerCurrentPosP(), &current.pos));
+ s16 tgt_ang = cLib_targetAngleY(player->getViewerCurrentPosP(), &current.pos);
+ mDoMtx_stack_c::YrotM(tgt_ang);
current.pos.set(0.0f, 0.0f, -63.5f);
mDoMtx_stack_c::multVec(&current.pos, &current.pos);
break;
+ }
+
+ default: {
+ JUT_PANIC(3411, "0");
+ break;
+ }
}
return true;
@@ -2142,8 +2382,7 @@ bool daNpcWrestler_c::sumouPunchHit(void* param_1) {
/* 80B34CD0-80B35364 005B30 0694+00 2/0 0/0 0/0 .text sumouPunchChaseHit__15daNpcWrestler_cFPv */
bool daNpcWrestler_c::sumouPunchChaseHit(void* param_1) {
- // NONMATCHING
- int jointNo = mType != 0 ? 0x12 : 0x11;
+ int jointNo = mType == 0 ? 0x12 : 0x11;
cXyz sp38;
switch (field_0xe96) {
@@ -2242,11 +2481,26 @@ bool daNpcWrestler_c::sumouPunchChaseHit(void* param_1) {
return true;
}
+/* 80B35780-80B358F0 0065E0 0170+00 8/8 0/0 0/0 .text checkOutOfArenaW__15daNpcWrestler_cFv */
+inline bool daNpcWrestler_c::checkOutOfArenaW() {
+ if (mArenaInfo.chkFlag == 0) {
+ return false;
+ }
+
+ int jointNo = mType == 0 ? 0x1A : 0x18;
+ int jointNo2 = mType == 0 ? 0x1E : 0x1B;
+ f32 fVar1 = pow(mArenaExtent, 2.0);
+
+ field_0x89c = getJointPos(jointNo);
+ field_0x8a8 = getJointPos(jointNo2);
+ return field_0x89c.abs2XZ(mArenaPos) > fVar1 || field_0x8a8.abs2XZ(mArenaPos) > fVar1;
+}
+
/* 80B35364-80B35780 0061C4 041C+00 1/0 0/0 0/0 .text sumouPunchMiss__15daNpcWrestler_cFPv */
-bool daNpcWrestler_c::sumouPunchMiss(void* param_1) {
- // NONMATCHING
+inline bool daNpcWrestler_c::sumouPunchMiss(void* param_1) {
+ // NONMATCHING - regalloc
daPy_py_c* player = daPy_getPlayerActorClass();
- int jointNo = mType != 0 ? 0x12 : 0x11;
+ int jointNo = mType == 0 ? 0x12 : 0x11;
cXyz sp2c;
switch (field_0xe96) {
@@ -2271,7 +2525,6 @@ bool daNpcWrestler_c::sumouPunchMiss(void* param_1) {
mpMorf->modelCalc();
mDoMtx_stack_c::copy(mpMorf->getModel()->getAnmMtx(jointNo));
mDoMtx_stack_c::multVecZero(&sp2c);
-
if (mpMorf->getFrame() > 13.0f && mpMorf->getFrame() < 34.0f) {
dCam_getBody()->ModeFix(6);
}
@@ -2291,33 +2544,17 @@ bool daNpcWrestler_c::sumouPunchMiss(void* param_1) {
}
break;
- case 3:
+ case 3: {
if (field_0xdd8 != NULL) {
field_0xdd8->quitImmortalEmitter();
field_0xdd8 = NULL;
}
break;
- }
-
- return true;
-}
-
-/* 80B35780-80B358F0 0065E0 0170+00 8/8 0/0 0/0 .text checkOutOfArenaW__15daNpcWrestler_cFv */
-bool daNpcWrestler_c::checkOutOfArenaW() {
- // NONMATCHING
- if (mArenaInfo == 0) {
- return false;
- }
-
- int jointNo = mType == 0 ? 0x1A : 0x18;
- int jointNo2 = mType == 0 ? 0x1E : 0x1B;
- f32 fVar1 = pow(mArenaExtent, 2.0);
-
- field_0x89c = getJointPos(jointNo);
- field_0x8a8 = getJointPos(jointNo2);
+ }
- if (field_0x89c.abs2XZ(mArenaPos) <= fVar1 && field_0x8a8.abs2XZ(mArenaPos) <= fVar1) {
- return false;
+ default: {
+ JUT_PANIC(3579, "0");
+ }
}
return true;
@@ -2333,9 +2570,8 @@ cXyz daNpcWrestler_c::getJointPos(int i_jointNo) {
/* 80B35968-80B3606C 0067C8 0704+00 2/0 0/0 0/0 .text sumouPunchDraw__15daNpcWrestler_cFPv */
bool daNpcWrestler_c::sumouPunchDraw(void* param_1) {
- // NONMATCHING
daPy_py_c* player = daPy_getPlayerActorClass();
- int jointNo = mType != 0 ? 0x12 : 0x11;
+ int jointNo = mType == 0 ? 0x12 : 0x11;
cXyz sp2c;
switch (field_0xe96) {
@@ -2435,9 +2671,9 @@ bool daNpcWrestler_c::sumouPunchDraw(void* param_1) {
/* 80B3606C-80B36908 006ECC 089C+00 5/0 0/0 0/0 .text sumouTackleHit__15daNpcWrestler_cFPv */
bool daNpcWrestler_c::sumouTackleHit(void* param_1) {
- // NONMATCHING
+ // NONMATCHING - regalloc
daPy_py_c* player = daPy_getPlayerActorClass();
- int jointNo = mType != 0 ? 0 : 0;
+ int jointNo = mType == 0 ? 0 : 0;
cXyz sp2c;
switch (field_0xe96) {
@@ -2542,9 +2778,9 @@ bool daNpcWrestler_c::sumouTackleHit(void* param_1) {
}
if (checkOutOfArenaP()) {
- setAction(&daNpcWrestler_c::sumouTacklePush);
- } else if (player->checkSumouPushBack()) {
setAction(&daNpcWrestler_c::demoSumouWin);
+ } else if (player->checkSumouPushBack()) {
+ setAction(&daNpcWrestler_c::sumouTacklePush);
}
break;
@@ -2576,7 +2812,6 @@ bool daNpcWrestler_c::sumouTackleHit(void* param_1) {
/* 80B36908-80B36C8C 007768 0384+00 2/0 0/0 0/0 .text sumouTackleMiss__15daNpcWrestler_cFPv */
bool daNpcWrestler_c::sumouTackleMiss(void* param_1) {
- // NONMATCHING
daPy_py_c* player = daPy_getPlayerActorClass();
switch (field_0xe96) {
@@ -2612,9 +2847,8 @@ bool daNpcWrestler_c::sumouTackleMiss(void* param_1) {
/* 80B36C8C-80B37270 007AEC 05E4+00 2/0 0/0 0/0 .text sumouTackleDraw__15daNpcWrestler_cFPv */
bool daNpcWrestler_c::sumouTackleDraw(void* param_1) {
- // NONMATCHING
daPy_py_c* player = daPy_getPlayerActorClass();
- int jointNo = mType != 0 ? 0 : 0;
+ int jointNo = mType == 0 ? 0 : 0;
cXyz sp2c;
switch (field_0xe96) {
@@ -2696,8 +2930,9 @@ bool daNpcWrestler_c::sumouTackleDraw(void* param_1) {
inline void daNpcWrestler_c::setStepAngle() {
f32 fVar1[2];
+ int var_r25 = 0;
+ (void) var_r25;
daPy_py_c* player = daPy_getPlayerActorClass();
-
mDoMtx_stack_c::transS(*player->getViewerCurrentPosP());
for (int i = 0; i < 2; i++) {
@@ -2707,11 +2942,11 @@ inline void daNpcWrestler_c::setStepAngle() {
mStepAngle = -field_0xbdc->horizontal_movement_speed;
}
-
- s16 sVar1 = cLib_targetAngleY(player->getViewerCurrentPosP(), &current.pos) + mStepAngle * field_0xbdc->lateral_movement_time;
+ s16 tgt_ang = cLib_targetAngleY(player->getViewerCurrentPosP(), &current.pos);
+ tgt_ang += mStepAngle * field_0xbdc->lateral_movement_time;
+ cXyz sp30(0.0f, 0.0f, field_0xbdc->grapple_distance);
mDoMtx_stack_c::push();
- mDoMtx_stack_c::YrotM(sVar1);
- cXyz sp30;
+ mDoMtx_stack_c::YrotM(tgt_ang);
mDoMtx_stack_c::multVec(&sp30, &sp30);
mDoMtx_stack_c::pop();
@@ -2729,13 +2964,8 @@ inline void daNpcWrestler_c::setStepAngle() {
}
/* 80B37270-80B378F4 0080D0 0684+00 4/0 0/0 0/0 .text sumouSideStep__15daNpcWrestler_cFPv */
-bool daNpcWrestler_c::sumouSideStep(void* param_1) {
- // NONMATCHING
- daPy_py_c* player = daPy_getPlayerActorClass();
- int jointNo, jointNo2;
- cXyz sp2c;
- JPABaseEmitter* emitter;
-
+inline bool daNpcWrestler_c::sumouSideStep(void* param_1) {
+ // NONMATCHING - g_dComIfG_gameInfo weirdness
switch (field_0xe96) {
case 0:
field_0xe80 = field_0xbdc->lateral_movement_time;
@@ -2750,12 +2980,13 @@ bool daNpcWrestler_c::sumouSideStep(void* param_1) {
field_0xe96 = 2;
break;
- case 2:
+ case 2: {
correctGraspPosAngle(true);
- jointNo = mType == 0 ? 0x1A : 0x18;
- jointNo2 = mType == 0 ? 0x1E : 0x1B;
-
+ int jointNo = mType == 0 ? 0x1A : 0x18;
+ int jointNo2 = mType == 0 ? 0x1E : 0x1B;
+ JPABaseEmitter* emitter = NULL;
+ cXyz sp2c;
mDoMtx_stack_c::copy(mpMorf->getModel()->getAnmMtx(jointNo));
mDoMtx_stack_c::multVecZero(&sp2c);
sp2c.y = current.pos.y;
@@ -2778,7 +3009,7 @@ bool daNpcWrestler_c::sumouSideStep(void* param_1) {
if (checkOutOfArenaP()) {
setAction(&daNpcWrestler_c::demoSumouWin2);
- } else if (daPy_getPlayerActorClass()->checkSumouTackleMiss()) {
+ } else if (daPy_getPlayerActorClass()->checkSumouPunchSuccess()) {
setAction(&daNpcWrestler_c::sumouPunchChaseShock);
} else if (field_0xe80 < 0) {
field_0xe8c = field_0xbd8->common.morf_frame;
@@ -2790,10 +3021,17 @@ bool daNpcWrestler_c::sumouSideStep(void* param_1) {
}
}
break;
+ }
- case 3:
+ case 3: {
mStepAngle = 0;
break;
+ }
+
+ default: {
+ JUT_PANIC(4008, "0");
+ break;
+ }
}
return true;
@@ -2801,7 +3039,6 @@ bool daNpcWrestler_c::sumouSideStep(void* param_1) {
/* 80B378F4-80B37C30 008754 033C+00 1/0 0/0 0/0 .text sumouLostBalance__15daNpcWrestler_cFPv */
bool daNpcWrestler_c::sumouLostBalance(void* param_1) {
- // NONMATCHING
daPy_py_c* player = daPy_getPlayerActorClass();
switch (field_0xe96) {
@@ -2835,7 +3072,6 @@ bool daNpcWrestler_c::sumouLostBalance(void* param_1) {
/* 80B37C30-80B37FB8 008A90 0388+00 4/0 0/0 0/0 .text sumouPunchShock__15daNpcWrestler_cFPv */
bool daNpcWrestler_c::sumouPunchShock(void* param_1) {
- // NONMATCHING
daPy_py_c* player = daPy_getPlayerActorClass();
switch (field_0xe96) {
@@ -2873,8 +3109,8 @@ bool daNpcWrestler_c::sumouPunchShock(void* param_1) {
}
/* 80B37FB8-80B38518 008E18 0560+00 2/0 0/0 0/0 .text sumouPunchChaseShock__15daNpcWrestler_cFPv */
-bool daNpcWrestler_c::sumouPunchChaseShock(void* param_1) {
- // NONMATCHING
+inline bool daNpcWrestler_c::sumouPunchChaseShock(void* param_1) {
+ // NONMATCHING - regalloc
daPy_py_c* player = daPy_getPlayerActorClass();
switch (field_0xe96) {
@@ -2917,6 +3153,9 @@ bool daNpcWrestler_c::sumouPunchChaseShock(void* param_1) {
case 3:
mStepAngle = 0;
break;
+
+ default:
+ JUT_PANIC(4149, "0");
}
return true;
@@ -2924,7 +3163,6 @@ bool daNpcWrestler_c::sumouPunchChaseShock(void* param_1) {
/* 80B38518-80B389A4 009378 048C+00 2/0 0/0 0/0 .text sumouPunchStagger__15daNpcWrestler_cFPv */
bool daNpcWrestler_c::sumouPunchStagger(void* param_1) {
- // NONMATCHING
daPy_py_c* player = daPy_getPlayerActorClass();
switch (field_0xe96) {
@@ -2964,7 +3202,6 @@ bool daNpcWrestler_c::sumouPunchStagger(void* param_1) {
/* 80B389A4-80B38C90 009804 02EC+00 4/0 0/0 0/0 .text sumouTackleShock__15daNpcWrestler_cFPv */
bool daNpcWrestler_c::sumouTackleShock(void* param_1) {
- // NONMATCHING
daPy_py_c* player = daPy_getPlayerActorClass();
switch (field_0xe96) {
@@ -2997,7 +3234,7 @@ bool daNpcWrestler_c::sumouTackleShock(void* param_1) {
/* 80B38C90-80B39334 009AF0 06A4+00 2/0 0/0 0/0 .text sumouTackleStagger__15daNpcWrestler_cFPv */
bool daNpcWrestler_c::sumouTackleStagger(void* param_1) {
- // NONMATCHING
+ // NONMATCHING - regalloc
daPy_py_c* player = daPy_getPlayerActorClass();
int jointNo = mType == 0 ? 0x1A : 0x18;
int jointNo2 = mType == 0 ? 0x1E : 0x1B;
@@ -3057,7 +3294,6 @@ bool daNpcWrestler_c::sumouTackleStagger(void* param_1) {
/* 80B39334-80B39554 00A194 0220+00 1/0 0/0 0/0 .text sumouTackleStaggerRelease__15daNpcWrestler_cFPv */
bool daNpcWrestler_c::sumouTackleStaggerRelease(void* param_1) {
- // NONMATCHING
daPy_py_c* player = daPy_getPlayerActorClass();
switch (field_0xe96) {
@@ -3087,26 +3323,25 @@ bool daNpcWrestler_c::sumouTackleStaggerRelease(void* param_1) {
}
/* 80B39554-80B39C18 00A3B4 06C4+00 1/0 0/0 0/0 .text sumouTacklePush__15daNpcWrestler_cFPv */
-bool daNpcWrestler_c::sumouTacklePush(void* param_1) {
- // NONMATCHING
+inline bool daNpcWrestler_c::sumouTacklePush(void* param_1) {
daPy_py_c* player = daPy_getPlayerActorClass();
int jointNo, jointNo2;
- cXyz sp60;
f32 fVar1, fVar2;
s16 sVar1;
-
+
switch (field_0xe96) {
case 0:
setExpressionAnm(0x11, true);
- setMotion(0x16, -1.0f, 0);
+ setMotion(0x16, 0.0f, 0);
field_0xe96 = 2;
break;
- case 2:
+ case 2: {
correctGraspPosAngle(true);
jointNo = mType == 0 ? 0x1A : 0x18;
jointNo2 = mType == 0 ? 0x1E : 0x1B;
+ cXyz sp60;
mDoMtx_stack_c::copy(mpMorf->getModel()->getAnmMtx(jointNo));
mDoMtx_stack_c::multVecZero(&sp60);
sp60.y = current.pos.y;
@@ -3129,15 +3364,10 @@ bool daNpcWrestler_c::sumouTacklePush(void* param_1) {
sVar1 = cLib_targetAngleY(mArenaPos, *player->getViewerCurrentPosP()) - mCurAngle.y;
if (abs(sVar1) > field_0xbdc->field_0x28) {
- if (sVar1 <= 0) {
- sVar1 = -field_0xbdc->field_0x28;
- } else {
- sVar1 = field_0xbdc->field_0x28;
- }
+ sVar1 = (sVar1 > 0) ? field_0xbdc->field_0x28 : (s16) -field_0xbdc->field_0x28;
}
player->setSumouPushBackDirection(sVar1);
-
mpMorf->setPlaySpeed(0.0f);
mpMorf->setFrameF(player->getBaseAnimeFrame());
@@ -3147,9 +3377,15 @@ bool daNpcWrestler_c::sumouTacklePush(void* param_1) {
setAction(&daNpcWrestler_c::sumouTackleRelease);
}
break;
+ }
case 3:
break;
+
+ default: {
+ JUT_PANIC(4435, "0");
+ break;
+ }
}
return true;
@@ -3157,7 +3393,6 @@ bool daNpcWrestler_c::sumouTacklePush(void* param_1) {
/* 80B39C18-80B39F88 00AA78 0370+00 1/0 0/0 0/0 .text sumouTackleRelease__15daNpcWrestler_cFPv */
bool daNpcWrestler_c::sumouTackleRelease(void* param_1) {
- // NONMATCHING
switch (field_0xe96) {
case 0:
setExpressionAnm(5, true);
@@ -3180,7 +3415,7 @@ bool daNpcWrestler_c::sumouTackleRelease(void* param_1) {
mDoMtx_stack_c::copy(mpMorf->getModel()->getAnmMtx(jointNo2));
mDoMtx_stack_c::multVecZero(&sp3c);
sp3c.y = current.pos.y;
- fopAcM_effSmokeSet2(&field_0xde8, NULL, &sp3c, &mCurAngle, 0.9f, &tevStr);
+ fopAcM_effSmokeSet2(&field_0xdec, NULL, &sp3c, &mCurAngle, 0.9f, &tevStr);
}
Z2GetAudioMgr()->changeSubBgmStatus(2);
@@ -3233,12 +3468,11 @@ inline void daNpcWrestler_c::initDemoCamera_ReadyWrestler() {
}
/* 80B39F88-80B3AE24 00ADE8 0E9C+00 2/0 0/0 0/0 .text demoSumouReady__15daNpcWrestler_cFPv */
-bool daNpcWrestler_c::demoSumouReady(void* param_1) {
- // NONMATCHING
+inline bool daNpcWrestler_c::demoSumouReady(void* param_1) {
dCamera_c* camBody = dCam_getBody();
- int iVar1;
- f32 fVar1, fVar2, fVar3;
+ bool dbg_0x9 = false;
+ bool dbg_0x8 = false;
switch (field_0xe96) {
case 0:
field_0xe84 = 0;
@@ -3254,7 +3488,7 @@ bool daNpcWrestler_c::demoSumouReady(void* param_1) {
daPy_getPlayerActorClass()->setSumouReady(this);
initDemoCamera_ReadyWrestler();
- setExpression(0x1B, field_0xbd8->common.morf_frame);
+ setMotionAnm(0x1B, field_0xbd8->common.morf_frame);
if (field_0xe9a != 0) {
field_0xe80 = 1.0f / field_0xbd8->fade_speed;
@@ -3313,20 +3547,18 @@ bool daNpcWrestler_c::demoSumouReady(void* param_1) {
mDoMtx_stack_c::multVec(&mDemoCam.mDemoCamCenter, &mDemoCam.mDemoCamCenter);
if (fabsf(field_0xe54) > fabsf(field_0xbd8->field_0xa0) - 40.0f) {
- setMotion(7, 8.0f, 0);
+ setMotion(7, 24.0f, 0);
field_0xe80 = field_0xbd8->field_0xb4;
field_0xe84++;
}
break;
case 3:
- iVar1 = field_0xe80;
- field_0xe80--;
- if (iVar1 <= 0) {
+ if (field_0xe80-- <= 0) {
mDemoCam.field_0x18.set(0.0f, 0.0f, -100.0f);
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::YrotM(mCurAngle.y);
- mDoMtx_stack_c::transM(cXyz(field_0xbd8->field_0xb8, field_0xbd8->field_0xbc, field_0xbd8->field_0xc0));
+ mDoMtx_stack_c::transM(field_0xbd8->field_0xb8);
mDoMtx_stack_c::multVecZero(&mDemoCam.field_0x24);
mDoMtx_stack_c::XrotM(field_0xbd8->field_0xe8);
mDoMtx_stack_c::multVec(&mDemoCam.field_0x18, &mDemoCam.field_0x18);
@@ -3347,20 +3579,23 @@ bool daNpcWrestler_c::demoSumouReady(void* param_1) {
fopAcM_effSmokeSet1(&field_0xde8, &field_0xdec, &sp3c, NULL, 0.8f, &tevStr, 1);
}
+#ifdef DEBUG
mDemoCam.field_0x18.set(0.0f, 0.0f, -100.0f);
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::YrotM(mCurAngle.y);
- mDoMtx_stack_c::transM(cXyz(field_0xbd8->field_0xb8, field_0xbd8->field_0xbc, field_0xbd8->field_0xc0));
+ mDoMtx_stack_c::transM(field_0xbd8->field_0xb8);
mDoMtx_stack_c::multVecZero(&mDemoCam.field_0x24);
mDoMtx_stack_c::XrotM(field_0xbd8->field_0xe8);
mDoMtx_stack_c::multVec(&mDemoCam.field_0x18, &mDemoCam.field_0x18);
+#endif
- if (cLib_addCalcPos(&mDemoCam.mDemoCamEye, mDemoCam.field_0x24, 0.15f, 5.0f, 1.0f) == 0.0f &&
- cLib_addCalcPos(&mDemoCam.mDemoCamCenter, mDemoCam.field_0x18, 0.15f, 5.0f, 1.0f) == 0.0f && mMotionPhase == 1) {
+ dbg_0x8 = cLib_addCalcPos(&mDemoCam.mDemoCamCenter, mDemoCam.field_0x18, 0.15f, 5.0f, 1.0f) == 0.0f;
+ dbg_0x9 = cLib_addCalcPos(&mDemoCam.mDemoCamEye, mDemoCam.field_0x24, 0.15f, 5.0f, 1.0f) == 0.0f;
+ if (dbg_0x9 && dbg_0x8 && mMotionPhase == 1) {
mDemoCam.field_0x18.set(0.0f, 0.0f, -100.0f);
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::YrotM(mCurAngle.y);
- mDoMtx_stack_c::transM(cXyz(field_0xbd8->field_0xc4, field_0xbd8->field_0xc8, field_0xbd8->field_0xcc));
+ mDoMtx_stack_c::transM(field_0xbd8->field_0xc4);
mDoMtx_stack_c::multVecZero(&mDemoCam.field_0x24);
mDoMtx_stack_c::XrotM(field_0xbd8->field_0xea);
mDoMtx_stack_c::multVec(&mDemoCam.field_0x18, &mDemoCam.field_0x18);
@@ -3370,19 +3605,20 @@ bool daNpcWrestler_c::demoSumouReady(void* param_1) {
break;
case 5:
+#ifdef DEBUG
mDemoCam.field_0x18.set(0.0f, 0.0f, -100.0f);
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::YrotM(mCurAngle.y);
- mDoMtx_stack_c::transM(cXyz(field_0xbd8->field_0xc4, field_0xbd8->field_0xc8, field_0xbd8->field_0xcc));
+ mDoMtx_stack_c::transM(field_0xbd8->field_0xc4);
mDoMtx_stack_c::multVecZero(&mDemoCam.field_0x24);
mDoMtx_stack_c::XrotM(field_0xbd8->field_0xea);
mDoMtx_stack_c::multVec(&mDemoCam.field_0x18, &mDemoCam.field_0x18);
+#endif
- if (cLib_addCalcPos(&mDemoCam.mDemoCamEye, mDemoCam.field_0x24, 0.15f, 5.0f, 1.0f) == 0.0f &&
- cLib_addCalcPos(&mDemoCam.mDemoCamCenter, mDemoCam.field_0x24, 0.15f, 5.0f, 1.0f) == 0.0f) {
- iVar1 = field_0xe80;
- field_0xe80--;
- if (iVar1 < 1) {
+ dbg_0x8 = cLib_addCalcPos(&mDemoCam.mDemoCamCenter, mDemoCam.field_0x18, 0.15f, 5.0f, 1.0f) == 0.0f;
+ dbg_0x9 = cLib_addCalcPos(&mDemoCam.mDemoCamEye, mDemoCam.field_0x24, 0.15f, 5.0f, 1.0f) == 0.0f;
+ if (dbg_0x9 && dbg_0x8) {
+ if (field_0xe80-- <= 0) {
daPy_getPlayerActorClass()->offPlayerNoDraw();
onWrestlerNoDraw();
initDemoCamera_ReadyLink();
@@ -3403,20 +3639,19 @@ bool daNpcWrestler_c::demoSumouReady(void* param_1) {
mDoMtx_stack_c::multVec(&mDemoCam.mDemoCamCenter, &mDemoCam.mDemoCamCenter);
if (fabsf(field_0xe54) > (fabsf(field_0xbd8->field_0xa0) - 40.0f)) {
- daPy_getPlayerActorClass()->changeOriginalDemo();
- daPy_getPlayerActorClass()->changeDemoMode(0x33, 0, 0, 0);
+ daPy_py_c* player = daPy_getPlayerActorClass();
+ player->changeOriginalDemo();
+ player->changeDemoMode(0x33, 0, 0, 0);
field_0xe80 = field_0xbd8->field_0xb6;
field_0xe84++;
}
break;
case 7:
- iVar1 = field_0xe80;
- field_0xe80--;
- if (iVar1 < 1) {
+ if (field_0xe80-- <= 0) {
mDoMtx_stack_c::transS(fopAcM_GetPosition(daPy_getPlayerActorClass()));
mDoMtx_stack_c::YrotM(fopAcM_GetShapeAngle_p(daPy_getPlayerActorClass())->y);
- mDoMtx_stack_c::transM(cXyz(field_0xbd8->field_0xd0, field_0xbd8->field_0xd4, field_0xbd8->field_0xd8));
+ mDoMtx_stack_c::transM(field_0xbd8->field_0xd0);
mDoMtx_stack_c::multVecZero(&mDemoCam.field_0x24);
mDoMtx_stack_c::XrotM(field_0xbd8->field_0xec);
mDemoCam.field_0x18.set(0.0f, 0.0f, -100.0f);
@@ -3431,23 +3666,22 @@ bool daNpcWrestler_c::demoSumouReady(void* param_1) {
dComIfGp_getVibration().StartShock(3, 15, cXyz(0.0f, 1.0f, 0.0f));
}
+#ifdef DEBUG
mDoMtx_stack_c::transS(fopAcM_GetPosition(daPy_getPlayerActorClass()));
mDoMtx_stack_c::YrotM(fopAcM_GetShapeAngle_p(daPy_getPlayerActorClass())->y);
- mDoMtx_stack_c::transM(cXyz(field_0xbd8->field_0xd0, field_0xbd8->field_0xd4, field_0xbd8->field_0xd8));
+ mDoMtx_stack_c::transM(field_0xbd8->field_0xd0);
mDoMtx_stack_c::multVecZero(&mDemoCam.field_0x24);
mDoMtx_stack_c::XrotM(field_0xbd8->field_0xec);
mDemoCam.field_0x18.set(0.0f, 0.0f, -100.0f);
mDoMtx_stack_c::multVec(&mDemoCam.field_0x18, &mDemoCam.field_0x18);
+#endif
- fVar2 = cLib_addCalcPos(&mDemoCam.mDemoCamCenter, mDemoCam.field_0x18, 0.15f, 5.0f, 1.0f);
- fVar3 = cLib_addCalcPos(&mDemoCam.mDemoCamEye, mDemoCam.field_0x24, 0.15f, 5.0f, 1.0f);
-
- iVar1 = field_0xe80;
- field_0xe80--;
- if (iVar1 < 1 && fVar3 == 0.0f && fVar1 == 0.0f) {
+ dbg_0x8 = cLib_addCalcPos(&mDemoCam.mDemoCamCenter, mDemoCam.field_0x18, 0.15f, 5.0f, 1.0f) == 0.0f;
+ dbg_0x9 = cLib_addCalcPos(&mDemoCam.mDemoCamEye, mDemoCam.field_0x24, 0.15f, 5.0f, 1.0f) == 0.0f;
+ if (field_0xe80-- <= 0 && dbg_0x9 && dbg_0x8) {
mDoMtx_stack_c::transS(fopAcM_GetPosition(daPy_getPlayerActorClass()));
mDoMtx_stack_c::YrotM(fopAcM_GetShapeAngle_p(daPy_getPlayerActorClass())->y);
- mDoMtx_stack_c::transM(cXyz(field_0xbd8->field_0xdc, field_0xbd8->field_0xc0, field_0xbd8->field_0xc4));
+ mDoMtx_stack_c::transM(field_0xbd8->field_0xdc);
mDoMtx_stack_c::multVecZero(&mDemoCam.field_0x24);
mDoMtx_stack_c::XrotM(field_0xbd8->field_0xee);
mDemoCam.field_0x18.set(0.0f, 0.0f, -100.0f);
@@ -3458,20 +3692,20 @@ bool daNpcWrestler_c::demoSumouReady(void* param_1) {
break;
case 9:
+#ifdef DEBUG
mDoMtx_stack_c::transS(fopAcM_GetPosition(daPy_getPlayerActorClass()));
mDoMtx_stack_c::YrotM(fopAcM_GetShapeAngle_p(daPy_getPlayerActorClass())->y);
- mDoMtx_stack_c::transM(cXyz(field_0xbd8->field_0xdc, field_0xbd8->field_0xc0, field_0xbd8->field_0xc4));
+ mDoMtx_stack_c::transM(field_0xbd8->field_0xdc);
mDoMtx_stack_c::multVecZero(&mDemoCam.field_0x24);
mDoMtx_stack_c::XrotM(field_0xbd8->field_0xee);
mDemoCam.field_0x18.set(0.0f, 0.0f, -100.0f);
mDoMtx_stack_c::multVec(&mDemoCam.field_0x18, &mDemoCam.field_0x18);
+#endif
- fVar2 = cLib_addCalcPos(&mDemoCam.mDemoCamCenter, mDemoCam.field_0x18, 0.15f, 5.0f, 1.0f);
- fVar3 = cLib_addCalcPos(&mDemoCam.mDemoCamEye, mDemoCam.field_0x24, 0.15f, 5.0f, 1.0f);
- if (fVar3 == 0.0f && fVar2 == 0.0f) {
- iVar1 = field_0xe80;
- field_0xe80--;
- if (iVar1 < 1) {
+ dbg_0x8 = cLib_addCalcPos(&mDemoCam.mDemoCamCenter, mDemoCam.field_0x18, 0.15f, 5.0f, 1.0f) == 0.0f;
+ dbg_0x9 = cLib_addCalcPos(&mDemoCam.mDemoCamEye, mDemoCam.field_0x24, 0.15f, 5.0f, 1.0f) == 0.0f;
+ if (dbg_0x9 && dbg_0x8) {
+ if (field_0xe80-- <= 0) {
field_0xe84++;
}
}
@@ -3483,6 +3717,10 @@ bool daNpcWrestler_c::demoSumouReady(void* param_1) {
mItemNo = 3;
setAction(&daNpcWrestler_c::gotoArena);
break;
+
+ default:
+ JUT_PANIC(4821, "0");
+ break;
}
mDemoCamFovy = field_0xbd8->field_0xf0;
@@ -3493,6 +3731,10 @@ bool daNpcWrestler_c::demoSumouReady(void* param_1) {
case 3:
break;
+
+ default:
+ JUT_PANIC(4828, "0");
+ break;
}
return true;
@@ -3500,7 +3742,6 @@ bool daNpcWrestler_c::demoSumouReady(void* param_1) {
/* 80B3AE24-80B3B4B4 00BC84 0690+00 2/0 0/0 0/0 .text demoSumouWin__15daNpcWrestler_cFPv */
bool daNpcWrestler_c::demoSumouWin(void* param_1) {
- // NONMATCHING
daPy_py_c* player = daPy_getPlayerActorClass();
dCamera_c* camBody = dCam_getBody();
f32 fVar1;
@@ -3622,7 +3863,6 @@ bool daNpcWrestler_c::demoSumouWin(void* param_1) {
/* 80B3B4B4-80B3BC84 00C314 07D0+00 3/0 0/0 0/0 .text demoSumouLose__15daNpcWrestler_cFPv */
bool daNpcWrestler_c::demoSumouLose(void* param_1) {
- // NONMATCHING
daPy_py_c* player = daPy_getPlayerActorClass();
dCamera_c* camBody = dCam_getBody();
int iVar1;
@@ -3632,7 +3872,6 @@ bool daNpcWrestler_c::demoSumouLose(void* param_1) {
case 0:
field_0xe84 = 0;
field_0xe80 = 20;
-
if (mType == 0) {
daNpcF_onTmpBit(0x2E);
} else {
@@ -3696,7 +3935,8 @@ bool daNpcWrestler_c::demoSumouLose(void* param_1) {
iVar1 = field_0xe80;
field_0xe80--;
if (iVar1 <= 0) {
- fVar1 = cLib_addCalcPos(&mDemoCam.mDemoCamCenter, getJointPos(2), 0.1f, 50.0f, 1.0f);
+ int joint_no = mType == 0 ? 2 : 2;
+ fVar1 = cLib_addCalcPos(&mDemoCam.mDemoCamCenter, getJointPos(joint_no), 0.1f, 50.0f, 1.0f);
fVar2 = cLib_addCalc(&mDemoCam.mDemoCamEye.y, mDemoCam.field_0x24.y, 0.05f, 50.0f, 1.0f);
fVar3 = cLib_addCalc(&mDemoCamFovy, 30.0f, 0.08f, 10.0f, 0.3f);
if (fVar1 == 0.0f && fVar2 == 0.0f && fVar3 == 0.0f) {
@@ -3716,7 +3956,7 @@ bool daNpcWrestler_c::demoSumouLose(void* param_1) {
mDemoCamFovy = 60.0f;
player->changeOriginalDemo();
- player->changeDemoMode(0x31, 0, 0, 0);
+ player->changeDemoMode(0x31, 1, 0, 0);
field_0xe80 = 20;
field_0xe84++;
// fallthrough
@@ -3732,10 +3972,10 @@ bool daNpcWrestler_c::demoSumouLose(void* param_1) {
dComIfGp_event_reset();
field_0xe8c = field_0xbd8->common.morf_frame;
- if (mType != 0) {
- setAction(&daNpcWrestler_c::demoTalkAfterLose);
- } else {
+ if (mType == 0) {
setAction(&daNpcWrestler_c::wait);
+ } else {
+ setAction(&daNpcWrestler_c::demoTalkAfterLose);
}
}
}
@@ -3757,7 +3997,6 @@ bool daNpcWrestler_c::demoSumouLose(void* param_1) {
/* 80B3BC84-80B3C278 00CAE4 05F4+00 11/0 0/0 0/0 .text demoSumouWin2__15daNpcWrestler_cFPv */
bool daNpcWrestler_c::demoSumouWin2(void* param_1) {
- // NONMATCHING
daPy_py_c* player = daPy_getPlayerActorClass();
dCamera_c* camBody = dCam_getBody();
f32 fVar1;
@@ -3771,7 +4010,7 @@ bool daNpcWrestler_c::demoSumouWin2(void* param_1) {
field_0xe96 = 2;
break;
- case 2:
+ case 2: {
Z2GetAudioMgr()->changeSubBgmStatus(4);
switch (field_0xe84) {
case 0:
@@ -3850,7 +4089,8 @@ bool daNpcWrestler_c::demoSumouWin2(void* param_1) {
camBody->Set(mDemoCam.mDemoCamCenter, mDemoCam.mDemoCamEye, mDemoCamFovy, 0);
}
break;
-
+ }
+
case 3:
field_0xe99 = 1;
break;
@@ -3861,7 +4101,6 @@ bool daNpcWrestler_c::demoSumouWin2(void* param_1) {
/* 80B3C278-80B3CA2C 00D0D8 07B4+00 5/0 0/0 0/0 .text demoSumouLose2__15daNpcWrestler_cFPv */
bool daNpcWrestler_c::demoSumouLose2(void* param_1) {
- // NONMATCHING
daPy_py_c* player = daPy_getPlayerActorClass();
dCamera_c* camBody = dCam_getBody();
int iVar1;
@@ -3897,7 +4136,6 @@ bool daNpcWrestler_c::demoSumouLose2(void* param_1) {
mDemoCam.mDemoCamEye = camBody->Eye();
mDemoCamFovy = camBody->Fovy();
mDemoCam.field_0x24.set(camBody->Eye().x, camBody->Eye().y + 180.0f, camBody->Eye().z);
-
player->setSumouPunchWinEnd();
setExpressionAnm(4, true);
setMotion(0x1B, -1.0f, 0);
@@ -3906,7 +4144,7 @@ bool daNpcWrestler_c::demoSumouLose2(void* param_1) {
field_0xe84++;
break;
- case 1:
+ case 1: {
if (mMotionPhase == 0 && mpMorf->getFrame() == 20.0f) {
dComIfGp_getVibration().StartShock(8, 15, cXyz(0.0f, 1.0f, 0.0f));
@@ -3931,14 +4169,17 @@ bool daNpcWrestler_c::demoSumouLose2(void* param_1) {
}
}
- fVar1 = cLib_addCalcPos(&mDemoCam.mDemoCamCenter, getJointPos(2), 0.1f, 50.0f, 1.0f);
+ int joint_no = mType == 0 ? 2 : 2;
+ fVar1 = cLib_addCalcPos(&mDemoCam.mDemoCamCenter, getJointPos(joint_no), 0.1f, 50.0f, 1.0f);
fVar2 = cLib_addCalc(&mDemoCam.mDemoCamEye.y, mDemoCam.field_0x24.y, 0.05f, 50.0f, 1.0f);
fVar3 = cLib_addCalc(&mDemoCamFovy, 30.0f, 0.08f, 10.0f, 0.3f);
if (fVar1 == 0.0f && fVar2 == 0.0f && fVar3 == 0.0f) {
field_0xe84++;
}
+
break;
+ }
case 2:
mDemoCam.mDemoCamEye.set(0.0f, 70.0f, 200.0f);
@@ -3951,15 +4192,14 @@ bool daNpcWrestler_c::demoSumouLose2(void* param_1) {
mDemoCamFovy = 60.0f;
player->changeOriginalDemo();
- player->changeDemoMode(0x31, 0, 0, 0);
+ player->changeDemoMode(0x31, 1, 0, 0);
field_0xe80 = 20;
field_0xe84++;
// fallthrough
- case 3:
- if (cLib_addCalc(&mDemoCam.mDemoCamCenter.y, mDemoCam.field_0x18.y, 0.04f, 10.0f, 0.2f) == 0.0f) {
- iVar1 = field_0xe80;
- field_0xe80--;
- if (iVar1 <= 0) {
+ case 3: {
+ f32 calc_ret = cLib_addCalc(&mDemoCam.mDemoCamCenter.y, mDemoCam.field_0x18.y, 0.04f, 10.0f, 0.2f);
+ if (calc_ret == 0.0f) {
+ if (field_0xe80-- <= 0) {
player->changeDemoMode(1, 0, 0, 0);
camBody->Reset(mDemoCam.mDemoCamCenter, mDemoCam.mDemoCamEye);
camBody->Start();
@@ -3967,15 +4207,19 @@ bool daNpcWrestler_c::demoSumouLose2(void* param_1) {
dComIfGp_event_reset();
field_0xe8c = field_0xbd8->common.morf_frame;
- if (mType != 0) {
- setAction(&daNpcWrestler_c::demoTalkAfterLose);
- } else {
+ if (mType == 0) {
setAction(&daNpcWrestler_c::wait);
+ } else {
+ setAction(&daNpcWrestler_c::demoTalkAfterLose);
}
-
-
}
}
+
+ break;
+ }
+
+ default:
+ JUT_PANIC(5347, "0");
break;
}
@@ -3987,18 +4231,19 @@ bool daNpcWrestler_c::demoSumouLose2(void* param_1) {
case 3:
field_0xe99 = 1;
break;
+
+ default:
+ JUT_PANIC(5355, "0");
}
return true;
}
/* 80B3CA2C-80B3D0C0 00D88C 0694+00 4/0 0/0 0/0 .text demoSumouUnilateralWin__15daNpcWrestler_cFPv */
-bool daNpcWrestler_c::demoSumouUnilateralWin(void* param_1) {
- // NONMATCHING
+inline bool daNpcWrestler_c::demoSumouUnilateralWin(void* param_1) {
daPy_py_c* player = daPy_getPlayerActorClass();
dCamera_c* camBody = dCam_getBody();
f32 fVar1;
- int iVar1;
switch (field_0xe96) {
case 0:
@@ -4079,11 +4324,10 @@ bool daNpcWrestler_c::demoSumouUnilateralWin(void* param_1) {
}
break;
- case 2:
- if (cLib_addCalc(&mDemoCam.mDemoCamCenter.y, mDemoCam.field_0x18.y, 0.04f, 10.0f, 0.9f) == 0.0f) {
- iVar1 = field_0xe80;
- field_0xe80--;
- if (iVar1 <= 0) {
+ case 2: {
+ f32 add_calc = cLib_addCalc(&mDemoCam.mDemoCamCenter.y, mDemoCam.field_0x18.y, 0.04f, 10.0f, 0.9f);
+ if (add_calc == 0.0f) {
+ if (field_0xe80-- <= 0) {
camBody->Reset(mDemoCam.mDemoCamCenter, mDemoCam.mDemoCamEye);
camBody->Start();
camBody->SetTrimSize(0);
@@ -4093,8 +4337,10 @@ bool daNpcWrestler_c::demoSumouUnilateralWin(void* param_1) {
}
}
break;
+ }
- case 3:
+ default:
+ JUT_PANIC(5478, "0");
break;
}
@@ -4106,18 +4352,18 @@ bool daNpcWrestler_c::demoSumouUnilateralWin(void* param_1) {
case 3:
field_0xe99 = 1;
break;
+
+ default:
+ JUT_PANIC(5486, "0");
+ break;
}
return true;
}
/* 80B3D0C0-80B3D584 00DF20 04C4+00 2/0 0/0 0/0 .text demoTalkAfterLose__15daNpcWrestler_cFPv */
-bool daNpcWrestler_c::demoTalkAfterLose(void* param_1) {
- // NONMATCHING
- daPy_py_c* player = daPy_getPlayerActorClass();
- dCamera_c* camBody = dCam_getBody();
- int iVar1, i_expression, i_motion, i_expression2, i_motion2;
-
+inline bool daNpcWrestler_c::demoTalkAfterLose(void* param_1) {
+ bool retval = false;
switch (field_0xe96) {
case 0:
initTalk(mMsgNo, NULL);
@@ -4137,26 +4383,18 @@ bool daNpcWrestler_c::demoTalkAfterLose(void* param_1) {
break;
}
- iVar1 = mMsgTimer;
+ int iVar1 = mMsgTimer;
+ int i_expression, i_motion;
if (ctrlMsgAnm(i_expression, i_motion, this, FALSE)) {
setExpression(i_expression, -1.0f);
- break;
- }
-
- if (iVar1 == 0) {
- break;
- }
-
- if (mMsgTimer != 0) {
- break;
+ } else if (iVar1 != 0 && mMsgTimer == 0) {
+ setExpressionTalkAfter();
}
-
- setExpressionTalkAfter();
- break;
+ } else {
+ eventInfo.onCondition(dEvtCnd_CANTALK_e);
+ fopAcM_orderSpeakEvent(this, 0, 0);
}
- eventInfo.onCondition(dEvtCnd_CANTALK_e);
- fopAcM_orderSpeakEvent(this, 0, 0);
break;
case 1:
@@ -4173,32 +4411,26 @@ bool daNpcWrestler_c::demoTalkAfterLose(void* param_1) {
mOrderEvtNo = 6;
changeEvent(l_resName[mType], l_evtNames[mOrderEvtNo], 1, 0xFFFF);
setAction(&daNpcWrestler_c::demo);
- return true;
- }
-
- iVar1 = mMsgTimer;
- if (ctrlMsgAnm(i_expression2, i_motion2, this, 0)) {
- setExpression(i_expression2, -1.0f);
- break;
- }
-
- if (iVar1 == 0) {
+ retval = true;
break;
}
- if (mMsgTimer != 0) {
- break;
+ int iVar1 = mMsgTimer;
+ int i_expression, i_motion;
+ if (ctrlMsgAnm(i_expression, i_motion, this, FALSE)) {
+ setExpression(i_expression, -1.0f);
+ } else if (iVar1 != 0 && mMsgTimer == 0) {
+ setExpressionTalkAfter();
}
-
- setExpressionTalkAfter();
- break;
+ } else {
+ eventInfo.onCondition(dEvtCnd_CANTALK_e);
+ fopAcM_orderSpeakEvent(this, 0, 0);
}
- eventInfo.onCondition(dEvtCnd_CANTALK_e);
- fopAcM_orderSpeakEvent(this, 0, 0);
break;
- case 3:
+ default:
+ JUT_PANIC(5571, "0");
break;
}
break;
@@ -4207,37 +4439,29 @@ bool daNpcWrestler_c::demoTalkAfterLose(void* param_1) {
setExpression(5, -1.0f);
dComIfGp_event_reset();
break;
+
+ default:
+ JUT_PANIC(5579, "0");
+ break;
}
- return false;
+ return retval;
}
/* 80B3D584-80B3DB50 00E3E4 05CC+00 3/0 0/0 0/0 .text EvCut_grDSEntry__15daNpcWrestler_cFi */
-BOOL daNpcWrestler_c::EvCut_grDSEntry(int i_cutIndex) {
- // NONMATCHING
- dEvent_manager_c* eventManager = dComIfGp_getPEvtManager();
- int* cutName = (int*)eventManager->getMyNowCutName(i_cutIndex);
+inline BOOL daNpcWrestler_c::EvCut_grDSEntry(int i_cutIndex) {
+ dEvent_manager_c& eventManager = dComIfGp_getEventManager();
+ int* cutName = (int*)eventManager.getMyNowCutName(i_cutIndex);
- if (eventManager->getIsAddvance(i_cutIndex) != 0) {
+ if (eventManager.getIsAddvance(i_cutIndex) != 0) {
switch (*cutName) {
case '0001':
- if (mLookMode != 3) {
- mLookMode = 3;
- }
-
+ setLookMode(3);
mActorMngr[0].entry(daPy_getPlayerActorClass());
break;
- case '0003':
- setExpressionAnm(0x3E, false);
- // fallthrough
- case '0004':
- initTalk(mMsgNo, NULL);
- mMsgTimer = 0;
- break;
-
case '0007':
- setMotionAnm(2, -1.0f);
+ setExpression(2, -1.0f);
break;
case '0002':
@@ -4249,6 +4473,18 @@ BOOL daNpcWrestler_c::EvCut_grDSEntry(int i_cutIndex) {
mMsgTimer = 0;
initTalkAngle();
break;
+
+ case '0003':
+ setMotionAnm(62, 0.0f);
+ // fallthrough
+ case '0004':
+ initTalk(mMsgNo, NULL);
+ mMsgTimer = 0;
+ break;
+
+ default:
+ JUT_PANIC(5622, "0");
+ break;
}
}
@@ -4261,7 +4497,6 @@ BOOL daNpcWrestler_c::EvCut_grDSEntry(int i_cutIndex) {
setExpressionTalkAfter();
}
- cXyz* pcVar1;
int* piVar1;
switch (*cutName) {
case '0001':
@@ -4274,17 +4509,12 @@ BOOL daNpcWrestler_c::EvCut_grDSEntry(int i_cutIndex) {
case '0008':
case '0009':
if (setTalkAngle() && talkProc(NULL, TRUE, NULL)) {
- #ifdef DEBUG
- char* choice;
- if (mFlow.getChoiceNo() == 0) {
- choice = "はい";
- } else {
- choice = "いいえ";
- }
- OS_REPORT("二択分岐 %s\n", choice);
- #endif
-
- if (mFlow.getChoiceNo() == 0) {
+ int choice_no = mFlow.getChoiceNo();
+#ifdef DEBUG
+ // "Two-way split %s\n", (mFlow.getChoiceNo() == 0) ? "Yes" : "No"
+ OS_REPORT("二択分岐 %s\n", (choice_no == 0) ? "はい" : "いいえ");
+#endif
+ if (choice_no == 0) {
mOrderEvtNo = 2;
changeEvent(l_resName[mType], l_evtNames[mOrderEvtNo], 1, 0xFFFF);
}
@@ -4292,48 +4522,67 @@ BOOL daNpcWrestler_c::EvCut_grDSEntry(int i_cutIndex) {
}
break;
- case '0003':
- pcVar1 = dComIfGp_evmng_getMyXyzP(i_cutIndex, "pos");
- if (pcVar1 != NULL && cLib_chasePosXZ(&current.pos, *pcVar1, 3.5f) != 0) {
+ case '0003': {
+ cXyz* xyz_p = dComIfGp_evmng_getMyXyzP(i_cutIndex, "pos");
+ if (xyz_p != NULL && cLib_chasePosXZ(&current.pos, *xyz_p, 3.5f) != 0) {
return TRUE;
}
+
break;
+ }
- case '0004':
+ case '0004': {
+ bool is_talk = false;
bool bVar1 = false;
- iVar1 = talkProc(NULL, TRUE, NULL);
- pcVar1 = dComIfGp_evmng_getMyXyzP(i_cutIndex, "pos");
+ if (talkProc(NULL, TRUE, NULL)) {
+ is_talk = true;
+ }
+
+ cXyz* pcVar1 = dComIfGp_evmng_getMyXyzP(i_cutIndex, "pos");
if (pcVar1 != NULL && cLib_chasePosXZ(&current.pos, *pcVar1, 3.5f) != 0) {
piVar1 = dComIfGp_evmng_getMyIntegerP(i_cutIndex, "angle");
- if (piVar1 != NULL && cLib_chaseAngleS(&shape_angle.y, *piVar1, 0x100) != 0) {
- setMotion(0, -1.0f, 0);
+ if (piVar1 != NULL) {
+ if (cLib_chaseAngleS(&shape_angle.y, *piVar1, 0x100)) {
+ setMotion(0, -1.0f, 0);
+ bVar1 = true;
+ }
+
setAngle(shape_angle.y);
- return TRUE;
}
}
+
+ return (is_talk && bVar1) ? TRUE : FALSE;
+ }
+
+ default: {
+ JUT_PANIC(5688, "0");
break;
+ }
}
return FALSE;
}
/* 80B3DB50-80B3DCE8 00E9B0 0198+00 1/0 0/0 0/0 .text EvCut_grDSEntry2__15daNpcWrestler_cFi */
-BOOL daNpcWrestler_c::EvCut_grDSEntry2(int i_cutIndex) {
- // NONMATCHING
- dEvent_manager_c* eventManager = dComIfGp_getPEvtManager();
- int* cutName = (int*)eventManager->getMyNowCutName(i_cutIndex);
+inline BOOL daNpcWrestler_c::EvCut_grDSEntry2(int i_cutIndex) {
+ dEvent_manager_c& eventManager = dComIfGp_getEventManager();
+ int* cutName = (int*)eventManager.getMyNowCutName(i_cutIndex);
- if (eventManager->getIsAddvance(i_cutIndex)) {
+ if (eventManager.getIsAddvance(i_cutIndex)) {
switch (*cutName) {
case '0001':
case '0002':
setLookMode(3);
mActorMngr[0].entry(daPy_getPlayerActorClass());
break;
+
+ default:
+ JUT_PANIC(5715, "0");
+ break;
}
}
- switch (i_cutIndex) {
+ switch (*cutName) {
case '0001':
return TRUE;
@@ -4344,6 +4593,10 @@ BOOL daNpcWrestler_c::EvCut_grDSEntry2(int i_cutIndex) {
mOrderEvtNo = 0;
mEventIdx = -1;
return TRUE;
+
+ default:
+ JUT_PANIC(5735, "0");
+ break;
}
return FALSE;
@@ -4351,55 +4604,56 @@ BOOL daNpcWrestler_c::EvCut_grDSEntry2(int i_cutIndex) {
/* 80B3DCE8-80B3E0FC 00EB48 0414+00 2/0 0/0 0/0 .text EvCut_grDSEntry3_4__15daNpcWrestler_cFi */
BOOL daNpcWrestler_c::EvCut_grDSEntry3_4(int i_cutIndex) {
- // NONMATCHING
dEvent_manager_c* eventManager = dComIfGp_getPEvtManager();
int* cutName = (int*)eventManager->getMyNowCutName(i_cutIndex);
- if (cutName != NULL) {
- if (eventManager->getIsAddvance(i_cutIndex)){
- switch (*cutName) {
- case '0001':
- setLookMode(3);
- mActorMngr[0].entry(daPy_getPlayerActorClass());
- initTalk(mMsgNo, NULL);
- initTalkAngle();
- mMsgTimer = 0;
- break;
- }
+ if (cutName == NULL) {
+ return FALSE;
+ }
+
+ if (eventManager->getIsAddvance(i_cutIndex)){
+ switch (*cutName) {
+ case '0001':
+ setLookMode(3);
+ mActorMngr[0].entry(daPy_getPlayerActorClass());
+ initTalk(mMsgNo, NULL);
+ initTalkAngle();
+ mMsgTimer = 0;
+ break;
}
+ }
- int iVar1 = mMsgTimer;
- int i_expression, i_motion;
- if (ctrlMsgAnm(i_expression, i_motion, this, FALSE) != 0) {
- setExpression(i_expression, -1.0f);
- setMotion(i_motion, -1.0f, 0);
- } else {
- if (iVar1 != 0 && mMsgTimer == 0) {
- setExpressionTalkAfter();
- }
+ int iVar1 = mMsgTimer;
+ int i_expression, i_motion;
+ if (ctrlMsgAnm(i_expression, i_motion, this, FALSE) != 0) {
+ setExpression(i_expression, -1.0f);
+ setMotion(i_motion, -1.0f, 0);
+ } else {
+ if (iVar1 != 0 && mMsgTimer == 0) {
+ setExpressionTalkAfter();
}
+ }
- switch (*cutName) {
- case '0001':
- if (setTalkAngle() && talkProc(NULL, TRUE, NULL)) {
- #ifdef DEBUG
- char* choice;
- if (mFlow.getChoiceNo() == 0) {
- choice = "はい";
- } else {
- choice = "いいえ";
- }
- OS_REPORT("二択分岐 %s\n", choice);
- #endif
+ switch (*cutName) {
+ case '0001':
+ if (setTalkAngle() && talkProc(NULL, TRUE, NULL)) {
+ #ifdef DEBUG
+ char* choice;
+ if (mFlow.getChoiceNo() == 0) {
+ choice = "はい";
+ } else {
+ choice = "いいえ";
+ }
+ OS_REPORT("二択分岐 %s\n", choice);
+ #endif
- if (mFlow.getChoiceNo() == 0) {
- mOrderEvtNo = 5;
- changeEvent(l_resName[mType], l_evtNames[mOrderEvtNo], 1, 0xFFFF);
- }
- return TRUE;
+ if (mFlow.getChoiceNo() == 0) {
+ mOrderEvtNo = 5;
+ changeEvent(l_resName[mType], l_evtNames[mOrderEvtNo], 1, 0xFFFF);
}
- break;
- }
+ return TRUE;
+ }
+ break;
}
return FALSE;
@@ -4407,7 +4661,6 @@ BOOL daNpcWrestler_c::EvCut_grDSEntry3_4(int i_cutIndex) {
/* 80B3E0FC-80B3E584 00EF5C 0488+00 1/0 0/0 0/0 .text EvCut_grDSEntry5__15daNpcWrestler_cFi */
BOOL daNpcWrestler_c::EvCut_grDSEntry5(int i_cutIndex) {
- // NONMATCHING
dEvent_manager_c* eventManager = dComIfGp_getPEvtManager();
int* cutName = (int*)eventManager->getMyNowCutName(i_cutIndex);
@@ -4429,7 +4682,7 @@ BOOL daNpcWrestler_c::EvCut_grDSEntry5(int i_cutIndex) {
if (ctrlMsgAnm(i_expression, i_motion, this, FALSE) != 0) {
setExpression(i_expression, -1.0f);
setMotion(i_motion, -1.0f, 0);
- } else if (iVar1 == 0 && mMsgTimer == 0) {
+ } else if (iVar1 && mMsgTimer == 0) {
setExpressionTalkAfter();
}
@@ -4453,7 +4706,6 @@ BOOL daNpcWrestler_c::EvCut_grDSEntry5(int i_cutIndex) {
/* 80B3E584-80B3EA2C 00F3E4 04A8+00 1/0 0/0 0/0 .text EvCut_grDSLose__15daNpcWrestler_cFi */
BOOL daNpcWrestler_c::EvCut_grDSLose(int i_cutIndex) {
- // NONMATCHING
dEvent_manager_c* eventManager = dComIfGp_getPEvtManager();
int* cutName = (int*)eventManager->getMyNowCutName(i_cutIndex);
int* piVar1;
@@ -4467,7 +4719,6 @@ BOOL daNpcWrestler_c::EvCut_grDSLose(int i_cutIndex) {
case '0002':
piVar1 = dComIfGp_evmng_getMyIntegerP(i_cutIndex, "angle");
pcVar1 = dComIfGp_evmng_getMyXyzP(i_cutIndex, "pos");
-
if (pcVar1 != NULL) {
current.pos.set(*pcVar1);
old.pos = current.pos;
@@ -4548,7 +4799,7 @@ static int daNpcWrestler_IsDelete(void* a_this) {
}
/* 80B3EAE4-80B3EB94 00F944 00B0+00 1/0 0/0 0/0 .text setParam__15daNpcWrestler_cFv */
-void daNpcWrestler_c::setParam() {
+inline void daNpcWrestler_c::setParam() {
attention_info.distances[fopAc_attn_LOCK_e] = getDistTableIdx(5, 6);
attention_info.distances[fopAc_attn_TALK_e] = attention_info.distances[fopAc_attn_LOCK_e];
attention_info.distances[fopAc_attn_SPEAK_e] = getDistTableIdx(3, 6);
@@ -4564,67 +4815,17 @@ void daNpcWrestler_c::setParam() {
}
inline bool daNpcWrestler_c::selectAction() {
- field_0xdcc = NULL;
- if (!chkAction(field_0xdcc)) {
- setAction(field_0xdcc);
+ actionFunc null_action = NULL;
+ if (null_action != NULL && chkAction(null_action) == FALSE) {
+ setAction(null_action);
return true;
}
return false;
}
-inline void daNpcWrestler_c::playExpression() {
- daNpcF_anmPlayData playData0 = {0x13, field_0xbd8->common.morf_frame, 0};
- daNpcF_anmPlayData* pDat0[1] = {&playData0};
- daNpcF_anmPlayData playData1 = {0x17, field_0xbd8->common.morf_frame, 1};
- daNpcF_anmPlayData* pDat1[1] = {&playData1};
- daNpcF_anmPlayData playData2 = {0x19, field_0xbd8->common.morf_frame, 1};
- daNpcF_anmPlayData* pDat2[1] = {&playData2};
- daNpcF_anmPlayData playData3 = {0x1A, field_0xbd8->common.morf_frame, 1};
- daNpcF_anmPlayData* pDat3[1] = {&playData3};
- daNpcF_anmPlayData playData4 = {0x18, field_0xbd8->common.morf_frame, 0};
- daNpcF_anmPlayData* pDat4[1] = {&playData4};
- daNpcF_anmPlayData playData5 = {0x1A, field_0xbd8->common.morf_frame, 0};
- daNpcF_anmPlayData* pDat5[1] = {&playData5};
- daNpcF_anmPlayData playData6 = {0, field_0xbd8->common.morf_frame, 0};
- daNpcF_anmPlayData* pDat6[1] = {&playData6};
-
- daNpcF_anmPlayData** expressionAnm[7] = {
- pDat0,
- pDat1,
- pDat2,
- pDat3,
- pDat4,
- pDat5,
- pDat6,
- };
-
- if (mExpression >= 0 && mExpression < 6) {
- playExpressionAnm(expressionAnm);
- }
-}
-
-/* 80B3EB94-80B3EF10 00F9F4 037C+00 1/0 0/0 0/0 .text main__15daNpcWrestler_cFv */
-BOOL daNpcWrestler_c::main() {
- // NONMATCHING
- if (!selectAction() && field_0xdcc != NULL) {
- (this->*field_0xdcc)(NULL);
- }
-
- if (dComIfGp_event_runCheck() && !eventInfo.checkCommandTalk() && field_0xe78 != -1) {
- dComIfGp_event_setItemPartnerId(field_0xe78);
- field_0xe78 = -1;
- }
-
- playExpression();
- playMotion();
- setWrestlerVoice();
- return TRUE;
-}
-
/* 80B3EF10-80B3FCE8 00FD70 0DD8+00 1/1 0/0 0/0 .text setWrestlerVoice__15daNpcWrestler_cFv */
-void daNpcWrestler_c::setWrestlerVoice() {
- // NONMATCHING
+inline void daNpcWrestler_c::setWrestlerVoice() {
J3DAnmTransform* anmTransform = mpMorf->getAnm();
if (mType == 0) {
@@ -4766,140 +4967,29 @@ void daNpcWrestler_c::setWrestlerVoice() {
}
}
-/* 80B3FCE8-80B404FC 010B48 0814+00 1/2 0/0 0/0 .text playMotion__15daNpcWrestler_cFv */
-void daNpcWrestler_c::playMotion() {
- // NONMATCHING
- daNpcF_anmPlayData playData0 = {0x39, field_0xbd8->common.morf_frame, 0};
- daNpcF_anmPlayData* pDat0[1] = {&playData0};
- daNpcF_anmPlayData playData1 = {0x39, 0.0f, 0};
- daNpcF_anmPlayData* pDat1[1] = {&playData1};
- daNpcF_anmPlayData playData2 = {0x3A, field_0xbd8->common.morf_frame, 1};
- daNpcF_anmPlayData* pDat2[1] = {&playData2};
- daNpcF_anmPlayData playData3 = {0x3B, field_0xbd8->common.morf_frame, 0};
- daNpcF_anmPlayData* pDat3[1] = {&playData3};
- daNpcF_anmPlayData playData4 = {0x3B, field_0xbd8->common.morf_frame, 0};
- daNpcF_anmPlayData* pDat4[1] = {&playData4};
- daNpcF_anmPlayData playData5 = {0x3C, field_0xbd8->common.morf_frame, 1};
- daNpcF_anmPlayData* pDat5[1] = {&playData5};
- daNpcF_anmPlayData playData6 = {0x3B, field_0xbd8->common.morf_frame, 0};
- daNpcF_anmPlayData* pDat6[1] = {&playData6};
- daNpcF_anmPlayData playData7 = {0x3D, field_0xbd8->common.morf_frame, 1};
- daNpcF_anmPlayData* pDat7[1] = {&playData7};
- daNpcF_anmPlayData playData8 = {0x3B, field_0xbd8->common.morf_frame, 0};
- daNpcF_anmPlayData* pDat8[1] = {&playData8};
- daNpcF_anmPlayData playData9 = {0x1D, 4.0f, 0};
- daNpcF_anmPlayData* pDat9[1] = {&playData9};
- daNpcF_anmPlayData playData10 = {0x20, field_0xbd8->common.morf_frame, 1};
- daNpcF_anmPlayData* pDat10[1] = {&playData10};
- daNpcF_anmPlayData playData11 = {0x1E, 24.0f, 0};
- daNpcF_anmPlayData* pDat11[1] = {&playData11};
- daNpcF_anmPlayData playData12 = {0x21, 0.0f, 0};
- daNpcF_anmPlayData* pDat12[1] = {&playData12};
- daNpcF_anmPlayData playData13 = {0x22, 6.0f, 1};
- daNpcF_anmPlayData* pDat13[1] = {&playData13};
- daNpcF_anmPlayData playData14 = {0x23, 6.0f, 0};
- daNpcF_anmPlayData* pDat14[1] = {&playData14};
- daNpcF_anmPlayData playData15 = {0x24, 6.0f, 0};
- daNpcF_anmPlayData* pDat15[1] = {&playData15};
- daNpcF_anmPlayData playData16 = {0x25, 6.0f, 1};
- daNpcF_anmPlayData* pDat16[1] = {&playData16};
- daNpcF_anmPlayData playData17 = {0x29, 6.0f, 1};
- daNpcF_anmPlayData* pDat17[1] = {&playData17};
- daNpcF_anmPlayData playData18 = {0x30, 0.0f, 0};
- daNpcF_anmPlayData* pDat18[1] = {&playData18};
- daNpcF_anmPlayData playData19 = {0x26, 6.0f, 1};
- daNpcF_anmPlayData* pDat19[1] = {&playData19};
- daNpcF_anmPlayData playData20 = {0x27, 6.0f, 1};
- daNpcF_anmPlayData* pDat20[1] = {&playData20};
- daNpcF_anmPlayData playData21 = {0x28, 6.0f, 1};
- daNpcF_anmPlayData* pDat21[1] = {&playData21};
- daNpcF_anmPlayData playData22 = {0x2B, 6.0f, 1};
- daNpcF_anmPlayData* pDat22[1] = {&playData22};
- daNpcF_anmPlayData playData23 = {0x2E, 0.0f, 1};
- daNpcF_anmPlayData* pDat23[1] = {&playData23};
- daNpcF_anmPlayData playData24 = {0x2F, 6.0f, 1};
- daNpcF_anmPlayData* pDat24[1] = {&playData24};
- daNpcF_anmPlayData playData25 = {0x2C, 0.0f, 1};
- daNpcF_anmPlayData* pDat25[1] = {&playData25};
- daNpcF_anmPlayData playData26 = {0x2D, 6.0f, 0};
- daNpcF_anmPlayData* pDat26[1] = {&playData26};
- daNpcF_anmPlayData playData27 = {0x31, 6.0f, 0};
- daNpcF_anmPlayData* pDat27[1] = {&playData27};
- daNpcF_anmPlayData playData28 = {0x32, 6.0f, 0};
- daNpcF_anmPlayData* pDat28[1] = {&playData28};
- daNpcF_anmPlayData playData29 = {0x38, 0.0f, 1};
- daNpcF_anmPlayData* pDat29[1] = {&playData29};
- daNpcF_anmPlayData playData30 = {0x39, 0.0f, 0};
- daNpcF_anmPlayData* pDat30[1] = {&playData30};
- daNpcF_anmPlayData playData31 = {0x34, field_0xbd8->common.morf_frame, 1};
- daNpcF_anmPlayData* pDat31[1] = {&playData31};
- daNpcF_anmPlayData playData32 = {0x36, 0.0f, 0};
- daNpcF_anmPlayData* pDat32[1] = {&playData32};
- daNpcF_anmPlayData playData33 = {0x35, field_0xbd8->common.morf_frame, 1};
- daNpcF_anmPlayData* pDat33[1] = {&playData33};
- daNpcF_anmPlayData playData34 = {0x36, 0.0f, 0};
- daNpcF_anmPlayData* pDat34[1] = {&playData34};
- daNpcF_anmPlayData playData35 = {0x2A, 6.0f, 1};
- daNpcF_anmPlayData* pDat35[1] = {&playData35};
- daNpcF_anmPlayData playData36 = {0x37, field_0xbd8->common.morf_frame, 1};
- daNpcF_anmPlayData* pDat36[1] = {&playData36};
- daNpcF_anmPlayData playData37 = {0x1B, 6.0f, 0};
- daNpcF_anmPlayData* pDat37[1] = {&playData37};
-
- daNpcF_anmPlayData** motionAnm[38] = {
- pDat0,
- pDat1,
- pDat2,
- pDat3,
- pDat4,
- pDat5,
- pDat6,
- pDat7,
- pDat8,
- pDat9,
- pDat10,
- pDat11,
- pDat12,
- pDat13,
- pDat14,
- pDat15,
- pDat16,
- pDat17,
- pDat18,
- pDat19,
- pDat20,
- pDat21,
- pDat22,
- pDat23,
- pDat24,
- pDat25,
- pDat26,
- pDat27,
- pDat28,
- pDat29,
- pDat30,
- pDat31,
- pDat32,
- pDat33,
- pDat34,
- pDat35,
- pDat36,
- pDat37
- };
+/* 80B3EB94-80B3EF10 00F9F4 037C+00 1/0 0/0 0/0 .text main__15daNpcWrestler_cFv */
+inline BOOL daNpcWrestler_c::main() {
+ if (!selectAction() && field_0xdcc != NULL) {
+ (this->*field_0xdcc)(NULL);
+ }
- if (mMotion >= 0 && mMotion < 30) {
- field_0xe92 = mMotionPhase;
- playMotionAnm(motionAnm);
+ if (dComIfGp_event_runCheck() != 0 && !eventInfo.checkCommandTalk() && field_0xe78 != -1) {
+ dComIfGp_event_setItemPartnerId(field_0xe78);
+ field_0xe78 = -1;
}
+
+ playExpression();
+ playMotion();
+ setWrestlerVoice();
+ return TRUE;
}
/* 80B404FC-80B405E8 01135C 00EC+00 1/0 0/0 0/0 .text ctrlBtk__15daNpcWrestler_cFv */
-// NONMATCHING somehow this needs to not inline TSinCosTable<13,f32>::sinShort
-BOOL daNpcWrestler_c::ctrlBtk() {
+inline BOOL daNpcWrestler_c::ctrlBtk() {
J3DAnmTextureSRTKey* btkAnm;
if (mpMatAnm != NULL) {
- if (field_0xe04[3] >= 0) {
- btkAnm = (J3DAnmTextureSRTKey*)getTexSRTKeyAnmP(l_resName[mType], field_0xe04[3]);
+ if (field_0xe04->btk_list->fileIdx >= 0) {
+ btkAnm = (J3DAnmTextureSRTKey*)getTexSRTKeyAnmP(l_resName[mType], field_0xe04->btk_list->fileIdx);
} else {
btkAnm = NULL;
}
@@ -4917,144 +5007,13 @@ BOOL daNpcWrestler_c::ctrlBtk() {
return FALSE;
}
-/* 80B42E24-80B42E28 000014 0004+00 1/1 0/0 0/0 .bss l_HIO */
-static daNpcWrestler_Param_c l_HIO;
-
-/* 80B405E8-80B40B3C 011448 0554+00 1/1 0/0 0/0 .text setAttnPos__15daNpcWrestler_cFv */
-void daNpcWrestler_c::setAttnPos() {
- // NONMATCHING
- static cXyz eyeOffset(-10.0f, 10.0f, 0.0f);
- static cXyz setAttnPos;
- cXyz sp44, sp50, sp5c;
-
- mDoMtx_stack_c::YrotS(field_0x990);
- cLib_addCalc2(&field_0x984[0], 0.0f, 0.1f, 125.0f);
- cLib_addCalc2(&field_0x984[2], 0.0f, 0.1f, 125.0f);
-
- for (int i = 0; i < 3; i++) {
- sp50.set(0.0f, 0.0f, field_0x984[i] * cM_ssin(field_0x992));
- mDoMtx_stack_c::multVec(&sp50, &sp5c);
- field_0x908[i].x = -sp5c.z;
- field_0x908[i].z = -sp5c.x;
- }
-
- cLib_chaseS(&field_0x992, 0, 0x555);
- if (mLookMode == 1) {
- for (int i = 0; i < 3; i++) {
- mLookatAngle[i].setall(0);
- }
- }
-
- setParam();
- lookat();
-
- mDoMtx_stack_c::copy(mpMorf->getModel()->getAnmMtx(4));
- mDoMtx_stack_c::multVecZero(&mHeadPos);
- mDoMtx_stack_c::multVec(&eyeOffset, &eyePos);
- setAttnPos.y = 0.0f;
- mDoMtx_stack_c::multVec(&eyeOffset, &sp50);
- mHeadAngle.x = cLib_targetAngleX(&mHeadPos, &sp50);
- mHeadAngle.y = cLib_targetAngleY(&mHeadPos, &sp50);
-
- cXyz* attnPos = mLookAt.getAttnPos();
- if (attnPos != NULL) {
- sp44 = *attnPos - eyePos;
- mEyeAngle.y = -mCurAngle.y - mLookatAngle[2].y;
- mEyeAngle.y = cM_atan2s(sp44.x, sp44.z);
- mEyeAngle.x = -cM_atan2s(sp44.y, sp44.absXZ());
- } else {
- mEyeAngle.y = 0;
- mEyeAngle.x = 0;
- }
-
- cXyz sp68;
- f32 fVar1 = field_0xbd8->common.attention_offset;
- sp44.set(0.0f, 0.0f, field_0xbdc->field_0x10);
- mDoMtx_stack_c::transS(current.pos);
- mDoMtx_stack_c::ZXYrotM(mCurAngle.x, mCurAngle.y, mCurAngle.z);
- mDoMtx_stack_c::multVec(&sp44, &sp68);
-
- if (chkAction(&daNpcWrestler_c::wait)) {
- if (!chkAction(&daNpcWrestler_c::talk)) {
- attention_info.position.set(sp68.x, 200.0f, sp68.z);
- }
- } else {
- attention_info.position.set(sp68.x, sp68.y + fVar1, sp68.z);
- }
-
- if (chkAction(&daNpcWrestler_c::wait)) {
- if (chkAction(&daNpcWrestler_c::talk)) {
- field_0xc90.SetC(sp68);
- dComIfG_Ccsp()->Set(&field_0xc90);
- }
- }
-}
-
-/* 80B40B3C-80B40D1C 01199C 01E0+00 1/1 0/0 0/0 .text lookat__15daNpcWrestler_cFv */
-void daNpcWrestler_c::lookat() {
- // NONMATCHING
- daPy_py_c* player = NULL;
- J3DModel* model = mpMorf->getModel();
- BOOL snap = FALSE;
- f32 fVar1 = field_0xbd8->common.body_angleX_min;
- f32 fVar2 = field_0xbd8->common.body_angleX_max;
- f32 fVar3 = field_0xbd8->common.body_angleY_min;
- f32 fVar4 = field_0xbd8->common.body_angleY_max;
- f32 fVar5 = field_0xbd8->common.head_angleX_min;
- f32 fVar6 = field_0xbd8->common.head_angleX_max;
- f32 fVar7 = field_0xbd8->common.head_angleY_min;
- f32 fVar8 = field_0xbd8->common.head_angleY_max;
- s16 angle_delta = mCurAngle.y - mOldAngle.y;
- cXyz lookat_pos[3] = {mLookatPos[0], mLookatPos[1], mLookatPos[2]};
- csXyz* lookat_angle[3] = {&mLookatAngle[0], &mLookatAngle[1], &mLookatAngle[2]};
- cXyz spe8;
-
- switch (mLookMode) {
- case LOOK_NONE:
- break;
-
- case LOOK_RESET:
- snap = TRUE;
- break;
-
- case LOOK_PLAYER:
- case LOOK_PLAYER_TALK:
- player = daPy_getPlayerActorClass();
-
- if (mLookMode == LOOK_PLAYER_TALK) {
- fVar7 = -80.0f;
- fVar8 = 80.0f;
- }
- }
-
- if (player != NULL) {
- mLookPos = player->attention_info.position;
-
- if (mLookMode != 2 && mLookMode != 3) {
- mLookPos.y -= 40.0f;
- }
-
- mLookAt.setAttnPos(&mLookPos);
- } else {
- mLookAt.setAttnPos(NULL);
- }
-
- mLookAt.setParam(fVar1, fVar2, fVar3, fVar4, 0.0f, 0.0f, 0.0f, 0.0f, fVar5, fVar6, fVar7, fVar8, mCurAngle.y, lookat_pos);
- mLookAt.calc(this, model->getBaseTRMtx(), lookat_angle, snap, angle_delta, FALSE);
-}
-
/* 80B40D1C-80B40D24 011B7C 0008+00 1/0 0/0 0/0 .text drawDbgInfo__15daNpcWrestler_cFv */
-BOOL daNpcWrestler_c::drawDbgInfo() {
+inline BOOL daNpcWrestler_c::drawDbgInfo() {
return FALSE;
}
/* 80B40D24-80B40D28 011B84 0004+00 1/0 0/0 0/0 .text drawOtherMdls__15daNpcWrestler_cFv */
-void daNpcWrestler_c::drawOtherMdls() {
- /* empty function */
-}
-
-/* 80B4166C-80B41670 0124CC 0004+00 1/0 0/0 0/0 .text adjustShapeAngle__15daNpcWrestler_cFv */
-void daNpcWrestler_c::adjustShapeAngle() {
+inline void daNpcWrestler_c::drawOtherMdls() {
/* empty function */
}