2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-08-15 20:43:04 +00:00
|
|
|
|
2019-09-28 02:53:03 +00:00
|
|
|
#include "Runtime/RetroTypes.hpp"
|
|
|
|
#include "Runtime/rstl.hpp"
|
|
|
|
#include "Runtime/Character/CharacterCommon.hpp"
|
|
|
|
|
|
|
|
#include <zeus/CVector3f.hpp>
|
2016-08-15 20:43:04 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
|
|
|
|
|
|
|
class CBodyStateCmd {
|
|
|
|
EBodyStateCmd x4_cmd;
|
2017-07-05 18:34:12 +00:00
|
|
|
|
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
virtual ~CBodyStateCmd() = default;
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBodyStateCmd(EBodyStateCmd cmd) : x4_cmd(cmd) {}
|
2018-12-08 05:30:43 +00:00
|
|
|
EBodyStateCmd GetCommandId() const { return x4_cmd; }
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCMeleeAttackCmd : public CBodyStateCmd {
|
|
|
|
pas::ESeverity x8_severity = pas::ESeverity::Invalid;
|
|
|
|
zeus::CVector3f xc_targetPos;
|
|
|
|
bool x18_hasTargetPos = false;
|
|
|
|
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCMeleeAttackCmd() : CBodyStateCmd(EBodyStateCmd::MeleeAttack) {}
|
|
|
|
explicit CBCMeleeAttackCmd(pas::ESeverity severity)
|
|
|
|
: CBodyStateCmd(EBodyStateCmd::MeleeAttack), x8_severity(severity) {}
|
|
|
|
explicit CBCMeleeAttackCmd(pas::ESeverity severity, const zeus::CVector3f& target)
|
|
|
|
: CBodyStateCmd(EBodyStateCmd::MeleeAttack), x8_severity(severity), xc_targetPos(target), x18_hasTargetPos(true) {}
|
2018-12-08 05:30:43 +00:00
|
|
|
pas::ESeverity GetAttackSeverity() const { return x8_severity; }
|
|
|
|
bool HasAttackTargetPos() const { return x18_hasTargetPos; }
|
|
|
|
const zeus::CVector3f& GetAttackTargetPos() const { return xc_targetPos; }
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCProjectileAttackCmd : public CBodyStateCmd {
|
|
|
|
pas::ESeverity x8_severity = pas::ESeverity::Invalid;
|
|
|
|
zeus::CVector3f xc_target;
|
|
|
|
bool x18_blendAnims = false;
|
|
|
|
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCProjectileAttackCmd() : CBodyStateCmd(EBodyStateCmd::ProjectileAttack) {}
|
|
|
|
explicit CBCProjectileAttackCmd(pas::ESeverity severity, const zeus::CVector3f& vec, bool b)
|
2018-12-08 05:30:43 +00:00
|
|
|
: CBodyStateCmd(EBodyStateCmd::ProjectileAttack), x8_severity(severity), xc_target(vec), x18_blendAnims(b) {}
|
|
|
|
pas::ESeverity GetAttackSeverity() const { return x8_severity; }
|
|
|
|
const zeus::CVector3f& GetTargetPosition() const { return xc_target; }
|
|
|
|
bool BlendTwoClosest() const { return x18_blendAnims; }
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCStepCmd : public CBodyStateCmd {
|
|
|
|
pas::EStepDirection x8_dir = pas::EStepDirection::Invalid;
|
|
|
|
pas::EStepType xc_type = pas::EStepType::Normal;
|
|
|
|
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCStepCmd() : CBodyStateCmd(EBodyStateCmd::Step) {}
|
|
|
|
explicit CBCStepCmd(pas::EStepDirection dir, pas::EStepType type)
|
2018-12-08 05:30:43 +00:00
|
|
|
: CBodyStateCmd(EBodyStateCmd::Step), x8_dir(dir), xc_type(type) {}
|
|
|
|
pas::EStepDirection GetStepDirection() const { return x8_dir; }
|
|
|
|
pas::EStepType GetStepType() const { return xc_type; }
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCJumpCmd : public CBodyStateCmd {
|
|
|
|
pas::EJumpType x8_type = pas::EJumpType::Normal;
|
|
|
|
zeus::CVector3f xc_waypoint1;
|
|
|
|
zeus::CVector3f x18_waypoint2;
|
2020-04-21 07:22:41 +00:00
|
|
|
bool x24_24_wallJump : 1 = false;
|
|
|
|
bool x24_25_startInJumpLoop : 1 = false;
|
2018-12-08 05:30:43 +00:00
|
|
|
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-04-21 07:22:41 +00:00
|
|
|
explicit CBCJumpCmd() : CBodyStateCmd(EBodyStateCmd::Jump) {}
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCJumpCmd(const zeus::CVector3f& wp1, pas::EJumpType type, bool startInLoop = false)
|
2020-04-21 07:22:41 +00:00
|
|
|
: CBodyStateCmd(EBodyStateCmd::Jump), x8_type(type), xc_waypoint1(wp1), x24_25_startInJumpLoop{startInLoop} {}
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCJumpCmd(const zeus::CVector3f& wp1, const zeus::CVector3f& wp2, pas::EJumpType type)
|
2020-04-21 07:22:41 +00:00
|
|
|
: CBodyStateCmd(EBodyStateCmd::Jump), x8_type(type), xc_waypoint1(wp1), x18_waypoint2(wp2), x24_24_wallJump{true} {}
|
2018-12-08 05:30:43 +00:00
|
|
|
pas::EJumpType GetJumpType() const { return x8_type; }
|
|
|
|
const zeus::CVector3f& GetJumpTarget() const { return xc_waypoint1; }
|
|
|
|
const zeus::CVector3f& GetSecondJumpTarget() const { return x18_waypoint2; }
|
|
|
|
bool IsWallJump() const { return x24_24_wallJump; }
|
|
|
|
bool StartInJumpLoop() const { return x24_25_startInJumpLoop; }
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCGenerateCmd : public CBodyStateCmd {
|
|
|
|
pas::EGenerateType x8_type = pas::EGenerateType::Invalid;
|
|
|
|
zeus::CVector3f xc_targetPos;
|
|
|
|
s32 x18_animId = -1;
|
2020-04-21 07:22:41 +00:00
|
|
|
bool x1c_24_targetTransform : 1 = false;
|
|
|
|
bool x1c_25_overrideAnim : 1 = false;
|
2018-12-08 05:30:43 +00:00
|
|
|
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-04-21 07:22:41 +00:00
|
|
|
explicit CBCGenerateCmd() : CBodyStateCmd(EBodyStateCmd::Generate) {}
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCGenerateCmd(pas::EGenerateType type)
|
2020-04-21 07:22:41 +00:00
|
|
|
: CBodyStateCmd(EBodyStateCmd::Generate), x8_type(type) {}
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCGenerateCmd(pas::EGenerateType type, s32 animId)
|
2020-04-21 07:22:41 +00:00
|
|
|
: CBodyStateCmd(EBodyStateCmd::Generate), x8_type(type), x18_animId(animId), x1c_25_overrideAnim{animId != -1} {}
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCGenerateCmd(pas::EGenerateType type, const zeus::CVector3f& vec, bool targetTransform = false,
|
|
|
|
bool overrideAnim = false)
|
2020-04-21 07:22:41 +00:00
|
|
|
: CBodyStateCmd(EBodyStateCmd::Generate)
|
|
|
|
, x8_type(type)
|
|
|
|
, xc_targetPos(vec)
|
|
|
|
, x1c_24_targetTransform{targetTransform}
|
|
|
|
, x1c_25_overrideAnim{overrideAnim} {}
|
2018-12-08 05:30:43 +00:00
|
|
|
pas::EGenerateType GetGenerateType() const { return x8_type; }
|
|
|
|
const zeus::CVector3f& GetExitTargetPos() const { return xc_targetPos; }
|
|
|
|
bool HasExitTargetPos() const { return x1c_24_targetTransform; }
|
|
|
|
s32 GetSpecialAnimId() const { return x18_animId; }
|
|
|
|
bool UseSpecialAnimId() const { return x1c_25_overrideAnim; }
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCKnockBackCmd : public CBodyStateCmd {
|
|
|
|
zeus::CVector3f x8_dir;
|
|
|
|
pas::ESeverity x14_severity = pas::ESeverity::Invalid;
|
|
|
|
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCKnockBackCmd() : CBodyStateCmd(EBodyStateCmd::KnockBack) {}
|
|
|
|
explicit CBCKnockBackCmd(const zeus::CVector3f& vec, pas::ESeverity severity)
|
2018-12-08 05:30:43 +00:00
|
|
|
: CBodyStateCmd(EBodyStateCmd::KnockBack), x8_dir(vec), x14_severity(severity) {}
|
|
|
|
const zeus::CVector3f& GetHitDirection() const { return x8_dir; }
|
|
|
|
pas::ESeverity GetHitSeverity() const { return x14_severity; }
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCHurledCmd : public CBodyStateCmd {
|
|
|
|
zeus::CVector3f x8_direction;
|
|
|
|
zeus::CVector3f x14_launchVel;
|
|
|
|
bool x20_startInKnockLoop = false;
|
|
|
|
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCHurledCmd() : CBodyStateCmd(EBodyStateCmd::Hurled) {}
|
|
|
|
explicit CBCHurledCmd(const zeus::CVector3f& dir, const zeus::CVector3f& launchVel, bool startInLoop = false)
|
2018-12-08 05:30:43 +00:00
|
|
|
: CBodyStateCmd(EBodyStateCmd::Hurled)
|
|
|
|
, x8_direction(dir)
|
|
|
|
, x14_launchVel(launchVel)
|
|
|
|
, x20_startInKnockLoop(startInLoop) {}
|
|
|
|
const zeus::CVector3f& GetHitDirection() const { return x8_direction; }
|
|
|
|
const zeus::CVector3f& GetLaunchVelocity() const { return x14_launchVel; }
|
|
|
|
bool GetSkipLaunchState() const { return x20_startInKnockLoop; }
|
|
|
|
void SetSkipLaunchState(bool s) { x20_startInKnockLoop = s; }
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCGetupCmd : public CBodyStateCmd {
|
|
|
|
pas::EGetupType x8_type = pas::EGetupType::Invalid;
|
|
|
|
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCGetupCmd() : CBodyStateCmd(EBodyStateCmd::Getup) {}
|
|
|
|
explicit CBCGetupCmd(pas::EGetupType type) : CBodyStateCmd(EBodyStateCmd::Getup), x8_type(type) {}
|
2018-12-08 05:30:43 +00:00
|
|
|
pas::EGetupType GetGetupType() const { return x8_type; }
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCLoopReactionCmd : public CBodyStateCmd {
|
|
|
|
pas::EReactionType x8_type = pas::EReactionType::Invalid;
|
|
|
|
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCLoopReactionCmd() : CBodyStateCmd(EBodyStateCmd::LoopReaction) {}
|
|
|
|
explicit CBCLoopReactionCmd(pas::EReactionType type) : CBodyStateCmd(EBodyStateCmd::LoopReaction), x8_type(type) {}
|
2018-12-08 05:30:43 +00:00
|
|
|
pas::EReactionType GetReactionType() const { return x8_type; }
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCLoopHitReactionCmd : public CBodyStateCmd {
|
|
|
|
pas::EReactionType x8_type = pas::EReactionType::Invalid;
|
|
|
|
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCLoopHitReactionCmd() : CBodyStateCmd(EBodyStateCmd::LoopHitReaction) {}
|
|
|
|
explicit CBCLoopHitReactionCmd(pas::EReactionType type) : CBodyStateCmd(EBodyStateCmd::LoopHitReaction), x8_type(type) {}
|
2018-12-08 05:30:43 +00:00
|
|
|
pas::EReactionType GetReactionType() const { return x8_type; }
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCKnockDownCmd : public CBodyStateCmd {
|
|
|
|
zeus::CVector3f x8_dir;
|
|
|
|
pas::ESeverity x14_severity = pas::ESeverity::Invalid;
|
|
|
|
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCKnockDownCmd() : CBodyStateCmd(EBodyStateCmd::KnockDown) {}
|
|
|
|
explicit CBCKnockDownCmd(const zeus::CVector3f& vec, pas::ESeverity severity)
|
2018-12-08 05:30:43 +00:00
|
|
|
: CBodyStateCmd(EBodyStateCmd::KnockDown), x8_dir(vec), x14_severity(severity) {}
|
|
|
|
const zeus::CVector3f& GetHitDirection() const { return x8_dir; }
|
|
|
|
pas::ESeverity GetHitSeverity() const { return x14_severity; }
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCSlideCmd : public CBodyStateCmd {
|
|
|
|
pas::ESlideType x8_type = pas::ESlideType::Invalid;
|
|
|
|
zeus::CVector3f xc_dir;
|
|
|
|
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCSlideCmd() : CBodyStateCmd(EBodyStateCmd::Slide) {}
|
|
|
|
explicit CBCSlideCmd(pas::ESlideType type, const zeus::CVector3f& dir)
|
2018-12-08 05:30:43 +00:00
|
|
|
: CBodyStateCmd(EBodyStateCmd::Slide), x8_type(type), xc_dir(dir) {}
|
|
|
|
pas::ESlideType GetSlideType() const { return x8_type; }
|
|
|
|
const zeus::CVector3f& GetSlideDirection() const { return xc_dir; }
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCScriptedCmd : public CBodyStateCmd {
|
|
|
|
s32 x8_anim = -1;
|
2020-04-21 07:22:41 +00:00
|
|
|
bool xc_24_loopAnim : 1 = false;
|
|
|
|
bool xc_25_timedLoop : 1 = false;
|
2018-12-08 05:30:43 +00:00
|
|
|
float x10_loopDur = 0.f;
|
|
|
|
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-04-21 07:22:41 +00:00
|
|
|
explicit CBCScriptedCmd() : CBodyStateCmd(EBodyStateCmd::Scripted) {}
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCScriptedCmd(int i, bool b1, bool b2, float f)
|
2020-04-21 07:22:41 +00:00
|
|
|
: CBodyStateCmd(EBodyStateCmd::Scripted), x8_anim(i), xc_24_loopAnim{b1}, xc_25_timedLoop{b2}, x10_loopDur(f) {}
|
2018-12-08 05:30:43 +00:00
|
|
|
s32 GetAnimId() const { return x8_anim; }
|
|
|
|
bool IsLooped() const { return xc_24_loopAnim; }
|
|
|
|
bool GetUseLoopDuration() const { return xc_25_timedLoop; }
|
|
|
|
float GetLoopDuration() const { return x10_loopDur; }
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCCoverCmd : public CBodyStateCmd {
|
|
|
|
pas::ECoverDirection x8_dir = pas::ECoverDirection::Invalid;
|
|
|
|
zeus::CVector3f xc_targetPos;
|
|
|
|
zeus::CVector3f x18_alignDir;
|
|
|
|
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCCoverCmd() : CBodyStateCmd(EBodyStateCmd::Cover) {}
|
|
|
|
explicit CBCCoverCmd(pas::ECoverDirection dir, const zeus::CVector3f& v1, const zeus::CVector3f& v2)
|
2018-12-08 05:30:43 +00:00
|
|
|
: CBodyStateCmd(EBodyStateCmd::Cover), x8_dir(dir), xc_targetPos(v1), x18_alignDir(v2) {}
|
|
|
|
pas::ECoverDirection GetDirection() const { return x8_dir; }
|
|
|
|
const zeus::CVector3f& GetTarget() const { return xc_targetPos; }
|
|
|
|
const zeus::CVector3f& GetAlignDirection() const { return x18_alignDir; }
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCWallHangCmd : public CBodyStateCmd {
|
|
|
|
TUniqueId x8_wpId = kInvalidUniqueId;
|
|
|
|
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCWallHangCmd() : CBodyStateCmd(EBodyStateCmd::WallHang) {}
|
|
|
|
explicit CBCWallHangCmd(TUniqueId uid) : CBodyStateCmd(EBodyStateCmd::WallHang), x8_wpId(uid) {}
|
2018-12-08 05:30:43 +00:00
|
|
|
TUniqueId GetTarget() const { return x8_wpId; }
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCAdditiveAimCmd : public CBodyStateCmd {
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCAdditiveAimCmd() : CBodyStateCmd(EBodyStateCmd::AdditiveAim) {}
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCAdditiveFlinchCmd : public CBodyStateCmd {
|
|
|
|
float x8_weight = 1.f;
|
|
|
|
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCAdditiveFlinchCmd() : CBodyStateCmd(EBodyStateCmd::AdditiveFlinch) {}
|
|
|
|
explicit CBCAdditiveFlinchCmd(float f) : CBodyStateCmd(EBodyStateCmd::AdditiveFlinch), x8_weight(f) {}
|
2018-12-08 05:30:43 +00:00
|
|
|
float GetWeight() const { return x8_weight; }
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCAdditiveReactionCmd : public CBodyStateCmd {
|
|
|
|
float x8_weight = 1.f;
|
|
|
|
pas::EAdditiveReactionType xc_type = pas::EAdditiveReactionType::Invalid;
|
|
|
|
bool x10_active = false;
|
|
|
|
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCAdditiveReactionCmd() : CBodyStateCmd(EBodyStateCmd::AdditiveReaction) {}
|
|
|
|
explicit CBCAdditiveReactionCmd(pas::EAdditiveReactionType type, float weight, bool active)
|
|
|
|
: CBodyStateCmd(EBodyStateCmd::AdditiveReaction), x8_weight(weight), xc_type(type), x10_active(active) {}
|
2018-12-08 05:30:43 +00:00
|
|
|
pas::EAdditiveReactionType GetType() const { return xc_type; }
|
|
|
|
float GetWeight() const { return x8_weight; }
|
|
|
|
bool GetIsActive() const { return x10_active; }
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCLoopAttackCmd : public CBodyStateCmd {
|
|
|
|
pas::ELoopAttackType x8_type = pas::ELoopAttackType::Invalid;
|
|
|
|
u32 xc_waitForAnimOver = 0;
|
|
|
|
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCLoopAttackCmd() : CBodyStateCmd(EBodyStateCmd::LoopAttack) {}
|
|
|
|
explicit CBCLoopAttackCmd(pas::ELoopAttackType type) : CBodyStateCmd(EBodyStateCmd::LoopAttack), x8_type(type) {}
|
2018-12-08 05:30:43 +00:00
|
|
|
pas::ELoopAttackType GetAttackType() const { return x8_type; }
|
|
|
|
bool WaitForAnimOver() const { return xc_waitForAnimOver == 1; }
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCTauntCmd : public CBodyStateCmd {
|
|
|
|
pas::ETauntType x8_type = pas::ETauntType::Invalid;
|
|
|
|
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCTauntCmd() : CBodyStateCmd(EBodyStateCmd::Taunt) {}
|
|
|
|
explicit CBCTauntCmd(pas::ETauntType type) : CBodyStateCmd(EBodyStateCmd::Taunt), x8_type(type) {}
|
2018-12-08 05:30:43 +00:00
|
|
|
pas::ETauntType GetTauntType() const { return x8_type; }
|
2017-07-05 18:34:12 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CBCLocomotionCmd {
|
|
|
|
zeus::CVector3f x0_move;
|
|
|
|
zeus::CVector3f xc_face;
|
|
|
|
float x18_weight;
|
|
|
|
|
2017-07-05 18:34:12 +00:00
|
|
|
public:
|
2020-03-31 03:52:22 +00:00
|
|
|
explicit CBCLocomotionCmd(const zeus::CVector3f& move, const zeus::CVector3f& face, float weight)
|
2018-12-08 05:30:43 +00:00
|
|
|
: x0_move(move), xc_face(face), x18_weight(weight) {}
|
|
|
|
const zeus::CVector3f& GetMoveVector() const { return x0_move; }
|
|
|
|
const zeus::CVector3f& GetFaceVector() const { return xc_face; }
|
|
|
|
float GetWeight() const { return x18_weight; }
|
2017-07-10 04:55:51 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
enum class ESteeringBlendMode { Normal, FullSpeed, Clamped };
|
|
|
|
|
|
|
|
class CBodyStateCmdMgr {
|
|
|
|
zeus::CVector3f x0_move;
|
|
|
|
zeus::CVector3f xc_face;
|
|
|
|
zeus::CVector3f x18_target;
|
|
|
|
zeus::CVector3f x24_additiveTarget;
|
|
|
|
ESteeringBlendMode x30_steeringMode = ESteeringBlendMode::Normal;
|
|
|
|
float x34_steeringSpeedMin = 0.f;
|
|
|
|
float x38_steeringSpeedMax = 1.f;
|
|
|
|
float x3c_steeringSpeed = 0.f;
|
|
|
|
rstl::reserved_vector<CBodyStateCmd*, 28> x40_commandTable;
|
|
|
|
u32 xb4_deliveredCmdMask = 0;
|
|
|
|
CBCGetupCmd xb8_getup;
|
|
|
|
CBCStepCmd xc4_step;
|
2020-03-31 03:52:22 +00:00
|
|
|
CBodyStateCmd xd4_die{EBodyStateCmd::Die};
|
2018-12-08 05:30:43 +00:00
|
|
|
CBCKnockDownCmd xdc_knockDown;
|
|
|
|
CBCKnockBackCmd xf4_knockBack;
|
|
|
|
CBCMeleeAttackCmd x10c_meleeAttack;
|
|
|
|
CBCProjectileAttackCmd x128_projectileAttack;
|
|
|
|
CBCLoopAttackCmd x144_loopAttack;
|
|
|
|
CBCLoopReactionCmd x154_loopReaction;
|
|
|
|
CBCLoopHitReactionCmd x160_loopHitReaction;
|
2020-03-31 03:52:22 +00:00
|
|
|
CBodyStateCmd x16c_exitState{EBodyStateCmd::ExitState};
|
|
|
|
CBodyStateCmd x174_leanFromCover{EBodyStateCmd::LeanFromCover};
|
|
|
|
CBodyStateCmd x17c_nextState{EBodyStateCmd::NextState};
|
|
|
|
CBodyStateCmd x184_maintainVelocity{EBodyStateCmd::MaintainVelocity};
|
2018-12-08 05:30:43 +00:00
|
|
|
CBCGenerateCmd x18c_generate;
|
|
|
|
CBCHurledCmd x1ac_hurled;
|
|
|
|
CBCJumpCmd x1d0_jump;
|
|
|
|
CBCSlideCmd x1f8_slide;
|
|
|
|
CBCTauntCmd x210_taunt;
|
|
|
|
CBCScriptedCmd x21c_scripted;
|
|
|
|
CBCCoverCmd x230_cover;
|
|
|
|
CBCWallHangCmd x254_wallHang;
|
2020-03-31 03:52:22 +00:00
|
|
|
CBodyStateCmd x260_locomotion{EBodyStateCmd::Locomotion};
|
|
|
|
CBodyStateCmd x268_additiveIdle{EBodyStateCmd::AdditiveIdle};
|
2018-12-08 05:30:43 +00:00
|
|
|
CBCAdditiveAimCmd x270_additiveAim;
|
|
|
|
CBCAdditiveFlinchCmd x278_additiveFlinch;
|
|
|
|
CBCAdditiveReactionCmd x284_additiveReaction;
|
2020-03-31 03:52:22 +00:00
|
|
|
CBodyStateCmd x298_stopReaction{EBodyStateCmd::StopReaction};
|
2018-12-08 05:30:43 +00:00
|
|
|
void DeliverCmd(EBodyStateCmd cmd) { xb4_deliveredCmdMask |= (1 << int(cmd)); }
|
2017-07-05 18:34:12 +00:00
|
|
|
|
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
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);
|
2018-12-17 05:40:27 +00:00
|
|
|
void DeliverFaceVector(const zeus::CVector3f& f) { xc_face = f; }
|
2018-12-08 05:30:43 +00:00
|
|
|
void DeliverTargetVector(const zeus::CVector3f& t) { x18_target = t; }
|
|
|
|
void DeliverAdditiveTargetVector(const zeus::CVector3f& t) { x24_additiveTarget = t; }
|
|
|
|
void SetSteeringBlendSpeed(float s) { x3c_steeringSpeed = s; }
|
|
|
|
void SetSteeringBlendMode(ESteeringBlendMode m) { x30_steeringMode = m; }
|
|
|
|
void SetSteeringSpeedRange(float rmin, float rmax) {
|
|
|
|
x34_steeringSpeedMin = rmin;
|
|
|
|
x38_steeringSpeedMax = rmax;
|
|
|
|
}
|
|
|
|
void BlendSteeringCmds();
|
|
|
|
void Reset();
|
|
|
|
void ClearLocomotionCmds();
|
2020-04-05 07:20:52 +00:00
|
|
|
|
|
|
|
CBodyStateCmd* GetCmd(EBodyStateCmd cmd) {
|
|
|
|
if ((xb4_deliveredCmdMask & (1U << u32(cmd))) != 0) {
|
|
|
|
return x40_commandTable[size_t(cmd)];
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
2018-12-08 05:30:43 +00:00
|
|
|
const CBodyStateCmd* GetCmd(EBodyStateCmd cmd) const {
|
2020-04-05 07:20:52 +00:00
|
|
|
if ((xb4_deliveredCmdMask & (1U << u32(cmd))) != 0) {
|
|
|
|
return x40_commandTable[size_t(cmd)];
|
|
|
|
}
|
2018-12-08 05:30:43 +00:00
|
|
|
return nullptr;
|
|
|
|
}
|
2020-04-05 07:20:52 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
const zeus::CVector3f& GetMoveVector() const { return x0_move; }
|
|
|
|
const zeus::CVector3f& GetFaceVector() const { return xc_face; }
|
|
|
|
const zeus::CVector3f& GetTargetVector() const { return x18_target; }
|
|
|
|
const zeus::CVector3f& GetAdditiveTargetVector() const { return x24_additiveTarget; }
|
2016-08-15 20:43:04 +00:00
|
|
|
};
|
2017-07-05 18:34:12 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|