npc_wrestler dbg work (#2795)

This commit is contained in:
YunataSavior 2025-11-10 19:52:59 -08:00 committed by GitHub
parent 23a1c94063
commit 70272b88f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 590 additions and 337 deletions

View File

@ -131,8 +131,7 @@ public:
}
void setHome() {
current.pos = home.pos;
old.pos = current.pos;
old.pos = current.pos = home.pos;
shape_angle.y = home.angle.y;
}
void offDispFlag() { mDispFlag = 0; }

View File

@ -16,16 +16,16 @@ struct daNpcWrestler_HIOParamSub {
/* 0x00 */ f32 field_0x0;
/* 0x04 */ f32 mWallH;
/* 0x08 */ f32 mWallR;
/* 0x0C */ f32 field_0xc; // リアル影サイズ (Real Shadow Size)
/* 0x0C */ f32 real_shadow_size; // リアル影サイズ (Real Shadow Size)
/* 0x10 */ f32 field_0x10;
/* 0x14 */ f32 field_0x14; // 見合う距離 (Right Distance)
/* 0x14 */ f32 reasonable_distance; // 見合う距離 (Right Distance)
/* 0x18 */ f32 grapple_distance; // 組み合い距離 (Grapple Distance)
/* 0x1C */ f32 field_0x1c; // 再配置距離 (Reconfiguration Distance)
/* 0x1C */ f32 reconfig_distance; // 再配置距離 (Reconfiguration Distance)
/* 0x20 */ s16 lateral_movement_time; // 横移動時間 (Lateral Movement Time)
/* 0x22 */ s16 horizontal_movement_speed; // 横移動速度 (Horizontal Movement Speed)
/* 0x24 */ s16 stagger_time; // ふらふら時間 (Stagger Time)
/* 0x26 */ s16 wait_time; // 待ち時間 (Wait Time)
/* 0x28 */ s16 field_0x28; // 曲がり限界 (Bending Limit)
/* 0x28 */ s16 bending_limit; // 曲がり限界 (Bending Limit)
/* 0x2C */ struct {
f32 lateral_movement_chance; // 横移動 の確率 (Lateral Movement Chance)
f32 hit_chance; // 張り手 の確率 (Hit Chance)
@ -39,16 +39,13 @@ struct daNpcWrestler_HIOParamSub {
/* 0x6C */ s16 ai_action; // AI行動 (AI Action)
/* 0x6E */ s16 ready_appearance_time; // Ready? 出現時間 (Ready? Appearance Time)
/* 0x70 */ s16 fight_appearance_time; // Fight! 出現時間 (Fight! Appearance Time)
/* 0x72 */ s16 field_0x72;
/* 0x74 */ s32 slap_hit_impact; // 張り手Hit衝撃 (Slap Hit Impact)
/* 0x78 */ s16 rotation; // 回転割り (Rotating)
/* 0x7A */ s16 field_0x7a;
/* 0x7C */ f32 camera_rotation_angle; // カメラ回転角 (Camera Rotation Angle)
/* 0x80 */ f32 field_0x80; // 音 土俵際距離 (Sound, Distance From Edge Of Ring)
/* 0x84 */ f32 field_0x84; // 動 土俵際距離 (Movement, Distance From Edge Of Ring)
/* 0x80 */ f32 ring_edge_sound; // 音 土俵際距離 (Sound, Distance From Edge Of Ring)
/* 0x84 */ f32 ring_edge_movement; // 動 土俵際距離 (Movement, Distance From Edge Of Ring)
/* 0x88 */ f32 fade_speed;
/* 0x8C */ s16 field_0x8c;
/* 0x8E */ s16 field_0x8e;
/* 0x90 */ f32 field_0x90;
/* 0x94 */ f32 field_0x94;
/* 0x98 */ f32 field_0x98;
@ -58,7 +55,6 @@ struct daNpcWrestler_HIOParamSub {
/* 0xA8 */ s16 field_0xa8;
/* 0xAA */ s16 field_0xaa;
/* 0xAC */ s16 field_0xac;
/* 0xAE */ s16 field_0xae;
/* 0xB0 */ f32 field_0xb0;
/* 0xB4 */ s16 field_0xb4;
/* 0xB6 */ s16 field_0xb6;
@ -94,27 +90,24 @@ public:
/* 0x04 */ daNpcWrestler_HIOParamSub* field_0x4;
};
class daNpcWrestler_HIO_c
#ifdef DEBUG
: public mDoHIO_entry_c
#endif
{
class daNpcWrestler_HIO_c : public mDoHIO_entry_c {
public:
daNpcWrestler_HIO_c() {
for (int i = 0; i < 2; i++) {
field_0x19c[i].setParam(&field_0x8.mTypeParams[i]);
}
}
daNpcWrestler_HIO_c();
virtual ~daNpcWrestler_HIO_c() {}
void listenPropertyEvent(const JORPropertyEvent*);
void genMessage(JORMContext*);
void listenPropertyEvent(JORPropertyEvent*);
/* 0x004 */ u8 field_0x4[0x8 - 0x4];
/* 0x008 */ daNpcWrestler_HIOParam field_0x8;
/* 0x008 */ daNpcWrestler_HIOParam m;
/* 0x19C */ daNpcWrestler_HIO_Node_c field_0x19c[2];
};
#if DEBUG
#define NPC_WRESTLER_HIO_CLASS daNpcWrestler_HIO_c
#else
#define NPC_WRESTLER_HIO_CLASS daNpcWrestler_Param_c
#endif
struct WrestlerParamList {
daNpc_GetParam1* bck_list;
daNpc_GetParam2* face_list;
@ -147,95 +140,94 @@ public:
/* 80B30170 */ static int ctrlJointCallBack(J3DJoint*, int);
/* 80B301BC */ bool checkStartUp();
/* 80B308B0 */ void reset();
/* 80B30AD8 */ int setAction(actionFunc);
/* 80B30AD8 */ inline int setAction(actionFunc);
/* 80B30BEC */ void checkArenaInfo();
/* 80B30CA4 */ bool checkArenaSub(fopAc_ac_c*);
/* 80B30D48 */ void setOnToArena(f32);
/* 80B30F00 */ bool wait(void*);
/* 80B316F4 */ bool talk(void*);
/* 80B31EB0 */ bool demo(void*);
/* 80B32058 */ bool gotoArena(void*);
/* 80B32444 */ bool gotoLiving(void*);
/* 80B32850 */ bool sumouReady(void*);
/* 80B331CC */ bool sumouWait(void*);
/* 80B339EC */ bool checkOutOfArenaP();
/* 80B33B3C */ bool setNextAction();
/* 80B34654 */ bool sumouPunchHit(void*);
/* 80B34CD0 */ bool sumouPunchChaseHit(void*);
/* 80B35364 */ bool sumouPunchMiss(void*);
/* 80B35780 */ bool checkOutOfArenaW();
/* 80B30F00 */ inline bool wait(void*);
/* 80B316F4 */ inline bool talk(void*);
/* 80B31EB0 */ inline bool demo(void*);
/* 80B32058 */ inline bool gotoArena(void*);
/* 80B32444 */ inline bool gotoLiving(void*);
/* 80B32850 */ inline bool sumouReady(void*);
/* 80B331CC */ inline bool sumouWait(void*);
/* 80B339EC */ inline bool checkOutOfArenaP();
/* 80B33B3C */ inline bool setNextAction();
/* 80B34654 */ inline bool sumouPunchHit(void*);
/* 80B34CD0 */ inline bool sumouPunchChaseHit(void*);
/* 80B35364 */ inline bool sumouPunchMiss(void*);
/* 80B35780 */ inline bool checkOutOfArenaW();
/* 80B358F0 */ cXyz getJointPos(int);
/* 80B35968 */ bool sumouPunchDraw(void*);
/* 80B3606C */ bool sumouTackleHit(void*);
/* 80B36908 */ bool sumouTackleMiss(void*);
/* 80B36C8C */ bool sumouTackleDraw(void*);
/* 80B37270 */ bool sumouSideStep(void*);
/* 80B378F4 */ bool sumouLostBalance(void*);
/* 80B37C30 */ bool sumouPunchShock(void*);
/* 80B37FB8 */ bool sumouPunchChaseShock(void*);
/* 80B38518 */ bool sumouPunchStagger(void*);
/* 80B389A4 */ bool sumouTackleShock(void*);
/* 80B38C90 */ bool sumouTackleStagger(void*);
/* 80B39334 */ bool sumouTackleStaggerRelease(void*);
/* 80B39554 */ bool sumouTacklePush(void*);
/* 80B39C18 */ bool sumouTackleRelease(void*);
/* 80B39F88 */ bool demoSumouReady(void*);
/* 80B3AE24 */ bool demoSumouWin(void*);
/* 80B3B4B4 */ bool demoSumouLose(void*);
/* 80B3BC84 */ bool demoSumouWin2(void*);
/* 80B3C278 */ bool demoSumouLose2(void*);
/* 80B3CA2C */ bool demoSumouUnilateralWin(void*);
/* 80B3D0C0 */ bool demoTalkAfterLose(void*);
/* 80B3D584 */ BOOL EvCut_grDSEntry(int);
/* 80B3DB50 */ BOOL EvCut_grDSEntry2(int);
/* 80B3DCE8 */ BOOL EvCut_grDSEntry3_4(int);
/* 80B3E0FC */ BOOL EvCut_grDSEntry5(int);
/* 80B3E584 */ BOOL EvCut_grDSLose(int);
/* 80B3EF10 */ void setWrestlerVoice();
/* 80B3FCE8 */ void playMotion();
/* 80B40B3C */ void lookat();
/* 80B35968 */ inline bool sumouPunchDraw(void*);
/* 80B3606C */ inline bool sumouTackleHit(void*);
/* 80B36908 */ inline bool sumouTackleMiss(void*);
/* 80B36C8C */ inline bool sumouTackleDraw(void*);
/* 80B37270 */ inline bool sumouSideStep(void*);
/* 80B378F4 */ inline bool sumouLostBalance(void*);
/* 80B37C30 */ inline bool sumouPunchShock(void*);
/* 80B37FB8 */ inline bool sumouPunchChaseShock(void*);
/* 80B38518 */ inline bool sumouPunchStagger(void*);
/* 80B389A4 */ inline bool sumouTackleShock(void*);
/* 80B38C90 */ inline bool sumouTackleStagger(void*);
/* 80B39334 */ inline bool sumouTackleStaggerRelease(void*);
/* 80B39554 */ inline bool sumouTacklePush(void*);
/* 80B39C18 */ inline bool sumouTackleRelease(void*);
/* 80B39F88 */ inline bool demoSumouReady(void*);
/* 80B3AE24 */ inline bool demoSumouWin(void*);
/* 80B3B4B4 */ inline bool demoSumouLose(void*);
/* 80B3BC84 */ inline bool demoSumouWin2(void*);
/* 80B3C278 */ inline bool demoSumouLose2(void*);
/* 80B3CA2C */ inline bool demoSumouUnilateralWin(void*);
/* 80B3D0C0 */ inline bool demoTalkAfterLose(void*);
/* 80B3D584 */ inline BOOL EvCut_grDSEntry(int);
/* 80B3DB50 */ inline BOOL EvCut_grDSEntry2(int);
/* 80B3DCE8 */ inline BOOL EvCut_grDSEntry3_4(int);
/* 80B3E0FC */ inline BOOL EvCut_grDSEntry5(int);
/* 80B3E584 */ inline BOOL EvCut_grDSLose(int);
/* 80B3EF10 */ inline void setWrestlerVoice();
/* 80B3FCE8 */ inline void playMotion();
/* 80B40B3C */ inline void lookat();
/* 80B2F4A0 */ virtual ~daNpcWrestler_c();
/* 80B3EAE4 */ void setParam();
/* 80B3EB94 */ BOOL main();
/* 80B404FC */ BOOL ctrlBtk();
/* 80B3EAE4 */ inline void setParam();
/* 80B3EB94 */ inline BOOL main();
/* 80B404FC */ inline BOOL ctrlBtk();
/* 80B4166C */ void adjustShapeAngle() {}
/* 80B405E8 */ void setAttnPos();
/* 80B3023C */ bool setExpressionAnm(int, bool);
/* 80B30654 */ bool setExpressionBtp(int);
/* 80B316C8 */ void setExpression(int, f32);
/* 80B3074C */ void setMotionAnm(int, f32);
/* 80B405E8 */ inline void setAttnPos();
/* 80B3023C */ inline bool setExpressionAnm(int, bool);
/* 80B30654 */ inline bool setExpressionBtp(int);
/* 80B316C8 */ inline void setExpression(int, f32);
/* 80B3074C */ inline void setMotionAnm(int, f32);
/* 80B31680 */ void setMotion(int, f32, int);
/* 80B40D1C */ BOOL drawDbgInfo();
/* 80B40D24 */ void drawOtherMdls();
/* 80B40D1C */ inline BOOL drawDbgInfo();
/* 80B40D24 */ inline void drawOtherMdls();
s16 getMessageNo() { return (fopAcM_GetParam(this) >> 8) & 0xFFFF; }
int getWrestlerAction() { return mWrestlerAction; }
u8 getType() { return argument & 0x7F; }
u8 getWrestlerType() { return getType(); }
bool chkAction(actionFunc i_action) { return i_action == field_0xdcc; }
bool selectAction();
inline bool selectAction();
s8 getArenaNo() { return (u8)fopAcM_GetParam(this); }
u32 getStatusNo() { return fopAcM_GetParam(this) >> 24; }
void setLookMode(int);
BOOL chkFindPlayer();
BOOL step(s16, int);
bool setTalkAngle();
void setStepAngle();
void setExpressionTalkAfter();
inline void setLookMode(int);
inline BOOL chkFindPlayer();
inline BOOL step(s16, int);
inline bool setTalkAngle();
inline void setStepAngle();
inline void setExpressionTalkAfter();
void initTalkAngle() { mTurnMode = 0; }
void setNextSumouEvent(int);
csXyz* fopAcM_GetHomeAngle_p(fopAc_ac_c* i_actor) { return &i_actor->home.angle; }
void setBackToLiving();
inline void setNextSumouEvent(int);
inline void setBackToLiving();
void offWrestlerNoDraw() { mWrestlerNoDraw = 0; }
void onWrestlerNoDraw() { mWrestlerNoDraw = 1; }
void initDemoCamera_ArenaSide();
void sumouAI();
s16 oppositeToPlayer();
void correctGraspPosAngle(bool);
void initDemoCamera_ReadyLink();
void initDemoCamera_ReadyWrestler();
void playExpression();
inline void initDemoCamera_ArenaSide();
inline void sumouAI();
inline s16 oppositeToPlayer();
inline void correctGraspPosAngle(bool);
inline void initDemoCamera_ReadyLink();
inline void initDemoCamera_ReadyWrestler();
inline void playExpression();
static EventFn mEvtSeqList[7];

View File

@ -13,7 +13,7 @@ public:
cXyz getArenaPos() { return home.pos; }
f32 getArenaExtent() { return scale.x * 100.0f; }
s16 getArenaAngle() { return home.angle.y; }
u16 getArenaNo() { return fopAcM_GetParam(this) & 0xFF; }
s16 getArenaNo() { return fopAcM_GetParam(this) & 0xFF; }
};
#endif /* D_A_TAG_ARENA_H */

View File

@ -425,6 +425,10 @@ inline void fopAcM_SetOldPosition(fopAc_ac_c* i_actor, f32 x, f32 y, f32 z) {
i_actor->old.pos.set(x, y, z);
}
inline csXyz* fopAcM_GetHomeAngle_p(fopAc_ac_c* i_actor) {
return &i_actor->home.angle;
}
inline void fopAcM_SetHomePosition(fopAc_ac_c* i_actor, f32 x, f32 y, f32 z) {
i_actor->home.pos.set(x, y, z);
}

View File

@ -42,6 +42,11 @@ inline float tan(float num) {
inline float pow(float x, float y) {
return ::pow(x, y);
}
inline float pow(float x, int y) {
// FIXME: Needs to use powf
return ::pow(x, y);
}
} // namespace std
#endif

View File

@ -63,6 +63,7 @@ double frexp(double, int*);
double ldexp(double, int);
double modf(double, double*);
double pow(double, double);
float powf(float, float);
double sin(double);
float sinf(float);
double sqrt(double);

View File

@ -3,4 +3,9 @@
/* 8036C780-8036C7A0 3670C0 0020+00 0/0 3/3 24/24 .text pow */
double pow(double x, double y) {
return __ieee754_pow(x, y);
}
}
float powf(float x, float y) {
// FIXME: Is this correct?
return __ieee754_pow(x, y);
}

View File

@ -3950,7 +3950,7 @@ bool daNpcChat_c::wait(void* param_1) {
if (
dKy_darkworld_check() == 0 && daPy_py_c::checkNowWolf() &&
fopAcM_searchPlayerDistanceXZ2(this) < std::pow(500.0, 2.0) || mFear
fopAcM_searchPlayerDistanceXZ2(this) < std::pow(500.0f, 2.0f) || mFear
) {
setAction(&daNpcChat_c::fear);
if (!mFear) {
@ -3988,8 +3988,7 @@ bool daNpcChat_c::wait(void* param_1) {
setMotion(i_motion, -1.0f, 1);
}
if (mTalkFlag) {
if (dComIfGp_event_getTalkPartner() != this) {
if (mTalkFlag && dComIfGp_event_getTalkPartner() != this) {
if (field_0xe51 == 1) {
setMotion(MOT_SITWAIT_A, -1.0f, 0);
} else if (field_0xe51 == 2) {
@ -3997,7 +3996,6 @@ bool daNpcChat_c::wait(void* param_1) {
} else {
setMotion(MOT_WAIT_A, -1.0f, 0);
}
}
}
} else if (mTalkFlag) {
mMode = 0;

File diff suppressed because it is too large Load Diff