Skip to content

Commit 9c48ec0

Browse files
authored
Major npc wrestler cleanup (#2531)
1 parent d4768a8 commit 9c48ec0

File tree

6 files changed

+1207
-1244
lines changed

6 files changed

+1207
-1244
lines changed

include/JSystem/JMath/JMATrigonometric.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ struct TAngleConstant_<f32> {
1919
static f32 RADIAN_TO_DEGREE_FACTOR() { return 180.0f / RADIAN_DEG180(); }
2020
};
2121

22+
namespace JMath {
2223
/**
2324
* @ingroup jsystem-jmath
2425
*
@@ -93,7 +94,6 @@ struct TAsinAcosTable {
9394
}
9495
};
9596

96-
namespace JMath {
9797
extern TSinCosTable<13, f32> sincosTable_;
9898
extern TAtanTable atanTable_;
9999
extern TAsinAcosTable asinAcosTable_;

include/d/actor/d_a_npc_wrestler.h

Lines changed: 38 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#define D_A_NPC_WRESTLER_H
33

44
#include "d/actor/d_a_npc.h"
5-
#include "d/actor/d_a_npc_bouS.h"
6-
#include "d/d_meter2_info.h"
75

86
/**
97
* @ingroup actors-npcs
@@ -28,14 +26,12 @@ struct daNpcWrestler_HIOParamSub {
2826
/* 0x24 */ s16 stagger_time; // ふらふら時間 (Stagger Time)
2927
/* 0x26 */ s16 wait_time; // 待ち時間 (Wait Time)
3028
/* 0x28 */ s16 field_0x28; // 曲がり限界 (Bending Limit)
31-
/* 0x2C */ f32 lateral_movement_chance; // 横移動 の確率 (Lateral Movement Chance)
32-
/* 0x30 */ f32 hit_chance; // 張り手 の確率 (Hit Chance)
33-
/* 0x34 */ f32 tackle_chance; // タックルの確率 (Tackle Chance)
34-
/* 0x38 */ f32 wait_chance; // 待 機 の確率 (Wait Chance)
35-
/* 0x3C */ f32 lateral_movement_chance_2; // 横移動 の確率 (Lateral Movement Chance)
36-
/* 0x40 */ f32 hit_chance_2; // 張り手 の確率 (Hit Chance)
37-
/* 0x44 */ f32 tackle_chance_2; // タックルの確率 (Tackle Chance)
38-
/* 0x48 */ f32 wait_chance_2; // 待 機 の確率 (Wait Chance)
29+
/* 0x2C */ struct {
30+
f32 lateral_movement_chance; // 横移動 の確率 (Lateral Movement Chance)
31+
f32 hit_chance; // 張り手 の確率 (Hit Chance)
32+
f32 tackle_chance; // タックルの確率 (Tackle Chance)
33+
f32 wait_chance; // 待 機 の確率 (Wait Chance)
34+
} chances[2];
3935
};
4036

4137
struct daNpcWrestler_HIOParam {
@@ -66,18 +62,10 @@ struct daNpcWrestler_HIOParamSub {
6662
/* 0xB0 */ f32 field_0xb0;
6763
/* 0xB4 */ s16 field_0xb4;
6864
/* 0xB6 */ s16 field_0xb6;
69-
/* 0xB8 */ f32 field_0xb8;
70-
/* 0xBC */ f32 field_0xbc;
71-
/* 0xC0 */ f32 field_0xc0;
72-
/* 0xC4 */ f32 field_0xc4;
73-
/* 0xC8 */ f32 field_0xc8;
74-
/* 0xCC */ f32 field_0xcc;
75-
/* 0xD0 */ f32 field_0xd0;
76-
/* 0xD4 */ f32 field_0xd4;
77-
/* 0xD8 */ f32 field_0xd8;
78-
/* 0xDC */ f32 field_0xdc;
79-
/* 0xE0 */ f32 field_0xe0;
80-
/* 0xE4 */ f32 field_0xe4;
65+
/* 0xB8 */ Vec field_0xb8;
66+
/* 0xC4 */ Vec field_0xc4;
67+
/* 0xD0 */ Vec field_0xd0;
68+
/* 0xDC */ Vec field_0xdc;
8169
/* 0xE8 */ s16 field_0xe8;
8270
/* 0xEA */ s16 field_0xea;
8371
/* 0xEC */ s16 field_0xec;
@@ -127,12 +115,28 @@ class daNpcWrestler_HIO_c
127115
/* 0x19C */ daNpcWrestler_HIO_Node_c field_0x19c[2];
128116
};
129117

118+
struct WrestlerParamList {
119+
daNpc_GetParam1* bck_list;
120+
daNpc_GetParam2* face_list;
121+
daNpc_GetParam1* btp_list;
122+
daNpc_GetParam1* btk_list;
123+
};
124+
125+
struct DemoCamera_c {
126+
cXyz mDemoCamCenter;
127+
cXyz mDemoCamEye;
128+
cXyz field_0x18;
129+
cXyz field_0x24;
130+
cXyz field_0x30;
131+
cXyz field_0x3c;
132+
};
133+
130134
class daNpcWrestler_c : public daNpcF_c {
131135
public:
132136
typedef bool (daNpcWrestler_c::*actionFunc)(void*);
133137
typedef BOOL (daNpcWrestler_c::*EventFn)(int);
134138

135-
/* 80B2F28C */ daNpcWrestler_c() {};
139+
/* 80B2F28C */ daNpcWrestler_c();
136140
/* 80B2F688 */ cPhs__Step Create();
137141
/* 80B2F974 */ int CreateHeap();
138142
/* 80B2FDB0 */ int Delete();
@@ -141,7 +145,7 @@ class daNpcWrestler_c : public daNpcF_c {
141145
/* 80B2FE84 */ int ctrlJoint(J3DJoint*, J3DModel*);
142146
/* 80B30150 */ static int createHeapCallBack(fopAc_ac_c*);
143147
/* 80B30170 */ static int ctrlJointCallBack(J3DJoint*, int);
144-
/* 80B301BC */ BOOL checkStartUp();
148+
/* 80B301BC */ bool checkStartUp();
145149
/* 80B308B0 */ void reset();
146150
/* 80B30AD8 */ int setAction(actionFunc);
147151
/* 80B30BEC */ void checkArenaInfo();
@@ -191,11 +195,11 @@ class daNpcWrestler_c : public daNpcF_c {
191195
/* 80B3FCE8 */ void playMotion();
192196
/* 80B40B3C */ void lookat();
193197

194-
/* 80B2F4A0 */ virtual ~daNpcWrestler_c() {}
198+
/* 80B2F4A0 */ virtual ~daNpcWrestler_c();
195199
/* 80B3EAE4 */ void setParam();
196200
/* 80B3EB94 */ BOOL main();
197201
/* 80B404FC */ BOOL ctrlBtk();
198-
/* 80B4166C */ void adjustShapeAngle();
202+
/* 80B4166C */ void adjustShapeAngle() {}
199203
/* 80B405E8 */ void setAttnPos();
200204
/* 80B3023C */ bool setExpressionAnm(int, bool);
201205
/* 80B30654 */ bool setExpressionBtp(int);
@@ -205,11 +209,11 @@ class daNpcWrestler_c : public daNpcF_c {
205209
/* 80B40D1C */ BOOL drawDbgInfo();
206210
/* 80B40D24 */ void drawOtherMdls();
207211

208-
int getMessageNo() { return fopAcM_GetParam(this) >> 8; }
212+
s16 getMessageNo() { return (fopAcM_GetParam(this) >> 8) & 0xFFFF; }
209213
int getWrestlerAction() { return mWrestlerAction; }
210214
u8 getType() { return subtype & 0x7F; }
211215
u8 getWrestlerType() { return getType(); }
212-
BOOL chkAction(actionFunc i_action) { return i_action == field_0xdcc; }
216+
bool chkAction(actionFunc i_action) { return i_action == field_0xdcc; }
213217
bool selectAction();
214218
s8 getArenaNo() { return (u8)fopAcM_GetParam(this); }
215219
u32 getStatusNo() { return fopAcM_GetParam(this) >> 24; }
@@ -222,12 +226,10 @@ class daNpcWrestler_c : public daNpcF_c {
222226
void initTalkAngle() { mTurnMode = 0; }
223227
void setNextSumouEvent(int);
224228
csXyz* fopAcM_GetHomeAngle_p(fopAc_ac_c* i_actor) { return &i_actor->home.angle; }
225-
csXyz* fopAcM_GetShapeAngle_p(fopAc_ac_c* i_actor) { return &i_actor->shape_angle; }
226229
void setBackToLiving();
227230
void offWrestlerNoDraw() { mWrestlerNoDraw = 0; }
228231
void onWrestlerNoDraw() { mWrestlerNoDraw = 1; }
229232
void initDemoCamera_ArenaSide();
230-
void dMeter2Info_setMeterString(s32);
231233
void sumouAI();
232234
s16 oppositeToPlayer();
233235
void correctGraspPosAngle(bool);
@@ -237,15 +239,6 @@ class daNpcWrestler_c : public daNpcF_c {
237239

238240
static EventFn mEvtSeqList[7];
239241

240-
struct DemoCamera_c {
241-
cXyz mDemoCamCenter;
242-
cXyz mDemoCamEye;
243-
cXyz field_0x18;
244-
cXyz field_0x24;
245-
cXyz field_0x30;
246-
cXyz field_0x3c;
247-
};
248-
249242
private:
250243
/* 0xB48 */ Z2Creature mSound;
251244
/* 0xBD8 */ const daNpcWrestler_HIOParam* field_0xbd8;
@@ -261,16 +254,19 @@ class daNpcWrestler_c : public daNpcF_c {
261254
/* 0xDE4 */ JPABaseEmitter* field_0xde4;
262255
/* 0xDE8 */ u32 field_0xde8;
263256
/* 0xDEC */ u32 field_0xdec;
264-
/* 0xDF0 */ cXyz mArenaPos;
257+
/* 0xDF0 */ Vec mArenaPos;
265258
/* 0xDFC */ f32 mArenaExtent;
266259
/* 0xE00 */ s16 mArenaAngle;
267-
/* 0xE02 */ u8 mArenaInfo;
260+
/* 0xE02 */ struct {
261+
u8 chkFlag;
262+
} mArenaInfo;
268263
/* 0xE03 */ u8 field_0xe03;
269-
/* 0xE04 */ int* field_0xe04;
264+
/* 0xE04 */ WrestlerParamList* field_0xe04;
270265
/* 0xE08 */ DemoCamera_c mDemoCam;
271266
/* 0xE50 */ f32 mDemoCamFovy;
272267
/* 0xE54 */ f32 field_0xe54;
273268
/* 0xE58 */ f32 field_0xe58;
269+
/* 0xE5C */ s16 field_0xe5c;
274270
/* 0xE5E */ s16 field_0xe5e;
275271
/* 0xE60 */ u8 field_0xe60[0xe64 - 0xe60];
276272
/* 0XE64 */ request_of_phase_process_class mPhase;

include/d/actor/d_a_player.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,23 +1194,23 @@ class daPy_py_c : public fopAc_ac_c {
11941194
void setSumouForceTackle() { mSpecialMode = 0x1B; }
11951195
void setSumouForceGraspCancel() { mSpecialMode = 0x24; }
11961196

1197-
BOOL checkSumouPushFront() { return mSpecialMode == 7; }
1198-
BOOL checkSumouPushBack() { return mSpecialMode == 8; }
1199-
BOOL checkSumouTackleSuccess() { return mSpecialMode == 0xF; }
1200-
BOOL checkSumouTackleSuccessPunch() { return mSpecialMode == 0x10; }
1201-
BOOL checkSumouTackleMiss() { return mSpecialMode == 0x11; }
1202-
BOOL checkSumouTackleDraw() { return mSpecialMode == 0x12; }
1203-
BOOL checkSumouPunchSuccess() { return mSpecialMode == 0x13; }
1204-
BOOL checkSumouPunchMiss() { return mSpecialMode == 0x14; }
1205-
BOOL checkSumouPunchDraw() { return mSpecialMode == 0x15; }
1206-
BOOL checkSumouWait() { return mSpecialMode == 0x16; }
1207-
BOOL checkSumouLeftMove() { return mSpecialMode == 0x17; }
1208-
BOOL checkSumouRightMove() { return mSpecialMode == 0x18; }
1209-
BOOL checkSumouSlideLeft() { return mSpecialMode == 0x19; }
1210-
BOOL checkSumouSlideRight() { return mSpecialMode == 0x1A; }
1211-
BOOL checkSumouPunchStagger() { return mSpecialMode == 0x1F; }
1212-
BOOL checkSumouTackleStagger() { return mSpecialMode == 0x20; }
1213-
BOOL checkSumouGraspRelease() { return mSpecialMode == 0x23; }
1197+
BOOL checkSumouPushFront() const { return mSpecialMode == 7; }
1198+
BOOL checkSumouPushBack() const { return mSpecialMode == 8; }
1199+
BOOL checkSumouTackleSuccess() const { return mSpecialMode == 0xF; }
1200+
BOOL checkSumouTackleSuccessPunch() const { return mSpecialMode == 0x10; }
1201+
BOOL checkSumouTackleMiss() const { return mSpecialMode == 0x11; }
1202+
BOOL checkSumouTackleDraw() const { return mSpecialMode == 0x12; }
1203+
BOOL checkSumouPunchSuccess() const { return mSpecialMode == 0x13; }
1204+
BOOL checkSumouPunchMiss() const { return mSpecialMode == 0x14; }
1205+
BOOL checkSumouPunchDraw() const { return mSpecialMode == 0x15; }
1206+
BOOL checkSumouWait() const { return mSpecialMode == 0x16; }
1207+
BOOL checkSumouLeftMove() const { return mSpecialMode == 0x17; }
1208+
BOOL checkSumouRightMove() const { return mSpecialMode == 0x18; }
1209+
BOOL checkSumouSlideLeft() const { return mSpecialMode == 0x19; }
1210+
BOOL checkSumouSlideRight() const { return mSpecialMode == 0x1A; }
1211+
BOOL checkSumouPunchStagger() const { return mSpecialMode == 0x1F; }
1212+
BOOL checkSumouTackleStagger() const { return mSpecialMode == 0x20; }
1213+
BOOL checkSumouGraspRelease() const { return mSpecialMode == 0x23; }
12141214
};
12151215

12161216
int daPy_addCalcShort(s16* param_0, s16 param_1, s16 param_2, s16 param_3, s16 param_4);

include/d/d_meter2_info.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,10 @@ inline s16 dMeter2Info_getHorseLifeCount() {
737737
return g_meter2_info.getHorseLifeCount();
738738
}
739739

740+
inline void dMeter2Info_setMeterString(s32 i_string) {
741+
g_meter2_info.setMeterString(i_string);
742+
}
743+
740744
inline void dMeter2Info_resetMeterString() {
741745
g_meter2_info.resetMeterString();
742746
}

include/f_op/f_op_actor_mng.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ inline cXyz* fopAcM_GetOldPosition_p(fopAc_ac_c* i_actor) {
245245
return &i_actor->old.pos;
246246
}
247247

248+
inline cXyz* fopAcM_GetScale_p(fopAc_ac_c* i_actor) {
249+
return &i_actor->scale;
250+
}
251+
248252
inline cXyz* fopAcM_GetSpeed_p(fopAc_ac_c* i_actor) {
249253
return &i_actor->speed;
250254
}

0 commit comments

Comments
 (0)