Skip to content

Commit

Permalink
Start blackman.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Drought-Ender authored and EpochFlame committed Sep 14, 2023
1 parent 5a45c55 commit e11ec16
Show file tree
Hide file tree
Showing 5 changed files with 415 additions and 666 deletions.
53 changes: 33 additions & 20 deletions include/Game/Entities/BlackMan.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,19 @@ struct PathNode;

namespace BlackMan {
struct Parms;
struct FSM;

void lHandCallBack(J3DJoint*, int);
void rHandCallBack(J3DJoint*, int);
void lFootCallBack(J3DJoint*, int);
void rFootCallBack(J3DJoint*, int);
void bodyCallBack(J3DJoint*, int);
struct FSM : public EnemyStateMachine {
virtual void init(EnemyBase*); // _08

// _00 = VTBL
// _00-_1C = EnemyStateMachine
};

bool lHandCallBack(J3DJoint*, int);
bool rHandCallBack(J3DJoint*, int);
bool lFootCallBack(J3DJoint*, int);
bool rFootCallBack(J3DJoint*, int);
bool bodyCallBack(J3DJoint*, int);

struct Obj : public EnemyBase {
Obj();
Expand Down Expand Up @@ -66,7 +72,11 @@ struct Obj : public EnemyBase {
virtual bool bombCallBack(Creature*, Vector3f&, f32); // _294 (weak)
virtual void doStartStoneState(); // _2A4
virtual void doFinishStoneState(); // _2A8
virtual void setFSM(FSM* fsm); // _2F8 (weak)
virtual void setFSM(FSM* fsm) {
mFSM = fsm;
mFSM->init(this);
mCurrentLifecycleState = nullptr;
}; // _2F8 (weak)
//////////////// VTABLE END

void walkFunc();
Expand Down Expand Up @@ -105,9 +115,13 @@ struct Obj : public EnemyBase {

inline Parms* getParms() { return C_PARMS; }


// _00 = VTBL
// _00-_2BC = EnemyBase
u8 _2BC[0x10]; // _2BC, unknown
Matrixf* mLeftHandMtx; // _2BC
Matrixf* mRightHandMtx; // _2C0
Matrixf* mLeftFootMtx; // _2C4
Matrixf* mRightFootMtx; // _2C8
int mFreezeTimer; // _2CC
Vector3f _2D0; // _2D0
int mPostFlickState; // _2DC
Expand All @@ -126,29 +140,33 @@ struct Obj : public EnemyBase {
f32 _33C; // _33C, timer?
s16 _340; // _340, next or current waypoint idx?
s16 _342; // _342, next or current waypoint idx?
u8 _344[0x4]; // _344, unknown
s16 _344; // _344, unknown
u32 _348; // _348
u8 _34C; // _34C, unknown
WalkSmokeEffect::Mgr mWalkSmokeMgr; // _350
Sys::MatLoopAnimator* mMatLoopAnimator; // _358
PathNode* _35C; // _35C
FSM* _360; // _360
FSM* mFSM; // _360
Tyre::Obj* mTyre; // _364
u16 _368; // _368, unknown
u16 mWaistJointIndex; // _368, unknown
u16 mChestJointIndex; // _36A
u16 mLeftHandJointIndex; // _36C
u16 mRightHandJointIndex; // _36E
u16 mLeftFootJointIndex; // _370
u16 mRightFootJointIndex; // _372
f32 _374; // _374
f32 _378; // _378
u8 _37C[0x14]; // _37C
f32 _378; // _374
J3DMaterial* _37C; // _37C
Color4 mUsingColor; // _380
Color4 mTargetColor; // _384
Color4 _388; // _388
Color4 _38C; // _38C
efx::TKageMove* mEfxMove; // _390
efx::TKageRun* mEfxRun; // _394
efx::TKageTyreup* mEfxTyreup; // _398
efx::TKageDead1* mEfxDead; // _39C
efx::TKageFlick* _3A0; // _3A0
efx::TKageFlick* _3A4; // _3A4
efx::TKageFlick* mEfxFrontFlick; // _3A0
efx::TKageFlick* mEfxBackFlick; // _3A4
u8 _3A8; // _3A8, unknown
u8 _3A9; // _3A9
u8 _3AA; // _3AA
Expand Down Expand Up @@ -316,12 +334,7 @@ enum StateID {
WRAITH_Count = 9,
};

struct FSM : public EnemyStateMachine {
virtual void init(EnemyBase*); // _08

// _00 = VTBL
// _00-_1C = EnemyStateMachine
};

struct State : public EnemyFSMState {
inline State(int stateID)
Expand Down
9 changes: 9 additions & 0 deletions include/PSSystem/PSGame.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "JSystem/JUtility/JUTException.h"
#include "PSSystem/PSCommon.h"
#include "PSSystem/PSScene.h"
#include "PSSystem/Seq.h"
#include "PSGame/SeMgr.h"

// idk what else goes in this file (if anything? maybe this is in the PSGame folder??)
Expand Down Expand Up @@ -33,6 +34,14 @@ inline PSGame::SeMgr* getSeMgrInstance()
P2ASSERTLINE(567, SingletonBase<PSGame::SeMgr>::sInstance);
return static_cast<PSGame::SeMgr*>(SingletonBase<PSGame::SeMgr>::sInstance);
}

inline SeqBase* getSeqFromScene(Scene* scene, u32 id) {
SeqBase* seq = scene->mSeqMgr.getSeq(id);
P2ASSERTLINE(487, seq);
return seq;
}
}; // namespace PSSystem



#endif
10 changes: 10 additions & 0 deletions include/PSSystem/PSMainSide_ObjSound.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "JSystem/JUtility/JUTException.h"
#include "PSM/EnemyBase.h"
#include "PSM/EnemyBoss.h"

// idk what else goes in this file (if anything? maybe this is in the PSGame folder??)
// but these use the file name in the exception check so :shrug:
Expand All @@ -20,6 +21,15 @@ inline void checkBoss(PSM::EnemyBase* soundObj)

inline void checkMidBoss(PSM::EnemyBase* soundObj) { P2ASSERTLINE(1114, soundObj->getCastType() == CCT_EnemyMidBoss); }

inline void disableAppearFlag(PSM::EnemyBase* soundObj) {
checkMidBoss(soundObj);
PSM::EnemyBoss* bossObj = static_cast<PSM::EnemyBoss*>(soundObj);
if (bossObj) {
bossObj->setAppearFlag(false);
bossObj->_FF = true;
}
}

}; // namespace PSM

#endif
23 changes: 23 additions & 0 deletions include/efx/TKage.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ struct TKageBend1 : public TSimpleMtx2 {
};

struct TKageDead1 : public TChaseMtx {
inline TKageDead1()
: TChaseMtx(PID_KageDead1, nullptr)
{
}

virtual ~TKageDead1(); // _48 (weak)

void setGlobalPrmColor(Color4&);
Expand All @@ -30,13 +35,23 @@ struct TKageDead2 : public TSimple1 {
};

struct TKageFlick : public TChasePos {
inline TKageFlick(Vector3f* chasePos)
: TChasePos(chasePos, PID_KageFlick)
{
}

virtual ~TKageFlick(); // _48 (weak)

// _00 = VTBL
// _00-_14 = TChasePos
};

struct TKageMove : public TChasePosYRot {

inline TKageMove(Vector3f* pos, f32* rot)
: TChasePosYRot(pos, rot, PID_KageMove)
{
}
virtual ~TKageMove(); // _48 (weak)

void setGlobalPrmColor(Color4&);
Expand All @@ -55,6 +70,10 @@ struct TKageRecov : public TSimple2 {
};

struct TKageRun : public TChasePosYRot {
inline TKageRun(Vector3f* pos, f32* rot)
: TChasePosYRot(pos, rot, PID_KageRun)
{
}
virtual ~TKageRun(); // _48 (weak)

void setGlobalPrmColor(Color4&);
Expand Down Expand Up @@ -84,6 +103,10 @@ struct TKageTyresmoke : public TChasePosYRot {
};

struct TKageTyreup : public TChasePosYRot {
inline TKageTyreup(Vector3f* pos, f32* rot)
: TChasePosYRot(pos, rot, PID_KageTyreUp)
{
}
virtual ~TKageTyreup(); // _48 (weak)

// _00 = VTBL
Expand Down
Loading

0 comments on commit e11ec16

Please sign in to comment.