mirror of https://github.com/AxioDL/metaforce.git
Various CPlayer and CBodyStateCmdMgr imps
This commit is contained in:
parent
6f9e6712ce
commit
bfb16a3a0d
|
@ -423,6 +423,7 @@ public:
|
|||
const CWorld* GetWorld() const { return x850_world.get(); }
|
||||
CRelayTracker* GetRelayTracker() { return x8bc_relayTracker.get(); }
|
||||
CCameraManager* GetCameraManager() const { return x870_cameraManager; }
|
||||
CFluidPlaneManager* GetFluidPlaneManager() const { return x87c_fluidPlaneManager; }
|
||||
|
||||
const std::shared_ptr<CMapWorldInfo>& MapWorldInfo() const { return x8c0_mapWorldInfo; }
|
||||
const std::shared_ptr<CWorldLayerState>& LayerState() const { return x8c8_worldLayerState; }
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
#include "CBodyStateCmdMgr.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
|
||||
CBodyStateCmdMgr::CBodyStateCmdMgr()
|
||||
{
|
||||
x40_commandTable.push_back(&xb8_getup);
|
||||
x40_commandTable.push_back(&xc4_step);
|
||||
x40_commandTable.push_back(&xd4_);
|
||||
x40_commandTable.push_back(&xdc_knockDown);
|
||||
x40_commandTable.push_back(&xf4_knockBack);
|
||||
x40_commandTable.push_back(&x10c_meleeAttack);
|
||||
x40_commandTable.push_back(&x128_projectileAttack);
|
||||
x40_commandTable.push_back(&x144_loopAttack);
|
||||
x40_commandTable.push_back(&x154_loopReaction);
|
||||
x40_commandTable.push_back(&x160_loopHitReaction);
|
||||
x40_commandTable.push_back(&x16c_);
|
||||
x40_commandTable.push_back(&x174_);
|
||||
x40_commandTable.push_back(&x17c_);
|
||||
x40_commandTable.push_back(&x184_);
|
||||
x40_commandTable.push_back(&x18c_generate);
|
||||
x40_commandTable.push_back(&x1ac_hurled);
|
||||
x40_commandTable.push_back(&x1d0_jump);
|
||||
x40_commandTable.push_back(&x1f8_slide);
|
||||
x40_commandTable.push_back(&x210_taunt);
|
||||
x40_commandTable.push_back(&x21c_scripted);
|
||||
x40_commandTable.push_back(&x230_cover);
|
||||
x40_commandTable.push_back(&x254_wallHang);
|
||||
x40_commandTable.push_back(&x260_);
|
||||
x40_commandTable.push_back(&x268_);
|
||||
x40_commandTable.push_back(&x270_additiveAim);
|
||||
x40_commandTable.push_back(&x278_additiveFlinch);
|
||||
x40_commandTable.push_back(&x284_additiveReaction);
|
||||
x40_commandTable.push_back(&x298_);
|
||||
}
|
||||
|
||||
}
|
|
@ -7,26 +7,222 @@
|
|||
|
||||
namespace urde
|
||||
{
|
||||
class CBodyStateCmd;
|
||||
class CBCMeleeAttackCmd;
|
||||
class CBCProjectileAttackCmd;
|
||||
class CBCStepCmd;
|
||||
class CBCJumpCmd;
|
||||
class CBCGenerateCmd;
|
||||
class CBCKnockBackCmd;
|
||||
class CBCHurledCmd;
|
||||
class CBCGetupCmd;
|
||||
class CBCLoopReactionCmd;
|
||||
class CBCKnockDownCmd;
|
||||
class CBCSlideCmd;
|
||||
class CBCScriptedCmd;
|
||||
class CBCCoverCmd;
|
||||
class CBCWallHangCmd;
|
||||
class CBCAdditiveAimCmd;
|
||||
class CBCLocomotionCmd;
|
||||
class CBCAdditiveAimCmd;
|
||||
class CBCAdditiveReactionCmd;
|
||||
class CBCLoopAttackCmd;
|
||||
|
||||
class CBodyStateCmd
|
||||
{
|
||||
EBodyStateCmd x4_cmd;
|
||||
public:
|
||||
virtual ~CBodyStateCmd() = default;
|
||||
CBodyStateCmd(EBodyStateCmd cmd) : x4_cmd(cmd) {}
|
||||
EBodyStateCmd GetCommandId() const { return x4_cmd; }
|
||||
};
|
||||
|
||||
class CBCMeleeAttackCmd : public CBodyStateCmd
|
||||
{
|
||||
pas::ESeverity x8_severity = pas::ESeverity::Invalid;
|
||||
zeus::CVector3f xc_;
|
||||
bool x18_ = false;
|
||||
public:
|
||||
CBCMeleeAttackCmd() : CBodyStateCmd(EBodyStateCmd::MeleeAttack) {}
|
||||
CBCMeleeAttackCmd(pas::ESeverity severity)
|
||||
: CBodyStateCmd(EBodyStateCmd::MeleeAttack), x8_severity(severity) {}
|
||||
};
|
||||
|
||||
class CBCProjectileAttackCmd : public CBodyStateCmd
|
||||
{
|
||||
pas::ESeverity x8_severity = pas::ESeverity::Invalid;
|
||||
zeus::CVector3f xc_;
|
||||
bool x18_ = false;
|
||||
public:
|
||||
CBCProjectileAttackCmd() : CBodyStateCmd(EBodyStateCmd::ProjectileAttack) {}
|
||||
CBCProjectileAttackCmd(pas::ESeverity severity, const zeus::CVector3f& vec, bool b)
|
||||
: CBodyStateCmd(EBodyStateCmd::ProjectileAttack), x8_severity(severity), xc_(vec), x18_(b) {}
|
||||
};
|
||||
|
||||
class CBCStepCmd : public CBodyStateCmd
|
||||
{
|
||||
pas::EStepDirection x8_dir = pas::EStepDirection::Invalid;
|
||||
pas::EStepType xc_type = pas::EStepType::Zero;
|
||||
public:
|
||||
CBCStepCmd() : CBodyStateCmd(EBodyStateCmd::Step) {}
|
||||
CBCStepCmd(pas::EStepDirection dir, pas::EStepType type)
|
||||
: CBodyStateCmd(EBodyStateCmd::Step), x8_dir(dir), xc_type(type) {}
|
||||
};
|
||||
|
||||
class CBCJumpCmd : public CBodyStateCmd
|
||||
{
|
||||
pas::EJumpType x8_type = pas::EJumpType::Zero;
|
||||
zeus::CVector3f xc_;
|
||||
zeus::CVector3f x18_;
|
||||
bool x24_24_ : 1;
|
||||
bool x24_25_ : 1;
|
||||
public:
|
||||
CBCJumpCmd()
|
||||
: CBodyStateCmd(EBodyStateCmd::Jump) { x24_24_ = false; x24_25_ = false; }
|
||||
CBCJumpCmd(const zeus::CVector3f& vec, pas::EJumpType type)
|
||||
: CBodyStateCmd(EBodyStateCmd::Jump), x8_type(type), xc_(vec) { x24_24_ = false; x24_25_ = false; }
|
||||
};
|
||||
|
||||
class CBCGenerateCmd : public CBodyStateCmd
|
||||
{
|
||||
pas::EGenerateType x8_type = pas::EGenerateType::Invalid;
|
||||
public:
|
||||
CBCGenerateCmd() : CBodyStateCmd(EBodyStateCmd::Generate) {}
|
||||
CBCGenerateCmd(pas::EGenerateType type, int i)
|
||||
: CBodyStateCmd(EBodyStateCmd::Generate), x8_type(type) {}
|
||||
CBCGenerateCmd(pas::EGenerateType type, const zeus::CVector3f& vec)
|
||||
: CBodyStateCmd(EBodyStateCmd::Generate), x8_type(type) {}
|
||||
};
|
||||
|
||||
class CBCKnockBackCmd : public CBodyStateCmd
|
||||
{
|
||||
zeus::CVector3f x8_;
|
||||
pas::ESeverity x14_severity = pas::ESeverity::Invalid;
|
||||
public:
|
||||
CBCKnockBackCmd() : CBodyStateCmd(EBodyStateCmd::KnockBack) {}
|
||||
CBCKnockBackCmd(const zeus::CVector3f& vec, pas::ESeverity severity)
|
||||
: CBodyStateCmd(EBodyStateCmd::KnockBack), x8_(vec), x14_severity(severity) {}
|
||||
};
|
||||
|
||||
class CBCHurledCmd : public CBodyStateCmd
|
||||
{
|
||||
zeus::CVector3f x8_v0;
|
||||
zeus::CVector3f x14_v1;
|
||||
bool x20_ = false;
|
||||
public:
|
||||
CBCHurledCmd() : CBodyStateCmd(EBodyStateCmd::Hurled) {}
|
||||
CBCHurledCmd(const zeus::CVector3f& v0, const zeus::CVector3f& v1)
|
||||
: CBodyStateCmd(EBodyStateCmd::Hurled), x8_v0(v0), x14_v1(v1) {}
|
||||
};
|
||||
|
||||
class CBCGetupCmd : public CBodyStateCmd
|
||||
{
|
||||
pas::EGetupType x8_type = pas::EGetupType::Invalid;
|
||||
public:
|
||||
CBCGetupCmd() : CBodyStateCmd(EBodyStateCmd::Getup) {}
|
||||
CBCGetupCmd(pas::EGetupType type)
|
||||
: CBodyStateCmd(EBodyStateCmd::Getup), x8_type(type) {}
|
||||
};
|
||||
|
||||
class CBCLoopReactionCmd : public CBodyStateCmd
|
||||
{
|
||||
pas::EReactionType x8_type = pas::EReactionType::Invalid;
|
||||
public:
|
||||
CBCLoopReactionCmd() : CBodyStateCmd(EBodyStateCmd::LoopReaction) {}
|
||||
CBCLoopReactionCmd(pas::EReactionType type)
|
||||
: CBodyStateCmd(EBodyStateCmd::LoopReaction), x8_type(type) {}
|
||||
};
|
||||
|
||||
class CBCLoopHitReactionCmd : public CBodyStateCmd
|
||||
{
|
||||
pas::EReactionType x8_type = pas::EReactionType::Invalid;
|
||||
public:
|
||||
CBCLoopHitReactionCmd() : CBodyStateCmd(EBodyStateCmd::LoopHitReaction) {}
|
||||
CBCLoopHitReactionCmd(pas::EReactionType type)
|
||||
: CBodyStateCmd(EBodyStateCmd::LoopHitReaction), x8_type(type) {}
|
||||
};
|
||||
|
||||
class CBCKnockDownCmd : public CBodyStateCmd
|
||||
{
|
||||
zeus::CVector3f x8_;
|
||||
pas::ESeverity x14_severity = pas::ESeverity::Invalid;
|
||||
public:
|
||||
CBCKnockDownCmd() : CBodyStateCmd(EBodyStateCmd::KnockDown) {}
|
||||
CBCKnockDownCmd(const zeus::CVector3f& vec, pas::ESeverity severity)
|
||||
: CBodyStateCmd(EBodyStateCmd::KnockDown), x8_(vec), x14_severity(severity) {}
|
||||
};
|
||||
|
||||
class CBCSlideCmd : public CBodyStateCmd
|
||||
{
|
||||
pas::ESlideType x8_type = pas::ESlideType::Invalid;
|
||||
zeus::CVector3f xc_;
|
||||
public:
|
||||
CBCSlideCmd() : CBodyStateCmd(EBodyStateCmd::Slide) {}
|
||||
CBCSlideCmd(pas::ESlideType type, const zeus::CVector3f& vec)
|
||||
: CBodyStateCmd(EBodyStateCmd::Slide), x8_type(type), xc_(vec) {}
|
||||
};
|
||||
|
||||
class CBCScriptedCmd : public CBodyStateCmd
|
||||
{
|
||||
int x8_ = -1;
|
||||
bool xc_24_ : 1;
|
||||
bool xc_25_ : 1;
|
||||
float x10_ = 0.f;
|
||||
public:
|
||||
CBCScriptedCmd() : CBodyStateCmd(EBodyStateCmd::Scripted) { xc_24_ = false; xc_25_ = false; }
|
||||
CBCScriptedCmd(int i, bool b1, bool b2, float f) : CBodyStateCmd(EBodyStateCmd::Scripted),
|
||||
x8_(i), x10_(f) { xc_24_ = b1; xc_25_ = b2; }
|
||||
};
|
||||
|
||||
class CBCCoverCmd : public CBodyStateCmd
|
||||
{
|
||||
pas::ECoverDirection x8_dir = pas::ECoverDirection::Invalid;
|
||||
zeus::CVector3f xc_;
|
||||
zeus::CVector3f x18_;
|
||||
public:
|
||||
CBCCoverCmd() : CBodyStateCmd(EBodyStateCmd::Cover) {}
|
||||
CBCCoverCmd(pas::ECoverDirection dir, const zeus::CVector3f& v1, const zeus::CVector3f& v2) :
|
||||
CBodyStateCmd(EBodyStateCmd::Cover), x8_dir(dir), xc_(v1), x18_(v2) {}
|
||||
};
|
||||
|
||||
class CBCWallHangCmd : public CBodyStateCmd
|
||||
{
|
||||
TUniqueId x8_uid = kInvalidUniqueId;
|
||||
public:
|
||||
CBCWallHangCmd() : CBodyStateCmd(EBodyStateCmd::WallHang) {}
|
||||
CBCWallHangCmd(TUniqueId uid) :
|
||||
CBodyStateCmd(EBodyStateCmd::WallHang), x8_uid(uid) {}
|
||||
};
|
||||
|
||||
class CBCAdditiveAimCmd : public CBodyStateCmd
|
||||
{
|
||||
public:
|
||||
CBCAdditiveAimCmd() : CBodyStateCmd(EBodyStateCmd::AdditiveAim) {}
|
||||
};
|
||||
|
||||
class CBCAdditiveFlinchCmd : public CBodyStateCmd
|
||||
{
|
||||
float x8_ = 1.f;
|
||||
public:
|
||||
CBCAdditiveFlinchCmd() : CBodyStateCmd(EBodyStateCmd::AdditiveFlinch) {}
|
||||
CBCAdditiveFlinchCmd(float f) : CBodyStateCmd(EBodyStateCmd::AdditiveFlinch), x8_(f) {}
|
||||
};
|
||||
|
||||
class CBCAdditiveReactionCmd : public CBodyStateCmd
|
||||
{
|
||||
float x8_ = 1.f;
|
||||
pas::EReactionType xc_type = pas::EReactionType::Invalid;
|
||||
bool x10_ = false;
|
||||
public:
|
||||
CBCAdditiveReactionCmd() : CBodyStateCmd(EBodyStateCmd::AdditiveReaction) {}
|
||||
CBCAdditiveReactionCmd(pas::EReactionType type, float f)
|
||||
: CBodyStateCmd(EBodyStateCmd::AdditiveReaction), x8_(f), xc_type(type) {}
|
||||
};
|
||||
|
||||
class CBCLoopAttackCmd : public CBodyStateCmd
|
||||
{
|
||||
pas::ELoopAttackType x8_type = pas::ELoopAttackType::Invalid;
|
||||
u32 xc_ = 0;
|
||||
public:
|
||||
CBCLoopAttackCmd() : CBodyStateCmd(EBodyStateCmd::LoopAttack) {}
|
||||
CBCLoopAttackCmd(pas::ELoopAttackType type)
|
||||
: CBodyStateCmd(EBodyStateCmd::LoopAttack), x8_type(type) {}
|
||||
};
|
||||
|
||||
class CBCTauntCmd : public CBodyStateCmd
|
||||
{
|
||||
pas::ETauntType x8_type = pas::ETauntType::Invalid;
|
||||
public:
|
||||
CBCTauntCmd() : CBodyStateCmd(EBodyStateCmd::Taunt) {}
|
||||
CBCTauntCmd(pas::ETauntType type)
|
||||
: CBodyStateCmd(EBodyStateCmd::Taunt), x8_type(type) {}
|
||||
};
|
||||
|
||||
class CBCLocomotionCmd
|
||||
{
|
||||
public:
|
||||
};
|
||||
|
||||
class CBodyStateCmdMgr
|
||||
{
|
||||
public:
|
||||
|
@ -34,31 +230,152 @@ public:
|
|||
{
|
||||
};
|
||||
private:
|
||||
zeus::CVector3f x0_;
|
||||
zeus::CVector3f xc_;
|
||||
zeus::CVector3f x18_;
|
||||
zeus::CVector3f x24_;
|
||||
u32 x30_ = 0;
|
||||
float x34_steeringSpeedMin;
|
||||
float x38_steeringSpeedMax;
|
||||
rstl::reserved_vector<CBodyStateCmd, 28> x44_;
|
||||
rstl::reserved_vector<CBodyStateCmd*, 28> x40_commandTable;
|
||||
u32 xb4_deliveredCmdMask = 0;
|
||||
CBCGetupCmd xb8_getup;
|
||||
CBCStepCmd xc4_step;
|
||||
CBodyStateCmd xd4_ = {EBodyStateCmd::Two};
|
||||
CBCKnockDownCmd xdc_knockDown;
|
||||
CBCKnockBackCmd xf4_knockBack;
|
||||
CBCMeleeAttackCmd x10c_meleeAttack;
|
||||
CBCProjectileAttackCmd x128_projectileAttack;
|
||||
CBCLoopAttackCmd x144_loopAttack;
|
||||
CBCLoopReactionCmd x154_loopReaction;
|
||||
CBCLoopHitReactionCmd x160_loopHitReaction;
|
||||
CBodyStateCmd x16c_ = {EBodyStateCmd::Ten};
|
||||
CBodyStateCmd x174_ = {EBodyStateCmd::Eleven};
|
||||
CBodyStateCmd x17c_ = {EBodyStateCmd::Twelve};
|
||||
CBodyStateCmd x184_ = {EBodyStateCmd::Thirteen};
|
||||
CBCGenerateCmd x18c_generate;
|
||||
CBCHurledCmd x1ac_hurled;
|
||||
CBCJumpCmd x1d0_jump;
|
||||
CBCSlideCmd x1f8_slide;
|
||||
CBCTauntCmd x210_taunt;
|
||||
CBCScriptedCmd x21c_scripted;
|
||||
CBCCoverCmd x230_cover;
|
||||
CBCWallHangCmd x254_wallHang;
|
||||
CBodyStateCmd x260_ = {EBodyStateCmd::TwentyTwo};
|
||||
CBodyStateCmd x268_ = {EBodyStateCmd::TwentyThree};
|
||||
CBCAdditiveAimCmd x270_additiveAim;
|
||||
CBCAdditiveFlinchCmd x278_additiveFlinch;
|
||||
CBCAdditiveReactionCmd x284_additiveReaction;
|
||||
CBodyStateCmd x298_ = {EBodyStateCmd::TwentySeven};
|
||||
void DeliverCmd(EBodyStateCmd cmd) { xb4_deliveredCmdMask |= (1 << int(cmd)); }
|
||||
public:
|
||||
CBodyStateCmdMgr() = default;
|
||||
void DeliverCmd(EBodyStateCmd);
|
||||
void DeliverCmd(const CBodyStateCmd&);
|
||||
void DeliverCmd(const CBCProjectileAttackCmd&);
|
||||
void DeliverCmd(const CBCMeleeAttackCmd&);
|
||||
void DeliverCmd(const CBCStepCmd&);
|
||||
void DeliverCmd(const CBCGenerateCmd&);
|
||||
void DeliverCmd(const CBCJumpCmd&);
|
||||
void DeliverCmd(const CBCSlideCmd&);
|
||||
void DeliverCmd(const CBCKnockBackCmd&);
|
||||
void DeliverCmd(const CBCHurledCmd&);
|
||||
void DeliverCmd(const CBCGetupCmd&);
|
||||
void DeliverCmd(const CBCLoopReactionCmd&);
|
||||
void DeliverCmd(const CBCKnockDownCmd&);
|
||||
void DeliverCmd(const CBCScriptedCmd&);
|
||||
void DeliverCmd(const CBCCoverCmd&);
|
||||
void DeliverCmd(const CBCWallHangCmd&);
|
||||
void DeliverCmd(const CBCAdditiveAimCmd&);
|
||||
void DeliverCmd(const CBCLocomotionCmd&);
|
||||
void DeliverCmd(const CBCAdditiveReactionCmd&);
|
||||
void DeliverCmd(const CBCLoopAttackCmd&);
|
||||
CBodyStateCmdMgr();
|
||||
void DeliverCmd(const CBodyStateCmd& cmd)
|
||||
{
|
||||
*x40_commandTable[int(cmd.GetCommandId())] = cmd;
|
||||
DeliverCmd(cmd.GetCommandId());
|
||||
}
|
||||
void DeliverCmd(const CBCGetupCmd& cmd)
|
||||
{
|
||||
xb8_getup = cmd;
|
||||
DeliverCmd(EBodyStateCmd::Getup);
|
||||
}
|
||||
void DeliverCmd(const CBCStepCmd& cmd)
|
||||
{
|
||||
xc4_step = cmd;
|
||||
DeliverCmd(EBodyStateCmd::Step);
|
||||
}
|
||||
void DeliverCmd(const CBCKnockDownCmd& cmd)
|
||||
{
|
||||
xdc_knockDown = cmd;
|
||||
DeliverCmd(EBodyStateCmd::KnockDown);
|
||||
}
|
||||
void DeliverCmd(const CBCKnockBackCmd& cmd)
|
||||
{
|
||||
xf4_knockBack = cmd;
|
||||
DeliverCmd(EBodyStateCmd::KnockBack);
|
||||
}
|
||||
void DeliverCmd(const CBCMeleeAttackCmd& cmd)
|
||||
{
|
||||
x10c_meleeAttack = cmd;
|
||||
DeliverCmd(EBodyStateCmd::MeleeAttack);
|
||||
}
|
||||
void DeliverCmd(const CBCProjectileAttackCmd& cmd)
|
||||
{
|
||||
x128_projectileAttack = cmd;
|
||||
DeliverCmd(EBodyStateCmd::ProjectileAttack);
|
||||
}
|
||||
void DeliverCmd(const CBCLoopAttackCmd& cmd)
|
||||
{
|
||||
x144_loopAttack = cmd;
|
||||
DeliverCmd(EBodyStateCmd::LoopAttack);
|
||||
}
|
||||
void DeliverCmd(const CBCLoopReactionCmd& cmd)
|
||||
{
|
||||
x154_loopReaction = cmd;
|
||||
DeliverCmd(EBodyStateCmd::LoopReaction);
|
||||
}
|
||||
void DeliverCmd(const CBCLoopHitReactionCmd& cmd)
|
||||
{
|
||||
x160_loopHitReaction = cmd;
|
||||
DeliverCmd(EBodyStateCmd::LoopHitReaction);
|
||||
}
|
||||
void DeliverCmd(const CBCGenerateCmd& cmd)
|
||||
{
|
||||
x18c_generate = cmd;
|
||||
DeliverCmd(EBodyStateCmd::Generate);
|
||||
}
|
||||
void DeliverCmd(const CBCHurledCmd& cmd)
|
||||
{
|
||||
x1ac_hurled = cmd;
|
||||
DeliverCmd(EBodyStateCmd::Hurled);
|
||||
}
|
||||
void DeliverCmd(const CBCJumpCmd& cmd)
|
||||
{
|
||||
x1d0_jump = cmd;
|
||||
DeliverCmd(EBodyStateCmd::Jump);
|
||||
}
|
||||
void DeliverCmd(const CBCSlideCmd& cmd)
|
||||
{
|
||||
x1f8_slide = cmd;
|
||||
DeliverCmd(EBodyStateCmd::Slide);
|
||||
}
|
||||
void DeliverCmd(const CBCTauntCmd& cmd)
|
||||
{
|
||||
x210_taunt = cmd;
|
||||
DeliverCmd(EBodyStateCmd::Taunt);
|
||||
}
|
||||
void DeliverCmd(const CBCScriptedCmd& cmd)
|
||||
{
|
||||
x21c_scripted = cmd;
|
||||
DeliverCmd(EBodyStateCmd::Scripted);
|
||||
}
|
||||
void DeliverCmd(const CBCCoverCmd& cmd)
|
||||
{
|
||||
x230_cover = cmd;
|
||||
DeliverCmd(EBodyStateCmd::Cover);
|
||||
}
|
||||
void DeliverCmd(const CBCWallHangCmd& cmd)
|
||||
{
|
||||
x254_wallHang = cmd;
|
||||
DeliverCmd(EBodyStateCmd::WallHang);
|
||||
}
|
||||
void DeliverCmd(const CBCAdditiveAimCmd& cmd)
|
||||
{
|
||||
x270_additiveAim = cmd;
|
||||
DeliverCmd(EBodyStateCmd::AdditiveAim);
|
||||
}
|
||||
void DeliverCmd(const CBCAdditiveFlinchCmd& cmd)
|
||||
{
|
||||
x278_additiveFlinch = cmd;
|
||||
DeliverCmd(EBodyStateCmd::AdditiveFlinch);
|
||||
}
|
||||
void DeliverCmd(const CBCAdditiveReactionCmd& cmd)
|
||||
{
|
||||
x284_additiveReaction = cmd;
|
||||
DeliverCmd(EBodyStateCmd::AdditiveReaction);
|
||||
}
|
||||
void DeliverCmd(const CBCLocomotionCmd& cmd);
|
||||
void DeliverTargetVector(const zeus::CVector3f&);
|
||||
void DeliverAdditiveTargetVector(const zeus::CVector3f&);
|
||||
void SetSteeringBlendSpeed(float);
|
||||
|
@ -74,5 +391,6 @@ public:
|
|||
s32 GetNumSteerCmds() const;
|
||||
zeus::CVector3f GetAdditiveTargetVector() const;
|
||||
};
|
||||
|
||||
}
|
||||
#endif // __URDE_CBODYSTATECMDMGR_HPP__
|
||||
|
|
|
@ -87,6 +87,7 @@ set(CHARACTER_SOURCES
|
|||
CBodyState.hpp CBodyState.cpp
|
||||
CBodyStateCmdMgr.hpp CBodyStateCmdMgr.cpp
|
||||
CBodyController.hpp CBodyController.cpp
|
||||
CGroundMovement.hpp CGroundMovement.cpp)
|
||||
CGroundMovement.hpp CGroundMovement.cpp
|
||||
CSteeringBehaviors.hpp CSteeringBehaviors.cpp)
|
||||
|
||||
runtime_add_list(Character CHARACTER_SOURCES)
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
#include "CSteeringBehaviors.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
|
||||
zeus::CVector3f CSteeringBehaviors::ProjectOrbitalPosition(const zeus::CVector3f&, const zeus::CVector3f&,
|
||||
const zeus::CVector3f&, float)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef __URDE_CSTEERINGBEHAVIORS_HPP__
|
||||
#define __URDE_CSTEERINGBEHAVIORS_HPP__
|
||||
|
||||
#include "RetroTypes.hpp"
|
||||
#include "zeus/CVector3f.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
|
||||
class CSteeringBehaviors
|
||||
{
|
||||
public:
|
||||
static zeus::CVector3f ProjectOrbitalPosition(const zeus::CVector3f&, const zeus::CVector3f&,
|
||||
const zeus::CVector3f&, float);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __URDE_CSTEERINGBEHAVIORS_HPP__
|
|
@ -28,7 +28,7 @@ enum class EFallState
|
|||
|
||||
enum class EReactionType
|
||||
{
|
||||
|
||||
Invalid = -1
|
||||
};
|
||||
|
||||
enum class EAdditiveReactionType
|
||||
|
@ -38,52 +38,52 @@ enum class EAdditiveReactionType
|
|||
|
||||
enum class EJumpType
|
||||
{
|
||||
|
||||
Zero
|
||||
};
|
||||
|
||||
enum class EStepDirection
|
||||
{
|
||||
|
||||
Invalid = -1
|
||||
};
|
||||
|
||||
enum class EStepType
|
||||
{
|
||||
|
||||
Zero
|
||||
};
|
||||
|
||||
enum class ESeverity
|
||||
{
|
||||
|
||||
Invalid = -1
|
||||
};
|
||||
|
||||
enum class EGetupType
|
||||
{
|
||||
|
||||
Invalid = -1
|
||||
};
|
||||
|
||||
enum class ELoopAttackType
|
||||
{
|
||||
|
||||
Invalid = -1
|
||||
};
|
||||
|
||||
enum class EGenerateType
|
||||
{
|
||||
|
||||
Invalid = -1
|
||||
};
|
||||
|
||||
enum class ESlideType
|
||||
{
|
||||
|
||||
Invalid = -1
|
||||
};
|
||||
|
||||
enum class ETauntType
|
||||
{
|
||||
|
||||
Invalid = -1
|
||||
};
|
||||
|
||||
enum class ECoverDirection
|
||||
{
|
||||
|
||||
Invalid = -1
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -94,9 +94,37 @@ enum class EBodyType
|
|||
Two,
|
||||
Three
|
||||
};
|
||||
|
||||
enum class EBodyStateCmd
|
||||
{
|
||||
|
||||
Getup,
|
||||
Step,
|
||||
Two,
|
||||
KnockDown,
|
||||
KnockBack,
|
||||
MeleeAttack,
|
||||
ProjectileAttack,
|
||||
LoopAttack,
|
||||
LoopReaction,
|
||||
LoopHitReaction,
|
||||
Ten,
|
||||
Eleven,
|
||||
Twelve,
|
||||
Thirteen,
|
||||
Generate,
|
||||
Hurled,
|
||||
Jump,
|
||||
Slide,
|
||||
Taunt,
|
||||
Scripted,
|
||||
Cover,
|
||||
WallHang,
|
||||
TwentyTwo,
|
||||
TwentyThree,
|
||||
AdditiveAim,
|
||||
AdditiveFlinch,
|
||||
AdditiveReaction,
|
||||
TwentySeven
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@ set(MP1_WORLD_SOURCES
|
|||
CBabygoth.hpp CBabygoth.cpp
|
||||
CMetroidPrimeRelay.hpp CMetroidPrimeRelay.cpp
|
||||
CActorContraption.hpp CActorContraption.cpp
|
||||
CThardusRockProjectile.hpp CThardusRockProjectile.cpp)
|
||||
CThardusRockProjectile.hpp CThardusRockProjectile.cpp
|
||||
CMetroidBeta.hpp CMetroidBeta.cpp
|
||||
CMetroid.hpp CMetroid.cpp)
|
||||
|
||||
runtime_add_list(World MP1_WORLD_SOURCES)
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
#include "CMetroid.hpp"
|
||||
#include "World/ScriptLoader.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
namespace MP1
|
||||
{
|
||||
|
||||
CMetroidData::CMetroidData(CInputStream& in)
|
||||
: x0_dVuln1(in), x68_dVuln2(in),
|
||||
xd0_(in.readFloatBig()),
|
||||
xd4_(in.readFloatBig()),
|
||||
xd8_(in.readFloatBig()),
|
||||
xdc_(in.readFloatBig()),
|
||||
xe0_(in.readFloatBig()),
|
||||
xe4_(in.readFloatBig())
|
||||
{
|
||||
xe8_animParms1 = ScriptLoader::LoadAnimationParameters(in);
|
||||
xf8_animParms2 = ScriptLoader::LoadAnimationParameters(in);
|
||||
x108_animParms3 = ScriptLoader::LoadAnimationParameters(in);
|
||||
x118_animParms4 = ScriptLoader::LoadAnimationParameters(in);
|
||||
x128_24_ = in.readBool();
|
||||
}
|
||||
|
||||
CMetroid::CMetroid(TUniqueId uid, const std::string& name, EFlavorType flavor, const CEntityInfo& info,
|
||||
const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo,
|
||||
const CActorParameters& aParms, const CMetroidData& metroidData)
|
||||
: CPatterned(ECharacter::Metroid, uid, name, flavor, info, xf, std::move(mData), pInfo,
|
||||
EMovementType::Flyer, EColliderType::One, EBodyType::Three, aParms, true)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
#ifndef CMETROID_HPP
|
||||
#define CMETROID_HPP
|
||||
|
||||
#include "World/CPatterned.hpp"
|
||||
#include "World/CAnimationParameters.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
namespace MP1
|
||||
{
|
||||
|
||||
class CMetroidData
|
||||
{
|
||||
CDamageVulnerability x0_dVuln1;
|
||||
CDamageVulnerability x68_dVuln2;
|
||||
float xd0_;
|
||||
float xd4_;
|
||||
float xd8_;
|
||||
float xdc_;
|
||||
float xe0_;
|
||||
float xe4_;
|
||||
std::experimental::optional<CAnimationParameters> xe8_animParms1;
|
||||
std::experimental::optional<CAnimationParameters> xf8_animParms2;
|
||||
std::experimental::optional<CAnimationParameters> x108_animParms3;
|
||||
std::experimental::optional<CAnimationParameters> x118_animParms4;
|
||||
bool x128_24_ : 1;
|
||||
public:
|
||||
CMetroidData(CInputStream& in);
|
||||
};
|
||||
|
||||
class CMetroid : public CPatterned
|
||||
{
|
||||
public:
|
||||
static constexpr ECharacter CharacterType = ECharacter::Metroid;
|
||||
CMetroid(TUniqueId uid, const std::string& name, EFlavorType flavor, const CEntityInfo& info,
|
||||
const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo,
|
||||
const CActorParameters& aParms, const CMetroidData& metroidData);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // CMETROID_HPP
|
|
@ -0,0 +1,18 @@
|
|||
#include "CMetroidBeta.hpp"
|
||||
#include "World/ScriptLoader.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
namespace MP1
|
||||
{
|
||||
|
||||
CMetroidBeta::CMetroidBeta(TUniqueId uid, const std::string& name, const CEntityInfo& info,
|
||||
const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo,
|
||||
const CActorParameters& aParms, const CMetroidData& metroidData)
|
||||
: CPatterned(ECharacter::MetroidBeta, uid, name, EFlavorType::One, info, xf, std::move(mData), pInfo,
|
||||
EMovementType::Flyer, EColliderType::One, EBodyType::Three, aParms, 2)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
#ifndef CMETROIDBETA_HPP
|
||||
#define CMETROIDBETA_HPP
|
||||
|
||||
#include "World/CPatterned.hpp"
|
||||
#include "CMetroid.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
namespace MP1
|
||||
{
|
||||
|
||||
class CMetroidBeta : public CPatterned
|
||||
{
|
||||
public:
|
||||
static constexpr ECharacter CharacterType = ECharacter::MetroidBeta;
|
||||
CMetroidBeta(TUniqueId uid, const std::string& name, const CEntityInfo& info,
|
||||
const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo,
|
||||
const CActorParameters& aParms, const CMetroidData& metroidData);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // CMETROIDBETA_HPP
|
|
@ -40,4 +40,10 @@ void CPlayerGun::TouchModel(CStateManager& stateMgr)
|
|||
|
||||
}
|
||||
|
||||
void CPlayerGun::DamageRumble(const zeus::CVector3f& location, float damage, const CStateManager& mgr)
|
||||
{
|
||||
x398_damageAmt = damage;
|
||||
x3dc_damageLocation = location;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -105,11 +105,11 @@ private:
|
|||
float x38c_ = 0.f;
|
||||
float x390_ = 0.f;
|
||||
float x394_ = 0.f;
|
||||
float x398_ = 0.f;
|
||||
float x398_damageAmt = 0.f;
|
||||
float x39c_ = 0.f;
|
||||
float x3a0_ = 0.f;
|
||||
CFidget x3a4_fidget;
|
||||
zeus::CVector3f x3dc_;
|
||||
zeus::CVector3f x3dc_damageLocation;
|
||||
zeus::CTransform x3e8_;
|
||||
zeus::CTransform x418_;
|
||||
zeus::CTransform x448_;
|
||||
|
@ -221,6 +221,7 @@ public:
|
|||
const CGunMorph& GetGunMorph() const { return x678_morph; }
|
||||
void SetX3e8(const zeus::CTransform& xf) { x3e8_ = xf; }
|
||||
CGrappleArm& GetGrappleArm() { return *x740_grappleArm; }
|
||||
void DamageRumble(const zeus::CVector3f& location, float damage, const CStateManager& mgr);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -78,6 +78,9 @@ protected:
|
|||
public:
|
||||
enum class EFluidState
|
||||
{
|
||||
Zero,
|
||||
One,
|
||||
Two
|
||||
};
|
||||
|
||||
enum class EScanState
|
||||
|
|
|
@ -50,6 +50,7 @@ public:
|
|||
float GetDamage(const CDamageVulnerability& dVuln) const;
|
||||
float GetRadiusDamage() const { return xc_radiusDamage; }
|
||||
float GetRadiusDamage(const CDamageVulnerability& dVuln) const;
|
||||
bool GetX18() const { return x18_; }
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -75,10 +75,10 @@ public:
|
|||
bool WeaponHits(const CWeaponMode& mode, bool checkDirect) const;
|
||||
EVulnerability GetVulnerability(const CWeaponMode& mode, bool ignoreDirect) const;
|
||||
|
||||
static CDamageVulnerability NormalVulnerabilty() { return sNormalVulnerability; }
|
||||
static CDamageVulnerability ImmuneVulnerabilty() { return sImmuneVulnerability; }
|
||||
static CDamageVulnerability ReflectVulnerabilty() { return sReflectVulnerability; }
|
||||
static CDamageVulnerability PasshThroughVulnerabilty() { return sPassThroughVulnerability; }
|
||||
static const CDamageVulnerability& NormalVulnerabilty() { return sNormalVulnerability; }
|
||||
static const CDamageVulnerability& ImmuneVulnerabilty() { return sImmuneVulnerability; }
|
||||
static const CDamageVulnerability& ReflectVulnerabilty() { return sReflectVulnerability; }
|
||||
static const CDamageVulnerability& PasshThroughVulnerabilty() { return sPassThroughVulnerability; }
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@ class CEnvFxManager
|
|||
|
||||
rstl::reserved_vector<CEnvFxManagerGrid, 64> x50_grids;
|
||||
|
||||
float xb54_;
|
||||
TLockedToken<CGenDescription> xb58_envRainSplash;
|
||||
bool xb64_ = true;
|
||||
|
||||
|
@ -76,6 +77,7 @@ public:
|
|||
void MoveWrapCells(s32, s32);
|
||||
void GetParticleBoundsToWorldScale() const;
|
||||
void AreaLoaded();
|
||||
void SetXB54(float f) { xb54_ = f; }
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -32,6 +32,11 @@ float CFluidPlaneManager::GetLastRippleDeltaTime(TUniqueId rippler) const
|
|||
return x0_rippleManager.GetLastRippleDeltaTime(rippler);
|
||||
}
|
||||
|
||||
float CFluidPlaneManager::GetLastSplashDeltaTime(TUniqueId splasher) const
|
||||
{
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
void CFluidPlaneManager::CreateSplash(TUniqueId splasher, CStateManager& mgr, const CScriptWater& water,
|
||||
const zeus::CVector3f& pos, float factor, bool)
|
||||
{
|
||||
|
|
|
@ -25,6 +25,7 @@ public:
|
|||
void EndFrame() { x121_ = false; }
|
||||
void Update(float dt);
|
||||
float GetLastRippleDeltaTime(TUniqueId rippler) const;
|
||||
float GetLastSplashDeltaTime(TUniqueId splasher) const;
|
||||
void CreateSplash(TUniqueId splasher, CStateManager& mgr, const CScriptWater& water,
|
||||
const zeus::CVector3f& pos, float factor, bool);
|
||||
};
|
||||
|
|
|
@ -32,6 +32,7 @@ public:
|
|||
private:
|
||||
CPlayer& x0_player;
|
||||
u32 x187c_ = 0;
|
||||
float x191c_damageTimer = 0.f;
|
||||
float x1DE8_boostTime = 0.f;
|
||||
CMorphBallShadow* x1e50_shadow = nullptr;
|
||||
|
||||
|
@ -136,6 +137,7 @@ public:
|
|||
void DrawBallShadow(const CStateManager& mgr);
|
||||
void StartLandingSfx() {}
|
||||
bool GetX187c() const { return x187c_; }
|
||||
void SetDamageTimer(float t) { x191c_damageTimer = t; }
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ CMaterialList gkPatternedFlyerMaterialList(EMaterialTypes::Character, EMaterialT
|
|||
CPatterned::CPatterned(ECharacter character, TUniqueId uid, const std::string& name, CPatterned::EFlavorType flavor,
|
||||
const CEntityInfo& info, const zeus::CTransform& xf, CModelData&& mData,
|
||||
const CPatternedInfo& pInfo, CPatterned::EMovementType moveType, CPatterned::EColliderType,
|
||||
EBodyType, const CActorParameters& actorParms, bool)
|
||||
EBodyType, const CActorParameters& actorParms, int variant)
|
||||
: CAi(uid, pInfo.xf8_active, name, info, xf, std::move(mData),
|
||||
zeus::CAABox(pInfo.xcc_bodyOrigin - zeus::CVector3f{pInfo.xc4_halfExtent, pInfo.xc4_halfExtent, 0.f},
|
||||
pInfo.xcc_bodyOrigin +
|
||||
|
|
|
@ -75,7 +75,7 @@ public:
|
|||
CPatterned(ECharacter character, TUniqueId uid, const std::string& name, EFlavorType flavor, const CEntityInfo& info,
|
||||
const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pinfo,
|
||||
CPatterned::EMovementType movement, EColliderType collider, EBodyType body,
|
||||
const CActorParameters& params, bool b1);
|
||||
const CActorParameters& params, int variant);
|
||||
|
||||
virtual void Death(CStateManager&, const zeus::CVector3f&, EStateMsg) {}
|
||||
virtual void KnockBack(const zeus::CVector3f&, CStateManager&, const CDamageInfo& info, EKnockBackType, bool, float) {}
|
||||
|
|
|
@ -13,8 +13,11 @@
|
|||
#include "CScriptGrapplePoint.hpp"
|
||||
#include "CPatterned.hpp"
|
||||
#include "CScriptWater.hpp"
|
||||
#include "CDependencyGroup.hpp"
|
||||
#include "Character/CSteeringBehaviors.hpp"
|
||||
#include "Weapon/CEnergyProjectile.hpp"
|
||||
#include "MP1/World/CThardusRockProjectile.hpp"
|
||||
#include "MP1/World/CMetroidBeta.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
|
@ -122,33 +125,248 @@ bool CPlayer::IsPlayerDeadEnough() const
|
|||
|
||||
void CPlayer::AsyncLoadSuit(CStateManager& mgr) { x490_gun->AsyncLoadSuit(mgr); }
|
||||
|
||||
void CPlayer::LoadAnimationTokens() {}
|
||||
void CPlayer::LoadAnimationTokens()
|
||||
{
|
||||
TLockedToken<CDependencyGroup> transGroup = g_SimplePool->GetObj("BallTransition_DGRP");
|
||||
CDependencyGroup& group = *transGroup;
|
||||
x25c_ballTransitionsRes.reserve(group.GetObjectTagVector().size());
|
||||
for (const SObjectTag& tag : group.GetObjectTagVector())
|
||||
{
|
||||
if (tag.type == FOURCC('CMDL') || tag.type == FOURCC('CSKR') || tag.type == FOURCC('TXTR'))
|
||||
continue;
|
||||
x25c_ballTransitionsRes.push_back(g_SimplePool->GetObj(tag));
|
||||
}
|
||||
}
|
||||
|
||||
bool CPlayer::HasTransitionBeamModel() const
|
||||
{
|
||||
return x7f0_ballTransitionBeamModel && !x7f0_ballTransitionBeamModel->IsNull();
|
||||
}
|
||||
|
||||
bool CPlayer::CanRenderUnsorted(CStateManager& mgr) const { return false; }
|
||||
|
||||
const CDamageVulnerability* CPlayer::GetDamageVulnerability(const zeus::CVector3f& v1, const zeus::CVector3f& v2,
|
||||
const CDamageInfo& info) const
|
||||
{
|
||||
return nullptr;
|
||||
if (x2f8_morphTransState == EPlayerMorphBallState::Morphed && x570_ > 0.f && !info.GetX18())
|
||||
return &CDamageVulnerability::ImmuneVulnerabilty();
|
||||
return &CDamageVulnerability::NormalVulnerabilty();
|
||||
}
|
||||
|
||||
const CDamageVulnerability* CPlayer::GetDamageVulnerability() const { return nullptr; }
|
||||
const CDamageVulnerability* CPlayer::GetDamageVulnerability() const
|
||||
{
|
||||
CDamageInfo info(CWeaponMode(EWeaponType::Power, false, false, false), 0.f, 0.f, 0.f);
|
||||
return GetDamageVulnerability(zeus::CVector3f::skZero, zeus::CVector3f::skUp, info);
|
||||
}
|
||||
|
||||
zeus::CVector3f CPlayer::GetHomingPosition(CStateManager& mgr, float) const { return {}; }
|
||||
zeus::CVector3f CPlayer::GetHomingPosition(CStateManager& mgr, float dt) const
|
||||
{
|
||||
if (dt > 0.f)
|
||||
return x34_transform.origin + PredictMotion(dt).x0_translation;
|
||||
return x34_transform.origin;
|
||||
}
|
||||
|
||||
zeus::CVector3f CPlayer::GetAimPosition(CStateManager& mgr, float) const { return {}; }
|
||||
zeus::CVector3f CPlayer::GetAimPosition(CStateManager& mgr, float dt) const
|
||||
{
|
||||
zeus::CVector3f ret = x34_transform.origin;
|
||||
if (dt > 0.f)
|
||||
{
|
||||
if (x304_orbitState == EPlayerOrbitState::Zero)
|
||||
ret += PredictMotion(dt).x0_translation;
|
||||
else
|
||||
ret = CSteeringBehaviors::ProjectOrbitalPosition(ret, x138_velocity, x314_orbitPoint, dt);
|
||||
}
|
||||
|
||||
void CPlayer::FluidFXThink(CActor::EFluidState, CScriptWater& water, CStateManager& mgr) {}
|
||||
if (x2f8_morphTransState == EPlayerMorphBallState::Morphed)
|
||||
ret.z += g_tweakPlayer->GetPlayerBallHalfExtent();
|
||||
else
|
||||
ret.z += GetEyeHeight();
|
||||
|
||||
zeus::CVector3f CPlayer::GetDamageLocationWR() const { return {}; }
|
||||
return ret;
|
||||
}
|
||||
|
||||
float CPlayer::GetPrevDamageAmount() const { return 0.f; }
|
||||
void CPlayer::FluidFXThink(EFluidState state, CScriptWater& water, CStateManager& mgr)
|
||||
{
|
||||
if (x2f8_morphTransState == EPlayerMorphBallState::Morphed)
|
||||
{
|
||||
x768_morphball->FluidFXThink(state, water, mgr);
|
||||
if (state == EFluidState::One)
|
||||
x9c5_30_ = true;
|
||||
}
|
||||
else if (x2f8_morphTransState != EPlayerMorphBallState::Unmorphed)
|
||||
{
|
||||
if (mgr.GetFluidPlaneManager()->GetLastSplashDeltaTime(x8_uid) >= 0.2f)
|
||||
{
|
||||
zeus::CVector3f position(x34_transform.origin);
|
||||
position.z = water.GetTriggerBoundsWR().max.z;
|
||||
mgr.GetFluidPlaneManager()->CreateSplash(x8_uid, mgr, water, position, 0.1f,
|
||||
state == EFluidState::Zero);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mgr.GetFluidPlaneManager()->GetLastSplashDeltaTime(x8_uid) >= 0.2f)
|
||||
{
|
||||
zeus::CVector3f posOffset = x50c_;
|
||||
if (posOffset.canBeNormalized())
|
||||
posOffset = posOffset.normalized() * zeus::CVector3f(1.2f, 1.2f, 0.f);
|
||||
switch (state)
|
||||
{
|
||||
case EFluidState::Zero:
|
||||
{
|
||||
bool doSplash = true;
|
||||
if (x4fc_ > 12.5f)
|
||||
{
|
||||
zeus::CVector3f lookDir = x34_transform.basis[1].normalized();
|
||||
zeus::CVector3f dcVel = GetDampedClampedVelocityWR();
|
||||
dcVel.z = 0.f;
|
||||
if (lookDir.dot(dcVel.normalized()) > 0.75f)
|
||||
doSplash = false;
|
||||
}
|
||||
if (doSplash)
|
||||
{
|
||||
zeus::CVector3f position = x34_transform.origin + posOffset;
|
||||
position.z = water.GetTriggerBoundsWR().max.z;
|
||||
mgr.GetFluidPlaneManager()->CreateSplash(x8_uid, mgr, water, position, 0.3f, true);
|
||||
if (water.GetFluidPlane().GetFluidType() == CFluidPlane::EFluidType::Zero)
|
||||
{
|
||||
float velMag = mgr.GetPlayer().GetVelocity().magnitude() / 10.f;
|
||||
mgr.GetEnvFxManager()->SetXB54(10.f * std::max(1.f, velMag));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case EFluidState::One:
|
||||
{
|
||||
if (x138_velocity.magnitude() > 1.f &&
|
||||
mgr.GetFluidPlaneManager()->GetLastRippleDeltaTime(x8_uid) >= 0.2f)
|
||||
{
|
||||
zeus::CVector3f position(x34_transform.origin);
|
||||
position.z = water.GetTriggerBoundsWR().max.z;
|
||||
water.GetFluidPlane().Ripple(0.5f, x8_uid, position, water, mgr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case EFluidState::Two:
|
||||
{
|
||||
zeus::CVector3f position = x34_transform.origin + posOffset;
|
||||
position.z = water.GetTriggerBoundsWR().max.z;
|
||||
mgr.GetFluidPlaneManager()->CreateSplash(x8_uid, mgr, water, position, 0.15f, true);
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float CPlayer::GetDamageAmount() const { return 0.f; }
|
||||
void CPlayer::TakeDamage(bool significant, const zeus::CVector3f& location,
|
||||
float dam, EWeaponType type, CStateManager& mgr)
|
||||
{
|
||||
if (!significant)
|
||||
return;
|
||||
if (dam >= 0.f)
|
||||
{
|
||||
x570_ = 0.5f;
|
||||
x55c_damageAmt = dam;
|
||||
x560_prevDamageAmt = (type == EWeaponType::AI && dam == 0.00002f) ? 10.f : dam;
|
||||
x564_damageLocation = location;
|
||||
x558_wasDamaged = true;
|
||||
|
||||
bool CPlayer::WasDamaged() const { return false; }
|
||||
bool doRumble = false;
|
||||
u16 suitDamageSfx = 0, damageLoopSfx = 0, damageSamusVoiceSfx = 0;
|
||||
|
||||
void CPlayer::TakeDamage(bool, const zeus::CVector3f&, float, EWeaponType, CStateManager& mgr) {}
|
||||
switch (type)
|
||||
{
|
||||
case EWeaponType::Phazon:
|
||||
case EWeaponType::Unused2:
|
||||
damageLoopSfx = 3114;
|
||||
damageSamusVoiceSfx = 1653;
|
||||
break;
|
||||
case EWeaponType::PoisonWater:
|
||||
damageLoopSfx = 1486;
|
||||
damageSamusVoiceSfx = 1633;
|
||||
break;
|
||||
case EWeaponType::Lava:
|
||||
damageLoopSfx = 657;
|
||||
case EWeaponType::Hot:
|
||||
damageSamusVoiceSfx = 1656;
|
||||
break;
|
||||
default:
|
||||
if (x2f8_morphTransState == EPlayerMorphBallState::Unmorphed)
|
||||
{
|
||||
if (dam > 30.f)
|
||||
damageSamusVoiceSfx = 1512;
|
||||
else if (dam > 15.f)
|
||||
damageSamusVoiceSfx = 1511;
|
||||
else
|
||||
damageSamusVoiceSfx = 1489;
|
||||
suitDamageSfx = 1467;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dam > 30.f)
|
||||
suitDamageSfx = 1514;
|
||||
else if (dam > 15.f)
|
||||
suitDamageSfx = 1513;
|
||||
else
|
||||
suitDamageSfx = 1491;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (damageSamusVoiceSfx && x774_samusVoiceTimeout <= 0.f)
|
||||
{
|
||||
StartSamusVoiceSfx(damageSamusVoiceSfx, 1.f, 8);
|
||||
x774_samusVoiceTimeout = mgr.GetActiveRandom()->Range(3.f, 4.f);
|
||||
doRumble = true;
|
||||
}
|
||||
|
||||
if (damageLoopSfx && !x9c7_24_ && x2ac_movementSurface >= EPlayerMovementSurface::Ice)
|
||||
{
|
||||
if (!x770_damageLoopSfx || x788_damageLoopSfxId != damageLoopSfx)
|
||||
{
|
||||
if (x770_damageLoopSfx && x788_damageLoopSfxId != damageLoopSfx)
|
||||
CSfxManager::SfxStop(x770_damageLoopSfx);
|
||||
x770_damageLoopSfx = CSfxManager::SfxStart(damageLoopSfx, 1.f, 0.f, false, 0x7f, true, kInvalidAreaId);
|
||||
x788_damageLoopSfxId = damageLoopSfx;
|
||||
}
|
||||
x784_ = 0.5f;
|
||||
}
|
||||
|
||||
if (suitDamageSfx)
|
||||
{
|
||||
if (x770_damageLoopSfx)
|
||||
{
|
||||
CSfxManager::SfxStop(x770_damageLoopSfx);
|
||||
x770_damageLoopSfx.reset();
|
||||
}
|
||||
x770_damageLoopSfx = CSfxManager::SfxStart(suitDamageSfx, 1.f, 0.f, false, 0x7f, true, kInvalidAreaId);
|
||||
x788_damageLoopSfxId = suitDamageSfx;
|
||||
xa2c_ = 0;
|
||||
doRumble = true;
|
||||
}
|
||||
|
||||
if (doRumble)
|
||||
{
|
||||
if (x2f8_morphTransState == EPlayerMorphBallState::Unmorphed)
|
||||
x490_gun->DamageRumble(location, dam, mgr);
|
||||
float tmp = x55c_damageAmt / 25.f;
|
||||
if (std::fabs(tmp) > 1.f)
|
||||
tmp = tmp > 0.f ? 1.f : -1.f;
|
||||
mgr.GetRumbleManager().Rumble(mgr, ERumbleFxId::Eleven, ERumblePriority::One);
|
||||
}
|
||||
|
||||
if (x2f8_morphTransState != EPlayerMorphBallState::Unmorphed)
|
||||
{
|
||||
x768_morphball->TakeDamage(x55c_damageAmt);
|
||||
x768_morphball->SetDamageTimer(0.4f);
|
||||
}
|
||||
}
|
||||
|
||||
if (x3b8_)
|
||||
BreakGrapple(EPlayerOrbitRequest::Eleven, mgr);
|
||||
}
|
||||
|
||||
void CPlayer::Accept(IVisitor& visitor)
|
||||
{
|
||||
|
@ -157,7 +375,16 @@ void CPlayer::Accept(IVisitor& visitor)
|
|||
|
||||
CHealthInfo* CPlayer::HealthInfo(const CStateManager& mgr) { return &mgr.GetPlayerState()->HealthInfo(); }
|
||||
|
||||
bool CPlayer::IsUnderBetaMetroidAttack(CStateManager& mgr) const { return false; }
|
||||
bool CPlayer::IsUnderBetaMetroidAttack(CStateManager& mgr) const
|
||||
{
|
||||
if (x274_energyDrain.GetEnergyDrainIntensity() > 0.f)
|
||||
{
|
||||
for (const CEnergyDrainSource& source : x274_energyDrain.GetEnergyDrainSources())
|
||||
if (CPatterned::CastTo<MP1::CMetroidBeta>(mgr.GetObjectById(source.GetEnergyDrainSourceId())))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
rstl::optional_object<zeus::CAABox> CPlayer::GetTouchBounds() const { return {}; }
|
||||
|
||||
|
@ -252,10 +479,10 @@ void CPlayer::Think(float, CStateManager&) {}
|
|||
|
||||
void CPlayer::PreThink(float dt, CStateManager& mgr)
|
||||
{
|
||||
x558_ = false;
|
||||
x55c_ = 0.f;
|
||||
x560_ = 0.f;
|
||||
x564_ = zeus::CVector3f::skZero;
|
||||
x558_wasDamaged = false;
|
||||
x55c_damageAmt = 0.f;
|
||||
x560_prevDamageAmt = 0.f;
|
||||
x564_damageLocation = zeus::CVector3f::skZero;
|
||||
xa04_ = dt;
|
||||
}
|
||||
|
||||
|
@ -299,10 +526,10 @@ void CPlayer::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CState
|
|||
{
|
||||
landSfx = GetMaterialSoundUnderPlayer(mgr, skPlayerLandSfxHard, 24, 0xffff);
|
||||
StartSamusVoiceSfx(1550, 1.f, 5);
|
||||
x55c_ = 0.f;
|
||||
x560_ = 10.f;
|
||||
x564_ = x34_transform.origin;
|
||||
x558_ = true;
|
||||
x55c_damageAmt = 0.f;
|
||||
x560_prevDamageAmt = 10.f;
|
||||
x564_damageLocation = x34_transform.origin;
|
||||
x558_wasDamaged = true;
|
||||
mgr.GetCameraManager()->AddCameraShaker(
|
||||
CCameraShakeData::BuildLandingCameraShakeData(0.3f, 1.25f), false);
|
||||
StartLandingControlFreeze();
|
||||
|
@ -533,7 +760,7 @@ void CPlayer::ApplyGrappleJump(CStateManager& mgr) {}
|
|||
|
||||
void CPlayer::BeginGrapple(zeus::CVector3f&, CStateManager& mgr) {}
|
||||
|
||||
void CPlayer::BreakGrapple(CStateManager& mgr) {}
|
||||
void CPlayer::BreakGrapple(EPlayerOrbitRequest, CStateManager& mgr) {}
|
||||
|
||||
void CPlayer::SetOrbitRequest(EPlayerOrbitRequest req, CStateManager& mgr)
|
||||
{
|
||||
|
@ -886,7 +1113,7 @@ void CPlayer::ComputeMovement(const CFinalInput& input, CStateManager& mgr, floa
|
|||
|
||||
float CPlayer::GetWeight() const { return 0.f; }
|
||||
|
||||
float CPlayer::GetDampedClampedVelocityWR() const { return 0.f; }
|
||||
zeus::CVector3f CPlayer::GetDampedClampedVelocityWR() const { return {}; }
|
||||
|
||||
void CPlayer::UpdateCinematicState(CStateManager& mgr)
|
||||
{
|
||||
|
|
|
@ -65,7 +65,8 @@ public:
|
|||
Seven,
|
||||
Eight,
|
||||
Nine,
|
||||
Ten
|
||||
Ten,
|
||||
Eleven
|
||||
};
|
||||
|
||||
enum class EPlayerZoneInfo
|
||||
|
@ -164,7 +165,7 @@ private:
|
|||
};
|
||||
|
||||
EPlayerMovementState x258_movementState = EPlayerMovementState::OnGround;
|
||||
std::vector<u32> x25c_;
|
||||
std::vector<CToken> x25c_ballTransitionsRes;
|
||||
TUniqueId x26c_ = kInvalidUniqueId;
|
||||
float x270_ = 0.f;
|
||||
CPlayerEnergyDrain x274_energyDrain = CPlayerEnergyDrain(4);
|
||||
|
@ -256,10 +257,10 @@ private:
|
|||
zeus::CVector3f x53c_ = x34_transform.basis[1];
|
||||
zeus::CVector3f x548_ = x34_transform.basis[1];
|
||||
float x554_ = x34_transform.basis[1].x;
|
||||
bool x558_ = false;
|
||||
float x55c_ = 0.f;
|
||||
float x560_ = 0.f;
|
||||
zeus::CVector3f x564_;
|
||||
bool x558_wasDamaged = false;
|
||||
float x55c_damageAmt = 0.f;
|
||||
float x560_prevDamageAmt = 0.f;
|
||||
zeus::CVector3f x564_damageLocation;
|
||||
float x570_ = 0.f;
|
||||
float x574_morphTime = 0.f;
|
||||
float x578_morphDuration = 0.f;
|
||||
|
@ -282,13 +283,13 @@ private:
|
|||
float x764_controlsFrozenTimeout = 0.f;
|
||||
std::unique_ptr<CMorphBall> x768_morphball;
|
||||
std::unique_ptr<CPlayerCameraBob> x76c_cameraBob;
|
||||
CSfxHandle x770_;
|
||||
float x774_ = 0.f;
|
||||
CSfxHandle x770_damageLoopSfx;
|
||||
float x774_samusVoiceTimeout = 0.f;
|
||||
u32 x778_ = 0;
|
||||
CSfxHandle x77c_samusVoiceSfx;
|
||||
int x780_samusVoicePriority = 0;
|
||||
float x784_ = 0.f;
|
||||
u16 x788_ = 0;
|
||||
u16 x788_damageLoopSfxId = 0;
|
||||
float x78c_ = 0.f;
|
||||
u32 x790_ = 0;
|
||||
zeus::CVector3f x794_;
|
||||
|
@ -385,6 +386,7 @@ public:
|
|||
bool IsPlayerDeadEnough() const;
|
||||
void AsyncLoadSuit(CStateManager& mgr);
|
||||
void LoadAnimationTokens();
|
||||
bool HasTransitionBeamModel() const;
|
||||
virtual bool CanRenderUnsorted(CStateManager& mgr) const;
|
||||
virtual const CDamageVulnerability* GetDamageVulnerability(const zeus::CVector3f& v1, const zeus::CVector3f& v2,
|
||||
const CDamageInfo& info) const;
|
||||
|
@ -392,10 +394,10 @@ public:
|
|||
virtual zeus::CVector3f GetHomingPosition(CStateManager& mgr, float) const;
|
||||
zeus::CVector3f GetAimPosition(CStateManager& mgr, float) const;
|
||||
virtual void FluidFXThink(CActor::EFluidState, CScriptWater& water, CStateManager& mgr);
|
||||
zeus::CVector3f GetDamageLocationWR() const;
|
||||
float GetPrevDamageAmount() const;
|
||||
float GetDamageAmount() const;
|
||||
bool WasDamaged() const;
|
||||
zeus::CVector3f GetDamageLocationWR() const { return x564_damageLocation; }
|
||||
float GetPrevDamageAmount() const { return x560_prevDamageAmt; }
|
||||
float GetDamageAmount() const { return x55c_damageAmt; }
|
||||
bool WasDamaged() const { return x558_wasDamaged; }
|
||||
void TakeDamage(bool, const zeus::CVector3f&, float, EWeaponType, CStateManager& mgr);
|
||||
void Accept(IVisitor& visitor);
|
||||
static CHealthInfo* HealthInfo(const CStateManager& mgr);
|
||||
|
@ -449,7 +451,7 @@ public:
|
|||
void UpdateGrappleState(const CFinalInput& input, CStateManager& mgr);
|
||||
void ApplyGrappleJump(CStateManager& mgr);
|
||||
void BeginGrapple(zeus::CVector3f&, CStateManager& mgr);
|
||||
void BreakGrapple(CStateManager& mgr);
|
||||
void BreakGrapple(EPlayerOrbitRequest, CStateManager& mgr);
|
||||
void SetOrbitRequest(EPlayerOrbitRequest req, CStateManager& mgr);
|
||||
void PreventFallingCameraPitch();
|
||||
void OrbitCarcass(CStateManager&);
|
||||
|
@ -511,7 +513,7 @@ public:
|
|||
float ForwardInput(const CFinalInput& input, float) const;
|
||||
void ComputeMovement(const CFinalInput& input, CStateManager& mgr, float);
|
||||
float GetWeight() const;
|
||||
float GetDampedClampedVelocityWR() const;
|
||||
zeus::CVector3f GetDampedClampedVelocityWR() const;
|
||||
const CVisorSteam& GetVisorSteam() const { return x7a0_visorSteam; }
|
||||
float GetVisorStaticAlpha() const { return x74c_visorStaticAlpha; }
|
||||
float GetMapAlpha() const { return x494_mapAlpha; }
|
||||
|
|
|
@ -25,8 +25,6 @@ float CPlayerEnergyDrain::GetEnergyDrainIntensity() const
|
|||
return intensity;
|
||||
}
|
||||
|
||||
float CPlayerEnergyDrain::GetEnergyDrainTime() const { return x10_energyDrainTime; }
|
||||
|
||||
void CPlayerEnergyDrain::ProcessEnergyDrain(const CStateManager& mgr, float dt)
|
||||
{
|
||||
auto it = x0_sources.begin();
|
||||
|
|
|
@ -14,11 +14,11 @@ class CPlayerEnergyDrain
|
|||
|
||||
public:
|
||||
CPlayerEnergyDrain(u32);
|
||||
const std::vector<CEnergyDrainSource>& GetEnergyDrainSources() const;
|
||||
const std::vector<CEnergyDrainSource>& GetEnergyDrainSources() const { return x0_sources; }
|
||||
void AddEnergyDrainSource(TUniqueId, float);
|
||||
void RemoveEnergyDrainSource(TUniqueId id);
|
||||
float GetEnergyDrainIntensity() const;
|
||||
float GetEnergyDrainTime() const;
|
||||
float GetEnergyDrainTime() const { return x10_energyDrainTime; }
|
||||
void ProcessEnergyDrain(const CStateManager&, float);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue