2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CPLAYER
|
|
|
|
#define _CPLAYER
|
2022-09-19 04:19:46 +00:00
|
|
|
|
2023-10-22 03:29:52 +00:00
|
|
|
#include "rstl/reserved_vector.hpp"
|
2022-09-19 04:19:46 +00:00
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
#include "MetroidPrime/CAnimRes.hpp"
|
|
|
|
#include "MetroidPrime/CPhysicsActor.hpp"
|
|
|
|
#include "MetroidPrime/Player/CPlayerEnergyDrain.hpp"
|
|
|
|
#include "MetroidPrime/Player/CPlayerState.hpp"
|
|
|
|
|
|
|
|
#include "Kyoto/TReservedAverage.hpp"
|
|
|
|
|
|
|
|
#include "rstl/auto_ptr.hpp"
|
|
|
|
#include "rstl/vector.hpp"
|
|
|
|
|
|
|
|
class CPlayerGun;
|
|
|
|
class CMorphBall;
|
|
|
|
class CPlayerCameraBob;
|
|
|
|
|
|
|
|
namespace NPlayer {
|
|
|
|
enum EPlayerMovementState {
|
|
|
|
kMS_OnGround,
|
|
|
|
kMS_Jump,
|
|
|
|
kMS_ApplyJump,
|
|
|
|
kMS_Falling,
|
|
|
|
kMS_FallingMorphed,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-09-26 05:54:05 +00:00
|
|
|
class CPlayer : public CPhysicsActor, public TOneStatic< CPlayer > {
|
2022-10-21 13:48:25 +00:00
|
|
|
struct CVisorSteam {
|
|
|
|
float x0_curTargetAlpha;
|
|
|
|
float x4_curAlphaInDur;
|
|
|
|
float x8_curAlphaOutDur;
|
|
|
|
CAssetId xc_tex;
|
|
|
|
float x10_nextTargetAlpha;
|
|
|
|
float x14_nextAlphaInDur;
|
|
|
|
float x18_nextAlphaOutDur;
|
|
|
|
CAssetId x1c_txtr;
|
|
|
|
float x20_alpha;
|
|
|
|
float x24_delayTimer;
|
|
|
|
bool x28_affectsThermal;
|
|
|
|
|
|
|
|
public:
|
2024-09-28 19:43:23 +00:00
|
|
|
CVisorSteam();
|
2024-09-26 05:54:05 +00:00
|
|
|
CVisorSteam(float targetAlpha, float alphaInDur, float alphaOutDur, CAssetId tex);
|
|
|
|
// : x0_curTargetAlpha(targetAlpha)
|
|
|
|
// , x4_curAlphaInDur(alphaInDur)
|
|
|
|
// , x8_curAlphaOutDur(alphaOutDur)
|
|
|
|
// , xc_tex(tex) {}
|
2022-10-30 19:47:50 +00:00
|
|
|
CAssetId GetTextureId() const { return xc_tex; }
|
2022-10-21 13:48:25 +00:00
|
|
|
void SetSteam(float targetAlpha, float alphaInDur, float alphaOutDur, CAssetId txtr,
|
|
|
|
bool affectsThermal);
|
|
|
|
void Update(float dt);
|
|
|
|
float GetAlpha() const { return x20_alpha; }
|
|
|
|
bool AffectsThermal() const { return x28_affectsThermal; }
|
|
|
|
};
|
2022-10-30 19:47:50 +00:00
|
|
|
|
2024-10-01 04:04:55 +00:00
|
|
|
class CPlayerStuckTracker {
|
2023-10-22 03:29:52 +00:00
|
|
|
public:
|
2024-10-01 04:04:55 +00:00
|
|
|
enum EPlayerState {
|
|
|
|
kPS_Jump,
|
|
|
|
kPS_StartingJump,
|
|
|
|
kPS_Moving,
|
|
|
|
};
|
|
|
|
|
|
|
|
CPlayerStuckTracker();
|
2024-10-15 05:47:46 +00:00
|
|
|
~CPlayerStuckTracker();
|
2024-10-01 04:04:55 +00:00
|
|
|
void AddState(EPlayerState, const CVector3f&, const CVector3f&, const CVector2f&);
|
|
|
|
bool IsPlayerStuck();
|
|
|
|
void ResetStats();
|
2024-09-26 05:54:05 +00:00
|
|
|
|
2023-10-22 03:29:52 +00:00
|
|
|
private:
|
2024-10-01 04:04:55 +00:00
|
|
|
rstl::reserved_vector< EPlayerState, 20 > x0_;
|
2024-09-26 05:54:05 +00:00
|
|
|
rstl::reserved_vector< CVector3f, 20 > x54_;
|
|
|
|
rstl::reserved_vector< CVector3f, 20 > x148_;
|
|
|
|
rstl::reserved_vector< CVector2f, 20 > x23c_;
|
2023-10-22 03:29:52 +00:00
|
|
|
};
|
|
|
|
|
2022-09-19 04:19:46 +00:00
|
|
|
public:
|
|
|
|
enum EPlayerOrbitState {
|
|
|
|
kOS_NoOrbit,
|
|
|
|
kOS_OrbitObject,
|
|
|
|
kOS_OrbitPoint,
|
|
|
|
kOS_OrbitCarcass,
|
|
|
|
kOS_ForcedOrbitObject, // For CMetroidBeta attack
|
|
|
|
kOS_Grapple,
|
|
|
|
};
|
|
|
|
enum ESurfaceRestraints {
|
|
|
|
kSR_Normal,
|
|
|
|
kSR_Air,
|
|
|
|
kSR_Ice,
|
|
|
|
kSR_Organic,
|
|
|
|
kSR_Water,
|
|
|
|
kSR_Lava,
|
|
|
|
kSR_Phazon,
|
|
|
|
kSR_Shrubbery,
|
|
|
|
};
|
|
|
|
enum EPlayerCameraState {
|
|
|
|
kCS_FirstPerson,
|
|
|
|
kCS_Ball,
|
|
|
|
kCS_Two,
|
|
|
|
kCS_Transitioning,
|
|
|
|
kCS_Spawned,
|
|
|
|
};
|
|
|
|
enum EPlayerMorphBallState {
|
|
|
|
kMS_Unmorphed,
|
|
|
|
kMS_Morphed,
|
|
|
|
kMS_Morphing,
|
|
|
|
kMS_Unmorphing,
|
|
|
|
};
|
|
|
|
enum EPlayerOrbitType {
|
|
|
|
kOT_Close,
|
|
|
|
kOT_Far,
|
|
|
|
kOT_Default,
|
|
|
|
};
|
|
|
|
enum EPlayerZoneInfo {
|
|
|
|
kZI_Targeting,
|
|
|
|
kZI_Scan,
|
|
|
|
};
|
|
|
|
enum EPlayerZoneType {
|
|
|
|
kZT_Always = -1,
|
|
|
|
kZT_Box,
|
|
|
|
kZT_Ellipse,
|
|
|
|
};
|
|
|
|
enum EPlayerScanState {
|
|
|
|
kSS_NotScanning,
|
|
|
|
kSS_Scanning,
|
|
|
|
kSS_ScanComplete,
|
|
|
|
};
|
|
|
|
enum EGrappleState {
|
|
|
|
kGS_None,
|
|
|
|
kGS_Firing,
|
|
|
|
kGS_Pull,
|
|
|
|
kGS_Swinging,
|
|
|
|
kGS_JumpOff,
|
|
|
|
};
|
|
|
|
enum EFootstepSfx {
|
|
|
|
kFS_None,
|
|
|
|
kFS_Left,
|
|
|
|
kFS_Right,
|
|
|
|
};
|
|
|
|
enum EGunHolsterState {
|
|
|
|
kGH_Holstered,
|
|
|
|
kGH_Drawing,
|
|
|
|
kGH_Drawn,
|
|
|
|
kGH_Holstering,
|
|
|
|
};
|
2024-09-30 06:02:23 +00:00
|
|
|
enum EOrbitBrokenType {
|
|
|
|
kOB_StopOrbit,
|
|
|
|
kOB_Respawn,
|
|
|
|
kOB_EnterMorphBall,
|
|
|
|
kOB_Default,
|
|
|
|
kOB_Four,
|
|
|
|
kOB_Five,
|
|
|
|
kOB_InvalidateTarget,
|
|
|
|
kOB_BadVerticalAngle,
|
|
|
|
kOB_ActivateOrbitSource,
|
|
|
|
kOB_ProjectileCollide,
|
|
|
|
kOB_Freeze,
|
|
|
|
kOB_DamageOnGrapple,
|
|
|
|
kOB_LostGrappleLineOfSight,
|
|
|
|
};
|
2022-09-19 04:19:46 +00:00
|
|
|
|
2024-09-26 05:54:05 +00:00
|
|
|
CPlayer(TUniqueId uid, const CTransform4f& xf, const CAABox& aabb, CAssetId resId,
|
|
|
|
const CVector3f& playerScale, float mass, float stepUp, float stepDown, float ballRadius,
|
|
|
|
const CMaterialList& ml);
|
|
|
|
|
2022-09-19 04:19:46 +00:00
|
|
|
// CEntity
|
2024-10-15 05:47:46 +00:00
|
|
|
// ~CPlayer() override;
|
2023-02-06 17:01:01 +00:00
|
|
|
void Accept(IVisitor& visitor) override;
|
|
|
|
void PreThink(float dt, CStateManager& mgr) override;
|
|
|
|
void Think(float dt, CStateManager& mgr) override;
|
|
|
|
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override;
|
2022-09-19 04:19:46 +00:00
|
|
|
|
|
|
|
// CActor
|
2023-02-06 17:01:01 +00:00
|
|
|
void PreRender(CStateManager&, const CFrustumPlanes&) override;
|
|
|
|
void AddToRenderer(const CFrustumPlanes&, const CStateManager&) const override;
|
|
|
|
void Render(const CStateManager&) const override;
|
|
|
|
bool CanRenderUnsorted(const CStateManager&) const override;
|
|
|
|
void CalculateRenderBounds() override;
|
|
|
|
CHealthInfo* HealthInfo(CStateManager&) override;
|
|
|
|
const CDamageVulnerability* GetDamageVulnerability() const override;
|
2022-09-19 04:19:46 +00:00
|
|
|
const CDamageVulnerability* GetDamageVulnerability(const CVector3f&, const CVector3f&,
|
2023-02-06 17:01:01 +00:00
|
|
|
const CDamageInfo&) const override;
|
|
|
|
rstl::optional_object< CAABox > GetTouchBounds() const override;
|
|
|
|
void Touch(CActor&, CStateManager&) override;
|
|
|
|
CVector3f GetAimPosition(const CStateManager&, float) const override;
|
|
|
|
CVector3f GetHomingPosition(const CStateManager&, float) const override;
|
|
|
|
void FluidFXThink(EFluidState, CScriptWater&, CStateManager&) override;
|
2022-09-19 04:19:46 +00:00
|
|
|
|
|
|
|
// CPhysicsActor
|
2023-02-06 17:01:01 +00:00
|
|
|
const CCollisionPrimitive* GetCollisionPrimitive() const override;
|
|
|
|
CTransform4f GetPrimitiveTransform() const override;
|
2022-10-08 05:12:48 +00:00
|
|
|
void CollidedWith(const TUniqueId& id, const CCollisionInfoList& list,
|
2023-02-06 17:01:01 +00:00
|
|
|
CStateManager& mgr) override;
|
|
|
|
float GetStepDownHeight() const override;
|
|
|
|
float GetStepUpHeight() const override;
|
|
|
|
float GetWeight() const override;
|
2022-09-19 04:19:46 +00:00
|
|
|
|
|
|
|
// CPlayer
|
|
|
|
virtual bool IsTransparent();
|
2022-11-14 00:10:00 +00:00
|
|
|
|
2022-09-21 05:18:07 +00:00
|
|
|
CVector3f GetBallPosition() const;
|
2022-10-21 12:01:25 +00:00
|
|
|
CVector3f GetEyePosition() const;
|
2022-10-30 19:47:50 +00:00
|
|
|
float GetEyeHeight() const;
|
2022-09-29 05:30:20 +00:00
|
|
|
CTransform4f CreateTransformFromMovementDirection() const;
|
2022-09-19 04:19:46 +00:00
|
|
|
EPlayerOrbitState GetOrbitState() const { return x304_orbitState; }
|
2022-09-29 05:30:20 +00:00
|
|
|
const CVector3f& GetMovementDirection() const { return x50c_moveDir; }
|
2022-10-03 11:55:03 +00:00
|
|
|
EPlayerMorphBallState GetMorphballTransitionState() const { return x2f8_morphBallState; }
|
2022-10-04 00:00:46 +00:00
|
|
|
|
|
|
|
static float skDefaultHudFadeOutSpeed;
|
|
|
|
static float skDefaultHudFadeInSpeed;
|
|
|
|
void SetHudDisable(float staticTimer, float outSpeed = skDefaultHudFadeOutSpeed,
|
|
|
|
float inSpeed = skDefaultHudFadeInSpeed);
|
|
|
|
|
2024-10-15 05:47:46 +00:00
|
|
|
void IncrementEnvironmentDamage(); // name?
|
|
|
|
void DecrementEnvironmentDamage(); // name?
|
2022-09-29 05:30:20 +00:00
|
|
|
// GetMovementDirection2D__7CPlayerCFv ??
|
2022-11-11 02:25:54 +00:00
|
|
|
void SetOrbitTargetId(TUniqueId id, CStateManager& mgr);
|
2024-09-30 06:02:23 +00:00
|
|
|
void TryToBreakOrbit(TUniqueId id, EOrbitBrokenType type, CStateManager& mgr);
|
|
|
|
void BreakOrbit(EOrbitBrokenType type, CStateManager& mgr);
|
|
|
|
void BreakGrapple(EOrbitBrokenType type, CStateManager& mgr);
|
2022-10-04 00:00:46 +00:00
|
|
|
void AddOrbitDisableSource(CStateManager& mgr, TUniqueId addId);
|
|
|
|
void RemoveOrbitDisableSource(TUniqueId uid);
|
2024-09-26 05:54:05 +00:00
|
|
|
void SetAimTargetId(TUniqueId target);
|
2023-10-12 02:21:41 +00:00
|
|
|
void DoSfxEffects(CSfxHandle sfx);
|
2024-09-30 06:02:23 +00:00
|
|
|
bool GetFrozenState() const;
|
|
|
|
void SetFrozenState(CStateManager& stateMgr, CAssetId steamTxtr, ushort sfx, CAssetId iceTxtr);
|
|
|
|
void BreakFrozenState(CStateManager& mgr);
|
2024-09-23 05:56:21 +00:00
|
|
|
void UpdateCinematicState(CStateManager& mgr);
|
2024-09-25 04:05:42 +00:00
|
|
|
bool IsMorphBallTransitioning() const;
|
2024-09-26 05:54:05 +00:00
|
|
|
void InitialiseAnimation();
|
|
|
|
void LoadAnimationTokens();
|
|
|
|
void HolsterGun(CStateManager& mgr);
|
|
|
|
void ResetGun(CStateManager& mgr);
|
|
|
|
void DrawGun(CStateManager& mgr);
|
|
|
|
bool CheckPostGrapple() const;
|
|
|
|
void UpdateGunState(const CFinalInput& input, CStateManager& mgr);
|
|
|
|
void UpdateAimTargetPrediction(const CTransform4f& xf, CStateManager& mgr);
|
|
|
|
void UpdateAssistedAiming(const CTransform4f& xf, CStateManager& mgr);
|
|
|
|
void UpdateGunTransform(const CVector3f& gunPos, CStateManager& mgr);
|
|
|
|
const CTransform4f& GetFirstPersonCameraTransform(CStateManager& mgr) const;
|
|
|
|
void UpdateDebugCamera(CStateManager& mgr);
|
|
|
|
void UpdateArmAndGunTransforms(float dt, CStateManager& mgr);
|
|
|
|
void UpdateGrappleArmTransform(const CVector3f& offset, CStateManager& mgr, float dt);
|
|
|
|
void ForceGunOrientation(const CTransform4f& xf, CStateManager& mgr);
|
|
|
|
void Update(float dt, CStateManager& mgr);
|
|
|
|
void UpdateMorphBallTransition(float dt, CStateManager& mgr);
|
|
|
|
void UpdateAimTarget(CStateManager& mgr);
|
|
|
|
void UpdateAimTargetTimer(float dt);
|
|
|
|
void UpdateOrbitModeTimer(float dt);
|
|
|
|
void UpdateOrbitPreventionTimer(float dt);
|
|
|
|
void UpdateGunAlpha();
|
|
|
|
void UpdateVisorTransition(float dt, CStateManager& mgr);
|
|
|
|
void UpdatePlayerSounds(float dt);
|
2024-09-28 19:43:23 +00:00
|
|
|
bool ShouldSampleFailsafe(CStateManager& mgr) const;
|
2024-10-15 05:47:46 +00:00
|
|
|
bool IsEnergyLow(const CStateManager& mgr) const;
|
|
|
|
const bool StartSamusVoiceSfx(ushort sfx, short vol, int prio);
|
2024-09-28 19:43:23 +00:00
|
|
|
void UpdateVisorState(const CFinalInput& input, float dt, CStateManager& mgr);
|
|
|
|
void UpdateCrosshairsState(const CFinalInput& input);
|
|
|
|
ushort GetMaterialSoundUnderPlayer(CStateManager& mgr, const ushort* table, int length,
|
|
|
|
ushort defId);
|
|
|
|
void UpdateFootstepSounds(const CFinalInput& input, CStateManager& mgr, float dt);
|
|
|
|
float JumpInput(const CFinalInput& input, CStateManager& mgr);
|
|
|
|
float TurnInput(const CFinalInput& input) const;
|
|
|
|
float StrafeInput(const CFinalInput& input) const;
|
|
|
|
float ForwardInput(const CFinalInput& input, float turnInput) const;
|
|
|
|
float GetActualFirstPersonMaxVelocity(float dt) const;
|
|
|
|
const CScriptWater* GetVisorRunoffEffect(const CStateManager& mgr) const;
|
|
|
|
void SetMorphBallState(EPlayerMorphBallState state, CStateManager& mgr);
|
2024-10-01 04:04:55 +00:00
|
|
|
bool CanEnterMorphBallState(CStateManager& mgr, float dt) const;
|
2024-09-30 06:02:23 +00:00
|
|
|
bool CanLeaveMorphBallState(CStateManager& mgr, CVector3f& pos) const;
|
|
|
|
void LeaveMorphBallState(CStateManager& mgr);
|
|
|
|
void EnterMorphBallState(CStateManager& mgr);
|
|
|
|
void ResetBallCamera(CStateManager& mgr);
|
|
|
|
void UpdateCameraState(CStateManager& mgr);
|
|
|
|
void UpdateFreeLookState(const CFinalInput& input, float dt, CStateManager& mgr);
|
|
|
|
void UpdateCameraTimers(float dt, const CFinalInput& input);
|
|
|
|
void UpdateSubmerged(const CStateManager& mgr);
|
|
|
|
bool CheckSubmerged();
|
|
|
|
void SetMoveState(NPlayer::EPlayerMovementState state, CStateManager& mgr);
|
|
|
|
void StartLandingControlFreeze(); // name?
|
|
|
|
void EndLandingControlFreeze(); // name?
|
|
|
|
void AdjustEyeOffset(CStateManager& mgr);
|
|
|
|
void SetEyeOffset(float bias);
|
|
|
|
float GetEyeOffset() const { return x9c8_eyeZBias; }
|
|
|
|
void UpdateStepUpSmoothing(float dt);
|
|
|
|
void UpdateEnvironmentDamageCameraShake(float dt, CStateManager& mgr);
|
|
|
|
void UpdatePhazonDamage(float dt, CStateManager& mgr);
|
|
|
|
void UpdateFreeLook(float dt);
|
|
|
|
void UpdatePlayerHints(CStateManager& mgr);
|
|
|
|
void UpdateBombJumpStuff();
|
|
|
|
void UpdateTransitionFilter(float dt, CStateManager& mgr);
|
|
|
|
void CalculatePlayerMovementDirection(float dt);
|
|
|
|
void UpdatePlayerControlDirection(float dt, CStateManager& mgr);
|
|
|
|
void UpdateFrozenState(const CFinalInput& input, CStateManager& mgr);
|
|
|
|
void UpdateControlLostState(float dt, CStateManager& mgr);
|
|
|
|
void ComputeMovement(const CFinalInput& input, CStateManager& mgr, float dt);
|
|
|
|
void ProcessInput(const CFinalInput& input, CStateManager& mgr);
|
|
|
|
void UpdateScanningState(const CFinalInput& input, CStateManager& mgr, float dt);
|
2024-10-01 04:04:55 +00:00
|
|
|
bool IsUnderBetaMetroidAttack(CStateManager& mgr) const;
|
|
|
|
void UpdateGrappleState(const CFinalInput& input, CStateManager& mgr);
|
|
|
|
void ApplyGrappleForces(const CFinalInput& input, CStateManager& mgr, float dt);
|
|
|
|
void ComputeFreeLook(const CFinalInput& input);
|
|
|
|
void UpdateOrbitInput(const CFinalInput& input, CStateManager& mgr);
|
|
|
|
void UpdateOrbitZone(CStateManager& mgr);
|
|
|
|
void UpdateMorphBallState(float dt, const CFinalInput& input, CStateManager& mgr);
|
|
|
|
void CalculateLeaveMorphBallDirection(const CFinalInput& input);
|
|
|
|
void TransitionToMorphBallState(float dt, CStateManager& mgr);
|
|
|
|
void TransitionFromMorphBallState(float dt, CStateManager& mgr);
|
|
|
|
float GetMaximumPlayerPositiveVerticalVelocity(const CStateManager& mgr) const;
|
|
|
|
CVector3f CalculateLeftStickEdgePosition(float strafeInput, float forwardInput) const;
|
|
|
|
bool AttachActorToPlayer(TUniqueId id, bool disableGun);
|
|
|
|
void DetachActorFromPlayer();
|
2024-10-15 05:47:46 +00:00
|
|
|
void RenderReflectedPlayer(CStateManager& mgr);
|
|
|
|
bool HasTransitionBeamModel() const;
|
|
|
|
void RenderGun(const CStateManager& mgr, const CVector3f& pos) const;
|
|
|
|
bool GetCombatMode() const;
|
|
|
|
bool GetExplorationMode() const;
|
|
|
|
void SetScanningState(EPlayerScanState state, CStateManager& mgr);
|
|
|
|
void UpdateSlideShowUnlocking(CStateManager& mgr); // name?
|
|
|
|
bool ValidateScanning(const CFinalInput& input, CStateManager& mgr) const;
|
|
|
|
float GetTransitionAlpha(const CVector3f& camPos, float zNear) const;
|
|
|
|
void TakeDamage(bool significant, const CVector3f& location, float damage, EWeaponType type,
|
|
|
|
CStateManager& mgr);
|
|
|
|
bool WasDamaged() const;
|
|
|
|
CVector3f GetDamageLocationWR() const;
|
|
|
|
float GetPrevDamageAmount() const;
|
|
|
|
float GetDamageAmount() const;
|
|
|
|
bool ObjectInScanningRange(TUniqueId id, const CStateManager& mgr);
|
|
|
|
void AsyncLoadSuit(CStateManager& mgr);
|
|
|
|
bool IsPlayerDeadEnough() const;
|
|
|
|
void SetControlDirectionInterpolation(float time);
|
|
|
|
void ResetControlDirectionInterpolation();
|
|
|
|
void DoThink(float dt, CStateManager& mgr); // name?
|
|
|
|
void DoPreThink(float dt, CStateManager& mgr); // name?
|
|
|
|
void SetPlayerHitWallDuringMove();
|
|
|
|
void DoPostCameraStuff(float dt, CStateManager& mgr); // name?
|
|
|
|
float UpdateCameraBob(float dt, CStateManager& mgr);
|
|
|
|
void UpdateOrbitTarget(CStateManager& mgr);
|
|
|
|
void UpdateOrbitOrientation(CStateManager& mgr);
|
|
|
|
bool IsTransparent() const;
|
2022-11-09 23:45:24 +00:00
|
|
|
|
2022-10-05 18:05:56 +00:00
|
|
|
CPlayerGun* PlayerGun() { return x490_gun.get(); }
|
|
|
|
const CPlayerGun* GetPlayerGun() const { return x490_gun.get(); }
|
2022-10-06 20:34:27 +00:00
|
|
|
|
2022-11-04 23:46:13 +00:00
|
|
|
CMorphBall* MorphBall() { return x768_morphball.get(); }
|
|
|
|
const CMorphBall* GetMorphBall() const { return x768_morphball.get(); }
|
|
|
|
|
2022-11-14 00:10:00 +00:00
|
|
|
float GetStaticTimer() const { return x740_staticTimer; }
|
|
|
|
|
2022-10-06 20:34:27 +00:00
|
|
|
ESurfaceRestraints GetCurrentSurfaceRestraint() const { return x2ac_surfaceRestraint; }
|
|
|
|
ESurfaceRestraints GetSurfaceRestraint() const {
|
|
|
|
return x2b0_outOfWaterTicks == 2 ? GetCurrentSurfaceRestraint() : kSR_Water;
|
|
|
|
}
|
2022-10-08 05:12:48 +00:00
|
|
|
|
2022-10-06 16:57:29 +00:00
|
|
|
TUniqueId GetOrbitTargetId() const { return x310_orbitTargetId; }
|
2022-10-20 11:18:42 +00:00
|
|
|
const CVector3f& GetOrbitPoint() const { return x314_orbitPoint; }
|
2022-10-06 16:57:29 +00:00
|
|
|
TUniqueId GetOrbitNextTargetId() const { return x33c_orbitNextTargetId; }
|
|
|
|
TUniqueId GetScanningObjectId() const { return x3b4_scanningObject; }
|
2022-10-06 19:38:21 +00:00
|
|
|
EGrappleState GetGrappleState() const { return x3b8_grappleState; }
|
2022-10-06 20:34:27 +00:00
|
|
|
bool IsInFreeLook() const { return x3dc_inFreeLook; }
|
|
|
|
bool GetFreeLookStickState() const { return x3de_lookAnalogHeld; }
|
2024-09-26 05:54:05 +00:00
|
|
|
TUniqueId GetAimTargetId() const { return x3f4_aimTarget; }
|
2022-10-06 20:34:27 +00:00
|
|
|
EPlayerCameraState GetCameraState() const { return x2f4_cameraState; }
|
2022-11-07 00:20:46 +00:00
|
|
|
void SetCameraState(EPlayerCameraState state, CStateManager& mgr);
|
2022-10-06 19:38:21 +00:00
|
|
|
EGunHolsterState GetGunHolsterState() const { return x498_gunHolsterState; }
|
2022-10-06 20:34:27 +00:00
|
|
|
NPlayer::EPlayerMovementState GetPlayerMovementState() const { return x258_movementState; }
|
2024-09-26 05:54:05 +00:00
|
|
|
const CVector3f& GetAssistedTargetAim() const { return x480_assistedTargetAim; }
|
2024-09-30 06:02:23 +00:00
|
|
|
// CPlayer::GetFlipSpiderBallControlY() const weak
|
|
|
|
// CPlayer::GetFlipSpiderBallControlX() const weak
|
2022-10-05 18:05:56 +00:00
|
|
|
|
2024-09-28 19:43:23 +00:00
|
|
|
bool IsInsideFluid() const { return x9c4_31_inWaterMovement; }
|
|
|
|
|
2022-10-17 19:19:07 +00:00
|
|
|
void Teleport(const CTransform4f& xf, CStateManager& mgr, bool resetBallCam);
|
|
|
|
void SetSpawnedMorphBallState(EPlayerMorphBallState state, CStateManager& mgr);
|
2022-10-21 13:48:25 +00:00
|
|
|
const CVisorSteam& GetVisorSteam() const { return x7a0_visorSteam; }
|
2022-10-30 19:47:50 +00:00
|
|
|
void SetVisorSteam(float targetAlpha, float alphaInDur, float alphaOutDir, CAssetId txtr,
|
|
|
|
bool affectsThermal);
|
2022-10-17 19:19:07 +00:00
|
|
|
|
2022-10-20 11:18:42 +00:00
|
|
|
CVector3f GetDampedClampedVelocityWR() const;
|
|
|
|
float GetAverageSpeed() const;
|
|
|
|
float GetGravity() const;
|
|
|
|
|
2024-10-15 05:47:46 +00:00
|
|
|
float GetAttachedActorStruggle() const;
|
2024-10-01 04:04:55 +00:00
|
|
|
void SetAttachedActorStruggle(float struggle) { xa28_attachedActorStruggle = struggle; }
|
|
|
|
|
2022-11-03 22:05:21 +00:00
|
|
|
// PlayerHint
|
|
|
|
// bool SetAreaPlayerHint(const CScriptPlayerHint& hint, CStateManager& mgr);
|
|
|
|
void AddToPlayerHintRemoveList(TUniqueId id, CStateManager& mgr);
|
|
|
|
void AddToPlayerHintAddList(TUniqueId id, CStateManager& mgr);
|
|
|
|
// void DeactivatePlayerHint(TUniqueId id, CStateManager& mgr);
|
|
|
|
// void UpdatePlayerHints(CStateManager& mgr);
|
|
|
|
|
2024-09-28 19:43:23 +00:00
|
|
|
static int SfxIdFromMaterial(const CMaterialList& mat, const ushort* idList, int tableLen,
|
|
|
|
ushort defId);
|
|
|
|
|
2022-09-19 04:19:46 +00:00
|
|
|
private:
|
|
|
|
NPlayer::EPlayerMovementState x258_movementState;
|
|
|
|
rstl::vector< CToken > x25c_ballTransitionsRes;
|
|
|
|
TUniqueId x26c_attachedActor;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x270_attachedActorTime;
|
2022-09-19 04:19:46 +00:00
|
|
|
CPlayerEnergyDrain x274_energyDrain;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x288_startingJumpTimeout;
|
|
|
|
float x28c_sjTimer;
|
|
|
|
float x290_minJumpTimeout;
|
|
|
|
float x294_jumpCameraTimer;
|
2024-09-30 06:02:23 +00:00
|
|
|
int x298_jumpPresses;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x29c_fallCameraTimer;
|
|
|
|
float x2a0_;
|
2022-09-19 04:19:46 +00:00
|
|
|
bool x2a4_cancelCameraPitch;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x2a8_timeSinceJump;
|
2022-09-19 04:19:46 +00:00
|
|
|
ESurfaceRestraints x2ac_surfaceRestraint;
|
2024-09-30 06:02:23 +00:00
|
|
|
int x2b0_outOfWaterTicks;
|
2022-10-09 05:37:23 +00:00
|
|
|
rstl::reserved_vector< float, 6 > x2b4_accelerationTable;
|
2022-09-19 04:19:46 +00:00
|
|
|
uint x2d0_curAcceleration;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x2d4_accelerationChangeTimer;
|
2022-09-19 04:19:46 +00:00
|
|
|
CAABox x2d8_fpBounds;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x2f0_ballTransHeight;
|
2022-09-19 04:19:46 +00:00
|
|
|
EPlayerCameraState x2f4_cameraState;
|
|
|
|
EPlayerMorphBallState x2f8_morphBallState;
|
|
|
|
EPlayerMorphBallState x2fc_spawnedMorphBallState;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x300_fallingTime;
|
2022-09-19 04:19:46 +00:00
|
|
|
EPlayerOrbitState x304_orbitState;
|
|
|
|
EPlayerOrbitType x308_orbitType;
|
2024-09-30 06:02:23 +00:00
|
|
|
EOrbitBrokenType x30c_orbitBrokenType;
|
2022-09-19 04:19:46 +00:00
|
|
|
TUniqueId x310_orbitTargetId;
|
|
|
|
CVector3f x314_orbitPoint;
|
|
|
|
CVector3f x320_orbitVector;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x32c_orbitModeTimer;
|
2022-09-19 04:19:46 +00:00
|
|
|
EPlayerZoneInfo x330_orbitZoneMode;
|
|
|
|
EPlayerZoneType x334_orbitType;
|
|
|
|
uint x338_;
|
|
|
|
TUniqueId x33c_orbitNextTargetId;
|
|
|
|
bool m_deferredOrbitObject;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x340_;
|
2022-09-19 04:19:46 +00:00
|
|
|
rstl::vector< TUniqueId > x344_nearbyOrbitObjects;
|
|
|
|
rstl::vector< TUniqueId > x354_onScreenOrbitObjects;
|
|
|
|
rstl::vector< TUniqueId > x364_offScreenOrbitObjects;
|
|
|
|
bool x374_orbitLockEstablished;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x378_orbitPreventionTimer;
|
2022-09-19 04:19:46 +00:00
|
|
|
bool x37c_sidewaysDashing;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x380_strafeInputAtDash;
|
|
|
|
float x384_dashTimer;
|
|
|
|
float x388_dashButtonHoldTime;
|
2022-09-19 04:19:46 +00:00
|
|
|
bool x38c_doneSidewaysDashing;
|
|
|
|
uint x390_orbitSource;
|
|
|
|
bool x394_orbitingEnemy;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x398_dashSpeedMultiplier;
|
2022-09-19 04:19:46 +00:00
|
|
|
bool x39c_noStrafeDashBlend;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x3a0_dashDuration;
|
|
|
|
float x3a4_strafeDashBlendDuration;
|
2022-09-19 04:19:46 +00:00
|
|
|
EPlayerScanState x3a8_scanState;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x3ac_scanningTime;
|
|
|
|
float x3b0_curScanTime;
|
2022-09-19 04:19:46 +00:00
|
|
|
TUniqueId x3b4_scanningObject;
|
|
|
|
EGrappleState x3b8_grappleState;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x3bc_grappleSwingTimer;
|
2022-09-19 04:19:46 +00:00
|
|
|
CVector3f x3c0_grappleSwingAxis;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x3cc_;
|
|
|
|
float x3d0_;
|
|
|
|
float x3d4_;
|
|
|
|
float x3d8_grappleJumpTimeout;
|
2022-09-19 04:19:46 +00:00
|
|
|
bool x3dc_inFreeLook;
|
|
|
|
bool x3dd_lookButtonHeld;
|
|
|
|
bool x3de_lookAnalogHeld;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x3e0_curFreeLookCenteredTime;
|
|
|
|
float x3e4_freeLookYawAngle;
|
|
|
|
float x3e8_horizFreeLookAngleVel;
|
|
|
|
float x3ec_freeLookPitchAngle;
|
|
|
|
float x3f0_vertFreeLookAngleVel;
|
2022-09-19 04:19:46 +00:00
|
|
|
TUniqueId x3f4_aimTarget;
|
|
|
|
CVector3f x3f8_targetAimPosition;
|
|
|
|
TReservedAverage< CVector3f, 10 > x404_aimTargetAverage;
|
|
|
|
CVector3f x480_assistedTargetAim;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x48c_aimTargetTimer;
|
2022-09-19 04:19:46 +00:00
|
|
|
rstl::single_ptr< CPlayerGun > x490_gun;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x494_gunAlpha;
|
2022-09-19 04:19:46 +00:00
|
|
|
EGunHolsterState x498_gunHolsterState;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x49c_gunHolsterRemTime;
|
2024-10-01 04:04:55 +00:00
|
|
|
rstl::single_ptr< CPlayerStuckTracker > x4a0_playerStuckTracker;
|
2022-10-09 05:37:23 +00:00
|
|
|
TReservedAverage< float, 20 > x4a4_moveSpeedAvg;
|
|
|
|
float x4f8_moveSpeed;
|
|
|
|
float x4fc_flatMoveSpeed;
|
2022-09-19 04:19:46 +00:00
|
|
|
CVector3f x500_lookDir;
|
|
|
|
CVector3f x50c_moveDir;
|
|
|
|
CVector3f x518_leaveMorphDir;
|
|
|
|
CVector3f x524_lastPosForDirCalc;
|
|
|
|
CVector3f x530_gunDir;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x53c_timeMoving;
|
2022-09-19 04:19:46 +00:00
|
|
|
CVector3f x540_controlDir;
|
|
|
|
CVector3f x54c_controlDirFlat;
|
|
|
|
bool x558_wasDamaged;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x55c_damageAmt;
|
|
|
|
float x560_prevDamageAmt;
|
2022-09-19 04:19:46 +00:00
|
|
|
CVector3f x564_damageLocation;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x570_immuneTimer;
|
|
|
|
float x574_morphTime;
|
|
|
|
float x578_morphDuration;
|
2022-09-19 04:19:46 +00:00
|
|
|
uint x57c_;
|
|
|
|
uint x580_;
|
|
|
|
int x584_ballTransitionAnim;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x588_alpha;
|
|
|
|
float x58c_transitionVel;
|
2022-09-19 04:19:46 +00:00
|
|
|
bool x590_leaveMorphballAllowed;
|
|
|
|
TReservedAverage< CTransform4f, 4 > x594_transisionBeamXfs;
|
|
|
|
TReservedAverage< CTransform4f, 4 > x658_transitionModelXfs;
|
2022-10-09 05:37:23 +00:00
|
|
|
TReservedAverage< float, 4 > x71c_transitionModelAlphas;
|
2022-09-19 04:19:46 +00:00
|
|
|
rstl::vector< rstl::auto_ptr< CModelData > > x730_transitionModels;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x740_staticTimer;
|
|
|
|
float x744_staticOutSpeed;
|
|
|
|
float x748_staticInSpeed;
|
|
|
|
float x74c_visorStaticAlpha;
|
|
|
|
float x750_frozenTimeout;
|
|
|
|
int x754_iceBreakJumps;
|
|
|
|
float x758_frozenTimeoutBias;
|
|
|
|
int x75c_additionalIceBreakJumps;
|
2022-09-19 04:19:46 +00:00
|
|
|
bool x760_controlsFrozen;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x764_controlsFrozenTimeout;
|
2022-09-19 04:19:46 +00:00
|
|
|
rstl::single_ptr< CMorphBall > x768_morphball;
|
|
|
|
rstl::single_ptr< CPlayerCameraBob > x76c_cameraBob;
|
|
|
|
CSfxHandle x770_damageLoopSfx;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x774_samusVoiceTimeout;
|
2022-09-19 04:19:46 +00:00
|
|
|
CSfxHandle x778_dashSfx;
|
|
|
|
CSfxHandle x77c_samusVoiceSfx;
|
|
|
|
int x780_samusVoicePriority;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x784_damageSfxTimer;
|
|
|
|
ushort x788_damageLoopSfxId;
|
|
|
|
float x78c_footstepSfxTimer;
|
2022-09-19 04:19:46 +00:00
|
|
|
EFootstepSfx x790_footstepSfxSel;
|
|
|
|
CVector3f x794_lastVelocity;
|
|
|
|
CVisorSteam x7a0_visorSteam;
|
|
|
|
CPlayerState::EPlayerSuit x7cc_transitionSuit;
|
2024-09-26 05:54:05 +00:00
|
|
|
CAnimRes x7d0_animRes;
|
2022-09-19 04:19:46 +00:00
|
|
|
CPlayerState::EBeamId x7ec_beam;
|
|
|
|
rstl::single_ptr< CModelData > x7f0_ballTransitionBeamModel;
|
|
|
|
CTransform4f x7f4_gunWorldXf;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x824_transitionFilterTimer;
|
|
|
|
float x828_distanceUnderWater;
|
2022-09-19 04:19:46 +00:00
|
|
|
bool x82c_inLava;
|
|
|
|
TUniqueId x82e_ridingPlatform;
|
|
|
|
TUniqueId x830_playerHint;
|
|
|
|
uint x834_playerHintPriority;
|
|
|
|
rstl::reserved_vector< rstl::pair< uint, TUniqueId >, 32 > x838_playerHints;
|
|
|
|
rstl::reserved_vector< TUniqueId, 32 > x93c_playerHintsToRemove;
|
|
|
|
rstl::reserved_vector< TUniqueId, 32 > x980_playerHintsToAdd;
|
|
|
|
bool x9c4_24_visorChangeRequested : 1;
|
|
|
|
bool x9c4_25_showCrosshairs : 1;
|
|
|
|
bool x9c4_26_ : 1;
|
|
|
|
bool x9c4_27_canEnterMorphBall : 1;
|
|
|
|
bool x9c4_28_canLeaveMorphBall : 1;
|
|
|
|
bool x9c4_29_spiderBallControlXY : 1;
|
|
|
|
bool x9c4_30_controlDirOverride : 1;
|
|
|
|
bool x9c4_31_inWaterMovement : 1;
|
|
|
|
bool x9c5_24_ : 1;
|
|
|
|
bool x9c5_25_splashUpdated : 1;
|
|
|
|
bool x9c5_26_ : 1;
|
|
|
|
bool x9c5_27_camSubmerged : 1;
|
|
|
|
bool x9c5_28_slidingOnWall : 1;
|
|
|
|
bool x9c5_29_hitWall : 1;
|
|
|
|
bool x9c5_30_selectFluidBallSound : 1;
|
|
|
|
bool x9c5_31_stepCameraZBiasDirty : 1;
|
|
|
|
bool x9c6_24_extendTargetDistance : 1;
|
|
|
|
bool x9c6_25_interpolatingControlDir : 1;
|
|
|
|
bool x9c6_26_outOfBallLookAtHint : 1;
|
|
|
|
bool x9c6_27_aimingAtProjectile : 1;
|
|
|
|
bool x9c6_28_aligningGrappleSwingTurn : 1;
|
|
|
|
bool x9c6_29_disableInput : 1;
|
|
|
|
bool x9c6_30_newScanScanning : 1;
|
|
|
|
bool x9c6_31_overrideRadarRadius : 1;
|
|
|
|
bool x9c7_24_noDamageLoopSfx : 1;
|
|
|
|
bool x9c7_25_outOfBallLookAtHintActor : 1;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x9c8_eyeZBias;
|
|
|
|
float x9cc_stepCameraZBias;
|
2022-09-19 04:19:46 +00:00
|
|
|
uint x9d0_bombJumpCount;
|
2022-10-09 05:37:23 +00:00
|
|
|
int x9d4_bombJumpCheckDelayFrames;
|
2022-09-19 04:19:46 +00:00
|
|
|
CVector3f x9d8_controlDirOverrideDir;
|
|
|
|
rstl::reserved_vector< TUniqueId, 5 > x9e4_orbitDisableList;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x9f4_deathTime;
|
|
|
|
float x9f8_controlDirInterpTime;
|
|
|
|
float x9fc_controlDirInterpDur;
|
2022-09-19 04:19:46 +00:00
|
|
|
TUniqueId xa00_deathPowerBomb;
|
2022-10-09 05:37:23 +00:00
|
|
|
float xa04_preThinkDt;
|
2022-09-19 04:19:46 +00:00
|
|
|
CAssetId xa08_steamTextureId;
|
|
|
|
CAssetId xa0c_iceTextureId;
|
2024-10-15 05:47:46 +00:00
|
|
|
int xa10_envDmgCounter;
|
2022-10-09 05:37:23 +00:00
|
|
|
float xa14_envDmgCameraShakeTimer;
|
|
|
|
float xa18_phazonDamageLag;
|
|
|
|
float xa1c_threatOverride;
|
|
|
|
float xa20_radarXYRadiusOverride;
|
|
|
|
float xa24_radarZRadiusOverride;
|
|
|
|
float xa28_attachedActorStruggle;
|
2022-09-19 04:19:46 +00:00
|
|
|
int xa2c_damageLoopSfxDelayTicks;
|
2022-10-09 05:37:23 +00:00
|
|
|
float xa30_samusExhaustedVoiceTimer;
|
2022-09-19 04:19:46 +00:00
|
|
|
};
|
|
|
|
CHECK_SIZEOF(CPlayer, 0xa38)
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CPLAYER
|