Skip to content
6 changes: 4 additions & 2 deletions include/Camera/Camera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CPolarSubCamera : public JDrama::TLookAtCamera {
void execSecureView_(s16, Vec*);
bool isLButtonCameraSpecifyMode(int) const;
void isLButtonCameraInbetween() const;
void isJetCoaster1stCamera() const;
bool isJetCoaster1stCamera() const;
void isTalkCameraSpecifyMode(int) const;
void isTalkCameraInbetween() const;
void isNormalCameraSpecifyMode(int) const;
Expand Down Expand Up @@ -131,7 +131,9 @@ class CPolarSubCamera : public JDrama::TLookAtCamera {

public:
/* 0x50 */ int mMode;
/* 0x54 */ char unk54[0x120 - 0x54];
/* 0x54 */ char unk54[0xA4 - 0x54];
/* 0xA4 */ s16 unkA4;
/* 0xA6 */ char unkA6[0x120 - 0xA6];
/* 0x120 */ TMarioGamePad* unk120;
/* 0x124 */ JGeometry::TVec3<f32> unk124;
/* 0x130 */ char unk130[0xC];
Expand Down
4 changes: 2 additions & 2 deletions include/JSystem/J3D/J3DGraphAnimator/J3DModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ class J3DModel {
/* 0x08 */ u32 unk8;
/* 0x0C */ J3DCalcCallBack unkC;
char pad1[0x4];
/* 0x14 */ Vec unk14;
/* 0x20 */ Mtx unk20;
/* 0x14 */ Vec unk14; // mBaseScale
/* 0x20 */ Mtx unk20; // mBaseMtx
/* 0x50 */ u8* mScaleFlagArr;
/* 0x54 */ u8* mEvlpScaleFlagArr;
/* 0x58 */ Mtx* mNodeMatrices;
Expand Down
9 changes: 9 additions & 0 deletions include/M3DUtil/MActor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ class MActorAnmBlk;

class MActor {
public:
enum ANM_TYPE {
ANM_TYPE_BCK,
ANM_TYPE_BLK,
ANM_TYPE_BPK,
ANM_TYPE_BTP,
ANM_TYPE_BTK,
ANM_TYPE_BRK
};

MActor(MActorAnmData*);

void setMActorAnmData(MActorAnmData*);
Expand Down
49 changes: 42 additions & 7 deletions include/Player/MarioMain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
#include <System/ParamInst.hpp>
#include <System/DrawSyncCallback.hpp>
#include <Strategic/TakeActor.hpp>
#include <Player/Yoshi.hpp>

class TLiveActor;
class TWaterGun;
class TBGCheckData;
class J3DAnmTexPattern;
class J3DModelData;
Expand All @@ -17,6 +19,23 @@ struct TBGWallCheckRecord;
// TODO: where should this be?
enum E_SIDEWALK_TYPE {};

enum E_MARIO_FLAG {
MARIO_FLAG_ABOVE_SEWER_FLOOR = (1 << 0),
MARIO_FLAG_VISIBLE = (1 << 1),
MARIO_FLAG_NPC_TALKING = (1 << 3),
MARIO_FLAG_RECENTLY_LEFT_WATER = (1 << 4),
MARIO_FLAG_GAME_OVER = (1 << 10),
MARIO_FLAG_GROUND_POUND_SIT_UP = (1 << 11),
MARIO_FLAG_HELMET_FLW_CAMERA = (1 << 12),
MARIO_FLAG_HELMET = (1 << 13),
MARIO_FLAG_FLUDD_EMITTING = (1 << 14),
MARIO_FLAG_HAS_FLUDD = (1 << 15),
MARIO_FLAG_IN_SHALLOW_WATER = (1 << 16),
MARIO_FLAG_IN_WATER = (1 << 17),
MARIO_FLAG_HAS_SHIRT = (1 << 20),
MARIO_FLAG_IS_PERFORMING = (1 << 21),
};

struct TRidingInfo {
const TLiveActor* unk0;
Vec localPos;
Expand Down Expand Up @@ -651,7 +670,7 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
bool isWearingCap();
void setDivHelm();
void getWallAngle() const;
void getPumpFrame() const;
f32 getPumpFrame() const;
void getCenterAnmMtx();
void getRootAnmMtx();
void getHeadRot();
Expand Down Expand Up @@ -781,7 +800,7 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
void canBendBody();
void considerRotateJumpStart();
void addVelocity(f32);
u32 onYoshi() const;
s32 onYoshi() const;
void getGroundJumpPower() const;
void windMove(const JGeometry::TVec3<f32>&);
void flowMove(const JGeometry::TVec3<f32>&);
Expand Down Expand Up @@ -1079,6 +1098,21 @@ class TMario : public TTakeActor, public TDrawSyncCallback {

TBGCheckData* getGroundPlane() const { return mGroundPlane; }

// Fabricated
bool checkFlag(u32 attribute) const
{
return unk118 & attribute ? true : false;
}

// Fabricated
bool fabricatedActionInline() const
{
if (mAction >= 0x168 && 0x16c >= mAction) {
return true;
}
return false;
}

public:
/* 0x74 */ u32 mInput;
/* 0x78 */ u32 unk78;
Expand Down Expand Up @@ -1114,15 +1148,15 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
/* 0xF6 */ u16 unkF6;

/* 0xF8 */ u16 mLightID;
// u16 _0FA;
/* 0xFA */ u16 unk0FA;

/* 0xFC */ u32 unkFC[2];

/* 0x104 */ void* mController; // TMarioControllerWork

/* 0x108 */ u32 unk108[4];

/* 0x118 */ u32 unk118; // gpMarioFlag points here;
/* 0x118 */ u32 unk118;

/* 0x11C */ u32 unk11C;

Expand All @@ -1140,18 +1174,18 @@ class TMario : public TTakeActor, public TDrawSyncCallback {

/* 0x38A */ char unk38A[0x5A];

/* 0x3E4 */ void* mWaterGun; // TWaterGun
/* 0x3E4 */ TWaterGun* mWaterGun;

/* 0x3E8 */ u32 unk3E8;
/* 0x3EC */ u32 unk3EC;

/* 0x3F0 */ void* mYoshi; // TYoshi 0x3F0
/* 0x3F0 */ TYoshi* mYoshi;

/* 0x3F4 */ char unk3F4[0x0FC];

/* 0x4F0 */ JGeometry::TVec3<f32> unk4F0;

void* mGamePad; // TMarioGamePad
/* 0x4FC */ TMarioGamePad* mGamePad;

/* 0x500 */ char unk500[0x74];

Expand Down Expand Up @@ -1248,5 +1282,6 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
};

extern TMario* gpMarioOriginal;
extern TMario* gpMarioForCallBack;

#endif
131 changes: 131 additions & 0 deletions include/Player/NozzleBase.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
#ifndef NOZZLEBASE_HPP
#define NOZZLEBASE_HPP

#include <M3DUtil/MActor.hpp>
#include <Player/ModelWaterManager.hpp>
#include <System/MarioGamePad.hpp>

class TWaterGun;

class TNozzleBase {
public:
struct TEmitParams : public TParams {
TEmitParams(const char* prm)
: TParams(prm)
, PARAM_INIT(mRocketType, 0)
, PARAM_INIT(mNum, 1.0f)
, PARAM_INIT(mAttack, 1)
, PARAM_INIT(mDirTremble, 0.0099999998)
, PARAM_INIT(mEmitPow, 40.0)
, PARAM_INIT(mEmitCtrl, 1.0f)
, PARAM_INIT(mPowTremble, 1.0f)
, PARAM_INIT(mSize, 40.0f)
, PARAM_INIT(mSizeTremble, 16.0f)
, PARAM_INIT(mAmountMax, 0x834)
, PARAM_INIT(mReactionPow, 0.0f)
, PARAM_INIT(mReactionY, 0.0f)
, PARAM_INIT(mDecRate, 0)
, PARAM_INIT(mTriggerRate, 0x100)
, PARAM_INIT(mDamageLoss, 0xfa)
, PARAM_INIT(mSuckRate, 0.1f)
, PARAM_INIT(mHitRadius, 50.0f)
, PARAM_INIT(mHitHeight, 80.0f)
, PARAM_INIT(mLAngleBase, 0x1000)
, PARAM_INIT(mLAngleNormal, 12000)
, PARAM_INIT(mLAngleSquat, 12000)
, PARAM_INIT(mLAngleMin, -0x2000)
, PARAM_INIT(mLAngleMax, 0x2000)
, PARAM_INIT(mLAngleChase, 0.1f)
, PARAM_INIT(mSizeMinPressure, 0.0f)
, PARAM_INIT(mSizeMaxPressure, 1.0f)
, PARAM_INIT(mNumMin, 1.0f)
, PARAM_INIT(mAttackMin, 1)
, PARAM_INIT(mDirTrembleMin, 0.0099999998)
, PARAM_INIT(mEmitPowMin, 40.0f)
, PARAM_INIT(mSizeMin, 40.0f)
, PARAM_INIT(mMotorPowMin, 5.0f)
, PARAM_INIT(mMotorPowMax, 25.0f)
, PARAM_INIT(mReactionPowMin, 0.0f)
, PARAM_INIT(mInsidePressureDec, 100.0f)
, PARAM_INIT(mInsidePressureMax, 4500.0f)
, PARAM_INIT(mTriggerTime, 1)
, PARAM_INIT(mType, 0)
, PARAM_INIT(mSideAngleMaxSide, 0x4000)
, PARAM_INIT(mSideAngleMaxFront, 0x4000)
, PARAM_INIT(mSideAngleMaxBack, 0x2000)
, PARAM_INIT(mRButtonMult, 10000.0)
, PARAM_INIT(mEmitPowScale, 10.0f)

{
}
// TODO: Validate these offsets...
/* 0x00 */ TParamRT<u8> mRocketType;
/* 0x14 */ TParamRT<f32> mNum;
/* 0x28 */ TParamRT<s16> mAttack;
/* 0x3C */ TParamRT<f32> mDirTremble;
/* 0x50 */ TParamRT<f32> mEmitPow;
/* 0x64 */ TParamRT<f32> mEmitCtrl;
/* 0x78 */ TParamRT<f32> mPowTremble;
/* 0x8C */ TParamRT<f32> mSize;
/* 0xA0 */ TParamRT<f32> mSizeTremble;
/* 0xB4 */ TParamRT<s32> mAmountMax;
/* 0xC8 */ TParamRT<f32> mReactionPow;
/* 0xDC */ TParamRT<f32> mReactionY;
/* 0xF0 */ TParamRT<s16> mDecRate;
/* 0x104 */ TParamRT<u16> mTriggerRate;
/* 0x118 */ TParamRT<s32> mDamageLoss;
/* 0x12C */ TParamRT<f32> mSuckRate;
/* 0x140 */ TParamRT<f32> mHitRadius;
/* 0x154 */ TParamRT<f32> mHitHeight;
/* 0x168 */ TParamRT<s16> mLAngleBase;
/* 0x17C */ TParamRT<s16> mLAngleNormal;
/* 0x190 */ TParamRT<s16> mLAngleSquat;
/* 0x1A4 */ TParamRT<s16> mLAngleMin;
/* 0x1B8 */ TParamRT<s16> mLAngleMax;
/* 0x1CC */ TParamRT<f32> mLAngleChase;
/* 0x1E0 */ TParamRT<f32> mSizeMinPressure;
/* 0x1F4 */ TParamRT<f32> mSizeMaxPressure;
/* 0x208 */ TParamRT<f32> mNumMin;
/* 0x21C */ TParamRT<s16> mAttackMin;
/* 0x230 */ TParamRT<f32> mDirTrembleMin;
/* 0x244 */ TParamRT<f32> mEmitPowMin;
/* 0x258 */ TParamRT<f32> mSizeMin;
/* 0x26C */ TParamRT<f32> mMotorPowMin;
/* 0x280 */ TParamRT<f32> mMotorPowMax;
/* 0x294 */ TParamRT<f32> mReactionPowMin;
/* 0x2C0 */ TParamRT<f32> mInsidePressureDec; // These should be correct
/* 0x2D4 */ TParamRT<f32> mInsidePressureMax;
/* 0x2E8 */ TParamRT<s16> mTriggerTime;
/* 0x2E4 */ TParamRT<s16> mType;
/* 0x2F8 */ TParamRT<s16> mSideAngleMaxSide;
/* 0x30C */ TParamRT<s16> mSideAngleMaxFront;
/* 0x320 */ TParamRT<s16> mSideAngleMaxBack;
/* 0x334 */ TParamRT<f32> mRButtonMult;
/* 0x348 */ TParamRT<f32> mEmitPowScale;
} mEmitParams; // 0x0000

TNozzleBase(const char* name, const char* prm, TWaterGun* fludd);

virtual void init();
virtual inline s32 getNozzleKind() const;
virtual inline s16 getGunAngle() { return unk36E; }
virtual inline s16 getWaistAngle() { return unk370; }
virtual void movement(const TMarioControllerWork&);
virtual void emitCommon(int, TWaterEmitInfo*);
virtual void emit(int);
virtual void animation(int);

void calcGunAngle(const TMarioControllerWork&);

/* 0x368 */ TWaterGun* mFludd;
/* 0x36C */ u16 unk36C; // Some animation state
/* 0x36E */ s16 unk36E; // Gun angle
/* 0x370 */ s16 unk370; // Waist angle
/* 0x372 */ u16 unk372;
/* 0x374 */ f32 unk374;
/* 0x378 */ f32 unk378;
/* 0x37C */ f32 unk37C;
/* 0x380 */ MActor* unk380; // MActor
};

#endif
23 changes: 23 additions & 0 deletions include/Player/NozzleDeform.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef NOZZLEDEFORM_HPP
#define NOZZLEDEFORM_HPP

#include <Player/NozzleBase.hpp>

class TNozzleDeform : public TNozzleBase {
public:
TNozzleDeform(const char* name, const char* prm, TWaterGun* fludd)
: TNozzleBase(name, prm, fludd)
, mBomb(name, "/Mario/WaterGun/NozzleDeformBomb.prm", fludd)
{
init();
}

virtual s32 getNozzleKind() const { return 3; }
virtual void movement(const TMarioControllerWork&);
virtual void emit(int);
virtual void animation(int);

/* 0x384 */ TNozzleTrigger mBomb;
};

#endif
37 changes: 37 additions & 0 deletions include/Player/NozzleTrigger.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#ifndef NOZZLETRIGGER_HPP
#define NOZZLETRIGGER_HPP

#include <Player/NozzleBase.hpp>
#include <Player/MarioMain.hpp>

class TNozzleTrigger : public TNozzleBase {
public:
TNozzleTrigger(const char* name, const char* prm, TWaterGun* fludd)
: TNozzleBase(name, prm, fludd)
{
unk38C = 0xffffffff;
unk384 = false;
unk385 = INACTIVE;
unk36C = 0;
unk386 = 0;
unk388 = 0.0f;
}

virtual void init();
virtual s32 getNozzleKind() const { return 1; };
virtual void movement(const TMarioControllerWork&);
virtual void emit(int);
virtual void animation(int);

// Inactive = not holding R, Active = charging R, Dead = R Waiting to be
// depressed
enum SPRAYSTATE { INACTIVE, ACTIVE, DEAD };

/* 0x384 */ bool unk384; // mRumbleOnCharge
/* 0x385 */ s8 unk385; // mSprayState, Current spray state
/* 0x386 */ s16 unk386; // Quarter frames left of spray (i think)
/* 0x388 */ f32 unk388; // mTriggerFill - How far the trigger has gotten
/* 0x38C */ u32 unk38C; // mSoundID - The sound to play when triggering
};

#endif
Loading