From 3fa80babf6e402f5c4eadc807a71e06a9acf8115 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Fri, 18 Aug 2017 20:52:13 -1000 Subject: [PATCH] More CPlayer implementations --- DataSpec/DNACommon/Tweaks/ITweakPlayer.hpp | 47 +- DataSpec/DNAMP1/Tweaks/CTweakPlayer.cpp | 594 ++++----- DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp | 105 +- Runtime/Audio/CSfxManager.cpp | 18 + Runtime/Audio/CSfxManager.hpp | 2 + Runtime/CStateManager.cpp | 4 +- Runtime/CStateManager.hpp | 36 +- Runtime/Camera/CBallCamera.hpp | 4 +- Runtime/Camera/CCameraManager.cpp | 4 +- Runtime/Camera/CFirstPersonCamera.cpp | 59 +- Runtime/Camera/CFirstPersonCamera.hpp | 8 +- Runtime/MP1/CInGameGuiManager.cpp | 2 +- Runtime/MP1/CPlayerVisor.cpp | 2 +- Runtime/Weapon/CPlayerGun.hpp | 3 +- Runtime/World/CDamageInfo.cpp | 2 +- Runtime/World/CDamageInfo.hpp | 4 +- Runtime/World/CMorphBall.cpp | 2 +- Runtime/World/CMorphBall.hpp | 23 +- Runtime/World/CPlayer.cpp | 1365 +++++++++++++++----- Runtime/World/CPlayer.hpp | 131 +- Runtime/World/CPlayerCameraBob.cpp | 6 +- Runtime/World/CPlayerCameraBob.hpp | 22 +- Runtime/World/CScriptPlayerHint.hpp | 6 +- 23 files changed, 1625 insertions(+), 824 deletions(-) diff --git a/DataSpec/DNACommon/Tweaks/ITweakPlayer.hpp b/DataSpec/DNACommon/Tweaks/ITweakPlayer.hpp index f89b178c7..1b3435e45 100644 --- a/DataSpec/DNACommon/Tweaks/ITweakPlayer.hpp +++ b/DataSpec/DNACommon/Tweaks/ITweakPlayer.hpp @@ -22,8 +22,11 @@ struct ITweakPlayer : ITweak virtual float GetVerticalDoubleJumpAccel() const=0; virtual float GetHorizontalDoubleJumpAccel() const=0; virtual float GetWaterJumpFactor() const=0; + virtual float GetWaterBallJumpFactor() const=0; virtual float GetLavaJumpFactor() const=0; + virtual float GetLavaBallJumpFactor() const=0; virtual float GetPhazonJumpFactor() const=0; + virtual float GetPhazonBallJumpFactor() const=0; virtual float GetAllowedJumpTime() const=0; virtual float GetAllowedDoubleJumpTime() const=0; virtual float GetMinDoubleJumpWindow() const=0; @@ -33,6 +36,8 @@ struct ITweakPlayer : ITweak virtual float GetAllowedLedgeTime() const=0; virtual float GetDoubleJumpImpulse() const=0; virtual float GetBackwardsForceMultiplier() const=0; + virtual float GetBombJumpRadius() const=0; + virtual float GetBombJumpHeight() const=0; virtual float GetEyeOffset() const=0; virtual float GetTurnSpeedMultiplier() const=0; virtual float GetFreeLookTurnSpeedMultiplier() const=0; @@ -40,10 +45,12 @@ struct ITweakPlayer : ITweak virtual float GetFreeLookSnapSpeed() const=0; virtual float GetFreeLookCenteredThresholdAngle() const=0; virtual float GetFreeLookCenteredTime() const=0; - virtual float GetOrbitNormalDistance() const=0; - virtual float GetMaxUpwardOrbitLookAngle() const=0; - virtual float GetMaxDownwardOrbitLookAngle() const=0; + virtual float GetOrbitModeTimer() const=0; + virtual float GetOrbitUpperAngle() const=0; + virtual float GetOrbitLowerAngle() const=0; virtual float GetOrbitHorizAngle() const=0; + virtual float GetOrbitMaxTargetDistance() const=0; + virtual float GetOrbitMaxLockDistance() const=0; virtual float GetOrbitDistanceThreshold() const=0; virtual uint32_t GetOrbitScreenBoxHalfExtentX(int zone) const=0; virtual uint32_t GetOrbitScreenBoxHalfExtentY(int zone) const=0; @@ -53,6 +60,7 @@ struct ITweakPlayer : ITweak virtual uint32_t GetOrbitZoneIdealY(int zone) const=0; virtual float GetOrbitNearX() const=0; virtual float GetOrbitNearZ() const=0; + virtual float GetOrbitFixedOffsetZDiff() const=0; virtual float GetOrbitZRange() const=0; virtual bool GetDashEnabled() const=0; virtual bool GetDashOnButtonRelease() const=0; @@ -77,12 +85,14 @@ struct ITweakPlayer : ITweak virtual float GetAimTargetTimer() const=0; virtual float GetAimAssistHorizontalAngle() const=0; virtual float GetAimAssistVerticalAngle() const=0; - virtual float GetScanningFrameSenseRange() const=0; + virtual float GetScanMaxTargetDistance() const=0; + virtual float GetScanMaxLockDistance() const=0; virtual bool GetMoveDuringFreeLook() const=0; virtual bool GetHoldButtonsForFreeLook() const=0; virtual bool GetTwoButtonsForFreeLook() const=0; virtual bool GetAimWhenOrbitingPoint() const=0; virtual bool GetStayInFreeLookWhileFiring() const=0; + virtual bool GetOrbitFixedOffset() const=0; virtual bool GetGunButtonTogglesHolster() const=0; virtual bool GetGunNotFiringHolstersGun() const=0; virtual float GetPlayerHeight() const=0; // x26c @@ -103,23 +113,26 @@ struct ITweakPlayer : ITweak virtual float GetGrappleJumpForce() const=0; virtual float GetGrappleReleaseTime() const=0; virtual uint32_t GetGrappleJumpMode() const=0; - virtual bool InvertGrappleTurn() const=0; + virtual bool GetOrbitReleaseBreaksGrapple() const=0; + virtual bool GetInvertGrappleTurn() const=0; virtual float GetHorizontalFreeLookAngleVel() const=0; virtual float GetVerticalFreeLookAngleVel() const=0; // x134 - virtual float GetX184() const=0; // x184 - virtual float GetX1fc() const=0; - virtual float GetX288() const=0; // x288 - virtual float GetX28c() const=0; // x28c - virtual float GetX290() const=0; // x290 - virtual float GetX294() const=0; // x294 - virtual float GetX298() const=0; // x298 - virtual float GetX29C() const=0; // x29c - virtual float GetX280() const=0; // x280 - virtual float GetX2B0() const=0; // x2b0 - virtual float GetX14C() const=0; // x14c + virtual float GetOrbitCameraSpeed() const=0; // x184 + virtual float GetOrbitPreventionTime() const=0; + virtual float GetJumpCameraPitchDownStart() const=0; // x288 + virtual float GetJumpCameraPitchDownFull() const=0; // x28c + virtual float GetJumpCameraPitchDownAngle() const=0; // x290 + virtual float GetFallCameraPitchDownStart() const=0; // x294 + virtual float GetFallCameraPitchDownFull() const=0; // x298 + virtual float GetFallCameraPitchDownAngle() const=0; // x29c + virtual float GetFirstPersonCameraSpeed() const=0; // x280 + virtual float GetGrappleCameraSpeed() const=0; // x2b0 + virtual float GetFreeLookDampenFactor() const=0; // x14c virtual float GetLeftLogicalThreshold() const=0; virtual float GetRightLogicalThreshold() const=0; - virtual float GetX164(int type) const=0; + virtual float GetOrbitZBasedDistance(int type) const=0; + virtual float GetOrbitNormalDistance(int type) const=0; + virtual float GetOrbitMaxDistance(int type) const=0; virtual float GetFrozenTimeout() const=0; virtual uint32_t GetIceBreakJumpCount() const=0; virtual float GetVariaDamageReduction() const=0; diff --git a/DataSpec/DNAMP1/Tweaks/CTweakPlayer.cpp b/DataSpec/DNAMP1/Tweaks/CTweakPlayer.cpp index 57b83653a..568d831fc 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakPlayer.cpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakPlayer.cpp @@ -117,16 +117,16 @@ void CTweakPlayer::read(athena::io::IStreamReader& __dna_reader) xd8_horizontalDoubleJumpAccel = __dna_reader.readFloatBig(); /* xdc_waterJumpFactor */ xdc_waterJumpFactor = __dna_reader.readFloatBig(); - /* xe0_ */ - xe0_ = __dna_reader.readFloatBig(); + /* xe0_waterBallJumpFactor */ + xe0_waterBallJumpFactor = __dna_reader.readFloatBig(); /* xe4_lavaJumpFactor */ xe4_lavaJumpFactor = __dna_reader.readFloatBig(); - /* xe8_ */ - xe8_ = __dna_reader.readFloatBig(); + /* xe8_lavaBallJumpFactor */ + xe8_lavaBallJumpFactor = __dna_reader.readFloatBig(); /* xec_phazonJumpFactor */ xec_phazonJumpFactor = __dna_reader.readFloatBig(); - /* xf0_ */ - xf0_ = __dna_reader.readFloatBig(); + /* xf0_phazonBallJumpFactor */ + xf0_phazonBallJumpFactor = __dna_reader.readFloatBig(); /* xf4_allowedJumpTime */ xf4_allowedJumpTime = __dna_reader.readFloatBig(); /* xf8_allowedDoubleJumpTime */ @@ -147,10 +147,10 @@ void CTweakPlayer::read(athena::io::IStreamReader& __dna_reader) x114_doubleJumpImpulse = __dna_reader.readFloatBig(); /* x118_backwardsForceMultiplier */ x118_backwardsForceMultiplier = __dna_reader.readFloatBig(); - /* x11c_ */ - x11c_ = __dna_reader.readFloatBig(); - /* x120_ */ - x120_ = __dna_reader.readFloatBig(); + /* x11c_bombJumpRadius */ + x11c_bombJumpRadius = __dna_reader.readFloatBig(); + /* x120_bombJumpHeight */ + x120_bombJumpHeight = __dna_reader.readFloatBig(); /* x124_eyeOffset */ x124_eyeOffset = __dna_reader.readFloatBig(); /* x128_turnSpeedMultiplier */ @@ -171,8 +171,8 @@ void CTweakPlayer::read(athena::io::IStreamReader& __dna_reader) x144_freeLookCenteredThresholdAngle = __dna_reader.readFloatBig(); /* x148_freeLookCenteredTime */ x148_freeLookCenteredTime = __dna_reader.readFloatBig(); - /* x14c_ */ - x14c_ = __dna_reader.readFloatBig(); + /* x14c_freeLookDampenFactor */ + x14c_freeLookDampenFactor = __dna_reader.readFloatBig(); /* x150_leftDiv */ x150_leftDiv = __dna_reader.readFloatBig(); /* x154_rightDiv */ @@ -203,8 +203,8 @@ void CTweakPlayer::read(athena::io::IStreamReader& __dna_reader) x229_27_ = __dna_reader.readBool(); /* x229_28_ */ x229_28_ = __dna_reader.readBool(); - /* x229_29_ */ - x229_29_ = __dna_reader.readBool(); + /* x229_29_orbitFixedOffset */ + x229_29_orbitFixedOffset = __dna_reader.readBool(); /* x229_30_gunButtonTogglesHolster */ x229_30_gunButtonTogglesHolster = __dna_reader.readBool(); /* x229_31_gunNotFiringHolstersGun */ @@ -251,44 +251,44 @@ void CTweakPlayer::read(athena::io::IStreamReader& __dna_reader) x264_aimAssistHorizontalAngle = __dna_reader.readFloatBig(); /* x268_aimAssistVerticalAngle */ x268_aimAssistVerticalAngle = __dna_reader.readFloatBig(); - /* x158_[0] */ - x158_[0] = __dna_reader.readFloatBig(); - /* x164_[0] */ - x164_[0] = __dna_reader.readFloatBig(); - /* x170_[0] */ - x170_[0] = __dna_reader.readFloatBig(); - /* x158_[1] */ - x158_[1] = __dna_reader.readFloatBig(); - /* x164_[1] */ - x164_[1] = __dna_reader.readFloatBig(); - /* x170_[1] */ - x170_[1] = __dna_reader.readFloatBig(); - /* x158_[2] */ - x158_[2] = __dna_reader.readFloatBig(); - /* x164_[2] */ - x164_[2] = __dna_reader.readFloatBig(); - /* x170_[2] */ - x170_[2] = __dna_reader.readFloatBig(); + /* x158_orbitZBasedDistance[0] */ + x158_orbitZBasedDistance[0] = __dna_reader.readFloatBig(); + /* x164_orbitNormalDistance[0] */ + x164_orbitNormalDistance[0] = __dna_reader.readFloatBig(); + /* x170_orbitMaxDistance[0] */ + x170_orbitMaxDistance[0] = __dna_reader.readFloatBig(); + /* x158_orbitZBasedDistance[1] */ + x158_orbitZBasedDistance[1] = __dna_reader.readFloatBig(); + /* x164_orbitNormalDistance[1] */ + x164_orbitNormalDistance[1] = __dna_reader.readFloatBig(); + /* x170_orbitMaxDistance[1] */ + x170_orbitMaxDistance[1] = __dna_reader.readFloatBig(); + /* x158_orbitZBasedDistance[2] */ + x158_orbitZBasedDistance[2] = __dna_reader.readFloatBig(); + /* x164_orbitNormalDistance[2] */ + x164_orbitNormalDistance[2] = __dna_reader.readFloatBig(); + /* x170_orbitMaxDistance[2] */ + x170_orbitMaxDistance[2] = __dna_reader.readFloatBig(); /* x17c_ */ x17c_ = __dna_reader.readFloatBig(); - /* x180_ */ - x180_orbitNormalDistance = __dna_reader.readFloatBig(); - /* x184_ */ - x184_ = __dna_reader.readFloatBig(); - /* x188_maxUpwardOrbitLookAngle */ - x188_maxUpwardOrbitLookAngle = __dna_reader.readFloatBig(); - /* x18c_maxDownwardOrbitLookAngle */ - x18c_maxDownwardOrbitLookAngle = __dna_reader.readFloatBig(); + /* x180_orbitModeTimer */ + x180_orbitModeTimer = __dna_reader.readFloatBig(); + /* x184_orbitCameraSpeed */ + x184_orbitCameraSpeed = __dna_reader.readFloatBig(); + /* x188_orbitUpperAngle */ + x188_orbitUpperAngle = __dna_reader.readFloatBig(); + /* x18c_orbitLowerAngle */ + x18c_orbitLowerAngle = __dna_reader.readFloatBig(); /* x190_orbitHorizAngle */ x190_orbitHorizAngle = __dna_reader.readFloatBig(); /* x194_ */ x194_ = __dna_reader.readFloatBig(); /* x198_ */ x198_ = __dna_reader.readFloatBig(); - /* x19c_ */ - x19c_ = __dna_reader.readFloatBig(); - /* x1a0_ */ - x1a0_ = __dna_reader.readFloatBig(); + /* x19c_orbitMaxTargetDistance */ + x19c_orbitMaxTargetDistance = __dna_reader.readFloatBig(); + /* x1a0_orbitMaxLockDistance */ + x1a0_orbitMaxLockDistance = __dna_reader.readFloatBig(); /* x1a4_orbitDistanceThreshold */ x1a4_orbitDistanceThreshold = __dna_reader.readFloatBig(); /* x1a8_orbitScreenBoxHalfExtentX[0] */ @@ -323,8 +323,8 @@ void CTweakPlayer::read(athena::io::IStreamReader& __dna_reader) x1e0_ = __dna_reader.readFloatBig(); /* x1e4_ */ x1e4_ = __dna_reader.readFloatBig(); - /* x1e8_ */ - x1e8_ = __dna_reader.readFloatBig(); + /* x1e8_orbitFixedOffsetZDiff */ + x1e8_orbitFixedOffsetZDiff = __dna_reader.readFloatBig(); /* x1ec_orbitZRange */ x1ec_orbitZRange = __dna_reader.readFloatBig(); /* x1f0_ */ @@ -333,8 +333,8 @@ void CTweakPlayer::read(athena::io::IStreamReader& __dna_reader) x1f4_ = __dna_reader.readFloatBig(); /* x1f8_ */ x1f8_ = __dna_reader.readFloatBig(); - /* x1fc_ */ - x1fc_ = __dna_reader.readFloatBig(); + /* x1fc_orbitPreventionTime */ + x1fc_orbitPreventionTime = __dna_reader.readFloatBig(); /* x200_24_dashEnabled */ x200_24_dashEnabled = __dna_reader.readBool(); /* x200_25_dashOnButtonRelease */ @@ -357,10 +357,10 @@ void CTweakPlayer::read(athena::io::IStreamReader& __dna_reader) x21c_25_scanFreezesGame = __dna_reader.readBool(); /* x21c_26_orbitWhileScanning */ x21c_26_orbitWhileScanning = __dna_reader.readBool(); - /* x220_ */ - x220_ = __dna_reader.readFloatBig(); - /* x224_scanningFrameSenseRange */ - x224_scanningFrameSenseRange = __dna_reader.readFloatBig(); + /* x220_scanMaxTargetDistance */ + x220_scanMaxTargetDistance = __dna_reader.readFloatBig(); + /* x224_scanMaxLockDistance */ + x224_scanMaxLockDistance = __dna_reader.readFloatBig(); /* x2a0_orbitDistanceMax */ x2a0_orbitDistanceMax = __dna_reader.readFloatBig(); /* x2a4_grappleSwingLength */ @@ -370,7 +370,7 @@ void CTweakPlayer::read(athena::io::IStreamReader& __dna_reader) /* x2ac_grapplePullSpeedMin */ x2ac_grapplePullSpeedMin = __dna_reader.readFloatBig(); /* x2b0_ */ - x2b0_ = __dna_reader.readFloatBig(); + x2b0_grappleCameraSpeed = __dna_reader.readFloatBig(); /* x2b4_maxGrappleLockedTurnAlignDistance */ x2b4_maxGrappleLockedTurnAlignDistance = __dna_reader.readFloatBig(); /* x2b8_grapplePullSpeedProportion */ @@ -387,9 +387,9 @@ void CTweakPlayer::read(athena::io::IStreamReader& __dna_reader) x2cc_grappleReleaseTime = __dna_reader.readFloatBig(); /* x2d0_grappleJumpMode */ x2d0_grappleJumpMode = __dna_reader.readUint32Big(); - /* x2d4_ */ - x2d4_ = __dna_reader.readBool(); - /* x2d5_ */ + /* x2d4_orbitReleaseBreaksGrapple */ + x2d4_orbitReleaseBreaksGrapple = __dna_reader.readBool(); + /* x2d5_invertGrappleTurn */ x2d5_invertGrappleTurn = __dna_reader.readBool(); /* x2d8_ */ x2d8_ = __dna_reader.readFloatBig(); @@ -410,21 +410,21 @@ void CTweakPlayer::read(athena::io::IStreamReader& __dna_reader) /* x27c_playerBallHalfExtent */ x27c_playerBallHalfExtent = __dna_reader.readFloatBig(); /* x280_ */ - x280_ = __dna_reader.readFloatBig(); + x280_firstPersonCameraSpeed = __dna_reader.readFloatBig(); /* x284_ */ x284_ = __dna_reader.readFloatBig(); - /* x288_ */ - x288_ = __dna_reader.readFloatBig(); - /* x28c_ */ - x28c_ = __dna_reader.readFloatBig(); - /* x290_ */ - x290_ = __dna_reader.readFloatBig(); - /* x294_ */ - x294_ = __dna_reader.readFloatBig(); - /* x298_ */ - x298_ = __dna_reader.readFloatBig(); - /* x29c_ */ - x29c_ = __dna_reader.readFloatBig(); + /* x288_jumpCameraPitchDownStart */ + x288_jumpCameraPitchDownStart = __dna_reader.readFloatBig(); + /* x28c_jumpCameraPitchDownFull */ + x28c_jumpCameraPitchDownFull = __dna_reader.readFloatBig(); + /* x290_jumpCameraPitchDownAngle */ + x290_jumpCameraPitchDownAngle = __dna_reader.readFloatBig(); + /* x294_fallCameraPitchDownStart */ + x294_fallCameraPitchDownStart = __dna_reader.readFloatBig(); + /* x298_fallCameraPitchDownFull */ + x298_fallCameraPitchDownFull = __dna_reader.readFloatBig(); + /* x29c_fallCameraPitchDownAngle */ + x29c_fallCameraPitchDownAngle = __dna_reader.readFloatBig(); /* x2e8_ */ x2e8_ = __dna_reader.readFloatBig(); /* x2ec_ */ @@ -557,16 +557,16 @@ void CTweakPlayer::write(athena::io::IStreamWriter& __dna_writer) const __dna_writer.writeFloatBig(xd8_horizontalDoubleJumpAccel); /* xdc_waterJumpFactor */ __dna_writer.writeFloatBig(xdc_waterJumpFactor); - /* xe0_ */ - __dna_writer.writeFloatBig(xe0_); + /* xe0_waterBallJumpFactor */ + __dna_writer.writeFloatBig(xe0_waterBallJumpFactor); /* xe4_lavaJumpFactor */ __dna_writer.writeFloatBig(xe4_lavaJumpFactor); - /* xe8_ */ - __dna_writer.writeFloatBig(xe8_); + /* xe8_lavaBallJumpFactor */ + __dna_writer.writeFloatBig(xe8_lavaBallJumpFactor); /* xec_phazonJumpFactor */ __dna_writer.writeFloatBig(xec_phazonJumpFactor); - /* xf0_ */ - __dna_writer.writeFloatBig(xf0_); + /* xf0_phazonBallJumpFactor */ + __dna_writer.writeFloatBig(xf0_phazonBallJumpFactor); /* xf4_allowedJumpTime */ __dna_writer.writeFloatBig(xf4_allowedJumpTime); /* xf8_allowedDoubleJumpTime */ @@ -587,10 +587,10 @@ void CTweakPlayer::write(athena::io::IStreamWriter& __dna_writer) const __dna_writer.writeFloatBig(x114_doubleJumpImpulse); /* x118_backwardsForceMultiplier */ __dna_writer.writeFloatBig(x118_backwardsForceMultiplier); - /* x11c_ */ - __dna_writer.writeFloatBig(x11c_); - /* x120_ */ - __dna_writer.writeFloatBig(x120_); + /* x11c_bombJumpRadius */ + __dna_writer.writeFloatBig(x11c_bombJumpRadius); + /* x120_bombJumpHeight */ + __dna_writer.writeFloatBig(x120_bombJumpHeight); /* x124_eyeOffset */ __dna_writer.writeFloatBig(x124_eyeOffset); /* x128_turnSpeedMultiplier */ @@ -611,8 +611,8 @@ void CTweakPlayer::write(athena::io::IStreamWriter& __dna_writer) const __dna_writer.writeFloatBig(x144_freeLookCenteredThresholdAngle); /* x148_freeLookCenteredTime */ __dna_writer.writeFloatBig(x148_freeLookCenteredTime); - /* x14c_ */ - __dna_writer.writeFloatBig(x14c_); + /* x14c_freeLookDampenFactor */ + __dna_writer.writeFloatBig(x14c_freeLookDampenFactor); /* x150_leftDiv */ __dna_writer.writeFloatBig(x150_leftDiv); /* x154_rightDiv */ @@ -643,8 +643,8 @@ void CTweakPlayer::write(athena::io::IStreamWriter& __dna_writer) const __dna_writer.writeBool(x229_27_); /* x229_28_ */ __dna_writer.writeBool(x229_28_); - /* x229_29_ */ - __dna_writer.writeBool(x229_29_); + /* x229_29_orbitFixedOffset */ + __dna_writer.writeBool(x229_29_orbitFixedOffset); /* x229_30_gunButtonTogglesHolster */ __dna_writer.writeBool(x229_30_gunButtonTogglesHolster); /* x229_31_gunNotFiringHolstersGun */ @@ -691,44 +691,44 @@ void CTweakPlayer::write(athena::io::IStreamWriter& __dna_writer) const __dna_writer.writeFloatBig(x264_aimAssistHorizontalAngle); /* x268_aimAssistVerticalAngle */ __dna_writer.writeFloatBig(x268_aimAssistVerticalAngle); - /* x158_[0] */ - __dna_writer.writeFloatBig(x158_[0]); - /* x164_[0] */ - __dna_writer.writeFloatBig(x164_[0]); - /* x170_[0] */ - __dna_writer.writeFloatBig(x170_[0]); - /* x158_[1] */ - __dna_writer.writeFloatBig(x158_[1]); - /* x164_[1] */ - __dna_writer.writeFloatBig(x164_[1]); - /* x170_[1] */ - __dna_writer.writeFloatBig(x170_[1]); - /* x158_[2] */ - __dna_writer.writeFloatBig(x158_[2]); - /* x164_[2] */ - __dna_writer.writeFloatBig(x164_[2]); - /* x170_[2] */ - __dna_writer.writeFloatBig(x170_[2]); + /* x158_orbitZBasedDistance[0] */ + __dna_writer.writeFloatBig(x158_orbitZBasedDistance[0]); + /* x164_orbitNormalDistance[0] */ + __dna_writer.writeFloatBig(x164_orbitNormalDistance[0]); + /* x170_orbitMaxDistance[0] */ + __dna_writer.writeFloatBig(x170_orbitMaxDistance[0]); + /* x158_orbitZBasedDistance[1] */ + __dna_writer.writeFloatBig(x158_orbitZBasedDistance[1]); + /* x164_orbitNormalDistance[1] */ + __dna_writer.writeFloatBig(x164_orbitNormalDistance[1]); + /* x170_orbitMaxDistance[1] */ + __dna_writer.writeFloatBig(x170_orbitMaxDistance[1]); + /* x158_orbitZBasedDistance[2] */ + __dna_writer.writeFloatBig(x158_orbitZBasedDistance[2]); + /* x164_orbitNormalDistance[2] */ + __dna_writer.writeFloatBig(x164_orbitNormalDistance[2]); + /* x170_orbitMaxDistance[2] */ + __dna_writer.writeFloatBig(x170_orbitMaxDistance[2]); /* x17c_ */ __dna_writer.writeFloatBig(x17c_); - /* x180_ */ - __dna_writer.writeFloatBig(x180_orbitNormalDistance); - /* x184_ */ - __dna_writer.writeFloatBig(x184_); - /* x188_maxUpwardOrbitLookAngle */ - __dna_writer.writeFloatBig(x188_maxUpwardOrbitLookAngle); - /* x18c_maxDownwardOrbitLookAngle */ - __dna_writer.writeFloatBig(x18c_maxDownwardOrbitLookAngle); + /* x180_orbitModeTimer */ + __dna_writer.writeFloatBig(x180_orbitModeTimer); + /* x184_orbitCameraSpeed */ + __dna_writer.writeFloatBig(x184_orbitCameraSpeed); + /* x188_orbitUpperAngle */ + __dna_writer.writeFloatBig(x188_orbitUpperAngle); + /* x18c_orbitLowerAngle */ + __dna_writer.writeFloatBig(x18c_orbitLowerAngle); /* x190_orbitHorizAngle */ __dna_writer.writeFloatBig(x190_orbitHorizAngle); /* x194_ */ __dna_writer.writeFloatBig(x194_); /* x198_ */ __dna_writer.writeFloatBig(x198_); - /* x19c_ */ - __dna_writer.writeFloatBig(x19c_); - /* x1a0_ */ - __dna_writer.writeFloatBig(x1a0_); + /* x19c_orbitMaxTargetDistance */ + __dna_writer.writeFloatBig(x19c_orbitMaxTargetDistance); + /* x1a0_orbitMaxLockDistance */ + __dna_writer.writeFloatBig(x1a0_orbitMaxLockDistance); /* x1a4_orbitDistanceThreshold */ __dna_writer.writeFloatBig(x1a4_orbitDistanceThreshold); /* x1a8_orbitScreenBoxHalfExtentX[0] */ @@ -763,8 +763,8 @@ void CTweakPlayer::write(athena::io::IStreamWriter& __dna_writer) const __dna_writer.writeFloatBig(x1e0_); /* x1e4_ */ __dna_writer.writeFloatBig(x1e4_); - /* x1e8_ */ - __dna_writer.writeFloatBig(x1e8_); + /* x1e8_orbitFixedOffsetZDiff */ + __dna_writer.writeFloatBig(x1e8_orbitFixedOffsetZDiff); /* x1ec_orbitZRange */ __dna_writer.writeFloatBig(x1ec_orbitZRange); /* x1f0_ */ @@ -773,8 +773,8 @@ void CTweakPlayer::write(athena::io::IStreamWriter& __dna_writer) const __dna_writer.writeFloatBig(x1f4_); /* x1f8_ */ __dna_writer.writeFloatBig(x1f8_); - /* x1fc_ */ - __dna_writer.writeFloatBig(x1fc_); + /* x1fc_orbitPreventionTime */ + __dna_writer.writeFloatBig(x1fc_orbitPreventionTime); /* x200_24_dashEnabled */ __dna_writer.writeBool(x200_24_dashEnabled); /* x200_25_dashOnButtonRelease */ @@ -797,10 +797,10 @@ void CTweakPlayer::write(athena::io::IStreamWriter& __dna_writer) const __dna_writer.writeBool(x21c_25_scanFreezesGame); /* x21c_26_orbitWhileScanning */ __dna_writer.writeBool(x21c_26_orbitWhileScanning); - /* x220_ */ - __dna_writer.writeFloatBig(x220_); - /* x224_scanningFrameSenseRange */ - __dna_writer.writeFloatBig(x224_scanningFrameSenseRange); + /* x220_scanMaxTargetDistance */ + __dna_writer.writeFloatBig(x220_scanMaxTargetDistance); + /* x224_scanMaxLockDistance */ + __dna_writer.writeFloatBig(x224_scanMaxLockDistance); /* x2a0_orbitDistanceMax */ __dna_writer.writeFloatBig(x2a0_orbitDistanceMax); /* x2a4_grappleSwingLength */ @@ -810,7 +810,7 @@ void CTweakPlayer::write(athena::io::IStreamWriter& __dna_writer) const /* x2ac_grapplePullSpeedMin */ __dna_writer.writeFloatBig(x2ac_grapplePullSpeedMin); /* x2b0_ */ - __dna_writer.writeFloatBig(x2b0_); + __dna_writer.writeFloatBig(x2b0_grappleCameraSpeed); /* x2b4_maxGrappleLockedTurnAlignDistance */ __dna_writer.writeFloatBig(x2b4_maxGrappleLockedTurnAlignDistance); /* x2b8_grapplePullSpeedProportion */ @@ -827,9 +827,9 @@ void CTweakPlayer::write(athena::io::IStreamWriter& __dna_writer) const __dna_writer.writeFloatBig(x2cc_grappleReleaseTime); /* x2d0_grappleJumpMode */ __dna_writer.writeUint32Big(x2d0_grappleJumpMode); - /* x2d4_ */ - __dna_writer.writeBool(x2d4_); - /* x2d5_ */ + /* x2d4_orbitReleaseBreaksGrapple */ + __dna_writer.writeBool(x2d4_orbitReleaseBreaksGrapple); + /* x2d5_invertGrappleTurn */ __dna_writer.writeBool(x2d5_invertGrappleTurn); /* x2d8_ */ __dna_writer.writeFloatBig(x2d8_); @@ -850,21 +850,21 @@ void CTweakPlayer::write(athena::io::IStreamWriter& __dna_writer) const /* x27c_playerBallHalfExtent */ __dna_writer.writeFloatBig(x27c_playerBallHalfExtent); /* x280_ */ - __dna_writer.writeFloatBig(x280_); + __dna_writer.writeFloatBig(x280_firstPersonCameraSpeed); /* x284_ */ __dna_writer.writeFloatBig(x284_); - /* x288_ */ - __dna_writer.writeFloatBig(x288_); - /* x28c_ */ - __dna_writer.writeFloatBig(x28c_); - /* x290_ */ - __dna_writer.writeFloatBig(x290_); - /* x294_ */ - __dna_writer.writeFloatBig(x294_); - /* x298_ */ - __dna_writer.writeFloatBig(x298_); - /* x29c_ */ - __dna_writer.writeFloatBig(x29c_); + /* x288_jumpCameraPitchDownStart */ + __dna_writer.writeFloatBig(x288_jumpCameraPitchDownStart); + /* x28c_jumpCameraPitchDownFull */ + __dna_writer.writeFloatBig(x28c_jumpCameraPitchDownFull); + /* x290_jumpCameraPitchDownAngle */ + __dna_writer.writeFloatBig(x290_jumpCameraPitchDownAngle); + /* x294_fallCameraPitchDownStart */ + __dna_writer.writeFloatBig(x294_fallCameraPitchDownStart); + /* x298_fallCameraPitchDownFull */ + __dna_writer.writeFloatBig(x298_fallCameraPitchDownFull); + /* x29c_fallCameraPitchDownAngle */ + __dna_writer.writeFloatBig(x29c_fallCameraPitchDownAngle); /* x2e8_ */ __dna_writer.writeFloatBig(x2e8_); /* x2ec_ */ @@ -1027,16 +1027,16 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin) xd8_horizontalDoubleJumpAccel = __dna_docin.readFloat("xd8_horizontalDoubleJumpAccel"); /* xdc_waterJumpFactor */ xdc_waterJumpFactor = __dna_docin.readFloat("xdc_waterJumpFactor"); - /* xe0_ */ - xe0_ = __dna_docin.readFloat("xe0_"); + /* xe0_waterBallJumpFactor */ + xe0_waterBallJumpFactor = __dna_docin.readFloat("xe0_waterBallJumpFactor"); /* xe4_lavaJumpFactor */ xe4_lavaJumpFactor = __dna_docin.readFloat("xe4_lavaJumpFactor"); - /* xe8_ */ - xe8_ = __dna_docin.readFloat("xe8_"); + /* xe8_lavaBallJumpFactor */ + xe8_lavaBallJumpFactor = __dna_docin.readFloat("xe8_lavaBallJumpFactor"); /* xec_phazonJumpFactor */ xec_phazonJumpFactor = __dna_docin.readFloat("xec_phazonJumpFactor"); - /* xf0_ */ - xf0_ = __dna_docin.readFloat("xf0_"); + /* xf0_phazonBallJumpFactor */ + xf0_phazonBallJumpFactor = __dna_docin.readFloat("xf0_phazonBallJumpFactor"); /* xf4_allowedJumpTime */ xf4_allowedJumpTime = __dna_docin.readFloat("xf4_allowedJumpTime"); /* xf8_allowedDoubleJumpTime */ @@ -1057,10 +1057,10 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin) x114_doubleJumpImpulse = __dna_docin.readFloat("x114_doubleJumpImpulse"); /* x118_backwardsForceMultiplier */ x118_backwardsForceMultiplier = __dna_docin.readFloat("x118_backwardsForceMultiplier"); - /* x11c_ */ - x11c_ = __dna_docin.readFloat("x11c_"); - /* x120_ */ - x120_ = __dna_docin.readFloat("x120_"); + /* x11c_bombJumpRadius */ + x11c_bombJumpRadius = __dna_docin.readFloat("x11c_bombJumpRadius"); + /* x120_bombJumpHeight */ + x120_bombJumpHeight = __dna_docin.readFloat("x120_bombJumpHeight"); /* x124_eyeOffset */ x124_eyeOffset = __dna_docin.readFloat("x124_eyeOffset"); /* x128_turnSpeedMultiplier */ @@ -1081,8 +1081,8 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin) x144_freeLookCenteredThresholdAngle = __dna_docin.readFloat("x144_freeLookCenteredThresholdAngle"); /* x148_freeLookCenteredTime */ x148_freeLookCenteredTime = __dna_docin.readFloat("x148_freeLookCenteredTime"); - /* x14c_ */ - x14c_ = __dna_docin.readFloat("x14c_"); + /* x14c_freeLookDampenFactor */ + x14c_freeLookDampenFactor = __dna_docin.readFloat("x14c_freeLookDampenFactor"); /* x150_leftDiv */ x150_leftDiv = __dna_docin.readFloat("x150_leftDiv"); /* x154_rightDiv */ @@ -1113,8 +1113,8 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin) x229_27_ = __dna_docin.readBool("x229_27_"); /* x229_28_ */ x229_28_ = __dna_docin.readBool("x229_28_"); - /* x229_29_ */ - x229_29_ = __dna_docin.readBool("x229_29_"); + /* x229_29_orbitFixedOffset */ + x229_29_orbitFixedOffset = __dna_docin.readBool("x229_29_orbitFixedOffset"); /* x229_30_gunButtonTogglesHolster */ x229_30_gunButtonTogglesHolster = __dna_docin.readBool("x229_30_gunButtonTogglesHolster"); /* x229_31_gunNotFiringHolstersGun */ @@ -1161,59 +1161,59 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin) x264_aimAssistHorizontalAngle = __dna_docin.readFloat("x264_aimAssistHorizontalAngle"); /* x268_aimAssistVerticalAngle */ x268_aimAssistVerticalAngle = __dna_docin.readFloat("x268_aimAssistVerticalAngle"); - /* x158_ */ + /* x158_orbitZBasedDistance */ size_t __x158_Count; - if (auto v = __dna_docin.enterSubVector("x158_", __x158_Count)) + if (auto v = __dna_docin.enterSubVector("x158_orbitZBasedDistance", __x158_Count)) { - /* x158_[0] */ - x158_[0] = __dna_docin.readFloat("x158_"); - /* x158_[1] */ - x158_[1] = __dna_docin.readFloat("x158_"); - /* x158_[2] */ - x158_[2] = __dna_docin.readFloat("x158_"); + /* x158_orbitZBasedDistance[0] */ + x158_orbitZBasedDistance[0] = __dna_docin.readFloat("x158_orbitZBasedDistance"); + /* x158_orbitZBasedDistance[1] */ + x158_orbitZBasedDistance[1] = __dna_docin.readFloat("x158_orbitZBasedDistance"); + /* x158_orbitZBasedDistance[2] */ + x158_orbitZBasedDistance[2] = __dna_docin.readFloat("x158_orbitZBasedDistance"); } - /* x164_ */ + /* x164_orbitNormalDistance */ size_t __x164_Count; - if (auto v = __dna_docin.enterSubVector("x164_", __x164_Count)) + if (auto v = __dna_docin.enterSubVector("x164_orbitNormalDistance", __x164_Count)) { - /* x164_[0] */ - x164_[0] = __dna_docin.readFloat("x164_"); - /* x164_[1] */ - x164_[1] = __dna_docin.readFloat("x164_"); - /* x164_[2] */ - x164_[2] = __dna_docin.readFloat("x164_"); + /* x164_orbitNormalDistance[0] */ + x164_orbitNormalDistance[0] = __dna_docin.readFloat("x164_orbitNormalDistance"); + /* x164_orbitNormalDistance[1] */ + x164_orbitNormalDistance[1] = __dna_docin.readFloat("x164_orbitNormalDistance"); + /* x164_orbitNormalDistance[2] */ + x164_orbitNormalDistance[2] = __dna_docin.readFloat("x164_orbitNormalDistance"); } - /* x170_ */ + /* x170_orbitMaxDistance */ size_t __x170_Count; - if (auto v = __dna_docin.enterSubVector("x170_", __x170_Count)) + if (auto v = __dna_docin.enterSubVector("x170_orbitMaxDistance", __x170_Count)) { - /* x170_[0] */ - x170_[0] = __dna_docin.readFloat("x170_"); - /* x170_[1] */ - x170_[1] = __dna_docin.readFloat("x170_"); - /* x170_[2] */ - x170_[2] = __dna_docin.readFloat("x170_"); + /* x170_orbitMaxDistance[0] */ + x170_orbitMaxDistance[0] = __dna_docin.readFloat("x170_orbitMaxDistance"); + /* x170_orbitMaxDistance[1] */ + x170_orbitMaxDistance[1] = __dna_docin.readFloat("x170_orbitMaxDistance"); + /* x170_orbitMaxDistance[2] */ + x170_orbitMaxDistance[2] = __dna_docin.readFloat("x170_orbitMaxDistance"); } /* x17c_ */ x17c_ = __dna_docin.readFloat("x17c_"); - /* x180_orbitNormalDistance */ - x180_orbitNormalDistance = __dna_docin.readFloat("x180_orbitNormalDistance"); - /* x184_ */ - x184_ = __dna_docin.readFloat("x184_"); - /* x188_maxUpwardOrbitLookAngle */ - x188_maxUpwardOrbitLookAngle = __dna_docin.readFloat("x188_maxUpwardOrbitLookAngle"); - /* x18c_maxDownwardOrbitLookAngle */ - x18c_maxDownwardOrbitLookAngle = __dna_docin.readFloat("x18c_maxDownwardOrbitLookAngle"); + /* x180_orbitModeTimer */ + x180_orbitModeTimer = __dna_docin.readFloat("x180_orbitModeTimer"); + /* x184_orbitCameraSpeed */ + x184_orbitCameraSpeed = __dna_docin.readFloat("x184_orbitCameraSpeed"); + /* x188_orbitUpperAngle */ + x188_orbitUpperAngle = __dna_docin.readFloat("x188_orbitUpperAngle"); + /* x18c_orbitLowerAngle */ + x18c_orbitLowerAngle = __dna_docin.readFloat("x18c_orbitLowerAngle"); /* x190_orbitHorizAngle */ x190_orbitHorizAngle = __dna_docin.readFloat("x190_orbitHorizAngle"); /* x194_ */ x194_ = __dna_docin.readFloat("x194_"); /* x198_ */ x198_ = __dna_docin.readFloat("x198_"); - /* x19c_ */ - x19c_ = __dna_docin.readFloat("x19c_"); - /* x1a0_ */ - x1a0_ = __dna_docin.readFloat("x1a0_"); + /* x19c_orbitMaxTargetDistance */ + x19c_orbitMaxTargetDistance = __dna_docin.readFloat("x19c_orbitMaxTargetDistance"); + /* x1a0_orbitMaxLockDistance */ + x1a0_orbitMaxLockDistance = __dna_docin.readFloat("x1a0_orbitMaxLockDistance"); /* x1a4_orbitDistanceThreshold */ x1a4_orbitDistanceThreshold = __dna_docin.readFloat("x1a4_orbitDistanceThreshold"); /* x1a8_orbitScreenBoxHalfExtentX */ @@ -1278,8 +1278,8 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin) x1e0_ = __dna_docin.readFloat("x1e0_"); /* x1e4_ */ x1e4_ = __dna_docin.readFloat("x1e4_"); - /* x1e8_ */ - x1e8_ = __dna_docin.readFloat("x1e8_"); + /* x1e8_orbitFixedOffsetZDiff */ + x1e8_orbitFixedOffsetZDiff = __dna_docin.readFloat("x1e8_orbitFixedOffsetZDiff"); /* x1ec_orbitZRange */ x1ec_orbitZRange = __dna_docin.readFloat("x1ec_orbitZRange"); /* x1f0_ */ @@ -1288,8 +1288,8 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin) x1f4_ = __dna_docin.readFloat("x1f4_"); /* x1f8_ */ x1f8_ = __dna_docin.readFloat("x1f8_"); - /* x1fc_ */ - x1fc_ = __dna_docin.readFloat("x1fc_"); + /* x1fc_orbitPreventionTime */ + x1fc_orbitPreventionTime = __dna_docin.readFloat("x1fc_orbitPreventionTime"); /* x200_24_dashEnabled */ x200_24_dashEnabled = __dna_docin.readBool("x200_24_dashEnabled"); /* x200_25_dashOnButtonRelease */ @@ -1312,10 +1312,10 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin) x21c_25_scanFreezesGame = __dna_docin.readBool("x21c_25_scanFreezesGame"); /* x21c_26_orbitWhileScanning */ x21c_26_orbitWhileScanning = __dna_docin.readBool("x21c_26_orbitWhileScanning"); - /* x220_ */ - x220_ = __dna_docin.readFloat("x220_"); - /* x224_scanningFrameSenseRange */ - x224_scanningFrameSenseRange = __dna_docin.readFloat("x224_scanningFrameSenseRange"); + /* x220_scanMaxTargetDistance */ + x220_scanMaxTargetDistance = __dna_docin.readFloat("x220_scanMaxTargetDistance"); + /* x224_scanMaxLockDistance */ + x224_scanMaxLockDistance = __dna_docin.readFloat("x224_scanMaxLockDistance"); /* x2a0_orbitDistanceMax */ x2a0_orbitDistanceMax = __dna_docin.readFloat("x2a0_orbitDistanceMax"); /* x2a4_grappleSwingLength */ @@ -1325,7 +1325,7 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin) /* x2ac_grapplePullSpeedMin */ x2ac_grapplePullSpeedMin = __dna_docin.readFloat("x2ac_grapplePullSpeedMin"); /* x2b0_ */ - x2b0_ = __dna_docin.readFloat("x2b0_"); + x2b0_grappleCameraSpeed = __dna_docin.readFloat("x2b0_"); /* x2b4_maxGrappleLockedTurnAlignDistance */ x2b4_maxGrappleLockedTurnAlignDistance = __dna_docin.readFloat("x2b4_maxGrappleLockedTurnAlignDistance"); /* x2b8_grapplePullSpeedProportion */ @@ -1342,10 +1342,10 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin) x2cc_grappleReleaseTime = __dna_docin.readFloat("x2cc_grappleReleaseTime"); /* x2d0_grappleJumpMode */ x2d0_grappleJumpMode = __dna_docin.readUint32("x2d0_grappleJumpMode"); - /* x2d4_ */ - x2d4_ = __dna_docin.readBool("x2d4_"); - /* x2d5_ */ - x2d5_invertGrappleTurn = __dna_docin.readBool("x2d5_"); + /* x2d4_orbitReleaseBreaksGrapple */ + x2d4_orbitReleaseBreaksGrapple = __dna_docin.readBool("x2d4_orbitReleaseBreaksGrapple"); + /* x2d5_invertGrappleTurn */ + x2d5_invertGrappleTurn = __dna_docin.readBool("x2d5_invertGrappleTurn"); /* x2d8_ */ x2d8_ = __dna_docin.readFloat("x2d8_"); /* x2dc_ */ @@ -1365,21 +1365,21 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin) /* x27c_playerBallHalfExtent */ x27c_playerBallHalfExtent = __dna_docin.readFloat("x27c_playerBallHalfExtent"); /* x280_ */ - x280_ = __dna_docin.readFloat("x280_"); + x280_firstPersonCameraSpeed = __dna_docin.readFloat("x280_"); /* x284_ */ x284_ = __dna_docin.readFloat("x284_"); - /* x288_ */ - x288_ = __dna_docin.readFloat("x288_"); - /* x28c_ */ - x28c_ = __dna_docin.readFloat("x28c_"); - /* x290_ */ - x290_ = __dna_docin.readFloat("x290_"); - /* x294_ */ - x294_ = __dna_docin.readFloat("x294_"); - /* x298_ */ - x298_ = __dna_docin.readFloat("x298_"); - /* x29c_ */ - x29c_ = __dna_docin.readFloat("x29c_"); + /* x288_jumpCameraPitchDownStart */ + x288_jumpCameraPitchDownStart = __dna_docin.readFloat("x288_jumpCameraPitchDownStart"); + /* x28c_jumpCameraPitchDownFull */ + x28c_jumpCameraPitchDownFull = __dna_docin.readFloat("x28c_jumpCameraPitchDownFull"); + /* x290_jumpCameraPitchDownAngle */ + x290_jumpCameraPitchDownAngle = __dna_docin.readFloat("x290_jumpCameraPitchDownAngle"); + /* x294_fallCameraPitchDownStart */ + x294_fallCameraPitchDownStart = __dna_docin.readFloat("x294_fallCameraPitchDownStart"); + /* x298_fallCameraPitchDownFull */ + x298_fallCameraPitchDownFull = __dna_docin.readFloat("x298_fallCameraPitchDownFull"); + /* x29c_fallCameraPitchDownAngle */ + x29c_fallCameraPitchDownAngle = __dna_docin.readFloat("x29c_fallCameraPitchDownAngle"); /* x2e8_ */ x2e8_ = __dna_docin.readFloat("x2e8_"); /* x2ec_ */ @@ -1536,16 +1536,16 @@ void CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout) const __dna_docout.writeFloat("xd8_horizontalDoubleJumpAccel", xd8_horizontalDoubleJumpAccel); /* xdc_waterJumpFactor */ __dna_docout.writeFloat("xdc_waterJumpFactor", xdc_waterJumpFactor); - /* xe0_ */ - __dna_docout.writeFloat("xe0_", xe0_); + /* xe0_waterBallJumpFactor */ + __dna_docout.writeFloat("xe0_waterBallJumpFactor", xe0_waterBallJumpFactor); /* xe4_lavaJumpFactor */ __dna_docout.writeFloat("xe4_lavaJumpFactor", xe4_lavaJumpFactor); - /* xe8_ */ - __dna_docout.writeFloat("xe8_", xe8_); + /* xe8_lavaBallJumpFactor */ + __dna_docout.writeFloat("xe8_lavaBallJumpFactor", xe8_lavaBallJumpFactor); /* xec_phazonJumpFactor */ __dna_docout.writeFloat("xec_phazonJumpFactor", xec_phazonJumpFactor); - /* xf0_ */ - __dna_docout.writeFloat("xf0_", xf0_); + /* xf0_phazonBallJumpFactor */ + __dna_docout.writeFloat("xf0_phazonBallJumpFactor", xf0_phazonBallJumpFactor); /* xf4_allowedJumpTime */ __dna_docout.writeFloat("xf4_allowedJumpTime", xf4_allowedJumpTime); /* xf8_allowedDoubleJumpTime */ @@ -1566,10 +1566,10 @@ void CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout) const __dna_docout.writeFloat("x114_doubleJumpImpulse", x114_doubleJumpImpulse); /* x118_backwardsForceMultiplier */ __dna_docout.writeFloat("x118_backwardsForceMultiplier", x118_backwardsForceMultiplier); - /* x11c_ */ - __dna_docout.writeFloat("x11c_", x11c_); - /* x120_ */ - __dna_docout.writeFloat("x120_", x120_); + /* x11c_bombJumpRadius */ + __dna_docout.writeFloat("x11c_bombJumpRadius", x11c_bombJumpRadius); + /* x120_bombJumpHeight */ + __dna_docout.writeFloat("x120_bombJumpHeight", x120_bombJumpHeight); /* x124_eyeOffset */ __dna_docout.writeFloat("x124_eyeOffset", x124_eyeOffset); /* x128_turnSpeedMultiplier */ @@ -1590,8 +1590,8 @@ void CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout) const __dna_docout.writeFloat("x144_freeLookCenteredThresholdAngle", x144_freeLookCenteredThresholdAngle); /* x148_freeLookCenteredTime */ __dna_docout.writeFloat("x148_freeLookCenteredTime", x148_freeLookCenteredTime); - /* x14c_ */ - __dna_docout.writeFloat("x14c_", x14c_); + /* x14c_freeLookDampenFactor */ + __dna_docout.writeFloat("x14c_freeLookDampenFactor", x14c_freeLookDampenFactor); /* x150_leftDiv */ __dna_docout.writeFloat("x150_leftDiv", x150_leftDiv); /* x154_rightDiv */ @@ -1622,8 +1622,8 @@ void CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout) const __dna_docout.writeBool("x229_27_", x229_27_); /* x229_28_ */ __dna_docout.writeBool("x229_28_", x229_28_); - /* x229_29_ */ - __dna_docout.writeBool("x229_29_", x229_29_); + /* x229_29_orbitFixedOffset */ + __dna_docout.writeBool("x229_29_orbitFixedOffset", x229_29_orbitFixedOffset); /* x229_30_gunButtonTogglesHolster */ __dna_docout.writeBool("x229_30_gunButtonTogglesHolster", x229_30_gunButtonTogglesHolster); /* x229_31_gunNotFiringHolstersGun */ @@ -1670,56 +1670,56 @@ void CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout) const __dna_docout.writeFloat("x264_aimAssistHorizontalAngle", x264_aimAssistHorizontalAngle); /* x268_aimAssistVerticalAngle */ __dna_docout.writeFloat("x268_aimAssistVerticalAngle", x268_aimAssistVerticalAngle); - /* x158_ */ - if (auto v = __dna_docout.enterSubVector("x158_")) + /* x158_orbitZBasedDistance */ + if (auto v = __dna_docout.enterSubVector("x158_orbitZBasedDistance")) { - /* x158_[0] */ - __dna_docout.writeFloat("x158_", x158_[0]); - /* x158_[1] */ - __dna_docout.writeFloat("x158_", x158_[1]); - /* x158_[2] */ - __dna_docout.writeFloat("x158_", x158_[2]); + /* x158_orbitZBasedDistance[0] */ + __dna_docout.writeFloat("x158_orbitZBasedDistance", x158_orbitZBasedDistance[0]); + /* x158_orbitZBasedDistance[1] */ + __dna_docout.writeFloat("x158_orbitZBasedDistance", x158_orbitZBasedDistance[1]); + /* x158_orbitZBasedDistance[2] */ + __dna_docout.writeFloat("x158_orbitZBasedDistance", x158_orbitZBasedDistance[2]); } - /* x164_ */ - if (auto v = __dna_docout.enterSubVector("x164_")) + /* x164_orbitNormalDistance */ + if (auto v = __dna_docout.enterSubVector("x164_orbitNormalDistance")) { - /* x164_[0] */ - __dna_docout.writeFloat("x164_", x164_[0]); - /* x164_[1] */ - __dna_docout.writeFloat("x164_", x164_[1]); - /* x164_[2] */ - __dna_docout.writeFloat("x164_", x164_[2]); + /* x164_orbitNormalDistance[0] */ + __dna_docout.writeFloat("x164_orbitNormalDistance", x164_orbitNormalDistance[0]); + /* x164_orbitNormalDistance[1] */ + __dna_docout.writeFloat("x164_orbitNormalDistance", x164_orbitNormalDistance[1]); + /* x164_orbitNormalDistance[2] */ + __dna_docout.writeFloat("x164_orbitNormalDistance", x164_orbitNormalDistance[2]); } - /* x170_ */ - if (auto v = __dna_docout.enterSubVector("x170_")) + /* x170_orbitMaxDistance */ + if (auto v = __dna_docout.enterSubVector("x170_orbitMaxDistance")) { - /* x170_[0] */ - __dna_docout.writeFloat("x170_", x170_[0]); - /* x170_[1] */ - __dna_docout.writeFloat("x170_", x170_[1]); - /* x170_[2] */ - __dna_docout.writeFloat("x170_", x170_[2]); + /* x170_orbitMaxDistance[0] */ + __dna_docout.writeFloat("x170_orbitMaxDistance", x170_orbitMaxDistance[0]); + /* x170_orbitMaxDistance[1] */ + __dna_docout.writeFloat("x170_orbitMaxDistance", x170_orbitMaxDistance[1]); + /* x170_orbitMaxDistance[2] */ + __dna_docout.writeFloat("x170_orbitMaxDistance", x170_orbitMaxDistance[2]); } /* x17c_ */ __dna_docout.writeFloat("x17c_", x17c_); - /* x180_orbitNormalDistance */ - __dna_docout.writeFloat("x180_orbitNormalDistance", x180_orbitNormalDistance); - /* x184_ */ - __dna_docout.writeFloat("x184_", x184_); - /* x188_maxUpwardOrbitLookAngle */ - __dna_docout.writeFloat("x188_maxUpwardOrbitLookAngle", x188_maxUpwardOrbitLookAngle); - /* x18c_maxDownwardOrbitLookAngle */ - __dna_docout.writeFloat("x18c_maxDownwardOrbitLookAngle", x18c_maxDownwardOrbitLookAngle); + /* x180_orbitModeTimer */ + __dna_docout.writeFloat("x180_orbitModeTimer", x180_orbitModeTimer); + /* x184_orbitCameraSpeed */ + __dna_docout.writeFloat("x184_orbitCameraSpeed", x184_orbitCameraSpeed); + /* x188_orbitUpperAngle */ + __dna_docout.writeFloat("x188_orbitUpperAngle", x188_orbitUpperAngle); + /* x18c_orbitLowerAngle */ + __dna_docout.writeFloat("x18c_orbitLowerAngle", x18c_orbitLowerAngle); /* x190_orbitHorizAngle */ __dna_docout.writeFloat("x190_orbitHorizAngle", x190_orbitHorizAngle); /* x194_ */ __dna_docout.writeFloat("x194_", x194_); /* x198_ */ __dna_docout.writeFloat("x198_", x198_); - /* x19c_ */ - __dna_docout.writeFloat("x19c_", x19c_); - /* x1a0_ */ - __dna_docout.writeFloat("x1a0_", x1a0_); + /* x19c_orbitMaxTargetDistance */ + __dna_docout.writeFloat("x19c_orbitMaxTargetDistance", x19c_orbitMaxTargetDistance); + /* x1a0_orbitMaxLockDistance */ + __dna_docout.writeFloat("x1a0_orbitMaxLockDistance", x1a0_orbitMaxLockDistance); /* x1a4_orbitDistanceThreshold */ __dna_docout.writeFloat("x1a4_orbitDistanceThreshold", x1a4_orbitDistanceThreshold); /* x1a8_orbitScreenBoxHalfExtentX */ @@ -1778,8 +1778,8 @@ void CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout) const __dna_docout.writeFloat("x1e0_", x1e0_); /* x1e4_ */ __dna_docout.writeFloat("x1e4_", x1e4_); - /* x1e8_ */ - __dna_docout.writeFloat("x1e8_", x1e8_); + /* x1e8_orbitFixedOffsetZDiff */ + __dna_docout.writeFloat("x1e8_orbitFixedOffsetZDiff", x1e8_orbitFixedOffsetZDiff); /* x1ec_orbitZRange */ __dna_docout.writeFloat("x1ec_orbitZRange", x1ec_orbitZRange); /* x1f0_ */ @@ -1788,8 +1788,8 @@ void CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout) const __dna_docout.writeFloat("x1f4_", x1f4_); /* x1f8_ */ __dna_docout.writeFloat("x1f8_", x1f8_); - /* x1fc_ */ - __dna_docout.writeFloat("x1fc_", x1fc_); + /* x1fc_orbitPreventionTime */ + __dna_docout.writeFloat("x1fc_orbitPreventionTime", x1fc_orbitPreventionTime); /* x200_24_dashEnabled */ __dna_docout.writeBool("x200_24_dashEnabled", x200_24_dashEnabled); /* x200_25_dashOnButtonRelease */ @@ -1812,10 +1812,10 @@ void CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout) const __dna_docout.writeBool("x21c_25_scanFreezesGame", x21c_25_scanFreezesGame); /* x21c_26_orbitWhileScanning */ __dna_docout.writeBool("x21c_26_orbitWhileScanning", x21c_26_orbitWhileScanning); - /* x220_ */ - __dna_docout.writeFloat("x220_", x220_); - /* x224_scanningFrameSenseRange */ - __dna_docout.writeFloat("x224_scanningFrameSenseRange", x224_scanningFrameSenseRange); + /* x220_scanMaxTargetDistance */ + __dna_docout.writeFloat("x220_scanMaxTargetDistance", x220_scanMaxTargetDistance); + /* x224_scanMaxLockDistance */ + __dna_docout.writeFloat("x224_scanMaxLockDistance", x224_scanMaxLockDistance); /* x2a0_orbitDistanceMax */ __dna_docout.writeFloat("x2a0_orbitDistanceMax", x2a0_orbitDistanceMax); /* x2a4_grappleSwingLength */ @@ -1825,7 +1825,7 @@ void CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout) const /* x2ac_grapplePullSpeedMin */ __dna_docout.writeFloat("x2ac_grapplePullSpeedMin", x2ac_grapplePullSpeedMin); /* x2b0_ */ - __dna_docout.writeFloat("x2b0_", x2b0_); + __dna_docout.writeFloat("x2b0_", x2b0_grappleCameraSpeed); /* x2b4_maxGrappleLockedTurnAlignDistance */ __dna_docout.writeFloat("x2b4_maxGrappleLockedTurnAlignDistance", x2b4_maxGrappleLockedTurnAlignDistance); /* x2b8_grapplePullSpeedProportion */ @@ -1842,10 +1842,10 @@ void CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout) const __dna_docout.writeFloat("x2cc_grappleReleaseTime", x2cc_grappleReleaseTime); /* x2d0_grappleJumpMode */ __dna_docout.writeUint32("x2d0_grappleJumpMode", x2d0_grappleJumpMode); - /* x2d4_ */ - __dna_docout.writeBool("x2d4_", x2d4_); - /* x2d4_ */ - __dna_docout.writeBool("x2d5_", x2d5_invertGrappleTurn); + /* x2d4_orbitReleaseBreaksGrapple */ + __dna_docout.writeBool("x2d4_orbitReleaseBreaksGrapple", x2d4_orbitReleaseBreaksGrapple); + /* x2d5_invertGrappleTurn */ + __dna_docout.writeBool("x2d5_invertGrappleTurn", x2d5_invertGrappleTurn); /* x2d8_ */ __dna_docout.writeFloat("x2d8_", x2d8_); /* x2dc_ */ @@ -1865,21 +1865,21 @@ void CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout) const /* x27c_playerBallHalfExtent */ __dna_docout.writeFloat("x27c_playerBallHalfExtent", x27c_playerBallHalfExtent); /* x280_ */ - __dna_docout.writeFloat("x280_", x280_); + __dna_docout.writeFloat("x280_", x280_firstPersonCameraSpeed); /* x284_ */ __dna_docout.writeFloat("x284_", x284_); - /* x288_ */ - __dna_docout.writeFloat("x288_", x288_); - /* x28c_ */ - __dna_docout.writeFloat("x28c_", x28c_); - /* x290_ */ - __dna_docout.writeFloat("x290_", x290_); - /* x294_ */ - __dna_docout.writeFloat("x294_", x294_); - /* x298_ */ - __dna_docout.writeFloat("x298_", x298_); - /* x29c_ */ - __dna_docout.writeFloat("x29c_", x29c_); + /* x288_jumpCameraPitchDownStart */ + __dna_docout.writeFloat("x288_jumpCameraPitchDownStart", x288_jumpCameraPitchDownStart); + /* x28c_jumpCameraPitchDownFull */ + __dna_docout.writeFloat("x28c_jumpCameraPitchDownFull", x28c_jumpCameraPitchDownFull); + /* x290_jumpCameraPitchDownAngle */ + __dna_docout.writeFloat("x290_jumpCameraPitchDownAngle", x290_jumpCameraPitchDownAngle); + /* x294_fallCameraPitchDownStart */ + __dna_docout.writeFloat("x294_fallCameraPitchDownStart", x294_fallCameraPitchDownStart); + /* x298_fallCameraPitchDownFull */ + __dna_docout.writeFloat("x298_fallCameraPitchDownFull", x298_fallCameraPitchDownFull); + /* x29c_fallCameraPitchDownAngle */ + __dna_docout.writeFloat("x29c_fallCameraPitchDownAngle", x29c_fallCameraPitchDownAngle); /* x2e8_ */ __dna_docout.writeFloat("x2e8_", x2e8_); /* x2ec_ */ @@ -1916,20 +1916,20 @@ void CTweakPlayer::FixupValues() x264_aimAssistHorizontalAngle = zeus::degToRad(x264_aimAssistHorizontalAngle); x268_aimAssistVerticalAngle = zeus::degToRad(x268_aimAssistVerticalAngle); x17c_ = zeus::degToRad(x17c_); - x184_ = zeus::degToRad(x184_); - x188_maxUpwardOrbitLookAngle = zeus::degToRad(x188_maxUpwardOrbitLookAngle); - x18c_maxDownwardOrbitLookAngle = zeus::degToRad(x18c_maxDownwardOrbitLookAngle); + x184_orbitCameraSpeed = zeus::degToRad(x184_orbitCameraSpeed); + x188_orbitUpperAngle = zeus::degToRad(x188_orbitUpperAngle); + x18c_orbitLowerAngle = zeus::degToRad(x18c_orbitLowerAngle); x190_orbitHorizAngle = zeus::degToRad(x190_orbitHorizAngle); x194_ = zeus::degToRad(x194_); x198_ = zeus::degToRad(x198_); x1f0_ = zeus::degToRad(x1f0_); x1f4_ = zeus::degToRad(x1f4_); - x2b0_ = zeus::degToRad(x2b0_); + x2b0_grappleCameraSpeed = zeus::degToRad(x2b0_grappleCameraSpeed); x2c0_grappleLookCenterSpeed = zeus::degToRad(x2c0_grappleLookCenterSpeed); - x280_ = zeus::degToRad(x280_); + x280_firstPersonCameraSpeed = zeus::degToRad(x280_firstPersonCameraSpeed); x284_ = zeus::degToRad(x284_); - x290_ = zeus::degToRad(x290_); - x29c_ = zeus::degToRad(x29c_); + x290_jumpCameraPitchDownAngle = zeus::degToRad(x290_jumpCameraPitchDownAngle); + x29c_fallCameraPitchDownAngle = zeus::degToRad(x29c_fallCameraPitchDownAngle); } const char* CTweakPlayer::DNAType() diff --git a/DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp b/DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp index f53898b0c..f31bd7335 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakPlayer.hpp @@ -24,11 +24,11 @@ struct CTweakPlayer : ITweakPlayer Value xd4_verticalDoubleJumpAccel; Value xd8_horizontalDoubleJumpAccel; Value xdc_waterJumpFactor; - Value xe0_; + Value xe0_waterBallJumpFactor; Value xe4_lavaJumpFactor; - Value xe8_; + Value xe8_lavaBallJumpFactor; Value xec_phazonJumpFactor; - Value xf0_; + Value xf0_phazonBallJumpFactor; Value xf4_allowedJumpTime; Value xf8_allowedDoubleJumpTime; Value xfc_minDoubleJumpWindow; @@ -39,8 +39,8 @@ struct CTweakPlayer : ITweakPlayer Value x110_allowedLedgeTime; Value x114_doubleJumpImpulse; Value x118_backwardsForceMultiplier; - Value x11c_; - Value x120_; + Value x11c_bombJumpRadius; + Value x120_bombJumpHeight; Value x124_eyeOffset; Value x128_turnSpeedMultiplier; Value x12c_freeLookTurnSpeedMultiplier; @@ -51,22 +51,22 @@ struct CTweakPlayer : ITweakPlayer Value x140_; Value x144_freeLookCenteredThresholdAngle; Value x148_freeLookCenteredTime; - Value x14c_; + Value x14c_freeLookDampenFactor; Value x150_leftDiv; Value x154_rightDiv; - Value x158_[3]; - Value x164_[3]; - Value x170_[3]; + Value x158_orbitZBasedDistance[3]; + Value x164_orbitNormalDistance[3]; + Value x170_orbitMaxDistance[3]; Value x17c_; - Value x180_orbitNormalDistance; - Value x184_; - Value x188_maxUpwardOrbitLookAngle; - Value x18c_maxDownwardOrbitLookAngle; + Value x180_orbitModeTimer; + Value x184_orbitCameraSpeed; + Value x188_orbitUpperAngle; + Value x18c_orbitLowerAngle; Value x190_orbitHorizAngle; Value x194_; Value x198_; - Value x19c_; - Value x1a0_; + Value x19c_orbitMaxTargetDistance; + Value x1a0_orbitMaxLockDistance; Value x1a4_orbitDistanceThreshold; Value x1a8_orbitScreenBoxHalfExtentX[2]; Value x1b0_orbitScreenBoxHalfExtentY[2]; @@ -78,12 +78,12 @@ struct CTweakPlayer : ITweakPlayer Value x1dc_orbitNearZ; Value x1e0_; Value x1e4_; - Value x1e8_; + Value x1e8_orbitFixedOffsetZDiff; Value x1ec_orbitZRange; Value x1f0_; Value x1f4_; Value x1f8_; - Value x1fc_; + Value x1fc_orbitPreventionTime; Value x200_24_dashEnabled : 1; Value x200_25_dashOnButtonRelease : 1; Value x204_dashButtonHoldCancelTime; @@ -95,8 +95,8 @@ struct CTweakPlayer : ITweakPlayer Value x21c_24_scanRetention : 1; Value x21c_25_scanFreezesGame : 1; Value x21c_26_orbitWhileScanning : 1; - Value x220_; - Value x224_scanningFrameSenseRange; + Value x220_scanMaxTargetDistance; + Value x224_scanMaxLockDistance; Value x228_24_freelookTurnsPlayer : 1; Value x228_25_ : 1; Value x228_26_ : 1; @@ -110,7 +110,7 @@ struct CTweakPlayer : ITweakPlayer Value x229_26_stayInFreeLookWhileFiring : 1; Value x229_27_ : 1; Value x229_28_ : 1; - Value x229_29_ : 1; + Value x229_29_orbitFixedOffset : 1; Value x229_30_gunButtonTogglesHolster : 1; Value x229_31_gunNotFiringHolstersGun : 1; Value x22a_24_fallingDoubleJump : 1; @@ -139,19 +139,19 @@ struct CTweakPlayer : ITweakPlayer Value x274_stepUpHeight; Value x278_stepDownHeight; Value x27c_playerBallHalfExtent; - Value x280_; + Value x280_firstPersonCameraSpeed; Value x284_; - Value x288_; - Value x28c_; - Value x290_; - Value x294_; - Value x298_; - Value x29c_; + Value x288_jumpCameraPitchDownStart; + Value x28c_jumpCameraPitchDownFull; + Value x290_jumpCameraPitchDownAngle; + Value x294_fallCameraPitchDownStart; + Value x298_fallCameraPitchDownFull; + Value x29c_fallCameraPitchDownAngle; Value x2a0_orbitDistanceMax; Value x2a4_grappleSwingLength; Value x2a8_grappleSwingPeriod; Value x2ac_grapplePullSpeedMin; - Value x2b0_; + Value x2b0_grappleCameraSpeed; Value x2b4_maxGrappleLockedTurnAlignDistance; Value x2b8_grapplePullSpeedProportion; Value x2bc_grapplePullSpeedMax; @@ -160,7 +160,7 @@ struct CTweakPlayer : ITweakPlayer Value x2c8_grappleJumpForce; Value x2cc_grappleReleaseTime; Value x2d0_grappleJumpMode; - Value x2d4_; + Value x2d4_orbitReleaseBreaksGrapple; Value x2d5_invertGrappleTurn; Value x2d8_; Value x2dc_; @@ -188,8 +188,11 @@ struct CTweakPlayer : ITweakPlayer float GetVerticalDoubleJumpAccel() const { return xd4_verticalDoubleJumpAccel; } float GetHorizontalDoubleJumpAccel() const { return xd8_horizontalDoubleJumpAccel; } float GetWaterJumpFactor() const { return xdc_waterJumpFactor; } + float GetWaterBallJumpFactor() const { return xe0_waterBallJumpFactor; } float GetLavaJumpFactor() const { return xe4_lavaJumpFactor; } + float GetLavaBallJumpFactor() const { return xe8_lavaBallJumpFactor; } float GetPhazonJumpFactor() const { return xec_phazonJumpFactor; } + float GetPhazonBallJumpFactor() const { return xf0_phazonBallJumpFactor; } float GetAllowedJumpTime() const { return xf4_allowedJumpTime; } float GetAllowedDoubleJumpTime() const { return xf8_allowedDoubleJumpTime; } float GetMinDoubleJumpWindow() const { return xfc_minDoubleJumpWindow; } @@ -199,6 +202,8 @@ struct CTweakPlayer : ITweakPlayer float GetAllowedLedgeTime() const { return x110_allowedLedgeTime; } float GetDoubleJumpImpulse() const { return x114_doubleJumpImpulse; } float GetBackwardsForceMultiplier() const { return x118_backwardsForceMultiplier; } + float GetBombJumpRadius() const { return x11c_bombJumpRadius; } + float GetBombJumpHeight() const { return x120_bombJumpHeight; } float GetEyeOffset() const { return x124_eyeOffset; } float GetTurnSpeedMultiplier() const { return x128_turnSpeedMultiplier; } float GetFreeLookTurnSpeedMultiplier() const { return x12c_freeLookTurnSpeedMultiplier; } @@ -206,10 +211,12 @@ struct CTweakPlayer : ITweakPlayer float GetFreeLookSnapSpeed() const { return x13c_freeLookSnapSpeed; } float GetFreeLookCenteredThresholdAngle() const { return x144_freeLookCenteredThresholdAngle; } float GetFreeLookCenteredTime() const { return x148_freeLookCenteredTime; } - float GetOrbitNormalDistance() const { return x180_orbitNormalDistance; } - float GetMaxUpwardOrbitLookAngle() const { return x188_maxUpwardOrbitLookAngle; } - float GetMaxDownwardOrbitLookAngle() const { return x18c_maxDownwardOrbitLookAngle; } + float GetOrbitModeTimer() const { return x180_orbitModeTimer; } + float GetOrbitUpperAngle() const { return x188_orbitUpperAngle; } + float GetOrbitLowerAngle() const { return x18c_orbitLowerAngle; } float GetOrbitHorizAngle() const { return x190_orbitHorizAngle; } + float GetOrbitMaxTargetDistance() const { return x19c_orbitMaxTargetDistance; } + float GetOrbitMaxLockDistance() const { return x1a0_orbitMaxLockDistance; } float GetOrbitDistanceThreshold() const { return x1a4_orbitDistanceThreshold; } uint32_t GetOrbitScreenBoxHalfExtentX(int zone) const { return x1a8_orbitScreenBoxHalfExtentX[zone]; } uint32_t GetOrbitScreenBoxHalfExtentY(int zone) const { return x1b0_orbitScreenBoxHalfExtentY[zone]; } @@ -219,6 +226,7 @@ struct CTweakPlayer : ITweakPlayer uint32_t GetOrbitZoneIdealY(int zone) const { return x1d0_orbitZoneIdealY[zone]; } float GetOrbitNearX() const { return x1d8_orbitNearX; } float GetOrbitNearZ() const { return x1dc_orbitNearZ; } + float GetOrbitFixedOffsetZDiff() const { return x1e8_orbitFixedOffsetZDiff; } float GetOrbitZRange() const { return x1ec_orbitZRange; } bool GetDashEnabled() const { return x200_24_dashEnabled; } bool GetDashOnButtonRelease() const { return x200_25_dashOnButtonRelease; } @@ -231,12 +239,14 @@ struct CTweakPlayer : ITweakPlayer bool GetScanRetention() const { return x21c_24_scanRetention; } bool GetScanFreezesGame() const { return x21c_25_scanFreezesGame; } bool GetOrbitWhileScanning() const { return x21c_26_orbitWhileScanning; } - float GetScanningFrameSenseRange() const { return x224_scanningFrameSenseRange; } + float GetScanMaxTargetDistance() const { return x220_scanMaxTargetDistance; } + float GetScanMaxLockDistance() const { return x224_scanMaxLockDistance; } bool GetMoveDuringFreeLook() const { return x228_27_moveDuringFreeLook; } bool GetHoldButtonsForFreeLook() const { return x228_28_holdButtonsForFreeLook; } bool GetTwoButtonsForFreeLook() const { return x228_29_twoButtonsForFreeLook; } bool GetAimWhenOrbitingPoint() const { return x229_25_aimWhenOrbitingPoint; } bool GetStayInFreeLookWhileFiring() const { return x229_26_stayInFreeLookWhileFiring; } + bool GetOrbitFixedOffset() const { return x229_29_orbitFixedOffset; } bool GetGunButtonTogglesHolster() const { return x229_30_gunButtonTogglesHolster; } bool GetGunNotFiringHolstersGun() const { return x229_31_gunNotFiringHolstersGun; } bool GetFallingDoubleJump() const { return x22a_24_fallingDoubleJump; } @@ -268,24 +278,27 @@ struct CTweakPlayer : ITweakPlayer float GetGrappleJumpForce() const { return x2c8_grappleJumpForce; } float GetGrappleReleaseTime() const { return x2cc_grappleReleaseTime; } uint32_t GetGrappleJumpMode() const { return x2d0_grappleJumpMode; } - bool InvertGrappleTurn() const { return x2d5_invertGrappleTurn; } + bool GetOrbitReleaseBreaksGrapple() const { return x2d4_orbitReleaseBreaksGrapple; } + bool GetInvertGrappleTurn() const { return x2d5_invertGrappleTurn; } float GetHorizontalFreeLookAngleVel() const { return x130_horizontalFreeLookAngleVel; } float GetVerticalFreeLookAngleVel() const { return x134_verticalFreeLookAngleVel; } - float GetX184() const { return x184_; } - float GetX1fc() const { return x1fc_; } + float GetOrbitCameraSpeed() const { return x184_orbitCameraSpeed; } + float GetOrbitPreventionTime() const { return x1fc_orbitPreventionTime; } bool GetFreeLookTurnsPlayer() const { return x228_24_freelookTurnsPlayer; } - float GetX288() const { return x288_; } - float GetX28c() const { return x28c_; } - float GetX290() const { return x290_; } - float GetX294() const { return x294_; } - float GetX298() const { return x298_; } - float GetX29C() const { return x29c_; } - float GetX280() const { return x280_; } - float GetX2B0() const { return x2b0_; } - float GetX14C() const { return x14c_; } + float GetJumpCameraPitchDownStart() const { return x288_jumpCameraPitchDownStart; } + float GetJumpCameraPitchDownFull() const { return x28c_jumpCameraPitchDownFull; } + float GetJumpCameraPitchDownAngle() const { return x290_jumpCameraPitchDownAngle; } + float GetFallCameraPitchDownStart() const { return x294_fallCameraPitchDownStart; } + float GetFallCameraPitchDownFull() const { return x298_fallCameraPitchDownFull; } + float GetFallCameraPitchDownAngle() const { return x29c_fallCameraPitchDownAngle; } + float GetFirstPersonCameraSpeed() const { return x280_firstPersonCameraSpeed; } + float GetGrappleCameraSpeed() const { return x2b0_grappleCameraSpeed; } + float GetFreeLookDampenFactor() const { return x14c_freeLookDampenFactor; } float GetLeftLogicalThreshold() const { return x150_leftDiv; } float GetRightLogicalThreshold() const { return x154_rightDiv; } - float GetX164(int type) const { return x164_[type]; } + float GetOrbitZBasedDistance(int type) const { return x158_orbitZBasedDistance[type]; } + float GetOrbitNormalDistance(int type) const { return x164_orbitNormalDistance[type]; } + float GetOrbitMaxDistance(int type) const { return x170_orbitMaxDistance[type]; } float GetFrozenTimeout() const { return x2f8_frozenTimeout; } uint32_t GetIceBreakJumpCount() const { return x2fc_iceBreakJumpCount; } float GetVariaDamageReduction() const { return x300_variaDamageReduction; } diff --git a/Runtime/Audio/CSfxManager.cpp b/Runtime/Audio/CSfxManager.cpp index 0aff2d829..86056eb9c 100644 --- a/Runtime/Audio/CSfxManager.cpp +++ b/Runtime/Audio/CSfxManager.cpp @@ -412,6 +412,23 @@ void CSfxManager::UpdateEmitter(const CSfxHandle& handle, const zeus::CVector3f& h.setMaxVol(maxVol); } +CSfxHandle CSfxManager::AddEmitter(u16 id, const zeus::CVector3f& pos, const zeus::CVector3f& dir, + bool useAcoustics, bool looped, s16 prio, s32 areaId) +{ + CAudioSys::C3DEmitterParmData parmData; + parmData.x0_pos = pos; + parmData.xc_dir = dir; + parmData.x18_maxDist = 150.f; + parmData.x1c_distComp = 0.1f; + parmData.x20_flags = 1; // Continuous parameter update + parmData.x24_sfxId = id; + parmData.x26_maxVol = 1.f; + parmData.x27_minVol = 0.165f; + parmData.x28_important = false; + parmData.x29_prio = 0x7f; + return AddEmitter(parmData, useAcoustics, prio, looped, areaId); +} + CSfxHandle CSfxManager::AddEmitter(u16 id, const zeus::CVector3f& pos, const zeus::CVector3f& dir, float vol, bool useAcoustics, bool looped, s16 prio, s32 areaId) { @@ -423,6 +440,7 @@ CSfxHandle CSfxManager::AddEmitter(u16 id, const zeus::CVector3f& pos, const zeu parmData.x20_flags = 1; // Continuous parameter update parmData.x24_sfxId = id; parmData.x26_maxVol = std::max(vol, 0.165f); + parmData.x27_minVol = 0.165f; parmData.x28_important = false; parmData.x29_prio = 0x7f; return AddEmitter(parmData, useAcoustics, prio, looped, areaId); diff --git a/Runtime/Audio/CSfxManager.hpp b/Runtime/Audio/CSfxManager.hpp index 2fc5eaf3b..2e4359313 100644 --- a/Runtime/Audio/CSfxManager.hpp +++ b/Runtime/Audio/CSfxManager.hpp @@ -224,6 +224,8 @@ public: static void RemoveEmitter(const CSfxHandle& handle); static void UpdateEmitter(const CSfxHandle& handle, const zeus::CVector3f& pos, const zeus::CVector3f& dir, float maxVol); + static CSfxHandle AddEmitter(u16 id, const zeus::CVector3f& pos, const zeus::CVector3f& dir, + bool useAcoustics, bool looped, s16 prio, s32 areaId); static CSfxHandle AddEmitter(u16 id, const zeus::CVector3f& pos, const zeus::CVector3f& dir, float vol, bool useAcoustics, bool looped, s16 prio, s32 areaId); static CSfxHandle AddEmitter(const CAudioSys::C3DEmitterParmData& parmData, diff --git a/Runtime/CStateManager.cpp b/Runtime/CStateManager.cpp index 2e812ca3e..b9ef71c9a 100644 --- a/Runtime/CStateManager.cpp +++ b/Runtime/CStateManager.cpp @@ -545,7 +545,7 @@ void CStateManager::DrawE3DeathEffect() const CPlayer& player = *x84c_player; if (player.x9f4_deathTime > 0.f) { - if (player.x2f8_morphTransState != CPlayer::EPlayerMorphBallState::Unmorphed) + if (player.x2f8_morphBallState != CPlayer::EPlayerMorphBallState::Unmorphed) { float blurAmt = zeus::clamp(0.f, (player.x9f4_deathTime - 1.f) / (6.f - 1.f), 1.f); if (blurAmt > 0.f) @@ -1316,7 +1316,7 @@ void CStateManager::KnockBackPlayer(CPlayer& player, const zeus::CVector3f& pos, CPlayer::ESurfaceRestraints surface = player.x2b0_outOfWaterTicks == 2 ? player.x2ac_surfaceRestraint : CPlayer::ESurfaceRestraints::Water; if (surface != CPlayer::ESurfaceRestraints::Normal && - player.GetOrbitState() == CPlayer::EPlayerOrbitState::Zero) + player.GetOrbitState() == CPlayer::EPlayerOrbitState::NoOrbit) usePower /= 7.f; } else diff --git a/Runtime/CStateManager.hpp b/Runtime/CStateManager.hpp index 4acc24b2c..1ff04db2e 100644 --- a/Runtime/CStateManager.hpp +++ b/Runtime/CStateManager.hpp @@ -177,37 +177,13 @@ private: std::set xb40_uniqueInstanceNames; CFinalInput xb54_finalInput; - CCameraFilterPassPoly xb84_camFilterPasses[9]; - CCameraBlurPass xd14_camBlurPasses[9]; + CCameraFilterPassPoly xb84_camFilterPasses[9]; // size: 0x2c + CCameraBlurPass xd14_camBlurPasses[9]; // size: 0x34 - s32 xe60_ = -1; - zeus::CVector3f xe64_; - - TUniqueId xe70_ = kInvalidUniqueId; - zeus::CVector3f xe74_ = {0.f, 1.f, 1.f}; - - s32 xe80_ = 2; - TUniqueId xe84_ = kInvalidUniqueId; - - union - { - struct - { - bool xe86_24_ : 1; - bool xe86_25_ : 1; - bool xe86_26_ : 1; - bool xe86_27_ : 1; - bool xe86_28_ : 1; - bool xe86_29_ : 1; - }; - u16 _dummy = 0; - }; - - u32 xeec_hintIdx = -1; + s32 xeec_hintIdx = -1; u32 xef0_hintPeriods = 0; - SOnScreenTex xef4_pendingScreenTex; - CAssetId xf08_pauseHudMessage = -1; + CAssetId xf08_pauseHudMessage; float xf0c_escapeTimer = 0.f; float xf10_escapeTotalTime = 0.f; float xf14_curTimeMod900 = 0.f; @@ -220,9 +196,7 @@ private: u32 xf34_particleFlags = 2; TUniqueId xf38_skipCineSpecialFunc = kInvalidUniqueId; std::list xf3c_; - u32 xf50_ = 0; std::list xf54_; - u32 xf68_ = 0; TUniqueId xf6c_playerActor = kInvalidUniqueId; u32 xf70_ = 0; @@ -233,7 +207,7 @@ private: CProjectedShadow* xf7c_projectedShadow = nullptr; u32 xf80_hudMessageFrameCount = 0; s32 xf84_ = -1; - CAssetId xf88_ = -1; + CAssetId xf88_; float xf8c_ = 0.f; EStateManagerTransition xf90_deferredTransition = EStateManagerTransition::InGame; diff --git a/Runtime/Camera/CBallCamera.hpp b/Runtime/Camera/CBallCamera.hpp index 23fd64918..11682b51e 100644 --- a/Runtime/Camera/CBallCamera.hpp +++ b/Runtime/Camera/CBallCamera.hpp @@ -19,7 +19,7 @@ public: Five }; private: - TUniqueId x3dc_ = kInvalidUniqueId; + TUniqueId x3dc_tooCloseActorId = kInvalidUniqueId; float x3e0_ = 10000.f; public: CBallCamera(TUniqueId, TUniqueId, const zeus::CTransform& xf, float, float, float, float); @@ -29,7 +29,7 @@ public: void Reset(const zeus::CTransform&, CStateManager& mgr); void SetState(EBallCameraState state, CStateManager& mgr); bool TransitionFromMorphBallState(CStateManager& mgr); - TUniqueId GetX3DC() const { return x3dc_; } + TUniqueId GetTooCloseActorId() const { return x3dc_tooCloseActorId; } float GetX3E0() const { return x3e0_; } void TeleportCamera(const zeus::CVector3f& pos, CStateManager& mgr); }; diff --git a/Runtime/Camera/CCameraManager.cpp b/Runtime/Camera/CCameraManager.cpp index c5860e37f..603a3ba35 100644 --- a/Runtime/Camera/CCameraManager.cpp +++ b/Runtime/Camera/CCameraManager.cpp @@ -181,10 +181,10 @@ void CCameraManager::CreateStandardCameras(CStateManager& stateMgr) { TUniqueId fpId = stateMgr.AllocateUniqueId(); x7c_fpCamera = new CFirstPersonCamera(fpId, zeus::CTransform::Identity(), - stateMgr.Player()->GetUniqueId(), g_tweakPlayer->GetX184(), + stateMgr.Player()->GetUniqueId(), g_tweakPlayer->GetOrbitCameraSpeed(), sFirstPersonFOV, sNearPlane, sFarPlane, sAspect); stateMgr.AddObject(x7c_fpCamera); - stateMgr.Player()->SetCameraState(CPlayer::EPlayerCameraState::Zero, stateMgr); + stateMgr.Player()->SetCameraState(CPlayer::EPlayerCameraState::FirstPerson, stateMgr); SetCurrentCameraId(fpId, stateMgr); x80_ballCamera = new CBallCamera(stateMgr.AllocateUniqueId(), stateMgr.Player()->GetUniqueId(), diff --git a/Runtime/Camera/CFirstPersonCamera.cpp b/Runtime/Camera/CFirstPersonCamera.cpp index 5f7e74763..e1639030c 100644 --- a/Runtime/Camera/CFirstPersonCamera.cpp +++ b/Runtime/Camera/CFirstPersonCamera.cpp @@ -12,10 +12,10 @@ namespace urde { -CFirstPersonCamera::CFirstPersonCamera(TUniqueId uid, const zeus::CTransform& xf, TUniqueId watchedObj, float f1, - float fov, float nearz, float farz, float aspect) +CFirstPersonCamera::CFirstPersonCamera(TUniqueId uid, const zeus::CTransform& xf, TUniqueId watchedObj, + float orbitCameraSpeed, float fov, float nearz, float farz, float aspect) : CGameCamera(uid, true, "First Person Camera", CEntityInfo(kInvalidAreaId, CEntity::NullConnectionList), xf, fov, - nearz, farz, aspect, watchedObj, false, 0) + nearz, farz, aspect, watchedObj, false, 0), x188_orbitCameraSpeed(orbitCameraSpeed) { } @@ -84,8 +84,8 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt) if (player->x3dc_inFreeLook) { float angle = player->x3ec_freeLookPitchAngle; - if (std::fabs(player->x3ec_freeLookPitchAngle) > (g_tweakPlayer->GetVerticalFreeLookAngleVel() - std::fabs(x1c0_))) - angle = (player->x3ec_freeLookPitchAngle > -0.f ? -1.f : 1.f); + float angleClamp = g_tweakPlayer->GetVerticalFreeLookAngleVel() - std::fabs(x1c0_); + angle = zeus::clamp(-angleClamp, angle, angleClamp); zeus::CVector3f vec; vec.z = std::sin(angle); vec.y = std::cos(-player->x3e4_freeLookYawAngle) * std::cos(angle); @@ -117,14 +117,15 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt) rVec = v; } } - else if (player->GetOrbitState() == CPlayer::EPlayerOrbitState::Zero && + else if (player->GetOrbitState() == CPlayer::EPlayerOrbitState::NoOrbit && player->GetMorphballTransitionState() == CPlayer::EPlayerMorphBallState::Unmorphed && - player->x3dc_inFreeLook && x1c4_pitchId == kInvalidUniqueId) + !player->x3dc_inFreeLook && x1c4_pitchId == kInvalidUniqueId) { - if (player->x294_jumpCameraPitchTimer > 0.f) + if (player->x294_jumpCameraTimer > 0.f) { - float angle = zeus::clamp(0.f, (player->x294_jumpCameraPitchTimer - g_tweakPlayer->GetX288()) / g_tweakPlayer->GetX28c(), 1.f) * - g_tweakPlayer->GetX290(); + float angle = zeus::clamp(0.f, (player->x294_jumpCameraTimer - g_tweakPlayer->GetJumpCameraPitchDownStart()) / + g_tweakPlayer->GetJumpCameraPitchDownFull(), 1.f) * + g_tweakPlayer->GetJumpCameraPitchDownAngle(); angle += x1c0_; rVec.x = 0.f; rVec.y = std::cos(angle); @@ -132,10 +133,11 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt) rVec = playerXf.rotate(rVec); } - else if (player->x29c_spaceJumpCameraPitchTimer > 0.f) + else if (player->x29c_fallCameraTimer > 0.f) { - float angle = zeus::clamp(0.f, (player->x29c_spaceJumpCameraPitchTimer - g_tweakPlayer->GetX294()) / g_tweakPlayer->GetX298(), 1.f) * - g_tweakPlayer->GetX29C(); + float angle = zeus::clamp(0.f, (player->x29c_fallCameraTimer - g_tweakPlayer->GetFallCameraPitchDownStart()) / + g_tweakPlayer->GetFallCameraPitchDownFull(), 1.f) * + g_tweakPlayer->GetFallCameraPitchDownAngle(); rVec.x = 0.f; rVec.y = std::cos(angle); rVec.z = -std::sin(angle); @@ -160,19 +162,18 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt) if (gunFrontVec.canBeNormalized()) gunFrontVec.normalize(); - float scaledDt = (dt * g_tweakPlayer->GetX184()); + float scaledDt = (dt * g_tweakPlayer->GetOrbitCameraSpeed()); float angle = gunFrontVec.dot(rVec); - if (std::fabs(angle) > 1.f) - angle = (angle > -0.f ? -1.f : 1.f); + angle = zeus::clamp(-1.f, angle, 1.f); float clampedAngle = zeus::clamp(0.f, std::acos(angle) / scaledDt, 1.f); - if (angle > 0.999f && x18c_ && !player->x374_orbitLockEstablished) + if (angle > 0.999f && x18c_lockCamera && !player->x374_orbitLockEstablished) qGun = zeus::CQuaternion::lookAt(rVec, gunFrontVec, zeus::CRelAngle::FromDegrees(360.f)); else qGun = zeus::CQuaternion::lookAt(rVec, gunFrontVec, scaledDt * clampedAngle); const CScriptGrapplePoint* gPoint = TCastToConstPtr(mgr.GetObjectById(player->x310_orbitTargetId)); - if (gPoint && player->x29c_spaceJumpCameraPitchTimer > 0.f) + if (gPoint && player->x29c_fallCameraTimer > 0.f) { gunFrontVec = x190_gunFollowXf.frontVector(); if (gunFrontVec.canBeNormalized()) @@ -192,11 +193,9 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt) /* BUG: This is exactly what the runtime is doing, should we restore the intended behavior? */ float angle = gunFrontVec.dot(rVec); - float sdt = dt * g_tweakPlayer->GetX2B0(); - - if (std::fabs(angle) > 1.0f) - angle = (angle > -0.f ? -1.f : 1.f); + float sdt = dt * g_tweakPlayer->GetGrappleCameraSpeed(); + angle = zeus::clamp(-1.f, angle, 1.f); angle = zeus::clamp(0.f, std::acos(angle) / sdt, 1.f); qGun = zeus::CQuaternion::lookAt(rVec, gunFrontVec, zeus::CRelAngle::FromDegrees(360.f)); } @@ -204,17 +203,17 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt) else if (player->GetOrbitState() == CPlayer::EPlayerOrbitState::Two || player->GetOrbitState() == CPlayer::EPlayerOrbitState::Three) { - dt *= g_tweakPlayer->GetX184(); + dt *= g_tweakPlayer->GetOrbitCameraSpeed(); CalculateGunFollowOrientationAndTransform(gunXf, qGun, dt, rVec); } - else if (player->GetOrbitState() == CPlayer::EPlayerOrbitState::Five) + else if (player->GetOrbitState() == CPlayer::EPlayerOrbitState::Grapple) { - dt *= g_tweakPlayer->GetX2B0(); + dt *= g_tweakPlayer->GetGrappleCameraSpeed(); CalculateGunFollowOrientationAndTransform(gunXf, qGun, dt, rVec); } else { - dt *= g_tweakPlayer->GetX280(); + dt *= g_tweakPlayer->GetFirstPersonCameraSpeed(); CalculateGunFollowOrientationAndTransform(gunXf, qGun, dt, rVec); } } @@ -235,16 +234,16 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt) gunFront.normalize(); float angle = gunFront.dot(rVec); - if (std::fabs(angle) > 1.f) - angle = (angle > -0.f ? -1.f : 1.f); + angle = zeus::clamp(-1.f, angle, 1.f); float sdt = dt * g_tweakPlayer->GetFreeLookSpeed(); qGun = zeus::CQuaternion::lookAt( - rVec, gunFront, sdt * zeus::clamp(0.f, g_tweakPlayer->GetX14C() * (std::acos(angle) / sdt), 1.f)); + rVec, gunFront, sdt * zeus::clamp(0.f, g_tweakPlayer->GetFreeLookDampenFactor() * + (std::acos(angle) / sdt), 1.f)); } zeus::CTransform bobXf = player->GetCameraBob()->GetCameraBobTransformation(); if (player->GetMorphballTransitionState() == CPlayer::EPlayerMorphBallState::Morphed || - player->GetOrbitState() == CPlayer::EPlayerOrbitState::Five || + player->GetOrbitState() == CPlayer::EPlayerOrbitState::Grapple || player->GetGrappleState() == CPlayer::EGrappleState::None || mgr.GetGameState() == CStateManager::EGameState::SoftPaused || mgr.GetCameraManager()->IsInCinematicCamera()) diff --git a/Runtime/Camera/CFirstPersonCamera.hpp b/Runtime/Camera/CFirstPersonCamera.hpp index c9d4d80d4..c4bc4faf1 100644 --- a/Runtime/Camera/CFirstPersonCamera.hpp +++ b/Runtime/Camera/CFirstPersonCamera.hpp @@ -8,8 +8,8 @@ namespace urde class CFirstPersonCamera : public CGameCamera { - float x188_; - bool x18c_ = false; + float x188_orbitCameraSpeed; + bool x18c_lockCamera = false; zeus::CTransform x190_gunFollowXf; float x1c0_ = 0.f; TUniqueId x1c4_pitchId = kInvalidUniqueId; @@ -25,7 +25,7 @@ class CFirstPersonCamera : public CGameCamera float x1d4_ = 0.f; public: - CFirstPersonCamera(TUniqueId, const zeus::CTransform& xf, TUniqueId, float, + CFirstPersonCamera(TUniqueId, const zeus::CTransform& xf, TUniqueId, float orbitCameraSpeed, float fov, float nearplane, float farplane, float aspect); void Accept(IVisitor& visitor); @@ -40,7 +40,7 @@ public: void UpdateElevation(CStateManager&); void CalculateGunFollowOrientationAndTransform(zeus::CTransform&, zeus::CQuaternion&, float, zeus::CVector3f&); void SetScriptPitchId(TUniqueId uid) { x1c4_pitchId = uid; } - void SetX18C(bool v) { x18c_ = v; } + void SetLockCamera(bool v) { x18c_lockCamera = v; } void SetX1C6_24(bool v) { x1c6_24_ = v; } }; } diff --git a/Runtime/MP1/CInGameGuiManager.cpp b/Runtime/MP1/CInGameGuiManager.cpp index aa298d5ff..5359540f5 100644 --- a/Runtime/MP1/CInGameGuiManager.cpp +++ b/Runtime/MP1/CInGameGuiManager.cpp @@ -600,7 +600,7 @@ void CInGameGuiManager::Draw(CStateManager& stateMgr) bool scanVisor = stateMgr.GetPlayerState()->GetActiveVisor(stateMgr) == CPlayerState::EPlayerVisor::Scan; if (drawVisor && x1f0_enablePlayerVisor) { - if (stateMgr.GetPlayer().GetCameraState() == CPlayer::EPlayerCameraState::Zero) + if (stateMgr.GetPlayer().GetCameraState() == CPlayer::EPlayerCameraState::FirstPerson) x20_faceplateDecor.Draw(stateMgr); CTargetingManager* tgtMgr = nullptr; if (scanVisor && x1e4_enableTargetingManager) diff --git a/Runtime/MP1/CPlayerVisor.cpp b/Runtime/MP1/CPlayerVisor.cpp index 3acdc78cb..0b17a469e 100644 --- a/Runtime/MP1/CPlayerVisor.cpp +++ b/Runtime/MP1/CPlayerVisor.cpp @@ -119,7 +119,7 @@ bool CPlayerVisor::DrawScanObjectIndicators(const CStateManager& mgr) const zeus::CTransform xf(zeus::CMatrix3f(scale), scanPos); float scanRange = g_tweakPlayer->GetScanningRange(); - float farRange = g_tweakPlayer->GetScanningFrameSenseRange() - scanRange; + float farRange = g_tweakPlayer->GetScanMaxLockDistance() - scanRange; float farT; if (farRange <= 0.f) farT = 1.f; diff --git a/Runtime/Weapon/CPlayerGun.hpp b/Runtime/Weapon/CPlayerGun.hpp index 4dde65f83..225cdd28e 100644 --- a/Runtime/Weapon/CPlayerGun.hpp +++ b/Runtime/Weapon/CPlayerGun.hpp @@ -211,7 +211,7 @@ private: bool x835_28_bombReady : 1; bool x835_29_powerBombReady : 1; bool x835_30_ : 1; - bool x835_31_ : 1; + bool x835_31_actorAttached : 1; }; u32 _dummy = 0; }; @@ -247,6 +247,7 @@ public: void AddToRenderer(const zeus::CFrustum& frustum, const CStateManager& mgr) const; bool GetFiring() const { return x2ec_firing != 0; } TUniqueId DropPowerBomb(CStateManager& mgr); + void SetActorAttached(bool b) { x835_31_actorAttached = b; } }; } diff --git a/Runtime/World/CDamageInfo.cpp b/Runtime/World/CDamageInfo.cpp index 3193798dc..3fdf5e018 100644 --- a/Runtime/World/CDamageInfo.cpp +++ b/Runtime/World/CDamageInfo.cpp @@ -21,7 +21,7 @@ CDamageInfo& CDamageInfo::operator=(const DataSpec::SShotParam& other) xc_radiusDamage = x8_damage; x10_radius = other.radius; x14_knockback = other.knockback; - x18_ = false; + x18_noImmunity = false; return *this; } diff --git a/Runtime/World/CDamageInfo.hpp b/Runtime/World/CDamageInfo.hpp index 32a2f6009..afd7f21fa 100644 --- a/Runtime/World/CDamageInfo.hpp +++ b/Runtime/World/CDamageInfo.hpp @@ -20,7 +20,7 @@ class CDamageInfo float xc_radiusDamage; float x10_radius; float x14_knockback; - bool x18_ = false; + bool x18_noImmunity = false; public: CDamageInfo() = default; @@ -50,7 +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_; } + bool NoImmunity() const { return x18_noImmunity; } }; } diff --git a/Runtime/World/CMorphBall.cpp b/Runtime/World/CMorphBall.cpp index f3758fe4c..c72153ae5 100644 --- a/Runtime/World/CMorphBall.cpp +++ b/Runtime/World/CMorphBall.cpp @@ -22,7 +22,7 @@ void CMorphBall::DrawBallShadow(const CStateManager& mgr) return; float alpha = 1.f; - switch (x0_player.x2f8_morphTransState) + switch (x0_player.x2f8_morphBallState) { case CPlayer::EPlayerMorphBallState::Unmorphed: return; diff --git a/Runtime/World/CMorphBall.hpp b/Runtime/World/CMorphBall.hpp index 85395597f..58ed21184 100644 --- a/Runtime/World/CMorphBall.hpp +++ b/Runtime/World/CMorphBall.hpp @@ -29,6 +29,12 @@ public: { Zero }; + + enum class EBombJumpState + { + Zero, + One + }; private: CPlayer& x0_player; std::unique_ptr x58_ballModel; @@ -50,14 +56,23 @@ private: u32 x1960_ = false; u32 x1964_ = false; u32 x19dc_ = false; + union + { + struct + { + bool x1de4_25 : 1; + }; + u32 _dummy = 0; + }; float x1DE8_boostTime = 0.f; + EBombJumpState x1e40_bombJumpState = EBombJumpState::Zero; CMorphBallShadow* x1e50_shadow = nullptr; public: CMorphBall(CPlayer& player, float); void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CStateManager& mgr); ESpiderBallState GetSpiderBallState() const { return ESpiderBallState::Zero; } - bool InSpiderBallMode() const { return false; } + bool InSpiderMode() const { return false; } zeus::CVector3f GetBallContactSurfaceNormal() const { return {}; } void GetModel() const {} const CCollidableSphere* GetCollidableSphere() const { return nullptr; } @@ -149,7 +164,7 @@ public: void SetAsProjectile(const CDamageInfo&, const CDamageInfo&) {} EBallBoostState GetBallBoostState() const { return EBallBoostState::Zero; } void SetBallBoostState(EBallBoostState) {} - void GetBombJumpState() const {} + EBombJumpState GetBombJumpState() const { return x1e40_bombJumpState; } void LoadAnimationTokens(const std::string&) {} void TakeDamage(float) {} void DrawBallShadow(const CStateManager& mgr); @@ -161,9 +176,11 @@ public: void SetDamageTimer(float t) { x191c_damageTimer = t; } void Stop() {} void StopSounds() {} - + void ActorAttached() {} CModelData& GetMorphballModelData() const { return *x58_ballModel; } u32 GetMorphballModelShader() const { return x5c_ballModelShader; } + bool GetX1DE4_25() const { return x1de4_25; } + void SetX1DE4_25(bool b) { x1de4_25 = b; } }; } diff --git a/Runtime/World/CPlayer.cpp b/Runtime/World/CPlayer.cpp index 1f9bcc955..f9f381006 100644 --- a/Runtime/World/CPlayer.cpp +++ b/Runtime/World/CPlayer.cpp @@ -170,7 +170,7 @@ void CPlayer::TransitionToMorphBallState(float dt, CStateManager& mgr) x150_momentum = zeus::CVector3f::skZero; CPhysicsActor::Stop(); SetMorphBallState(EPlayerMorphBallState::Morphing, mgr); - SetCameraState(EPlayerCameraState::Three, mgr); + SetCameraState(EPlayerCameraState::Transitioning, mgr); x500_lookDir = x34_transform.basis[1]; x50c_moveDir = x500_lookDir; x50c_moveDir.z = 0.f; @@ -193,7 +193,7 @@ void CPlayer::TransitionToMorphBallState(float dt, CStateManager& mgr) else { ballCam->SetState(CBallCamera::EBallCameraState::Zero, mgr); - SetCameraState(EPlayerCameraState::One, mgr); + SetCameraState(EPlayerCameraState::Ball, mgr); zeus::CTransform newXf = mgr.GetCameraManager()->GetFirstPersonCamera()->GetTransform(); ballCam->SetTransform(newXf); ballCam->TeleportCamera(newXf.origin, mgr); @@ -278,7 +278,7 @@ void CPlayer::TransitionFromMorphBallState(CStateManager& mgr) } CBallCamera* ballCam = mgr.GetCameraManager()->GetBallCamera(); - if (TCastToConstPtr act = mgr.GetObjectById(ballCam->GetX3DC())) + if (TCastToConstPtr act = mgr.GetObjectById(ballCam->GetTooCloseActorId())) { if (ballCam->GetX3E0() < 20.f && ballCam->GetX3E0() > 1.f) { @@ -308,13 +308,13 @@ void CPlayer::TransitionFromMorphBallState(CStateManager& mgr) SetAngularVelocityWR(zeus::CAxisAngle::sIdentity); AddMaterial(EMaterialTypes::GroundCollider, mgr); x150_momentum = zeus::CVector3f::skZero; - SetCameraState(EPlayerCameraState::Three, mgr); - x824_ = 0.01f; + SetCameraState(EPlayerCameraState::Transitioning, mgr); + x824_transitionFilterTimer = 0.01f; x57c_ = 0; x580_ = 0; if (!ballCam->TransitionFromMorphBallState(mgr)) { - x824_ = 0.95f; + x824_transitionFilterTimer = 0.95f; LeaveMorphBallState(mgr); } } @@ -338,7 +338,7 @@ s32 CPlayer::GetNextBallTransitionAnim(float dt, bool& loopOut, CStateManager& m void CPlayer::UpdateMorphBallTransition(float dt, CStateManager& mgr) { - switch (x2f8_morphTransState) + switch (x2f8_morphBallState) { case EPlayerMorphBallState::Unmorphed: case EPlayerMorphBallState::Morphed: @@ -411,12 +411,12 @@ void CPlayer::UpdateMorphBallTransition(float dt, CStateManager& mgr) CGameCamera* cam = mgr.GetCameraManager()->GetCurrentCamera(mgr); x588_alpha = GetTransitionAlpha(cam->GetTranslation(), cam->GetNearClipDistance()); - if (x2f8_morphTransState == EPlayerMorphBallState::Morphing && morphT > 0.93f) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphing && morphT > 0.93f) { x588_alpha *= std::min(1.f, 1.f - (morphT - 0.93f) / 0.07f + 0.2f); xb4_drawFlags = CModelFlags(5, 0, 1, zeus::CColor(1.f, x588_alpha)); } - else if (x2f8_morphTransState == EPlayerMorphBallState::Unmorphing && x588_alpha < 1.f) + else if (x2f8_morphBallState == EPlayerMorphBallState::Unmorphing && x588_alpha < 1.f) { if (x588_alpha > 0.05f) xb4_drawFlags = CModelFlags(5, 0, 0x21, zeus::CColor(1.f, x588_alpha)); @@ -432,7 +432,7 @@ void CPlayer::UpdateMorphBallTransition(float dt, CStateManager& mgr) x658_transitionModelXfs.AddValue(x34_transform); x71c_transitionModelAlphas.AddValue(x588_alpha); - switch (x2f8_morphTransState) + switch (x2f8_morphBallState) { case EPlayerMorphBallState::Unmorphing: GetCollisionPrimitive()->CalculateAABox(GetPrimitiveTransform()).center(); @@ -440,7 +440,7 @@ void CPlayer::UpdateMorphBallTransition(float dt, CStateManager& mgr) SetAngularVelocityWR(zeus::CAxisAngle::sIdentity); if (x574_morphTime >= x578_morphDuration || mgr.GetCameraManager()->IsInCinematicCamera()) { - x824_ = std::max(x824_, 0.95f); + x824_transitionFilterTimer = std::max(x824_transitionFilterTimer, 0.95f); zeus::CVector3f pos; if (CanLeaveMorphBallState(mgr, pos)) { @@ -536,7 +536,7 @@ void CPlayer::Update(float dt, CStateManager& mgr) { CSfxManager::KillAll(CSfxManager::ESfxChannels::Game); CStreamAudioManager::StopAll(); - if (x2f8_morphTransState == EPlayerMorphBallState::Unmorphed) + if (x2f8_morphBallState == EPlayerMorphBallState::Unmorphed) { CSfxHandle hnd = CSfxManager::SfxStart(1516, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId); ApplySubmergedPitchBend(hnd); @@ -545,7 +545,7 @@ void CPlayer::Update(float dt, CStateManager& mgr) float prevDeathTime = x9f4_deathTime; x9f4_deathTime += dt; - if (x2f8_morphTransState != EPlayerMorphBallState::Unmorphed) + if (x2f8_morphBallState != EPlayerMorphBallState::Unmorphed) { if (x9f4_deathTime >= 1.f && prevDeathTime < 1.f) xa00_deathPowerBomb = x490_gun->DropPowerBomb(mgr); @@ -557,7 +557,7 @@ void CPlayer::Update(float dt, CStateManager& mgr) } } - switch (x2f8_morphTransState) + switch (x2f8_morphBallState) { case EPlayerMorphBallState::Unmorphed: case EPlayerMorphBallState::Morphing: @@ -567,36 +567,36 @@ void CPlayer::Update(float dt, CStateManager& mgr) break; } - if (x2f8_morphTransState == EPlayerMorphBallState::Unmorphed) + if (x2f8_morphBallState == EPlayerMorphBallState::Unmorphed) { UpdateAimTargetTimer(dt); UpdateAimTarget(mgr); UpdateOrbitModeTimer(dt); } UpdateOrbitPreventionTimer(dt); - if (x2f8_morphTransState == EPlayerMorphBallState::Morphed) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphed) x768_morphball->Update(dt, mgr); else x768_morphball->StopSounds(); - if (x2f8_morphTransState == EPlayerMorphBallState::Unmorphing || - x2f8_morphTransState == EPlayerMorphBallState::Morphing) + if (x2f8_morphBallState == EPlayerMorphBallState::Unmorphing || + x2f8_morphBallState == EPlayerMorphBallState::Morphing) x768_morphball->UpdateEffects(dt, mgr); UpdateGunAlpha(); UpdateDebugCamera(mgr); UpdateVisorTransition(dt, mgr); mgr.SetActorAreaId(*this, mgr.GetWorld()->GetCurrentAreaId()); UpdatePlayerSounds(dt); - if (x26c_ != kInvalidUniqueId) - x270_ += dt; + if (x26c_attachedActor != kInvalidUniqueId) + x270_attachedActorTime += dt; - x740_staticOutTimer = std::max(0.f, x740_staticOutTimer - dt); - if (x740_staticOutTimer > 0.f) + x740_staticTimer = std::max(0.f, x740_staticTimer - dt); + if (x740_staticTimer > 0.f) x74c_visorStaticAlpha = std::max(0.f, x74c_visorStaticAlpha - x744_staticOutSpeed * dt); else x74c_visorStaticAlpha = std::min(1.f, x74c_visorStaticAlpha + x748_staticInSpeed * dt); x274_energyDrain.ProcessEnergyDrain(mgr, dt); - x4a4_.AddValue(x4f8_); + x4a4_moveSpeedAvg.AddValue(x4f8_moveSpeed); mgr.GetPlayerState()->UpdateStaticInterference(mgr, dt); if (!ShouldSampleFailsafe(mgr)) @@ -634,19 +634,19 @@ float CPlayer::UpdateCameraBob(float dt, CStateManager& mgr) float bobMag = 0.f; CPlayerCameraBob::ECameraBobState state; zeus::CVector3f backupVel = x138_velocity; - if (x304_orbitState == EPlayerOrbitState::Zero) + if (x304_orbitState == EPlayerOrbitState::NoOrbit) { bobMag = std::fabs(backupVel.dot(x34_transform.basis[1]) / GetActualFirstPersonMaxVelocity(dt)); - state = CPlayerCameraBob::ECameraBobState::Zero; + state = CPlayerCameraBob::ECameraBobState::Walk; if (bobMag < 0.01f) { bobMag = 0.f; - state = CPlayerCameraBob::ECameraBobState::Three; + state = CPlayerCameraBob::ECameraBobState::WalkNoBob; } } else { - state = CPlayerCameraBob::ECameraBobState::One; + state = CPlayerCameraBob::ECameraBobState::Orbit; float f29 = backupVel.dot(x34_transform.basis[0]); float f30 = backupVel.dot(x34_transform.basis[1]); float maxVel = GetActualFirstPersonMaxVelocity(dt); @@ -661,32 +661,32 @@ float CPlayer::UpdateCameraBob(float dt, CStateManager& mgr) if (x258_movementState != EPlayerMovementState::OnGround) { bobMag = 0.f; - state = CPlayerCameraBob::ECameraBobState::Two; + state = CPlayerCameraBob::ECameraBobState::InAir; } else if (bobMag < 0.01f) { if (x490_gun->GetFiring()) { bobMag = 0.f; - state = CPlayerCameraBob::ECameraBobState::Four; + state = CPlayerCameraBob::ECameraBobState::GunFireNoBob; } else if (std::fabs(GetAngularVelocityOR().angle()) > 0.1f) { bobMag = 0.f; - state = CPlayerCameraBob::ECameraBobState::Five; + state = CPlayerCameraBob::ECameraBobState::TurningNoBob; } } if (x3dc_inFreeLook || x3dd_lookButtonHeld) { bobMag = 0.f; - state = CPlayerCameraBob::ECameraBobState::Six; + state = CPlayerCameraBob::ECameraBobState::FreeLookNoBob; } - if (x304_orbitState == EPlayerOrbitState::Five) + if (x304_orbitState == EPlayerOrbitState::Grapple) { bobMag = 0.f; - state = CPlayerCameraBob::ECameraBobState::Seven; + state = CPlayerCameraBob::ECameraBobState::GrappleNoBob; } if (x3a8_scanState == EPlayerScanState::ScanComplete) @@ -697,7 +697,7 @@ float CPlayer::UpdateCameraBob(float dt, CStateManager& mgr) if (x38c_doneSidewaysDashing) { bobMag *= 0.1f; - state = CPlayerCameraBob::ECameraBobState::Six; + state = CPlayerCameraBob::ECameraBobState::FreeLookNoBob; if (x258_movementState == EPlayerMovementState::OnGround) x38c_doneSidewaysDashing = false; } @@ -724,6 +724,12 @@ float CPlayer::GetAcceleration() const return x2b4_accelerationTable[x2d0_curAcceleration]; } +float CPlayer::CalculateOrbitZBasedDistance(EPlayerOrbitType type) const +{ + return zeus::clamp(1.f, std::fabs(x314_orbitPoint.z - GetTranslation().z) / 20.f, 4.f) * + g_tweakPlayer->GetOrbitZBasedDistance(int(type)); +} + void CPlayer::PostUpdate(float dt, CStateManager& mgr) { UpdateArmAndGunTransforms(dt, mgr); @@ -754,7 +760,7 @@ void CPlayer::PostUpdate(float dt, CStateManager& mgr) bool CPlayer::StartSamusVoiceSfx(u16 sfx, float vol, int prio) { - if (x2f8_morphTransState == EPlayerMorphBallState::Morphed) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphed) return false; bool started = true; if (x77c_samusVoiceSfx) @@ -779,9 +785,9 @@ bool CPlayer::StartSamusVoiceSfx(u16 sfx, float vol, int prio) bool CPlayer::IsPlayerDeadEnough() const { - if (x2f8_morphTransState == CPlayer::EPlayerMorphBallState::Unmorphed) + if (x2f8_morphBallState == CPlayer::EPlayerMorphBallState::Unmorphed) return x9f4_deathTime > 2.5f; - if (x2f8_morphTransState == CPlayer::EPlayerMorphBallState::Morphed) + if (x2f8_morphBallState == CPlayer::EPlayerMorphBallState::Morphed) return x9f4_deathTime > 6.f; return false; @@ -812,7 +818,7 @@ bool CPlayer::CanRenderUnsorted(CStateManager& mgr) const { return false; } const CDamageVulnerability* CPlayer::GetDamageVulnerability(const zeus::CVector3f& v1, const zeus::CVector3f& v2, const CDamageInfo& info) const { - if (x2f8_morphTransState == EPlayerMorphBallState::Morphed && x570_ > 0.f && !info.GetX18()) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphed && x570_immuneTimer > 0.f && !info.NoImmunity()) return &CDamageVulnerability::ImmuneVulnerabilty(); return &CDamageVulnerability::NormalVulnerabilty(); } @@ -835,13 +841,13 @@ zeus::CVector3f CPlayer::GetAimPosition(CStateManager& mgr, float dt) const zeus::CVector3f ret = x34_transform.origin; if (dt > 0.f) { - if (x304_orbitState == EPlayerOrbitState::Zero) + if (x304_orbitState == EPlayerOrbitState::NoOrbit) ret += PredictMotion(dt).x0_translation; else ret = CSteeringBehaviors::ProjectOrbitalPosition(ret, x138_velocity, x314_orbitPoint, dt); } - if (x2f8_morphTransState == EPlayerMorphBallState::Morphed) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphed) ret.z += g_tweakPlayer->GetPlayerBallHalfExtent(); else ret.z += GetEyeHeight(); @@ -851,13 +857,13 @@ zeus::CVector3f CPlayer::GetAimPosition(CStateManager& mgr, float dt) const void CPlayer::FluidFXThink(EFluidState state, CScriptWater& water, CStateManager& mgr) { - if (x2f8_morphTransState == EPlayerMorphBallState::Morphed) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphed) { x768_morphball->FluidFXThink(state, water, mgr); if (state == EFluidState::InFluid) x9c5_30_ = true; } - else if (x2f8_morphTransState != EPlayerMorphBallState::Unmorphed) + else if (x2f8_morphBallState != EPlayerMorphBallState::Unmorphed) { if (mgr.GetFluidPlaneManager()->GetLastSplashDeltaTime(x8_uid) >= 0.2f) { @@ -879,7 +885,7 @@ void CPlayer::FluidFXThink(EFluidState state, CScriptWater& water, CStateManager case EFluidState::EnteredFluid: { bool doSplash = true; - if (x4fc_ > 12.5f) + if (x4fc_flatMoveSpeed > 12.5f) { zeus::CVector3f lookDir = x34_transform.basis[1].normalized(); zeus::CVector3f dcVel = GetDampedClampedVelocityWR(); @@ -931,7 +937,7 @@ void CPlayer::TakeDamage(bool significant, const zeus::CVector3f& location, return; if (dam >= 0.f) { - x570_ = 0.5f; + x570_immuneTimer = 0.5f; x55c_damageAmt = dam; x560_prevDamageAmt = (type == EWeaponType::AI && dam == 0.00002f) ? 10.f : dam; x564_damageLocation = location; @@ -957,7 +963,7 @@ void CPlayer::TakeDamage(bool significant, const zeus::CVector3f& location, damageSamusVoiceSfx = 1656; break; default: - if (x2f8_morphTransState == EPlayerMorphBallState::Unmorphed) + if (x2f8_morphBallState == EPlayerMorphBallState::Unmorphed) { if (dam > 30.f) damageSamusVoiceSfx = 1512; @@ -1013,7 +1019,7 @@ void CPlayer::TakeDamage(bool significant, const zeus::CVector3f& location, if (doRumble) { - if (x2f8_morphTransState == EPlayerMorphBallState::Unmorphed) + if (x2f8_morphBallState == EPlayerMorphBallState::Unmorphed) x490_gun->DamageRumble(location, dam, mgr); float tmp = x55c_damageAmt / 25.f; if (std::fabs(tmp) > 1.f) @@ -1021,7 +1027,7 @@ void CPlayer::TakeDamage(bool significant, const zeus::CVector3f& location, mgr.GetRumbleManager().Rumble(mgr, ERumbleFxId::Eleven, ERumblePriority::One); } - if (x2f8_morphTransState != EPlayerMorphBallState::Unmorphed) + if (x2f8_morphBallState != EPlayerMorphBallState::Unmorphed) { x768_morphball->TakeDamage(x55c_damageAmt); x768_morphball->SetDamageTimer(0.4f); @@ -1052,7 +1058,7 @@ bool CPlayer::IsUnderBetaMetroidAttack(CStateManager& mgr) const rstl::optional_object CPlayer::GetTouchBounds() const { - if (x2f8_morphTransState == EPlayerMorphBallState::Morphed) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphed) { float ballTouchRad = x768_morphball->GetBallTouchRadius(); zeus::CVector3f ballCenter = @@ -1310,8 +1316,8 @@ void CPlayer::RenderGun(const CStateManager& mgr, const zeus::CVector3f& pos) co mgr.GetPlayerState()->GetVisorTransitionFactor() >= 1.f) return; - if ((mgr.GetCameraManager()->IsInFirstPersonCamera() && x2f4_cameraState == EPlayerCameraState::Zero) || - (x2f8_morphTransState == EPlayerMorphBallState::Morphing && + if ((mgr.GetCameraManager()->IsInFirstPersonCamera() && x2f4_cameraState == EPlayerCameraState::FirstPerson) || + (x2f8_morphBallState == EPlayerMorphBallState::Morphing && x498_gunHolsterState == EGunHolsterState::Holstering)) { CModelFlags flags(5, 0, 3, zeus::CColor(1.f, x494_gunAlpha)); @@ -1321,15 +1327,15 @@ void CPlayer::RenderGun(const CStateManager& mgr, const zeus::CVector3f& pos) co void CPlayer::Render(const CStateManager& mgr) const { - bool doRender = x2f4_cameraState != EPlayerCameraState::Four; + bool doRender = x2f4_cameraState != EPlayerCameraState::Spawned; if (!doRender) if (TCastToConstPtr cam = mgr.GetCameraManager()->GetCurrentCamera(mgr)) - doRender = (x2f8_morphTransState == EPlayerMorphBallState::Morphed && cam->GetW1() & 0x40); - if (x2f4_cameraState != EPlayerCameraState::Zero && doRender) + doRender = (x2f8_morphBallState == EPlayerMorphBallState::Morphed && cam->GetW1() & 0x40); + if (x2f4_cameraState != EPlayerCameraState::FirstPerson && doRender) { bool doTransitionRender = false; bool doBallRender = false; - switch (x2f8_morphTransState) + switch (x2f8_morphBallState) { case EPlayerMorphBallState::Unmorphed: x64_modelData->Touch(mgr, 0); @@ -1405,7 +1411,7 @@ void CPlayer::Render(const CStateManager& mgr) const float morphFactor = x574_morphTime / x578_morphDuration; float ballAlphaStart = 0.75f; float ballAlphaMag = 4.f; - if (x2f8_morphTransState == EPlayerMorphBallState::Unmorphing) + if (x2f8_morphBallState == EPlayerMorphBallState::Unmorphing) { ballAlphaStart = 0.875f; morphFactor = 1.f - morphFactor; @@ -1420,7 +1426,7 @@ void CPlayer::Render(const CStateManager& mgr) const x90_actorLights.get(), flags); } - if (x2f8_morphTransState == EPlayerMorphBallState::Morphing) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphing) { if (morphFactor > 0.5f) { @@ -1457,13 +1463,13 @@ void CPlayer::Render(const CStateManager& mgr) const void CPlayer::RenderReflectedPlayer(CStateManager& mgr) { zeus::CFrustum frustum; - switch (x2f8_morphTransState) + switch (x2f8_morphBallState) { case EPlayerMorphBallState::Unmorphed: case EPlayerMorphBallState::Morphing: case EPlayerMorphBallState::Unmorphing: SetCalculateLighting(true); - if (x2f4_cameraState == EPlayerCameraState::Zero) + if (x2f4_cameraState == EPlayerCameraState::FirstPerson) CActor::PreRender(mgr, frustum); CPhysicsActor::Render(mgr); if (HasTransitionBeamModel()) @@ -1480,7 +1486,7 @@ void CPlayer::RenderReflectedPlayer(CStateManager& mgr) void CPlayer::PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) { - if (x2f8_morphTransState == EPlayerMorphBallState::Morphed) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphed) { SetCalculateLighting(false); x768_morphball->PreRender(mgr, frustum); @@ -1488,14 +1494,14 @@ void CPlayer::PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) else { SetCalculateLighting(true); - if (x2f8_morphTransState == EPlayerMorphBallState::Unmorphed) + if (x2f8_morphBallState == EPlayerMorphBallState::Unmorphed) { x490_gun->PreRender(mgr, frustum, mgr.GetCameraManager()->GetGlobalCameraTranslation(mgr)); } } - if (x2f8_morphTransState == EPlayerMorphBallState::Unmorphed || + if (x2f8_morphBallState == EPlayerMorphBallState::Unmorphed || mgr.GetCameraManager()->IsInCinematicCamera()) { x768_morphball->DeleteBallShadow(); @@ -1509,13 +1515,13 @@ void CPlayer::PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) for (auto& model : x730_transitionModels) model->AnimationData()->PreRender(); - if (x2f4_cameraState != EPlayerCameraState::Zero) + if (x2f4_cameraState != EPlayerCameraState::FirstPerson) CActor::PreRender(mgr, frustum); } void CPlayer::CalculateRenderBounds() { - if (x2f8_morphTransState == EPlayerMorphBallState::Morphed) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphed) { float rad = x768_morphball->GetBallRadius(); x9c_renderBounds = zeus::CAABox(GetTranslation() - zeus::CVector3f(rad, rad, 0.f), @@ -1529,8 +1535,8 @@ void CPlayer::CalculateRenderBounds() void CPlayer::AddToRenderer(const zeus::CFrustum& frustum, const CStateManager& mgr) const { - if (x2f4_cameraState != EPlayerCameraState::Zero && - x2f8_morphTransState == EPlayerMorphBallState::Morphed) + if (x2f4_cameraState != EPlayerCameraState::FirstPerson && + x2f8_morphBallState == EPlayerMorphBallState::Morphed) { if (x768_morphball->IsInFrustum(frustum)) CActor::AddToRenderer(frustum, mgr); @@ -1559,7 +1565,7 @@ void CPlayer::ComputeFreeLook(const CFinalInput& input) if (!g_tweakPlayer->GetStayInFreeLookWhileFiring() && (ControlMapper::GetDigitalInput(ControlMapper::ECommands::FireOrBomb, input) || - x304_orbitState != EPlayerOrbitState::Zero)) + x304_orbitState != EPlayerOrbitState::NoOrbit)) { x3e8_horizFreeLookAngleVel = 0.f; x3f0_vertFreeLookAngleVel = 0.f; @@ -1601,7 +1607,7 @@ void CPlayer::ComputeFreeLook(const CFinalInput& input) void CPlayer::UpdateFreeLookState(const CFinalInput& input, float dt, CStateManager& mgr) { if (x304_orbitState == EPlayerOrbitState::Four || IsMorphBallTransitioning() || - x2f8_morphTransState != EPlayerMorphBallState::Unmorphed || + x2f8_morphBallState != EPlayerMorphBallState::Unmorphed || (x3b8_grappleState != EGrappleState::None && x3b8_grappleState != EGrappleState::Firing)) { x3dc_inFreeLook = false; @@ -1737,7 +1743,7 @@ void CPlayer::ProcessFrozenInput(float dt, CStateManager& mgr) else { CFinalInput dummy; - if (x2f8_morphTransState == EPlayerMorphBallState::Morphed) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphed) { x768_morphball->ComputeBallMovement(dummy, mgr, dt); x768_morphball->UpdateBallDynamics(mgr, dt); @@ -1754,7 +1760,7 @@ void CPlayer::ProcessInput(const CFinalInput& input, CStateManager& mgr) if (input.ControllerIdx() != 0) return; - if (x2f8_morphTransState != EPlayerMorphBallState::Morphed) + if (x2f8_morphBallState != EPlayerMorphBallState::Morphed) UpdateScanningState(input, mgr, input.DeltaTime()); if (mgr.GetGameState() != CStateManager::EGameState::Running) @@ -1773,7 +1779,7 @@ void CPlayer::ProcessInput(const CFinalInput& input, CStateManager& mgr) return; CFinalInput dummyInput; - if (x2f8_morphTransState == EPlayerMorphBallState::Morphed) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphed) { x768_morphball->ComputeBallMovement(dummyInput, mgr, input.DeltaTime()); x768_morphball->UpdateBallDynamics(mgr, input.DeltaTime()); @@ -1792,7 +1798,7 @@ void CPlayer::ProcessInput(const CFinalInput& input, CStateManager& mgr) return; } - if (x2f8_morphTransState == EPlayerMorphBallState::Unmorphed && x4a0_failsafeTest->Passes()) + if (x2f8_morphBallState == EPlayerMorphBallState::Unmorphed && x4a0_failsafeTest->Passes()) { auto* prim = static_cast(GetCollisionPrimitive()); zeus::CAABox tmpAABB(prim->GetAABB().min - 0.2f, prim->GetAABB().max + 0.2f); @@ -1814,11 +1820,11 @@ void CPlayer::ProcessInput(const CFinalInput& input, CStateManager& mgr) } UpdateGrappleState(input, mgr); - if (x2f8_morphTransState == EPlayerMorphBallState::Morphed) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphed) { float leftDiv = g_tweakBall->GetLeftStickDivisor(); float rightDiv = g_tweakBall->GetRightStickDivisor(); - if (x26c_ != kInvalidUniqueId || IsUnderBetaMetroidAttack(mgr)) + if (x26c_attachedActor != kInvalidUniqueId || IsUnderBetaMetroidAttack(mgr)) leftDiv = 2.f; CFinalInput scaledInput = input.ScaleAnalogueSticks(leftDiv, rightDiv); x768_morphball->ComputeBallMovement(scaledInput, mgr, input.DeltaTime()); @@ -1827,7 +1833,7 @@ void CPlayer::ProcessInput(const CFinalInput& input, CStateManager& mgr) } else { - if (x304_orbitState == EPlayerOrbitState::Five) + if (x304_orbitState == EPlayerOrbitState::Grapple) { ApplyGrappleForces(input, mgr, input.DeltaTime()); } @@ -1856,13 +1862,13 @@ void CPlayer::ProcessInput(const CFinalInput& input, CStateManager& mgr) UpdateGunState(input, mgr); UpdateVisorState(input, input.DeltaTime(), mgr); - if (x2f8_morphTransState == EPlayerMorphBallState::Morphed || - (x2f8_morphTransState == EPlayerMorphBallState::Unmorphed && + if (x2f8_morphBallState == EPlayerMorphBallState::Morphed || + (x2f8_morphBallState == EPlayerMorphBallState::Unmorphed && x498_gunHolsterState == EGunHolsterState::Drawn)) { x490_gun->ProcessInput(input, mgr); - if (x2f8_morphTransState == EPlayerMorphBallState::Morphed && - x26c_ != kInvalidUniqueId) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphed && + x26c_attachedActor != kInvalidUniqueId) { if (ControlMapper::GetPressInput(ControlMapper::ECommands::TurnLeft, input) || ControlMapper::GetPressInput(ControlMapper::ECommands::TurnRight, input) || @@ -1870,16 +1876,16 @@ void CPlayer::ProcessInput(const CFinalInput& input, CStateManager& mgr) ControlMapper::GetPressInput(ControlMapper::ECommands::Backward, input) || ControlMapper::GetPressInput(ControlMapper::ECommands::JumpOrBoost, input)) { - xa28_ += input.DeltaTime() * 600.f * input.DeltaTime(); - if (xa28_ > 1.f) - xa28_ = 1.f; + xa28_attachedActorStruggle += input.DeltaTime() * 600.f * input.DeltaTime(); + if (xa28_attachedActorStruggle > 1.f) + xa28_attachedActorStruggle = 1.f; } else { float tmp = 7.5f * input.DeltaTime(); - xa28_ -= input.DeltaTime() * std::min(1.f, xa28_ * tmp + tmp); - if (xa28_ < 0.f) - xa28_ = 0.f; + xa28_attachedActorStruggle -= input.DeltaTime() * std::min(1.f, xa28_attachedActorStruggle * tmp + tmp); + if (xa28_attachedActorStruggle < 0.f) + xa28_attachedActorStruggle = 0.f; } } } @@ -1903,12 +1909,12 @@ bool CPlayer::ShouldSampleFailsafe(CStateManager& mgr) const TCastToPtr cineCam = mgr.GetCameraManager()->GetCurrentCamera(mgr); if (!mgr.GetPlayerState()->IsPlayerAlive()) return false; - return x2f4_cameraState != EPlayerCameraState::Four || !cineCam || (cineCam->GetW1() & 0x80) == 0; + return x2f4_cameraState != EPlayerCameraState::Spawned || !cineCam || (cineCam->GetW1() & 0x80) == 0; } void CPlayer::CalculateLeaveMorphBallDirection(const CFinalInput& input) { - if (x2f8_morphTransState != EPlayerMorphBallState::Morphed) + if (x2f8_morphBallState != EPlayerMorphBallState::Morphed) { x518_leaveMorphDir = x50c_moveDir; } @@ -1927,21 +1933,21 @@ void CPlayer::CalculateLeaveMorphBallDirection(const CFinalInput& input) void CPlayer::CalculatePlayerControlDirection(CStateManager& mgr) { - if (x9c4_30_) + if (x9c4_30_controlDirOverride) { - if (x9d8_.canBeNormalized()) + if (x9d8_controlDirOverrideDir.canBeNormalized()) { - x540_ = x9d8_.normalized(); - x54c_ = x9d8_; - x54c_.z = 0.f; - if (x54c_.canBeNormalized()) - x54c_.normalize(); + x540_controlDir = x9d8_controlDirOverrideDir.normalized(); + x54c_controlDirFlat = x9d8_controlDirOverrideDir; + x54c_controlDirFlat.z = 0.f; + if (x54c_controlDirFlat.canBeNormalized()) + x54c_controlDirFlat.normalize(); else - x540_ = x54c_ = zeus::CVector3f::skForward; + x540_controlDir = x54c_controlDirFlat = zeus::CVector3f::skForward; } else { - x540_ = x54c_ = zeus::CVector3f::skForward; + x540_controlDir = x54c_controlDirFlat = zeus::CVector3f::skForward; } } else @@ -1950,7 +1956,7 @@ void CPlayer::CalculatePlayerControlDirection(CStateManager& mgr) GetTranslation() - mgr.GetCameraManager()->GetCurrentCamera(mgr)->GetTranslation(); if (!camToPlayer.canBeNormalized()) { - x540_ = x54c_ = zeus::CVector3f::skForward; + x540_controlDir = x54c_controlDirFlat = zeus::CVector3f::skForward; } else { @@ -1959,44 +1965,44 @@ void CPlayer::CalculatePlayerControlDirection(CStateManager& mgr) { if (camToPlayerFlat.magnitude() > g_tweakBall->GetBallCameraControlDistance()) { - x540_ = camToPlayer.normalized(); + x540_controlDir = camToPlayer.normalized(); if (camToPlayerFlat.canBeNormalized()) { camToPlayerFlat.normalize(); - switch (x2f8_morphTransState) + switch (x2f8_morphBallState) { case EPlayerMorphBallState::Morphed: - x54c_ = camToPlayerFlat; + x54c_controlDirFlat = camToPlayerFlat; break; default: - x540_ = GetTransform().basis[1]; - x54c_ = x540_; - x54c_.z = 0.f; - if (x54c_.canBeNormalized()) - x54c_.normalize(); + x540_controlDir = GetTransform().basis[1]; + x54c_controlDirFlat = x540_controlDir; + x54c_controlDirFlat.z = 0.f; + if (x54c_controlDirFlat.canBeNormalized()) + x54c_controlDirFlat.normalize(); } } - else if (x2f8_morphTransState != EPlayerMorphBallState::Morphed) + else if (x2f8_morphBallState != EPlayerMorphBallState::Morphed) { - x540_ = GetTransform().basis[1]; - x54c_.z = 0.f; - if (x54c_.canBeNormalized()) - x54c_.normalize(); + x540_controlDir = GetTransform().basis[1]; + x54c_controlDirFlat.z = 0.f; + if (x54c_controlDirFlat.canBeNormalized()) + x54c_controlDirFlat.normalize(); } } else { - if (x4fc_ < 0.25f) + if (x4fc_flatMoveSpeed < 0.25f) { - x540_ = camToPlayer; - x54c_ = camToPlayerFlat; + x540_controlDir = camToPlayer; + x54c_controlDirFlat = camToPlayerFlat; } - else if (x2f8_morphTransState != EPlayerMorphBallState::Morphed) + else if (x2f8_morphBallState != EPlayerMorphBallState::Morphed) { - x540_ = GetTransform().basis[1]; - x54c_.z = 0.f; - if (x54c_.canBeNormalized()) - x54c_.normalize(); + x540_controlDir = GetTransform().basis[1]; + x54c_controlDirFlat.z = 0.f; + if (x54c_controlDirFlat.canBeNormalized()) + x54c_controlDirFlat.normalize(); } } } @@ -2006,28 +2012,28 @@ void CPlayer::CalculatePlayerControlDirection(CStateManager& mgr) void CPlayer::CalculatePlayerMovementDirection(float dt) { - if (x2f8_morphTransState == EPlayerMorphBallState::Morphing || - x2f8_morphTransState == EPlayerMorphBallState::Unmorphing) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphing || + x2f8_morphBallState == EPlayerMorphBallState::Unmorphing) return; - zeus::CVector3f delta = GetTranslation() - x524_; + zeus::CVector3f delta = GetTranslation() - x524_lastPosForDirCalc; if (delta.canBeNormalized() && delta.magnitude() > 0.02f) { - x53c_ += dt; - x4f8_ = std::fabs(delta.magnitude() / dt); + x53c_timeMoving += dt; + x4f8_moveSpeed = std::fabs(delta.magnitude() / dt); x500_lookDir = delta.normalized(); zeus::CVector3f flatDelta(delta.x, delta.y, 0.f); if (flatDelta.canBeNormalized()) { - x4fc_ = std::fabs(flatDelta.magnitude() / dt); + x4fc_flatMoveSpeed = std::fabs(flatDelta.magnitude() / dt); flatDelta.normalize(); - switch (x2f8_morphTransState) + switch (x2f8_morphBallState) { case EPlayerMorphBallState::Morphed: - if (x4fc_ > 0.25f) + if (x4fc_flatMoveSpeed > 0.25f) x50c_moveDir = flatDelta; - x530_ = x50c_moveDir; - x524_ = GetTranslation(); + x530_gunDir = x50c_moveDir; + x524_lastPosForDirCalc = GetTranslation(); break; default: x500_lookDir = GetTransform().basis[1]; @@ -2035,30 +2041,30 @@ void CPlayer::CalculatePlayerMovementDirection(float dt) x50c_moveDir.z = 0.f; if (x50c_moveDir.canBeNormalized()) x50c_moveDir.normalize(); - x530_ = x50c_moveDir; - x524_ = GetTranslation(); + x530_gunDir = x50c_moveDir; + x524_lastPosForDirCalc = GetTranslation(); break; } } else { - if (x2f8_morphTransState != EPlayerMorphBallState::Morphed) + if (x2f8_morphBallState != EPlayerMorphBallState::Morphed) { x500_lookDir = GetTransform().basis[1]; x50c_moveDir = x500_lookDir; x50c_moveDir.z = 0.f; if (x50c_moveDir.canBeNormalized()) x50c_moveDir.normalize(); - x530_ = x50c_moveDir; - x524_ = GetTranslation(); + x530_gunDir = x50c_moveDir; + x524_lastPosForDirCalc = GetTranslation(); } - x4fc_ = 0.f; + x4fc_flatMoveSpeed = 0.f; } } else { - x53c_ = 0.f; - switch (x2f8_morphTransState) + x53c_timeMoving = 0.f; + switch (x2f8_morphBallState) { case EPlayerMorphBallState::Morphed: case EPlayerMorphBallState::Morphing: @@ -2071,12 +2077,12 @@ void CPlayer::CalculatePlayerMovementDirection(float dt) x50c_moveDir.z = 0.f; if (x50c_moveDir.canBeNormalized()) x50c_moveDir.normalize(); - x530_ = x50c_moveDir; - x524_ = GetTranslation(); + x530_gunDir = x50c_moveDir; + x524_lastPosForDirCalc = GetTranslation(); break; } - x4f8_ = 0.f; - x4fc_ = 0.f; + x4f8_moveSpeed = 0.f; + x4fc_flatMoveSpeed = 0.f; } x50c_moveDir.z = 0.f; @@ -2116,7 +2122,7 @@ void CPlayer::Freeze(CStateManager& stateMgr, CAssetId steamTxtr, u16 sfx, CAsse return; bool showMsg; - if (x2f8_morphTransState == EPlayerMorphBallState::Unmorphed) + if (x2f8_morphBallState == EPlayerMorphBallState::Unmorphed) showMsg = g_GameState->SystemOptions().GetShowFrozenFpsMessage(); else showMsg = g_GameState->SystemOptions().GetShowFrozenBallMessage(); @@ -2124,7 +2130,7 @@ void CPlayer::Freeze(CStateManager& stateMgr, CAssetId steamTxtr, u16 sfx, CAsse if (showMsg) { const char16_t* msg = - g_MainStringTable->GetString(int(x2f8_morphTransState >= EPlayerMorphBallState::Morphed) + 19); + g_MainStringTable->GetString(int(x2f8_morphBallState >= EPlayerMorphBallState::Morphed) + 19); CHUDMemoParms parms(5.f, true, false, false); MP1::CSamusHud::DisplayHudMemo(msg, parms); } @@ -2164,7 +2170,7 @@ void CPlayer::UpdateFrozenState(const CFinalInput& input, CStateManager& mgr) } x7a0_visorSteam.Update(input.DeltaTime()); - switch (x2f8_morphTransState) + switch (x2f8_morphBallState) { case EPlayerMorphBallState::Morphed: x490_gun->ProcessInput(input, mgr); @@ -2262,24 +2268,283 @@ void CPlayer::UpdatePhazonDamage(float dt, CStateManager& mgr) } +void CPlayer::ResetPlayerHintState() +{ + x9c4_26_ = true; + x9c4_27_canEnterMorphBall = true; + x9c4_28_canLeaveMorphBall = true; + x9c4_30_controlDirOverride = false; + x9c6_24_extendTargetDistance = false; + x9c6_26_outOfBallLookAtHint = false; + x9c4_29_ = false; + x9c6_29_disableInput = false; + x9c7_25_outOfBallLookAtHintActor = false; + x768_morphball->SetX1DE4_25(true); + ResetControlDirectionInterpolation(); +} + +bool CPlayer::SetAreaPlayerHint(const CScriptPlayerHint& hint, CStateManager& mgr) +{ + x9c4_26_ = (hint.GetOverrideFlags() & 0x1) != 0; + x9c4_27_canEnterMorphBall = (hint.GetOverrideFlags() & 0x40) == 0; + x9c4_28_canLeaveMorphBall = (hint.GetOverrideFlags() & 0x20) == 0; + x9c4_30_controlDirOverride = (hint.GetOverrideFlags() & 0x2) != 0; + if (x9c4_30_controlDirOverride) + x9d8_controlDirOverrideDir = hint.GetTransform().basis[1]; + x9c6_24_extendTargetDistance = (hint.GetOverrideFlags() & 0x4) != 0; + x9c6_26_outOfBallLookAtHint = (hint.GetOverrideFlags() & 0x8) != 0; + x9c4_29_ = (hint.GetOverrideFlags() & 0x10) != 0; + x9c6_29_disableInput = (hint.GetOverrideFlags() & 0x80) != 0; + x9c7_25_outOfBallLookAtHintActor = (hint.GetOverrideFlags() & 0x4000) != 0; + x768_morphball->SetX1DE4_25((hint.GetOverrideFlags() & 0x100) == 0); + bool switchedVisor = false; + if ((hint.GetOverrideFlags() & 0x200) != 0) + { + if (mgr.GetPlayerState()->HasPowerUp(CPlayerState::EItemType::CombatVisor)) + mgr.GetPlayerState()->StartVisorTransition(CPlayerState::EPlayerVisor::Combat); + switchedVisor = true; + } + if ((hint.GetOverrideFlags() & 0x400) != 0) + { + if (mgr.GetPlayerState()->HasPowerUp(CPlayerState::EItemType::ScanVisor)) + mgr.GetPlayerState()->StartVisorTransition(CPlayerState::EPlayerVisor::Scan); + switchedVisor = true; + } + if ((hint.GetOverrideFlags() & 0x800) != 0) + { + if (mgr.GetPlayerState()->HasPowerUp(CPlayerState::EItemType::ThermalVisor)) + mgr.GetPlayerState()->StartVisorTransition(CPlayerState::EPlayerVisor::Thermal); + switchedVisor = true; + } + if ((hint.GetOverrideFlags() & 0x1000) != 0) + { + if (mgr.GetPlayerState()->HasPowerUp(CPlayerState::EItemType::XRayVisor)) + mgr.GetPlayerState()->StartVisorTransition(CPlayerState::EPlayerVisor::XRay); + switchedVisor = true; + } + return switchedVisor; +} + +void CPlayer::AddToPlayerHintRemoveList(TUniqueId id, CStateManager& mgr) +{ + if (TCastToPtr hint = mgr.ObjectById(id)) + { + bool alreadyAdded = false; + for (TUniqueId existId : x93c_playerHintsToRemove) + if (id == existId) + return; + if (!alreadyAdded && x93c_playerHintsToRemove.size() != 32) + x93c_playerHintsToRemove.push_back(id); + } +} + +void CPlayer::AddToPlayerHintAddList(TUniqueId id, CStateManager& mgr) +{ + if (TCastToPtr hint = mgr.ObjectById(id)) + { + bool alreadyAdded = false; + for (TUniqueId existId : x980_playerHintsToAdd) + if (id == existId) + return; + if (!alreadyAdded && x980_playerHintsToAdd.size() != 32) + x980_playerHintsToAdd.push_back(id); + } +} + +void CPlayer::DeactivatePlayerHint(TUniqueId id, CStateManager& mgr) +{ + if (TCastToPtr hint = mgr.ObjectById(id)) + { + bool alreadyAdded = false; + for (TUniqueId existId : x93c_playerHintsToRemove) + if (id == existId) + return; + if (!alreadyAdded && x93c_playerHintsToRemove.size() != 32) + { + x93c_playerHintsToRemove.push_back(id); + hint->ClearObjectList(); + hint->SetDeactivated(); + } + } +} + void CPlayer::UpdatePlayerHints(CStateManager& mgr) { + bool removedHint = false; + for (auto it = x838_playerHints.begin() ; it != x838_playerHints.end() ;) + { + auto& p = *it; + TCastToPtr hint = mgr.ObjectById(p.second); + if (!hint) + { + it = x838_playerHints.erase(it); + removedHint = true; + } + else + { + ++it; + } + } + bool needsNewHint = false; + for (TUniqueId id : x93c_playerHintsToRemove) + { + for (auto it = x838_playerHints.begin() ; it != x838_playerHints.end() ;) + { + if (it->second == id) + { + it = x838_playerHints.erase(it); + if (id == x830_playerHint) + needsNewHint = true; + break; + } + ++it; + } + } + x93c_playerHintsToRemove.clear(); + + bool addedHint = false; + for (TUniqueId id : x980_playerHintsToAdd) + { + if (TCastToPtr hint = mgr.ObjectById(id)) + { + bool exists = false; + for (auto& p : x838_playerHints) + if (p.second == id) + { + exists = true; + break; + } + if (!exists) + { + x838_playerHints.emplace_back(hint->GetPriority(), id); + addedHint = true; + } + } + } + x980_playerHintsToAdd.clear(); + + if (needsNewHint || addedHint || removedHint) + { + std::sort(x838_playerHints.begin(), x838_playerHints.end(), + [](const auto& a, const auto& b) { return a.first < b.first; }); + + if ((needsNewHint || removedHint) && x838_playerHints.empty()) + { + x830_playerHint = kInvalidUniqueId; + x834_ = 1000; + ResetPlayerHintState(); + return; + } + + CScriptPlayerHint* foundHint = nullptr; + bool foundHintInArea = false; + for (auto& p : x838_playerHints) + { + if (TCastToPtr hint = mgr.ObjectById(p.second)) + { + foundHint = hint.GetPtr(); + if (hint->GetAreaIdAlways() == mgr.GetNextAreaId()) + { + foundHintInArea = true; + break; + } + } + } + + if (!foundHintInArea) + { + x830_playerHint = kInvalidUniqueId; + x834_ = 1000; + ResetPlayerHintState(); + } + + if (foundHint != nullptr && foundHintInArea && x830_playerHint != foundHint->GetUniqueId()) + { + x830_playerHint = foundHint->GetUniqueId(); + x834_ = foundHint->GetPriority(); + if (SetAreaPlayerHint(*foundHint, mgr)) + DeactivatePlayerHint(x830_playerHint, mgr); + } + } } void CPlayer::UpdateBombJumpStuff() { + if (x9d0_bombJumpCount == 0) + return; + x9d4_bombJumpCheckDelayFrames -= 1; + if (x9d4_bombJumpCheckDelayFrames > 0) + return; + zeus::CVector3f velFlat = x138_velocity; + velFlat.z = 0.f; + if (x258_movementState == EPlayerMovementState::OnGround || + (velFlat.canBeNormalized() && velFlat.magnitude() > 6.f)) + x9d0_bombJumpCount = 0; } void CPlayer::UpdateTransitionFilter(float dt, CStateManager& mgr) { + if (x824_transitionFilterTimer <= 0.f) + { + mgr.GetCameraFilterPass(8).DisableFilter(0.f); + return; + } + x824_transitionFilterTimer += dt; + if (x824_transitionFilterTimer > 1.25f) + { + x824_transitionFilterTimer = 0.f; + mgr.GetCameraFilterPass(8).DisableFilter(0.f); + return; + } + + if (x824_transitionFilterTimer < 0.95f) + return; + + float time = x824_transitionFilterTimer - 0.95f; + zeus::CColor color(1.f, 0.87f, 0.54f, 1.f); + if (time < 0.1f) + color.a = 0.3f * time / 0.1f; + else if (time >= 0.15f) + color.a = 1.f - zeus::clamp(-1.f, (time - 0.15f) / 0.15f, 1.f) * 0.3f; + else + color.a = 0.3f; + + mgr.GetCameraFilterPass(8).SetFilter(EFilterType::Add, EFilterShape::ScanLinesEven, 0.f, color, {}); +} + +void CPlayer::ResetControlDirectionInterpolation() +{ + x9c6_25_interpolatingControlDir = false; + x9f8_controlDirInterpTime = 0.f; +} + +void CPlayer::SetControlDirectionInterpolation(float time) +{ + x9c6_25_interpolatingControlDir = true; + x9f8_controlDirInterpTime = 0.f; + x9fc_controlDirInterpDur = time; } void CPlayer::UpdatePlayerControlDirection(float dt, CStateManager& mgr) { - + zeus::CVector3f oldControlDir = x540_controlDir; + zeus::CVector3f oldControlDirFlat = x54c_controlDirFlat; + CalculatePlayerControlDirection(mgr); + if (x9c6_25_interpolatingControlDir && x2f8_morphBallState == EPlayerMorphBallState::Morphed) + { + x9f8_controlDirInterpTime += dt; + if (x9f8_controlDirInterpTime > x9fc_controlDirInterpDur) + { + x9f8_controlDirInterpTime = x9fc_controlDirInterpDur; + ResetControlDirectionInterpolation(); + } + float t = zeus::clamp(-1.f, x9f8_controlDirInterpTime / x9fc_controlDirInterpDur, 1.f); + x540_controlDir = zeus::CVector3f::lerp(oldControlDir, x540_controlDir, t); + x54c_controlDirFlat = zeus::CVector3f::lerp(oldControlDirFlat, x540_controlDir, t); + } } void CPlayer::Think(float dt, CStateManager& mgr) @@ -2317,8 +2582,8 @@ void CPlayer::Think(float dt, CStateManager& mgr) if (x258_movementState == EPlayerMovementState::FallingMorphed && x300_fallingTime > 0.4f) SetMoveState(EPlayerMovementState::StartingJump, mgr); - if (x570_ > 0.f) - x570_ -= dt; + if (x570_immuneTimer > 0.f) + x570_immuneTimer -= dt; Update(dt, mgr); UpdateTransitionFilter(dt, mgr); @@ -2332,7 +2597,7 @@ void CPlayer::Think(float dt, CStateManager& mgr) x2ac_surfaceRestraint = ESurfaceRestraints::Normal; #endif - if (x2f8_morphTransState == EPlayerMorphBallState::Unmorphed && x9c5_27_camSubmerged && + if (x2f8_morphBallState == EPlayerMorphBallState::Unmorphed && x9c5_27_camSubmerged && mgr.GetCameraManager()->GetFluidCounter() == 0) { if (auto water = GetVisorRunoffEffect(mgr)) @@ -2354,7 +2619,7 @@ void CPlayer::Think(float dt, CStateManager& mgr) } x9c5_27_camSubmerged = mgr.GetCameraManager()->GetFluidCounter() != 0; - if (x2f8_morphTransState != EPlayerMorphBallState::Morphed) + if (x2f8_morphBallState != EPlayerMorphBallState::Morphed) { if (std::fabs(x34_transform.basis[0].z) > FLT_EPSILON || std::fabs(x34_transform.basis[1].z) > FLT_EPSILON) @@ -2405,7 +2670,7 @@ void CPlayer::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CState { case EScriptObjectMessage::OnFloor: if (x258_movementState != EPlayerMovementState::OnGround && - x2f8_morphTransState != EPlayerMorphBallState::Morphed && + x2f8_morphBallState != EPlayerMorphBallState::Morphed && x300_fallingTime > 0.3f) { if (x258_movementState != EPlayerMovementState::Falling) @@ -2446,7 +2711,7 @@ void CPlayer::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CState } } else if (x258_movementState != EPlayerMovementState::OnGround && - x2f8_morphTransState == EPlayerMorphBallState::Morphed) + x2f8_morphBallState == EPlayerMorphBallState::Morphed) { if (x138_velocity.z < -40.f && !x768_morphball->GetIsInHalfPipeMode() && x258_movementState == EPlayerMovementState::StartingJump && @@ -2474,16 +2739,16 @@ void CPlayer::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CState SetMoveState(EPlayerMovementState::OnGround, mgr); break; case EScriptObjectMessage::Falling: - if (x2f8_morphTransState == EPlayerMorphBallState::Morphed) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphed) if (x768_morphball->GetX187c() == 1) break; - if (x2f8_morphTransState != EPlayerMorphBallState::Morphed) + if (x2f8_morphBallState != EPlayerMorphBallState::Morphed) SetMoveState(EPlayerMovementState::Falling, mgr); else if (x258_movementState == EPlayerMovementState::OnGround) SetMoveState(EPlayerMovementState::FallingMorphed, mgr); break; case EScriptObjectMessage::LandOnNotFloor: - if (x2f8_morphTransState == EPlayerMorphBallState::Morphed && + if (x2f8_morphBallState == EPlayerMorphBallState::Morphed && x768_morphball->GetX187c() == 1 && x258_movementState != EPlayerMovementState::StartingJump) SetMoveState(EPlayerMovementState::StartingJump, mgr); @@ -2546,7 +2811,7 @@ void CPlayer::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CState UpdateSubmerged(mgr); break; case EScriptObjectMessage::ProjectileCollide: - x378_ = g_tweakPlayer->GetX1fc(); + x378_orbitPreventionTimer = g_tweakPlayer->GetOrbitPreventionTime(); SetOrbitRequest(EPlayerOrbitRequest::Nine, mgr); break; case EScriptObjectMessage::AddPlatformRider: @@ -2600,7 +2865,7 @@ static const u16 skRightStepSounds[] = void CPlayer::UpdateFootstepSounds(const CFinalInput& input, CStateManager& mgr, float dt) { - if (x2f8_morphTransState != EPlayerMorphBallState::Unmorphed || + if (x2f8_morphBallState != EPlayerMorphBallState::Unmorphed || x258_movementState != EPlayerMovementState::OnGround || x3dc_inFreeLook || x3dd_lookButtonHeld) return; @@ -2611,7 +2876,7 @@ void CPlayer::UpdateFootstepSounds(const CFinalInput& input, CStateManager& mgr, float forward = std::fabs(ForwardInput(input, turn)); turn = std::fabs(turn); float sfxDelay = 0.f; - if (forward > 0.05f || x304_orbitState != EPlayerOrbitState::Zero) + if (forward > 0.05f || x304_orbitState != EPlayerOrbitState::NoOrbit) { float vel = std::min(1.f, x138_velocity.magnitude() / GetActualFirstPersonMaxVelocity(dt)); if (vel > 0.05f) @@ -2750,9 +3015,9 @@ void CPlayer::UpdateVisorState(const CFinalInput& input, float dt, CStateManager if (x7a0_visorSteam.AffectsThermal()) mgr.SetThermalColdScale2(mgr.GetThermalColdScale2() + x7a0_visorSteam.GetAlpha()); - if (x304_orbitState == EPlayerOrbitState::Five || + if (x304_orbitState == EPlayerOrbitState::Grapple || TCastToPtr(mgr.ObjectById(x310_orbitTargetId)) || - x2f8_morphTransState != EPlayerMorphBallState::Unmorphed || + x2f8_morphBallState != EPlayerMorphBallState::Unmorphed || mgr.GetPlayerState()->GetIsVisorTransitioning() || x3a8_scanState != EPlayerScanState::NotScanning) return; @@ -2876,7 +3141,7 @@ void CPlayer::UpdateArmAndGunTransforms(float dt, CStateManager& mgr) { zeus::CVector3f grappleOffset; zeus::CVector3f gunOffset; - if (x2f8_morphTransState == EPlayerMorphBallState::Morphed) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphed) { gunOffset = {0.f, 0.f, 0.6f}; } @@ -2896,7 +3161,7 @@ void CPlayer::UpdateArmAndGunTransforms(float dt, CStateManager& mgr) void CPlayer::ForceGunOrientation(const zeus::CTransform& xf, CStateManager& mgr) { ResetGun(mgr); - x530_ = xf.basis[1]; + x530_gunDir = xf.basis[1]; x490_gun->SetTransform(xf); UpdateArmAndGunTransforms(0.01f, mgr); } @@ -2915,8 +3180,8 @@ void CPlayer::UpdateCameraTimers(float dt, const CFinalInput& input) { if (x3dc_inFreeLook || x3dd_lookButtonHeld) { - x294_jumpCameraPitchTimer = 0.f; - x29c_spaceJumpCameraPitchTimer = 0.f; + x294_jumpCameraTimer = 0.f; + x29c_fallCameraTimer = 0.f; return; } @@ -2937,11 +3202,11 @@ void CPlayer::UpdateCameraTimers(float dt, const CFinalInput& input) ++x298_jumpPresses; if (ControlMapper::GetDigitalInput(ControlMapper::ECommands::JumpOrBoost, input) && - x294_jumpCameraPitchTimer > 0.f && !x2a4_cancelCameraPitch && x298_jumpPresses <= 2) - x294_jumpCameraPitchTimer += dt; + x294_jumpCameraTimer > 0.f && !x2a4_cancelCameraPitch && x298_jumpPresses <= 2) + x294_jumpCameraTimer += dt; - if (x29c_spaceJumpCameraPitchTimer > 0.f && !x2a4_cancelCameraPitch) - x29c_spaceJumpCameraPitchTimer += dt; + if (x29c_fallCameraTimer > 0.f && !x2a4_cancelCameraPitch) + x29c_fallCameraTimer += dt; } void CPlayer::UpdateMorphBallState(const CFinalInput&, CStateManager& mgr) {} @@ -2958,7 +3223,7 @@ void CPlayer::UpdateGunTransform(const zeus::CVector3f& gunPos, CStateManager& m zeus::CTransform gunXf = camXf; zeus::CVector3f viewGunPos; - if (x2f8_morphTransState == EPlayerMorphBallState::Morphing) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphing) viewGunPos = camXf * (gunPos - zeus::CVector3f(0.f, 0.f, eyeHeight)); else viewGunPos = camXf.rotate(gunPos - zeus::CVector3f(0.f, 0.f, eyeHeight)) + GetEyePosition(); @@ -2991,7 +3256,7 @@ void CPlayer::UpdateGunTransform(const zeus::CVector3f& gunPos, CStateManager& m { float liftAngle = 1.f - zeus::clamp(-1.f, x49c_gunHolsterRemTime / g_tweakPlayerGun->GetGunHolsterTime(), 1.f); - if (x2f8_morphTransState == EPlayerMorphBallState::Morphing) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphing) liftAngle = 1.f - zeus::clamp(-1.f, x49c_gunHolsterRemTime / 0.1f, 1.f); if (liftAngle > 0.01f) { @@ -3126,7 +3391,7 @@ void CPlayer::HolsterGun(CStateManager& mgr) if (x498_gunHolsterState == EGunHolsterState::Holstered || x498_gunHolsterState == EGunHolsterState::Holstering) return; - float time = x2f8_morphTransState == EPlayerMorphBallState::Morphing ? 0.1f : + float time = x2f8_morphBallState == EPlayerMorphBallState::Morphing ? 0.1f : g_tweakPlayerGun->GetGunHolsterTime(); if (x498_gunHolsterState == EGunHolsterState::Drawing) x49c_gunHolsterRemTime = time * (1.f - x49c_gunHolsterRemTime / 0.45f); @@ -3139,7 +3404,7 @@ void CPlayer::HolsterGun(CStateManager& mgr) bool CPlayer::IsMorphBallTransitioning() const { - switch (x2f8_morphTransState) + switch (x2f8_morphBallState) { case EPlayerMorphBallState::Morphing: case EPlayerMorphBallState::Unmorphing: @@ -3154,7 +3419,7 @@ void CPlayer::UpdateGrappleArmTransform(const zeus::CVector3f& offset, CStateMan zeus::CTransform armXf = x34_transform; zeus::CVector3f armPosition = x34_transform.rotate(offset) + x34_transform.origin; armXf.origin = armPosition; - if (x2f8_morphTransState != EPlayerMorphBallState::Unmorphed) + if (x2f8_morphBallState != EPlayerMorphBallState::Unmorphed) { x490_gun->GetGrappleArm().SetTransform(armXf); } @@ -3283,7 +3548,7 @@ void CPlayer::ApplyGrappleForces(const CFinalInput& input, CStateManager& mgr, f case EGrappleState::Swinging: { float turnAngleSpeed = zeus::degToRad(g_tweakPlayer->GetMaxGrappleTurnSpeed()); - if (g_tweakPlayer->InvertGrappleTurn()) + if (g_tweakPlayer->GetInvertGrappleTurn()) turnAngleSpeed *= -1.f; zeus::CVector3f pointToPlayer = GetTranslation() - point->GetTranslation(); float pointToPlayerZProj = @@ -3409,7 +3674,7 @@ bool CPlayer::ValidateFPPosition(const zeus::CVector3f& pos, CStateManager& mgr) void CPlayer::UpdateGrappleState(const CFinalInput& input, CStateManager& mgr) { if (!mgr.GetPlayerState()->HasPowerUp(CPlayerState::EItemType::GrappleBeam) || - x2f8_morphTransState == EPlayerMorphBallState::Morphed || + x2f8_morphBallState == EPlayerMorphBallState::Morphed || mgr.GetPlayerState()->GetCurrentVisor() == CPlayerState::EPlayerVisor::Scan || mgr.GetPlayerState()->GetTransitioningVisor() == CPlayerState::EPlayerVisor::Scan) return; @@ -3433,14 +3698,14 @@ void CPlayer::UpdateGrappleState(const CFinalInput& input, CStateManager& mgr) { switch (x304_orbitState) { - case EPlayerOrbitState::Five: + case EPlayerOrbitState::Grapple: switch (g_tweakPlayer->GetGrappleJumpMode()) { case 0: case 1: if (ControlMapper::GetPressInput(ControlMapper::ECommands::FireOrBomb, input)) { - if (TCastToPtr point2 = mgr.ObjectById(x33c_)) + if (TCastToPtr point2 = mgr.ObjectById(x33c_orbitNextTargetId)) { playerToPoint = point2->GetTranslation() - eyePosition; playerToPoint.z = 0.f; @@ -3451,9 +3716,9 @@ void CPlayer::UpdateGrappleState(const CFinalInput& input, CStateManager& mgr) x3c0_grappleSwingAxis.y = -playerToPoint.x; x3c0_grappleSwingAxis.normalize(); x3bc_grappleSwingTimer = 0.f; - SetOrbitTargetId(x33c_, mgr); + SetOrbitTargetId(x33c_orbitNextTargetId, mgr); x3b8_grappleState = EGrappleState::Pull; - x33c_ = kInvalidUniqueId; + x33c_orbitNextTargetId = kInvalidUniqueId; x490_gun->GetGrappleArm().GrappleBeamConnected(); } } @@ -3546,9 +3811,9 @@ void CPlayer::UpdateGrappleState(const CFinalInput& input, CStateManager& mgr) } } - if (x304_orbitState != EPlayerOrbitState::Five) + if (x304_orbitState != EPlayerOrbitState::Grapple) { - if (x304_orbitState >= EPlayerOrbitState::Five) + if (x304_orbitState >= EPlayerOrbitState::Grapple) return; if (x304_orbitState != EPlayerOrbitState::One) return; @@ -3657,7 +3922,7 @@ void CPlayer::BeginGrapple(zeus::CVector3f& vec, CStateManager& mgr) x3c0_grappleSwingAxis.y = -vec.x; x3c0_grappleSwingAxis.normalize(); x3bc_grappleSwingTimer = 0.f; - SetOrbitState(EPlayerOrbitState::Five, mgr); + SetOrbitState(EPlayerOrbitState::Grapple, mgr); x3b8_grappleState = EGrappleState::Pull; RemoveMaterial(EMaterialTypes::GroundCollider, mgr); } @@ -3665,8 +3930,8 @@ void CPlayer::BeginGrapple(zeus::CVector3f& vec, CStateManager& mgr) void CPlayer::BreakGrapple(EPlayerOrbitRequest req, CStateManager& mgr) { - x294_jumpCameraPitchTimer = 0.f; - x29c_spaceJumpCameraPitchTimer = 0.f; + x294_jumpCameraTimer = 0.f; + x29c_fallCameraTimer = 0.f; if (g_tweakPlayer->GetGrappleJumpMode() == 2 && x3b8_grappleState == EGrappleState::Swinging) { ApplyGrappleJump(mgr); @@ -3690,11 +3955,11 @@ void CPlayer::SetOrbitRequest(EPlayerOrbitRequest req, CStateManager& mgr) case EPlayerOrbitRequest::Seven: SetOrbitState(EPlayerOrbitState::Two, mgr); - x314_orbitPoint = g_tweakPlayer->GetX164(int(x308_orbitType)) * + x314_orbitPoint = g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)) * x34_transform.basis[1] + x34_transform.origin; break; default: - SetOrbitState(EPlayerOrbitState::Zero, mgr); + SetOrbitState(EPlayerOrbitState::NoOrbit, mgr); break; } } @@ -3703,13 +3968,13 @@ bool CPlayer::InGrappleJumpCooldown() const { if (x258_movementState == EPlayerMovementState::OnGround) return false; - return x3d8_grappleJumpTimeout > 0.f || x294_jumpCameraPitchTimer == 0.f; + return x3d8_grappleJumpTimeout > 0.f || x294_jumpCameraTimer == 0.f; } void CPlayer::PreventFallingCameraPitch() { - x294_jumpCameraPitchTimer = 0.f; - x29c_spaceJumpCameraPitchTimer = 0.01f; + x294_jumpCameraTimer = 0.f; + x29c_fallCameraTimer = 0.01f; x2a4_cancelCameraPitch = true; } @@ -3726,7 +3991,7 @@ void CPlayer::OrbitPoint(EPlayerOrbitType type, CStateManager& mgr) { x308_orbitType = type; SetOrbitState(EPlayerOrbitState::Two, mgr); - SetOrbitPosition(g_tweakPlayer->GetX164(int(x308_orbitType)), mgr); + SetOrbitPosition(g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)), mgr); } zeus::CVector3f CPlayer::GetHUDOrbitTargetPosition() const @@ -3741,29 +4006,29 @@ void CPlayer::SetOrbitState(EPlayerOrbitState state, CStateManager& mgr) switch (x304_orbitState) { case EPlayerOrbitState::One: - cam->SetX18C(false); + cam->SetLockCamera(false); break; case EPlayerOrbitState::Three: { - cam->SetX18C(true); + cam->SetLockCamera(true); zeus::CVector3f playerToPoint = x314_orbitPoint - GetTranslation(); if (playerToPoint.canBeNormalized()) x340_ = playerToPoint.magnitude(); else x340_ = 0.f; SetOrbitTargetId(kInvalidUniqueId, mgr); - x33c_ = kInvalidUniqueId; + x33c_orbitNextTargetId = kInvalidUniqueId; break; } - case EPlayerOrbitState::Zero: - x32c_orbitDistance = g_tweakPlayer->GetOrbitNormalDistance(); - x32c_orbitDistance = 0.28f; + case EPlayerOrbitState::NoOrbit: + x32c_orbitModeTimer = g_tweakPlayer->GetOrbitModeTimer(); + x32c_orbitModeTimer = 0.28f; SetOrbitTargetId(kInvalidUniqueId, mgr); - x33c_ = kInvalidUniqueId; + x33c_orbitNextTargetId = kInvalidUniqueId; break; case EPlayerOrbitState::Two: SetOrbitTargetId(kInvalidUniqueId, mgr); - x33c_ = kInvalidUniqueId; + x33c_orbitNextTargetId = kInvalidUniqueId; break; default: break; @@ -3785,17 +4050,17 @@ void CPlayer::SetOrbitTargetId(TUniqueId id, CStateManager& mgr) x374_orbitLockEstablished = false; } -void CPlayer::UpdateOrbitPosition(float pos, CStateManager& mgr) +void CPlayer::UpdateOrbitPosition(float dist, CStateManager& mgr) { switch (x304_orbitState) { case EPlayerOrbitState::Two: case EPlayerOrbitState::Three: - SetOrbitPosition(pos, mgr); + SetOrbitPosition(dist, mgr); break; case EPlayerOrbitState::One: case EPlayerOrbitState::Four: - case EPlayerOrbitState::Five: + case EPlayerOrbitState::Grapple: if (TCastToPtr act = mgr.ObjectById(x310_orbitTargetId)) if (x310_orbitTargetId != kInvalidUniqueId) x314_orbitPoint = act->GetOrbitPosition(mgr); @@ -3818,7 +4083,7 @@ void CPlayer::UpdateOrbitFixedPosition() x314_orbitPoint = x34_transform.rotate(x320_orbitVector) + GetEyePosition(); } -void CPlayer::SetOrbitPosition(float pos, CStateManager& mgr) +void CPlayer::SetOrbitPosition(float dist, CStateManager& mgr) { zeus::CTransform camXf = GetFirstPersonCameraTransform(mgr); if (x304_orbitState == EPlayerOrbitState::Two && x30c_orbitRequest == EPlayerOrbitRequest::Seven) @@ -3827,8 +4092,8 @@ void CPlayer::SetOrbitPosition(float pos, CStateManager& mgr) float dot = fwd.normalized().dot(fwd); if (std::fabs(dot) > 1.f) dot = (dot > 0.f) ? 1.f : -1.f; - x314_orbitPoint = camXf.rotate(zeus::CVector3f(0.f, pos / dot, 0.f)) + camXf.origin; - x320_orbitVector = zeus::CVector3f(0.f, pos, x314_orbitPoint.z - camXf.origin.z); + x314_orbitPoint = camXf.rotate(zeus::CVector3f(0.f, dist / dot, 0.f)) + camXf.origin; + x320_orbitVector = zeus::CVector3f(0.f, dist, x314_orbitPoint.z - camXf.origin.z); } void CPlayer::UpdateAimTarget(CStateManager& mgr) @@ -3880,7 +4145,7 @@ void CPlayer::UpdateAimTarget(CStateManager& mgr) } else { - if (x304_orbitState == EPlayerOrbitState::Zero) + if (x304_orbitState == EPlayerOrbitState::NoOrbit) needsReset = true; } @@ -3939,8 +4204,8 @@ bool CPlayer::ValidateAimTargetId(TUniqueId uid, CStateManager& mgr) zeus::CVector3f posInBox(vpWHalf + screenPos.x * vpWHalf, vpHHalf + screenPos.y * vpHHalf, screenPos.z); - if (WithinOrbitScreenBox(posInBox, x330_orbitZone, x334_orbitType) || - (x330_orbitZone != EPlayerZoneInfo::Zero && + if (WithinOrbitScreenBox(posInBox, x330_orbitZoneMode, x334_orbitType) || + (x330_orbitZoneMode != EPlayerZoneInfo::Zero && WithinOrbitScreenBox(posInBox, EPlayerZoneInfo::Zero, x334_orbitType))) { float eyeToAimMag = eyeToAim.magnitude(); @@ -4137,7 +4402,7 @@ TUniqueId CPlayer::CheckEnemiesAgainstOrbitZone(const std::vector& li TUniqueId CPlayer::FindOrbitTargetId(CStateManager& mgr) { - return FindBestOrbitableObject(x354_onScreenOrbitObjects, x330_orbitZone, mgr); + return FindBestOrbitableObject(x354_onScreenOrbitObjects, x330_orbitZoneMode, mgr); } void CPlayer::UpdateOrbitableObjects(CStateManager& mgr) @@ -4161,9 +4426,9 @@ void CPlayer::UpdateOrbitableObjects(CStateManager& mgr) rstl::reserved_vector nearList; mgr.BuildNearList(nearList, nearAABB, filter, nullptr); - FindOrbitableObjects(nearList, x344_nearbyOrbitObjects, x330_orbitZone, EPlayerZoneType::Always, mgr, true); - FindOrbitableObjects(nearList, x354_onScreenOrbitObjects, x330_orbitZone, x334_orbitType, mgr, true); - FindOrbitableObjects(nearList, x364_offScreenOrbitObjects, x330_orbitZone, x334_orbitType, mgr, false); + FindOrbitableObjects(nearList, x344_nearbyOrbitObjects, x330_orbitZoneMode, EPlayerZoneType::Always, mgr, true); + FindOrbitableObjects(nearList, x354_onScreenOrbitObjects, x330_orbitZoneMode, x334_orbitType, mgr, true); + FindOrbitableObjects(nearList, x364_offScreenOrbitObjects, x330_orbitZoneMode, x334_orbitType, mgr, false); } TUniqueId CPlayer::FindBestOrbitableObject(const std::vector& ids, @@ -4432,14 +4697,14 @@ bool CPlayer::CheckOrbitDisableSourceList(CStateManager& mgr) { for (auto it = x9e4_orbitDisableList.begin() ; it != x9e4_orbitDisableList.end() ;) { - if (!mgr.GetObjectById(*it)) + if (mgr.GetObjectById(*it) == nullptr) { it = x9e4_orbitDisableList.erase(it); continue; } ++it; } - return x9e4_orbitDisableList.size() != 0; + return !x9e4_orbitDisableList.empty(); } void CPlayer::RemoveOrbitDisableSource(TUniqueId uid) @@ -4468,13 +4733,193 @@ void CPlayer::AddOrbitDisableSource(CStateManager& mgr, TUniqueId addId) SetOrbitTargetId(kInvalidUniqueId, mgr); } -void CPlayer::UpdateOrbitPreventionTimer(float) {} +void CPlayer::UpdateOrbitPreventionTimer(float dt) +{ + if (x378_orbitPreventionTimer > 0.f) + x378_orbitPreventionTimer -= dt; +} -void CPlayer::UpdateOrbitModeTimer(float) {} +void CPlayer::UpdateOrbitModeTimer(float dt) +{ + if (x304_orbitState == EPlayerOrbitState::NoOrbit && x32c_orbitModeTimer > 0.f) + x32c_orbitModeTimer -= dt; + x32c_orbitModeTimer = 0.f; +} -void CPlayer::UpdateOrbitZone(CStateManager& mgr) {} +void CPlayer::UpdateOrbitZone(CStateManager& mgr) +{ + if (mgr.GetPlayerState()->GetCurrentVisor() != CPlayerState::EPlayerVisor::Scan) + { + x334_orbitType = EPlayerZoneType::Ellipse; + x338_ = 1; + x330_orbitZoneMode = EPlayerZoneInfo::Zero; + } + else + { + x334_orbitType = EPlayerZoneType::Box; + x338_ = 2; + x330_orbitZoneMode = EPlayerZoneInfo::One; + } +} -void CPlayer::UpdateOrbitInput(const CFinalInput& input, CStateManager& mgr) {} +void CPlayer::UpdateOrbitInput(const CFinalInput& input, CStateManager& mgr) +{ + if (x2f8_morphBallState != EPlayerMorphBallState::Unmorphed || x378_orbitPreventionTimer > 0.f) + return; + + UpdateOrbitableObjects(mgr); + if (x304_orbitState == EPlayerOrbitState::NoOrbit) + x33c_orbitNextTargetId = FindOrbitTargetId(mgr); + + if (ControlMapper::GetDigitalInput(ControlMapper::ECommands::OrbitClose, input) || + ControlMapper::GetDigitalInput(ControlMapper::ECommands::OrbitFar, input) || + ControlMapper::GetDigitalInput(ControlMapper::ECommands::OrbitObject, input)) + { + switch (x304_orbitState) + { + case EPlayerOrbitState::NoOrbit: + if (ControlMapper::GetPressInput(ControlMapper::ECommands::OrbitObject, input)) + { + SetOrbitTargetId(x33c_orbitNextTargetId, mgr); + if (x310_orbitTargetId != kInvalidUniqueId) + { + if (ValidateAimTargetId(x310_orbitTargetId, mgr)) + ResetAimTargetPrediction(x310_orbitTargetId); + SetOrbitState(EPlayerOrbitState::One, mgr); + UpdateOrbitPosition(g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)), mgr); + } + } + else + { + if (ControlMapper::GetPressInput(ControlMapper::ECommands::OrbitFar, input)) + OrbitPoint(EPlayerOrbitType::Far, mgr); + if (ControlMapper::GetPressInput(ControlMapper::ECommands::OrbitClose, input)) + OrbitPoint(EPlayerOrbitType::Close, mgr); + } + break; + case EPlayerOrbitState::Grapple: + if (x310_orbitTargetId == kInvalidUniqueId) + BreakGrapple(EPlayerOrbitRequest::Zero, mgr); + break; + case EPlayerOrbitState::One: + if (TCastToConstPtr point = mgr.GetObjectById(x310_orbitTargetId)) + { + if (ValidateCurrentOrbitTargetId(mgr) == EOrbitValidationResult::OK) + UpdateOrbitPosition(g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)), mgr); + else + BreakGrapple(EPlayerOrbitRequest::Six, mgr); + } + else + { + EOrbitValidationResult result = ValidateCurrentOrbitTargetId(mgr); + if (result == EOrbitValidationResult::OK) + UpdateOrbitPosition(g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)), mgr); + else if (result == EOrbitValidationResult::BrokenLookAngle) + OrbitPoint(EPlayerOrbitType::Far, mgr); + else if (result == EOrbitValidationResult::ExtremeHorizonAngle) + SetOrbitRequest(EPlayerOrbitRequest::Seven, mgr); + else + ActivateOrbitSource(mgr); + } + UpdateOrbitSelection(input, mgr); + break; + case EPlayerOrbitState::Two: + if (ControlMapper::GetPressInput(ControlMapper::ECommands::OrbitObject, input)) + { + SetOrbitTargetId(FindOrbitTargetId(mgr), mgr); + if (x310_orbitTargetId != kInvalidUniqueId) + { + if (ValidateAimTargetId(x310_orbitTargetId, mgr)) + ResetAimTargetPrediction(x310_orbitTargetId); + SetOrbitState(EPlayerOrbitState::One, mgr); + UpdateOrbitPosition(g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)), mgr); + } + } + else + { + switch (x308_orbitType) + { + case EPlayerOrbitType::Far: + if (ControlMapper::GetDigitalInput(ControlMapper::ECommands::OrbitClose, input)) + { + x308_orbitType = EPlayerOrbitType::Close; + UpdateOrbitPosition(g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)), mgr); + } + break; + case EPlayerOrbitType::Close: + if (ControlMapper::GetDigitalInput(ControlMapper::ECommands::OrbitFar, input) && + !ControlMapper::GetDigitalInput(ControlMapper::ECommands::OrbitClose, input)) + { + x308_orbitType = EPlayerOrbitType::Far; + UpdateOrbitPosition(g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)), mgr); + } + break; + break; + default: + break; + } + } + UpdateOrbitPosition(g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)), mgr); + break; + case EPlayerOrbitState::Three: + if (ControlMapper::GetPressInput(ControlMapper::ECommands::OrbitObject, input)) + { + SetOrbitTargetId(FindOrbitTargetId(mgr), mgr); + if (x310_orbitTargetId != kInvalidUniqueId) + { + if (ValidateAimTargetId(x310_orbitTargetId, mgr)) + ResetAimTargetPrediction(x310_orbitTargetId); + SetOrbitState(EPlayerOrbitState::One, mgr); + UpdateOrbitPosition(g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)), mgr); + } + } + UpdateOrbitSelection(input, mgr); + break; + case EPlayerOrbitState::Four: + UpdateOrbitPosition(g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)), mgr); + UpdateOrbitSelection(input, mgr); + break; + } + + if (x304_orbitState == EPlayerOrbitState::Grapple) + { + x33c_orbitNextTargetId = FindOrbitTargetId(mgr); + if (x33c_orbitNextTargetId == x310_orbitTargetId) + x33c_orbitNextTargetId = kInvalidUniqueId; + } + } + else + { + switch (x304_orbitState) + { + case EPlayerOrbitState::One: + if (TCastToConstPtr point = mgr.GetObjectById(x310_orbitTargetId)) + BreakGrapple(EPlayerOrbitRequest::Three, mgr); + else + SetOrbitRequest(EPlayerOrbitRequest::Zero, mgr); + break; + case EPlayerOrbitState::Grapple: + if (!g_tweakPlayer->GetOrbitReleaseBreaksGrapple()) + { + x33c_orbitNextTargetId = FindOrbitTargetId(mgr); + if (x33c_orbitNextTargetId == x310_orbitTargetId) + x33c_orbitNextTargetId = kInvalidUniqueId; + } + else + { + BreakGrapple(EPlayerOrbitRequest::Zero, mgr); + } + break; + case EPlayerOrbitState::Four: + UpdateOrbitPosition(g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)), mgr); + UpdateOrbitSelection(input, mgr); + break; + default: + SetOrbitRequest(EPlayerOrbitRequest::Zero, mgr); + break; + } + } +} void CPlayer::ActivateOrbitSource(CStateManager& mgr) { @@ -4488,22 +4933,150 @@ void CPlayer::ActivateOrbitSource(CStateManager& mgr) break; case 2: if (x394_orbitingEnemy) - OrbitPoint(EPlayerOrbitType::One, mgr); + OrbitPoint(EPlayerOrbitType::Far, mgr); else OrbitCarcass(mgr); break; } } -void CPlayer::UpdateOrbitSelection(const CFinalInput& input, CStateManager& mgr) {} +void CPlayer::UpdateOrbitSelection(const CFinalInput& input, CStateManager& mgr) +{ + x33c_orbitNextTargetId = FindOrbitTargetId(mgr); + TCastToConstPtr curPoint = mgr.GetObjectById(x310_orbitTargetId); + TCastToConstPtr nextPoint = mgr.GetObjectById(x33c_orbitNextTargetId); + if (curPoint || (x304_orbitState == EPlayerOrbitState::Grapple && !nextPoint)) + { + x33c_orbitNextTargetId = kInvalidUniqueId; + return; + } -void CPlayer::UpdateOrbitOrientation(CStateManager& mgr) {} + if (ControlMapper::GetPressInput(ControlMapper::ECommands::OrbitObject, input) && + x33c_orbitNextTargetId != kInvalidUniqueId) + { + SetOrbitTargetId(x33c_orbitNextTargetId, mgr); + if (ValidateAimTargetId(x310_orbitTargetId, mgr)) + ResetAimTargetPrediction(x310_orbitTargetId); + SetOrbitState(EPlayerOrbitState::One, mgr); + UpdateOrbitPosition(g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)), mgr); + } +} -void CPlayer::UpdateOrbitTarget(CStateManager& mgr) {} +void CPlayer::UpdateOrbitOrientation(CStateManager& mgr) +{ + if (x2f8_morphBallState != EPlayerMorphBallState::Unmorphed) + return; -float CPlayer::GetOrbitMaxLockDistance(CStateManager& mgr) const { return 0.f; } + switch (x304_orbitState) + { + case EPlayerOrbitState::Two: + if (x3dc_inFreeLook) + return; + case EPlayerOrbitState::One: + case EPlayerOrbitState::Three: + case EPlayerOrbitState::Four: + { + zeus::CVector3f playerToPoint = x314_orbitPoint - GetTranslation(); + if (!x374_orbitLockEstablished) + playerToPoint = mgr.GetCameraManager()->GetFirstPersonCamera()->GetTransform().basis[1]; + playerToPoint.z = 0.f; + if (playerToPoint.canBeNormalized()) + { + zeus::CTransform xf = zeus::lookAt(zeus::CVector3f::skZero, playerToPoint); + xf.origin = GetTranslation(); + SetTransform(xf); + } + break; + } + default: + break; + } +} -float CPlayer::GetOrbitMaxTargetDistance(CStateManager& mgr) const { return 0.f; } +void CPlayer::UpdateOrbitTarget(CStateManager& mgr) +{ + if (!ValidateOrbitTargetIdAndPointer(x310_orbitTargetId, mgr)) + SetOrbitTargetId(kInvalidUniqueId, mgr); + if (!ValidateOrbitTargetIdAndPointer(x33c_orbitNextTargetId, mgr)) + x33c_orbitNextTargetId = kInvalidUniqueId; + zeus::CVector3f playerToPoint = x314_orbitPoint - GetTranslation(); + playerToPoint.z = 0.f; + float playerToPointMag = playerToPoint.magnitude(); + + switch (x304_orbitState) + { + case EPlayerOrbitState::One: + if (auto* ent = static_cast(mgr.GetObjectById(x310_orbitTargetId))) + { + if (ent->GetDoTargetDistanceTest() && + (playerToPointMag >= GetOrbitMaxLockDistance(mgr) || playerToPointMag < 0.5f)) + { + if (playerToPointMag < 0.5f) + SetOrbitRequest(EPlayerOrbitRequest::Seven, mgr); + else + ActivateOrbitSource(mgr); + } + } + UpdateOrbitPosition(g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)), mgr); + break; + case EPlayerOrbitState::Two: + { + if (g_tweakPlayer->GetOrbitFixedOffset() && + std::fabs(x320_orbitVector.z) > g_tweakPlayer->GetOrbitFixedOffsetZDiff()) + { + UpdateOrbitFixedPosition(); + return; + } + if (playerToPointMag < CalculateOrbitZBasedDistance(x308_orbitType)) + UpdateOrbitPosition(CalculateOrbitZBasedDistance(x308_orbitType), mgr); + float maxDist = g_tweakPlayer->GetOrbitMaxDistance(int(x308_orbitType)); + if (playerToPointMag > maxDist) + UpdateOrbitPosition(maxDist, mgr); + if (x3dd_lookButtonHeld) + SetOrbitPosition(g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)), mgr); + zeus::CVector3f eyeToPoint = x314_orbitPoint - GetEyePosition(); + float angleToPoint = std::asin(zeus::clamp(-1.f, std::fabs(eyeToPoint.z) / eyeToPoint.magnitude(), 1.f)); + if ((eyeToPoint.z >= 0.f && angleToPoint >= g_tweakPlayer->GetOrbitUpperAngle()) || + (eyeToPoint.z < 0.f && angleToPoint >= g_tweakPlayer->GetOrbitLowerAngle())) + SetOrbitRequest(EPlayerOrbitRequest::Seven, mgr); + break; + } + case EPlayerOrbitState::Three: + { + if (x3dd_lookButtonHeld) + SetOrbitPosition(x340_, mgr); + if (playerToPointMag < CalculateOrbitZBasedDistance(x308_orbitType)) + { + UpdateOrbitPosition(CalculateOrbitZBasedDistance(x308_orbitType), mgr); + x340_ = CalculateOrbitZBasedDistance(x308_orbitType); + } + float maxDist = g_tweakPlayer->GetOrbitMaxDistance(int(x308_orbitType)); + if (playerToPointMag > maxDist) + { + UpdateOrbitPosition(maxDist, mgr); + x340_ = g_tweakPlayer->GetOrbitMaxDistance(int(x308_orbitType)); + } + break; + } + case EPlayerOrbitState::NoOrbit: + SetOrbitTargetId(kInvalidUniqueId, mgr); + break; + default: break; + } + UpdateOrbitZPosition(); +} + +float CPlayer::GetOrbitMaxLockDistance(CStateManager& mgr) const +{ + return mgr.GetPlayerState()->GetCurrentVisor() == CPlayerState::EPlayerVisor::Scan ? + g_tweakPlayer->GetScanMaxLockDistance() : g_tweakPlayer->GetOrbitMaxLockDistance(); +} + +float CPlayer::GetOrbitMaxTargetDistance(CStateManager& mgr) const +{ + return mgr.GetPlayerState()->GetCurrentVisor() == CPlayerState::EPlayerVisor::Scan ? + g_tweakPlayer->GetScanMaxTargetDistance() : g_tweakPlayer->GetOrbitMaxTargetDistance(); +} CPlayer::EOrbitValidationResult CPlayer::ValidateOrbitTargetId(TUniqueId uid, CStateManager& mgr) const { @@ -4514,7 +5087,7 @@ CPlayer::EOrbitValidationResult CPlayer::ValidateOrbitTargetId(TUniqueId uid, CS if (!act || !act->GetIsTargetable() || !act->GetActive()) return EOrbitValidationResult::InvalidTarget; - if (x740_staticOutTimer != 0.f) + if (x740_staticTimer != 0.f) return EOrbitValidationResult::PlayerNotReadyToTarget; zeus::CVector3f eyePos = GetEyePosition(); @@ -4526,8 +5099,8 @@ CPlayer::EOrbitValidationResult CPlayer::ValidateOrbitTargetId(TUniqueId uid, CS { float angleFromHorizon = std::asin(zeus::clamp(-1.f, std::fabs(eyeToOrbit.z) / eyeToOrbit.magnitude(), 1.f)); - if ((eyeToOrbit.z >= 0.f && angleFromHorizon >= g_tweakPlayer->GetMaxUpwardOrbitLookAngle()) || - (eyeToOrbit.z < 0.f && angleFromHorizon >= g_tweakPlayer->GetMaxDownwardOrbitLookAngle())) + if ((eyeToOrbit.z >= 0.f && angleFromHorizon >= g_tweakPlayer->GetOrbitUpperAngle()) || + (eyeToOrbit.z < 0.f && angleFromHorizon >= g_tweakPlayer->GetOrbitLowerAngle())) return EOrbitValidationResult::ExtremeHorizonAngle; } else @@ -4684,9 +5257,103 @@ float CPlayer::GetStepDownHeight() const return CPhysicsActor::GetStepDownHeight(); } -void CPlayer::Teleport(const zeus::CTransform& xf, CStateManager& mgr, bool) {} +void CPlayer::Teleport(const zeus::CTransform& xf, CStateManager& mgr, bool resetBallCam) +{ + CPhysicsActor::Stop(); + zeus::CVector3f lookDir = xf.basis[1]; + if (lookDir.canBeNormalized()) + { + lookDir.normalize(); + SetTransform(zeus::lookAt(zeus::CVector3f::skZero, lookDir)); + SetTranslation(xf.origin); + x500_lookDir = lookDir; + x50c_moveDir = lookDir; + x530_gunDir = lookDir; + x524_lastPosForDirCalc = xf.origin; + x4f8_moveSpeed = 0.f; + x4fc_flatMoveSpeed = 0.f; + x53c_timeMoving = 0.f; + x4a4_moveSpeedAvg.Clear(); + x540_controlDir = lookDir; + x54c_controlDirFlat = lookDir; + } + else + { + SetTranslation(xf.origin); + } -void CPlayer::BombJump(const zeus::CVector3f& pos, CStateManager& mgr) {} + x9c5_31_stepCameraZBiasDirty = true; + x9c8_eyeZBias = 0.f; + x1f4_lastNonCollidingState = GetMotionState(); + SetMoveState(EPlayerMovementState::OnGround, mgr); + zeus::CTransform eyeXf = x34_transform; + eyeXf.origin = GetEyePosition(); + mgr.GetCameraManager()->GetFirstPersonCamera()->Reset(eyeXf, mgr); + if (resetBallCam) + mgr.GetCameraManager()->GetBallCamera()->Reset(eyeXf, mgr); + ForceGunOrientation(x34_transform, mgr); + SetOrbitRequest(EPlayerOrbitRequest::One, mgr); +} + +void CPlayer::BombJump(const zeus::CVector3f& pos, CStateManager& mgr) +{ + if (x2f8_morphBallState == EPlayerMorphBallState::Morphed && + x768_morphball->GetBombJumpState() != CMorphBall::EBombJumpState::One) + { + zeus::CVector3f posToBall = + GetTranslation() + zeus::CVector3f(0.f, 0.f, g_tweakPlayer->GetPlayerBallHalfExtent()) - pos; + float maxJump = g_tweakPlayer->GetBombJumpHeight(); + if (posToBall.magSquared() < maxJump * maxJump && + posToBall.dot(zeus::CVector3f::skUp) >= -g_tweakPlayer->GetPlayerBallHalfExtent()) + { + float upVel = std::sqrt(2.f * std::fabs(g_tweakPlayer->GetNormalGravAccel()) * + g_tweakPlayer->GetBombJumpRadius()); + mgr.GetRumbleManager().Rumble(mgr, ERumbleFxId::Eleven, ERumblePriority::One); + x2a0_ = 0.01f; + switch (GetSurfaceRestraint()) + { + case ESurfaceRestraints::Water: + upVel *= g_tweakPlayer->GetWaterBallJumpFactor(); + break; + case ESurfaceRestraints::Lava: + upVel *= g_tweakPlayer->GetLavaBallJumpFactor(); + break; + case ESurfaceRestraints::PhazonFluid: + upVel *= g_tweakPlayer->GetPhazonBallJumpFactor(); + break; + default: + break; + } + SetVelocityWR(zeus::CVector3f(0.f, 0.f, upVel)); + x768_morphball->SetDamageTimer(0.1f); + x768_morphball->CancelBoosting(); + if (x9d0_bombJumpCount > 0) + { + if (x9d0_bombJumpCount > 2) + { + x9d0_bombJumpCount = 0; + x9d4_bombJumpCheckDelayFrames = 0; + } + else + { + ++x9d0_bombJumpCount; + } + } + else + { + CBallCamera* ballCam = mgr.GetCameraManager()->GetBallCamera(); + if (ballCam->GetTooCloseActorId() != kInvalidUniqueId && ballCam->GetX3E0() < 5.f) + { + x9d0_bombJumpCount = 1; + x9d4_bombJumpCheckDelayFrames = 2; + } + } + CSfxHandle hnd = CSfxManager::AddEmitter(1468, GetTranslation(), zeus::CVector3f::skZero, + false, false, 0x7f, kInvalidAreaId); + ApplySubmergedPitchBend(hnd); + } + } +} zeus::CTransform CPlayer::CreateTransformFromMovementDirection() const { @@ -4701,7 +5368,7 @@ zeus::CTransform CPlayer::CreateTransformFromMovementDirection() const const CCollisionPrimitive* CPlayer::GetCollisionPrimitive() const { - switch (x2f8_morphTransState) + switch (x2f8_morphBallState) { case EPlayerMorphBallState::Morphed: return GetCollidableSphere(); @@ -4722,13 +5389,13 @@ zeus::CTransform CPlayer::GetPrimitiveTransform() const void CPlayer::CollidedWith(TUniqueId id, const CCollisionInfoList& list, CStateManager& mgr) { - if (x2f8_morphTransState != EPlayerMorphBallState::Unmorphed) + if (x2f8_morphBallState != EPlayerMorphBallState::Unmorphed) x768_morphball->CollidedWith(id, list, mgr); } float CPlayer::GetActualBallMaxVelocity(float dt) const { - ESurfaceRestraints surf = x2b0_outOfWaterTicks == 2 ? x2ac_surfaceRestraint : ESurfaceRestraints::Water; + ESurfaceRestraints surf = GetSurfaceRestraint(); float friction = g_tweakBall->GetBallTranslationFriction(int(surf)); float maxSpeed = g_tweakBall->GetBallTranslationMaxSpeed(int(surf)); float acceleration = g_tweakBall->GetMaxBallTranslationAcceleration(int(surf)); @@ -4737,7 +5404,7 @@ float CPlayer::GetActualBallMaxVelocity(float dt) const float CPlayer::GetActualFirstPersonMaxVelocity(float dt) const { - ESurfaceRestraints surf = x2b0_outOfWaterTicks == 2 ? x2ac_surfaceRestraint : ESurfaceRestraints::Water; + ESurfaceRestraints surf = GetSurfaceRestraint(); float friction = g_tweakPlayer->GetPlayerTranslationFriction(int(surf)); float maxSpeed = g_tweakPlayer->GetPlayerTranslationMaxSpeed(int(surf)); float acceleration = g_tweakPlayer->GetMaxTranslationalAcceleration(int(surf)); @@ -4769,10 +5436,10 @@ void CPlayer::SetMoveState(EPlayerMovementState newState, CStateManager& mgr) x28c_sjTimer = g_tweakPlayer->GetMaxDoubleJumpWindow(); else x28c_sjTimer = 0.f; - if (x294_jumpCameraPitchTimer <= 0.f && x29c_spaceJumpCameraPitchTimer <= 0.f && + if (x294_jumpCameraTimer <= 0.f && x29c_fallCameraTimer <= 0.f && !x3dc_inFreeLook && !x3dd_lookButtonHeld) { - x294_jumpCameraPitchTimer = 0.01f; + x294_jumpCameraTimer = 0.01f; x2a4_cancelCameraPitch = false; } x258_movementState = EPlayerMovementState::Jump; @@ -4802,10 +5469,10 @@ void CPlayer::SetMoveState(EPlayerMovementState newState, CStateManager& mgr) x288_startingJumpTimeout = 0.f; x28c_sjTimer = 0.f; x2ac_surfaceRestraint = ESurfaceRestraints::Normal; - if (x2f8_morphTransState != EPlayerMorphBallState::Morphed) + if (x2f8_morphBallState != EPlayerMorphBallState::Morphed) AddMaterial(EMaterialTypes::GroundCollider); - x294_jumpCameraPitchTimer = 0.f; - x29c_spaceJumpCameraPitchTimer = 0.f; + x294_jumpCameraTimer = 0.f; + x29c_fallCameraTimer = 0.f; x2a4_cancelCameraPitch = false; x298_jumpPresses = 0; break; @@ -4814,11 +5481,11 @@ void CPlayer::SetMoveState(EPlayerMovementState newState, CStateManager& mgr) if (x258_movementState != EPlayerMovementState::StartingJump) { x258_movementState = EPlayerMovementState::StartingJump; - if (x294_jumpCameraPitchTimer <= x288_startingJumpTimeout && - x29c_spaceJumpCameraPitchTimer <= x288_startingJumpTimeout && + if (x294_jumpCameraTimer <= x288_startingJumpTimeout && + x29c_fallCameraTimer <= x288_startingJumpTimeout && !x3dc_inFreeLook && !x3dd_lookButtonHeld) { - x29c_spaceJumpCameraPitchTimer = 0.01f; + x29c_fallCameraTimer = 0.01f; x2a4_cancelCameraPitch = false; } } @@ -4834,7 +5501,7 @@ float CPlayer::JumpInput(const CFinalInput& input, CStateManager& mgr) float jumpFactor = 1.f; if (!mgr.GetPlayerState()->HasPowerUp(CPlayerState::EItemType::GravitySuit)) { - ESurfaceRestraints restraints = x2b0_outOfWaterTicks == 2 ? x2ac_surfaceRestraint : ESurfaceRestraints::Water; + ESurfaceRestraints restraints = GetSurfaceRestraint(); switch (restraints) { case ESurfaceRestraints::Water: @@ -4918,7 +5585,7 @@ float CPlayer::JumpInput(const CFinalInput& input, CStateManager& mgr) float CPlayer::TurnInput(const CFinalInput& input) const { - if (x304_orbitState == EPlayerOrbitState::One || x304_orbitState == EPlayerOrbitState::Five) + if (x304_orbitState == EPlayerOrbitState::One || x304_orbitState == EPlayerOrbitState::Grapple) return 0.f; if (IsMorphBallTransitioning()) return 0.f; @@ -4952,14 +5619,14 @@ float CPlayer::TurnInput(const CFinalInput& input) const } right = left - right; - if (x32c_orbitDistance > 0.f) - right *= (1.f - zeus::clamp(0.f, x32c_orbitDistance / g_tweakPlayer->GetOrbitNormalDistance(), 1.f) * 0.5f); + if (x32c_orbitModeTimer > 0.f) + right *= (1.f - zeus::clamp(0.f, x32c_orbitModeTimer / g_tweakPlayer->GetOrbitModeTimer(), 1.f) * 0.5f); return zeus::clamp(-1.f, right, 1.f); } float CPlayer::StrafeInput(const CFinalInput& input) const { - if (IsMorphBallTransitioning() || x304_orbitState == EPlayerOrbitState::Zero) + if (IsMorphBallTransitioning() || x304_orbitState == EPlayerOrbitState::NoOrbit) return 0.f; return ControlMapper::GetAnalogInput(ControlMapper::ECommands::StrafeRight, input) - ControlMapper::GetAnalogInput(ControlMapper::ECommands::StrafeLeft, input); @@ -4969,11 +5636,11 @@ float CPlayer::ForwardInput(const CFinalInput& input, float turnInput) const { float forwards = ControlMapper::GetAnalogInput(ControlMapper::ECommands::Forward, input); float backwards = ControlMapper::GetAnalogInput(ControlMapper::ECommands::Backward, input); - if (x2f8_morphTransState != EPlayerMorphBallState::Unmorphed || InGrappleJumpCooldown()) + if (x2f8_morphBallState != EPlayerMorphBallState::Unmorphed || InGrappleJumpCooldown()) backwards = 0.f; - if (x2f8_morphTransState == EPlayerMorphBallState::Morphing && x584_ballTransitionAnim == 2) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphing && x584_ballTransitionAnim == 2) forwards = 0.f; - if (x2f8_morphTransState == EPlayerMorphBallState::Unmorphing && x584_ballTransitionAnim == 5) + if (x2f8_morphBallState == EPlayerMorphBallState::Unmorphing && x584_ballTransitionAnim == 5) forwards = 0.f; if (forwards >= 0.001f) { @@ -5036,7 +5703,7 @@ bool CPlayer::SidewaysDashAllowed(float strafeInput, float forwardInput, if (g_tweakPlayer->GetDashOnButtonRelease()) { - if (x304_orbitState != EPlayerOrbitState::Zero && g_tweakPlayer->GetDashEnabled() && + if (x304_orbitState != EPlayerOrbitState::NoOrbit && g_tweakPlayer->GetDashEnabled() && x288_startingJumpTimeout > 0.f && !ControlMapper::GetDigitalInput(ControlMapper::ECommands::JumpOrBoost, input) && x388_dashButtonHoldTime < g_tweakPlayer->GetDashButtonHoldCancelTime() && @@ -5046,7 +5713,7 @@ bool CPlayer::SidewaysDashAllowed(float strafeInput, float forwardInput, } else { - if (x304_orbitState != EPlayerOrbitState::Zero && g_tweakPlayer->GetDashEnabled() && + if (x304_orbitState != EPlayerOrbitState::NoOrbit && g_tweakPlayer->GetDashEnabled() && ControlMapper::GetDigitalInput(ControlMapper::ECommands::JumpOrBoost, input) && x288_startingJumpTimeout > 0.f && std::fabs(strafeInput) >= std::fabs(forwardInput) && @@ -5080,7 +5747,7 @@ void CPlayer::ComputeDash(const CFinalInput& input, float dt, CStateManager& mgr if (!orbitToPlayer.canBeNormalized()) return; zeus::CVector3f useOrbitToPlayer = orbitToPlayer; - ESurfaceRestraints restraints = x2b0_outOfWaterTicks == 2 ? x2ac_surfaceRestraint : ESurfaceRestraints::Water; + ESurfaceRestraints restraints = GetSurfaceRestraint(); float strafeVel = dt * skStrafeDistances[int(restraints)]; if (ControlMapper::GetDigitalInput(ControlMapper::ECommands::JumpOrBoost, input)) x388_dashButtonHoldTime += dt; @@ -5158,7 +5825,7 @@ void CPlayer::ComputeDash(const CFinalInput& input, float dt, CStateManager& mgr void CPlayer::ComputeMovement(const CFinalInput& input, CStateManager& mgr, float dt) { - ESurfaceRestraints restraints = x2b0_outOfWaterTicks == 2 ? x2ac_surfaceRestraint : ESurfaceRestraints::Water; + ESurfaceRestraints restraints = GetSurfaceRestraint(); float jumpInput = JumpInput(input, mgr); float zRotateInput = TurnInput(input); @@ -5169,9 +5836,9 @@ void CPlayer::ComputeMovement(const CFinalInput& input, CStateManager& mgr, floa if (!g_tweakPlayer->GetHoldButtonsForFreeLook() || x3dd_lookButtonHeld) turnSpeedMul = g_tweakPlayer->GetFreeLookTurnSpeedMultiplier(); - if (x304_orbitState == EPlayerOrbitState::Zero || + if (x304_orbitState == EPlayerOrbitState::NoOrbit || (x3dd_lookButtonHeld && x304_orbitState != EPlayerOrbitState::One && - x304_orbitState != EPlayerOrbitState::Five)) + x304_orbitState != EPlayerOrbitState::Grapple)) { if (std::fabs(zRotateInput) < 0.00001f) { @@ -5212,10 +5879,10 @@ void CPlayer::ComputeMovement(const CFinalInput& input, CStateManager& mgr, floa forwardForce = 0.f; } - if (x304_orbitState != EPlayerOrbitState::Zero && x3dd_lookButtonHeld) + if (x304_orbitState != EPlayerOrbitState::NoOrbit && x3dd_lookButtonHeld) forwardForce = 0.f; - if (x304_orbitState == EPlayerOrbitState::Zero || x3dd_lookButtonHeld) + if (x304_orbitState == EPlayerOrbitState::NoOrbit || x3dd_lookButtonHeld) { ApplyForceOR({0.f, forwardForce, jumpInput}, zeus::CAxisAngle::sIdentity); if (zRotateInput != 0.f) @@ -5267,9 +5934,32 @@ void CPlayer::ComputeMovement(const CFinalInput& input, CStateManager& mgr, floa x2d4_accelerationChangeTimer = std::max(0.f, x2d4_accelerationChangeTimer); } -float CPlayer::GetWeight() const { return 0.f; } +float CPlayer::GetWeight() const { return xe8_mass * -GetGravity(); } -zeus::CVector3f CPlayer::GetDampedClampedVelocityWR() const { return {}; } +zeus::CVector3f CPlayer::GetDampedClampedVelocityWR() const +{ + zeus::CVector3f localVel = x34_transform.transposeRotate(x138_velocity); + if ((x258_movementState != EPlayerMovementState::StartingJump || + GetSurfaceRestraint() != ESurfaceRestraints::InAir) && + x304_orbitState == EPlayerOrbitState::NoOrbit) + { + float friction = g_tweakPlayer->GetPlayerTranslationFriction(int(GetSurfaceRestraint())); + if (localVel.y > 0.f) + localVel.y = std::max(0.f, localVel.y - friction); + else + localVel.y = std::min(0.f, localVel.y + friction); + if (localVel.x > 0.f) + localVel.x = std::max(0.f, localVel.x - friction); + else + localVel.x = std::min(0.f, localVel.x + friction); + } + + float maxSpeed = g_tweakPlayer->GetPlayerTranslationMaxSpeed(int(GetSurfaceRestraint())); + localVel.y = zeus::clamp(-maxSpeed, localVel.y, maxSpeed); + if (x258_movementState == EPlayerMovementState::OnGround) + localVel.z = 0.f; + return x34_transform.rotate(localVel); +} const CScriptWater* CPlayer::GetVisorRunoffEffect(const CStateManager& mgr) const { @@ -5280,14 +5970,14 @@ const CScriptWater* CPlayer::GetVisorRunoffEffect(const CStateManager& mgr) cons void CPlayer::SetMorphBallState(EPlayerMorphBallState state, CStateManager& mgr) { - if (x2f8_morphTransState == EPlayerMorphBallState::Morphed && + if (x2f8_morphBallState == EPlayerMorphBallState::Morphed && state != EPlayerMorphBallState::Morphed) x9c5_26_ = x9c4_31_dampUnderwaterMotion; - x2f8_morphTransState = state; + x2f8_morphBallState = state; xf9_standardCollider = state == EPlayerMorphBallState::Morphed; - switch (x2f8_morphTransState) + switch (x2f8_morphBallState) { case EPlayerMorphBallState::Unmorphed: if (x9c5_26_ && mgr.GetCameraManager()->GetFluidCounter() == 0) @@ -5320,7 +6010,7 @@ void CPlayer::SetMorphBallState(EPlayerMorphBallState state, CStateManager& mgr) bool CPlayer::CanLeaveMorphBallState(CStateManager& mgr, zeus::CVector3f& pos) const { if (x768_morphball->IsProjectile() || !x590_ || - (IsUnderBetaMetroidAttack(mgr) && x2f8_morphTransState == EPlayerMorphBallState::Morphed)) + (IsUnderBetaMetroidAttack(mgr) && x2f8_morphBallState == EPlayerMorphBallState::Morphed)) return false; if (!x9c4_28_canLeaveMorphBall) return false; @@ -5343,14 +6033,14 @@ bool CPlayer::CanLeaveMorphBallState(CStateManager& mgr, zeus::CVector3f& pos) c return false; } -void CPlayer::SetHudDisable(float f1, float f2, float f3) +void CPlayer::SetHudDisable(float staticTimer, float outSpeed, float inSpeed) { - x740_staticOutTimer = f1; - x744_staticOutSpeed = f2; - x748_staticInSpeed = f3; + x740_staticTimer = staticTimer; + x744_staticOutSpeed = outSpeed; + x748_staticInSpeed = inSpeed; if (x744_staticOutSpeed != 0.f) return; - if (x740_staticOutTimer == 0.f) + if (x740_staticTimer == 0.f) x74c_visorStaticAlpha = 1.f; else x74c_visorStaticAlpha = 0.f; @@ -5382,7 +6072,7 @@ void CPlayer::LeaveMorphBallState(CStateManager& mgr) x768_morphball->LeaveMorphBallState(mgr); mgr.GetCameraManager()->SetPlayerCamera(mgr, mgr.GetCameraManager()->GetFirstPersonCamera()->GetUniqueId()); mgr.GetCameraManager()->GetBallCamera()->SetState(CBallCamera::EBallCameraState::Zero, mgr); - SetCameraState(EPlayerCameraState::Zero, mgr); + SetCameraState(EPlayerCameraState::FirstPerson, mgr); mgr.GetCameraManager()->GetFirstPersonCamera()->SetX1C6_24(true); mgr.GetCameraManager()->GetFirstPersonCamera()->Think(0.f, mgr); ForceGunOrientation(x34_transform, mgr); @@ -5392,7 +6082,7 @@ void CPlayer::LeaveMorphBallState(CStateManager& mgr) bool CPlayer::CanEnterMorphBallState(CStateManager& mgr, float f1) const { if (x3b8_grappleState != EGrappleState::None || - (IsUnderBetaMetroidAttack(mgr) && x2f8_morphTransState == EPlayerMorphBallState::Unmorphed)) + (IsUnderBetaMetroidAttack(mgr) && x2f8_morphBallState == EPlayerMorphBallState::Unmorphed)) return false; return x9c4_27_canEnterMorphBall; } @@ -5412,7 +6102,7 @@ void CPlayer::EnterMorphBallState(CStateManager& mgr) void CPlayer::ActivateMorphBallCamera(CStateManager& mgr) { - SetCameraState(EPlayerCameraState::One, mgr); + SetCameraState(EPlayerCameraState::Ball, mgr); mgr.GetCameraManager()->GetBallCamera()->SetState(CBallCamera::EBallCameraState::Zero, mgr); } @@ -5420,29 +6110,29 @@ void CPlayer::UpdateCinematicState(CStateManager& mgr) { if (mgr.GetCameraManager()->IsInCinematicCamera()) { - if (x2f4_cameraState != EPlayerCameraState::Four) + if (x2f4_cameraState != EPlayerCameraState::Spawned) { - x2fc_cinematicMorphTransState = x2f8_morphTransState; - if (x2fc_cinematicMorphTransState == EPlayerMorphBallState::Unmorphing) - x2fc_cinematicMorphTransState = EPlayerMorphBallState::Unmorphed; - if (x2fc_cinematicMorphTransState == EPlayerMorphBallState::Morphing) - x2fc_cinematicMorphTransState = EPlayerMorphBallState::Morphed; - SetCameraState(EPlayerCameraState::Four, mgr); + x2fc_spawnedMorphBallState = x2f8_morphBallState; + if (x2fc_spawnedMorphBallState == EPlayerMorphBallState::Unmorphing) + x2fc_spawnedMorphBallState = EPlayerMorphBallState::Unmorphed; + if (x2fc_spawnedMorphBallState == EPlayerMorphBallState::Morphing) + x2fc_spawnedMorphBallState = EPlayerMorphBallState::Morphed; + SetCameraState(EPlayerCameraState::Spawned, mgr); } } else { - if (x2f4_cameraState == EPlayerCameraState::Four) + if (x2f4_cameraState == EPlayerCameraState::Spawned) { - if (x2fc_cinematicMorphTransState == x2f8_morphTransState) + if (x2fc_spawnedMorphBallState == x2f8_morphBallState) { - switch (x2fc_cinematicMorphTransState) + switch (x2fc_spawnedMorphBallState) { case EPlayerMorphBallState::Morphed: - SetCameraState(EPlayerCameraState::One, mgr); + SetCameraState(EPlayerCameraState::Ball, mgr); break; case EPlayerMorphBallState::Unmorphed: - SetCameraState(EPlayerCameraState::Zero, mgr); + SetCameraState(EPlayerCameraState::FirstPerson, mgr); if (mgr.GetPlayerState()->GetCurrentVisor() != CPlayerState::EPlayerVisor::Scan) { ForceGunOrientation(x34_transform, mgr); @@ -5456,7 +6146,7 @@ void CPlayer::UpdateCinematicState(CStateManager& mgr) { CPhysicsActor::Stop(); SetOrbitRequest(EPlayerOrbitRequest::One, mgr); - switch (x2fc_cinematicMorphTransState) + switch (x2fc_spawnedMorphBallState) { case EPlayerMorphBallState::Unmorphed: { @@ -5465,7 +6155,7 @@ void CPlayer::UpdateCinematicState(CStateManager& mgr) { SetTranslation(GetTranslation() + vec); LeaveMorphBallState(mgr); - SetCameraState(EPlayerCameraState::Zero, mgr); + SetCameraState(EPlayerCameraState::FirstPerson, mgr); ForceGunOrientation(x34_transform, mgr); DrawGun(mgr); } @@ -5493,22 +6183,22 @@ void CPlayer::SetCameraState(EPlayerCameraState camState, CStateManager& stateMg CCameraManager* camMgr = stateMgr.GetCameraManager(); switch (camState) { - case EPlayerCameraState::Zero: + case EPlayerCameraState::FirstPerson: camMgr->SetCurrentCameraId(camMgr->GetFirstPersonCamera()->GetUniqueId(), stateMgr); x768_morphball->SetBallLightActive(stateMgr, false); break; - case EPlayerCameraState::One: - case EPlayerCameraState::Three: + case EPlayerCameraState::Ball: + case EPlayerCameraState::Transitioning: camMgr->SetCurrentCameraId(camMgr->GetBallCamera()->GetUniqueId(), stateMgr); x768_morphball->SetBallLightActive(stateMgr, true); break; case EPlayerCameraState::Two: break; - case EPlayerCameraState::Four: + case EPlayerCameraState::Spawned: { bool ballLight = false; if (TCastToPtr cineCam = camMgr->GetCurrentCamera(stateMgr)) - ballLight = x2f8_morphTransState == EPlayerMorphBallState::Morphed && cineCam->GetW1() & 0x40; + ballLight = x2f8_morphBallState == EPlayerMorphBallState::Morphed && cineCam->GetW1() & 0x40; x768_morphball->SetBallLightActive(stateMgr, ballLight); break; } @@ -5541,17 +6231,18 @@ void CPlayer::SetPlayerHitWallDuringMove() void CPlayer::Touch(CActor& actor, CStateManager& mgr) { - if (x2f8_morphTransState == EPlayerMorphBallState::Morphed) + if (x2f8_morphBallState == EPlayerMorphBallState::Morphed) x768_morphball->Touch(actor, mgr); } -void CPlayer::CVisorSteam::SetSteam(float a, float b, float c, CAssetId txtr, bool affectsThermal) +void CPlayer::CVisorSteam::SetSteam(float targetAlpha, float alphaInDur, float alphaOutDur, + CAssetId txtr, bool affectsThermal) { - if (x1c_txtr.IsValid() || a > x10_) + if (x1c_txtr.IsValid() || targetAlpha > x10_nextTargetAlpha) { - x10_ = a; - x14_ = b; - x18_ = c; + x10_nextTargetAlpha = targetAlpha; + x14_nextAlphaInDur = alphaInDur; + x18_nextAlphaOutDur = alphaOutDur; x1c_txtr = txtr; } x28_affectsThermal = affectsThermal; @@ -5562,30 +6253,30 @@ CAssetId CPlayer::CVisorSteam::GetTextureId() const { return xc_tex; } void CPlayer::CVisorSteam::Update(float dt) { if (!x1c_txtr.IsValid()) - x0_ = 0.f; + x0_curTargetAlpha = 0.f; else { - x0_ = x10_; - x4_ = x14_; - x8_ = x18_; + x0_curTargetAlpha = x10_nextTargetAlpha; + x4_curAlphaInDur = x14_nextAlphaInDur; + x8_curAlphaOutDur = x18_nextAlphaOutDur; xc_tex = x1c_txtr; } x1c_txtr.Reset(); - if ((x20_alpha - x0_) < 0.000009999f || std::fabs(x20_alpha) > 0.000009999f) + if ((x20_alpha - x0_curTargetAlpha) < 0.000009999f || std::fabs(x20_alpha) > 0.000009999f) return; - if (x20_alpha > x0_) + if (x20_alpha > x0_curTargetAlpha) { - if (x24_ <= 0.f) + if (x24_delayTimer <= 0.f) { - x20_alpha -= (dt / x8_); - x20_alpha = std::min(x20_alpha, x0_); + x20_alpha -= dt / x8_curAlphaOutDur; + x20_alpha = std::min(x20_alpha, x0_curTargetAlpha); } else { - x24_ = x0_ - dt; - x24_ = zeus::max(0.f, x24_); + x24_delayTimer = x0_curTargetAlpha - dt; + x24_delayTimer = zeus::max(0.f, x24_delayTimer); } return; } @@ -5594,11 +6285,11 @@ void CPlayer::CVisorSteam::Update(float dt) if (!tmpTex) return; - x20_alpha += (x20_alpha + (dt / x4_)); - if (x20_alpha > x0_) - x20_alpha = x0_; + x20_alpha += dt / x4_curAlphaInDur; + if (x20_alpha > x0_curTargetAlpha) + x20_alpha = x0_curTargetAlpha; - x24_ = 0.1f; + x24_delayTimer = 0.1f; } void CPlayer::CFailsafeTest::Reset() @@ -5679,7 +6370,39 @@ bool CPlayer::CFailsafeTest::Passes() const return false; } -void CPlayer::SetSpawnedMorphBallState(CPlayer::EPlayerMorphBallState, CStateManager&) {} +void CPlayer::SetSpawnedMorphBallState(EPlayerMorphBallState state, CStateManager& mgr) +{ + x2fc_spawnedMorphBallState = state; + SetCameraState(EPlayerCameraState::Spawned, mgr); + if (x2fc_spawnedMorphBallState != x2f8_morphBallState) + { + CPhysicsActor::Stop(); + SetOrbitRequest(EPlayerOrbitRequest::One, mgr); + switch (x2fc_spawnedMorphBallState) + { + case EPlayerMorphBallState::Unmorphed: + { + zeus::CVector3f pos; + if (CanLeaveMorphBallState(mgr, pos)) + { + SetTranslation(GetTranslation() + pos); + LeaveMorphBallState(mgr); + ForceGunOrientation(x34_transform, mgr); + DrawGun(mgr); + } + break; + } + case EPlayerMorphBallState::Morphed: + EnterMorphBallState(mgr); + ActivateMorphBallCamera(mgr); + mgr.GetCameraManager()->SetupBallCamera(mgr); + mgr.GetCameraManager()->GetBallCamera()->Reset(CreateTransformFromMovementDirection(), mgr); + break; + default: + break; + } + } +} void CPlayer::DecrementPhazon() { @@ -5702,7 +6425,7 @@ bool CPlayer::CheckSubmerged() const if (xe6_24_fluidCounter == 0) return false; - return x828_waterLevelOnPlayer >= (x2f8_morphTransState == EPlayerMorphBallState::Morphed ? + return x828_waterLevelOnPlayer >= (x2f8_morphBallState == EPlayerMorphBallState::Morphed ? 2.f * g_tweakPlayer->GetPlayerBallHalfExtent() : 0.5f * GetEyeHeight()); } @@ -5729,4 +6452,28 @@ void CPlayer::ApplySubmergedPitchBend(CSfxHandle& sfx) CSfxManager::PitchBend(sfx, -1.f); } +void CPlayer::DetachActorFromPlayer() +{ + x26c_attachedActor = kInvalidUniqueId; + x270_attachedActorTime = 0.f; + xa28_attachedActorStruggle = 0.f; + x490_gun->SetActorAttached(false); +} + +bool CPlayer::AttachActorToPlayer(TUniqueId id, bool disableGun) +{ + if (x26c_attachedActor == kInvalidUniqueId) + { + if (disableGun) + x490_gun->SetActorAttached(true); + x26c_attachedActor = id; + x270_attachedActorTime = 0.f; + xa28_attachedActorStruggle = 0.f; + x768_morphball->ActorAttached(); + return true; + } + + return false; +} + } diff --git a/Runtime/World/CPlayer.hpp b/Runtime/World/CPlayer.hpp index 3678dc940..0a39bf94d 100644 --- a/Runtime/World/CPlayer.hpp +++ b/Runtime/World/CPlayer.hpp @@ -21,6 +21,7 @@ class CFinalInput; class CPlayerCameraBob; class CFirstPersonCamera; class CCollidableSphere; +class CScriptPlayerHint; class CPlayer : public CPhysicsActor { @@ -40,19 +41,19 @@ public: enum class EPlayerOrbitType { - Zero, - One, + Close, + Far, Two }; enum class EPlayerOrbitState { - Zero, + NoOrbit, One, Two, Three, Four, - Five + Grapple }; enum class EPlayerOrbitRequest @@ -115,11 +116,11 @@ public: enum class EPlayerCameraState { - Zero, - One, + FirstPerson, + Ball, Two, - Three, - Four + Transitioning, + Spawned }; enum class ESurfaceRestraints @@ -161,22 +162,23 @@ public: private: struct CVisorSteam { - float x0_; - float x4_; - float x8_; + float x0_curTargetAlpha; + float x4_curAlphaInDur; + float x8_curAlphaOutDur; CAssetId xc_tex; - float x10_ = 0.f; - float x14_ = 0.f; - float x18_ = 0.f; + float x10_nextTargetAlpha = 0.f; + float x14_nextAlphaInDur = 0.f; + float x18_nextAlphaOutDur = 0.f; CAssetId x1c_txtr; float x20_alpha = 0.f; - float x24_ = 0.f; + float x24_delayTimer = 0.f; bool x28_affectsThermal = false; public: - CVisorSteam(float a, float b, float c, CAssetId tex) : x0_(a), x4_(b), x8_(c), xc_tex(tex) {} + CVisorSteam(float targetAlpha, float alphaInDur, float alphaOutDur, CAssetId tex) + : x0_curTargetAlpha(targetAlpha), x4_curAlphaInDur(alphaInDur), x8_curAlphaOutDur(alphaOutDur), xc_tex(tex) {} CAssetId GetTextureId() const; - void SetSteam(float a, float b, float c, CAssetId txtr, bool affectsThermal); + 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; } @@ -205,15 +207,15 @@ private: EPlayerMovementState x258_movementState = EPlayerMovementState::OnGround; std::vector x25c_ballTransitionsRes; - TUniqueId x26c_ = kInvalidUniqueId; - float x270_ = 0.f; + TUniqueId x26c_attachedActor = kInvalidUniqueId; + float x270_attachedActorTime = 0.f; CPlayerEnergyDrain x274_energyDrain = CPlayerEnergyDrain(4); float x288_startingJumpTimeout = 0.f; float x28c_sjTimer = 0.f; float x290_minJumpTimeout = 0.f; - float x294_jumpCameraPitchTimer = 0.f; + float x294_jumpCameraTimer = 0.f; u32 x298_jumpPresses = 0; - float x29c_spaceJumpCameraPitchTimer = 0.f; + float x29c_fallCameraTimer = 0.f; float x2a0_ = 0.f; bool x2a4_cancelCameraPitch = false; float x2a8_timeSinceJump = 1000.f; @@ -224,27 +226,27 @@ private: float x2d4_accelerationChangeTimer = 0.f; zeus::CAABox x2d8_fpBounds; float x2f0_ballTransHeight = 0.f; - EPlayerCameraState x2f4_cameraState = EPlayerCameraState::Zero; - EPlayerMorphBallState x2f8_morphTransState = EPlayerMorphBallState::Unmorphed; - EPlayerMorphBallState x2fc_cinematicMorphTransState = EPlayerMorphBallState::Unmorphed; + EPlayerCameraState x2f4_cameraState = EPlayerCameraState::FirstPerson; + EPlayerMorphBallState x2f8_morphBallState = EPlayerMorphBallState::Unmorphed; + EPlayerMorphBallState x2fc_spawnedMorphBallState = EPlayerMorphBallState::Unmorphed; float x300_fallingTime = 0.f; - EPlayerOrbitState x304_orbitState = EPlayerOrbitState::Zero; - EPlayerOrbitType x308_orbitType = EPlayerOrbitType::Zero; + EPlayerOrbitState x304_orbitState = EPlayerOrbitState::NoOrbit; + EPlayerOrbitType x308_orbitType = EPlayerOrbitType::Close; EPlayerOrbitRequest x30c_orbitRequest = EPlayerOrbitRequest::Three; TUniqueId x310_orbitTargetId = kInvalidUniqueId; zeus::CVector3f x314_orbitPoint; zeus::CVector3f x320_orbitVector; - float x32c_orbitDistance = 0.f; - EPlayerZoneInfo x330_orbitZone = EPlayerZoneInfo::Zero; + float x32c_orbitModeTimer = 0.f; + EPlayerZoneInfo x330_orbitZoneMode = EPlayerZoneInfo::Zero; EPlayerZoneType x334_orbitType = EPlayerZoneType::Ellipse; u32 x338_ = 1; - TUniqueId x33c_ = kInvalidUniqueId; + TUniqueId x33c_orbitNextTargetId = kInvalidUniqueId; float x340_ = 0.f; std::vector x344_nearbyOrbitObjects; std::vector x354_onScreenOrbitObjects; std::vector x364_offScreenOrbitObjects; bool x374_orbitLockEstablished = false; - float x378_ = 0.f; + float x378_orbitPreventionTimer = 0.f; bool x37c_sidewaysDashing = false; float x380_strafeInputAtDash = 0.f; float x384_dashTimer = 0.f; @@ -285,22 +287,22 @@ private: EGunHolsterState x498_gunHolsterState = EGunHolsterState::Drawn; float x49c_gunHolsterRemTime; std::unique_ptr x4a0_failsafeTest; - TReservedAverage x4a4_; - float x4f8_ = 0.f; - float x4fc_ = 0.f; + TReservedAverage x4a4_moveSpeedAvg; + float x4f8_moveSpeed = 0.f; + float x4fc_flatMoveSpeed = 0.f; zeus::CVector3f x500_lookDir = x34_transform.basis[1]; zeus::CVector3f x50c_moveDir = x34_transform.basis[1]; zeus::CVector3f x518_leaveMorphDir = x34_transform.basis[1]; - zeus::CVector3f x524_ = x34_transform.basis[1]; - zeus::CVector3f x530_ = x34_transform.basis[1]; - float x53c_ = 0.f; - zeus::CVector3f x540_ = x34_transform.basis[1]; - zeus::CVector3f x54c_ = x34_transform.basis[1]; + zeus::CVector3f x524_lastPosForDirCalc = x34_transform.basis[1]; + zeus::CVector3f x530_gunDir = x34_transform.basis[1]; + float x53c_timeMoving = 0.f; + zeus::CVector3f x540_controlDir = x34_transform.basis[1]; + zeus::CVector3f x54c_controlDirFlat = x34_transform.basis[1]; bool x558_wasDamaged = false; float x55c_damageAmt = 0.f; float x560_prevDamageAmt = 0.f; zeus::CVector3f x564_damageLocation; - float x570_ = 0.f; + float x570_immuneTimer = 0.f; float x574_morphTime = 0.f; float x578_morphDuration = 0.f; u32 x57c_ = 0; @@ -313,7 +315,7 @@ private: TReservedAverage x658_transitionModelXfs; TReservedAverage x71c_transitionModelAlphas; std::vector> x730_transitionModels; - float x740_staticOutTimer = 0.f; + float x740_staticTimer = 0.f; float x744_staticOutSpeed = 0.f; float x748_staticInSpeed = 0.f; float x74c_visorStaticAlpha = 1.f; @@ -344,15 +346,15 @@ private: CPlayerState::EBeamId x7ec_beam = CPlayerState::EBeamId::Power; std::unique_ptr x7f0_ballTransitionBeamModel; zeus::CTransform x7f4_gunWorldXf; - float x824_ = 0.f; + float x824_transitionFilterTimer = 0.f; float x828_waterLevelOnPlayer = 0.f; bool x82c_inLava = false; TUniqueId x82e_ridingPlatform = kInvalidUniqueId; TUniqueId x830_playerHint = kInvalidUniqueId; u32 x834_ = 1000; - u32 x838_ = 0; - u32 x93c_ = 0; - u32 x980_ = 0; + rstl::reserved_vector, 32> x838_playerHints; + rstl::reserved_vector x93c_playerHintsToRemove; + rstl::reserved_vector x980_playerHintsToAdd; union { @@ -364,7 +366,7 @@ private: bool x9c4_27_canEnterMorphBall : 1; bool x9c4_28_canLeaveMorphBall : 1; bool x9c4_29_ : 1; - bool x9c4_30_ : 1; + bool x9c4_30_controlDirOverride : 1; bool x9c4_31_dampUnderwaterMotion : 1; bool x9c5_24_ : 1; bool x9c5_25_splashUpdated : 1; @@ -375,7 +377,7 @@ private: bool x9c5_30_ : 1; bool x9c5_31_stepCameraZBiasDirty : 1; bool x9c6_24_extendTargetDistance : 1; - bool x9c6_25_ : 1; + bool x9c6_25_interpolatingControlDir : 1; bool x9c6_26_outOfBallLookAtHint : 1; bool x9c6_27_aimingAtProjectile : 1; bool x9c6_28_aligningGrappleSwingTurn : 1; @@ -390,14 +392,14 @@ private: float x9c8_eyeZBias = 0.f; float x9cc_stepCameraZBias = 0.f; - u32 x9d0_ = 0; - u32 x9d4_ = 0; - zeus::CVector3f x9d8_ = zeus::CVector3f::skForward; + u32 x9d0_bombJumpCount = 0; + u32 x9d4_bombJumpCheckDelayFrames = 0; + zeus::CVector3f x9d8_controlDirOverrideDir = zeus::CVector3f::skForward; rstl::reserved_vector x9e4_orbitDisableList; float x9f4_deathTime = 0.f; - float x9f8_ = 0.f; - float x9fc_ = 0.f; + float x9f8_controlDirInterpTime = 0.f; + float x9fc_controlDirInterpDur = 0.f; TUniqueId xa00_deathPowerBomb = kInvalidUniqueId; float xa04_ = 0.f; CAssetId xa08_steamTextureId; @@ -408,7 +410,7 @@ private: float xa1c_threatOverride = 0.f; float xa20_radarXYRadiusOverride = 1.f; float xa24_radarZRadiusOverride = 1.f; - float xa28_ = 0.f; + float xa28_attachedActorStruggle = 0.f; u32 xa2c_ = 2; float xa30_samusExhaustedVoiceTimer = 4.f; @@ -420,6 +422,7 @@ private: void InitializeBallTransition(); float UpdateCameraBob(float dt, CStateManager& mgr); float GetAcceleration() const; + float CalculateOrbitZBasedDistance(EPlayerOrbitType type) const; public: CPlayer(TUniqueId, const zeus::CTransform&, const zeus::CAABox&, CAssetId w1, const zeus::CVector3f&, float, float, @@ -490,9 +493,16 @@ public: void UpdateWaterSurfaceCameraBias(CStateManager& mgr); void UpdatePhazonCameraShake(float dt, CStateManager& mgr); void UpdatePhazonDamage(float dt, CStateManager& mgr); + void ResetPlayerHintState(); + 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); void UpdateBombJumpStuff(); void UpdateTransitionFilter(float dt, CStateManager& mgr); + void ResetControlDirectionInterpolation(); + void SetControlDirectionInterpolation(float time); void UpdatePlayerControlDirection(float dt, CStateManager& mgr); void Think(float, CStateManager&); void PreThink(float, CStateManager&); @@ -520,7 +530,7 @@ public: void DrawGun(CStateManager& mgr); void HolsterGun(CStateManager& mgr); EPlayerCameraState GetCameraState() const { return x2f4_cameraState; } - EPlayerMorphBallState GetMorphballTransitionState() const { return x2f8_morphTransState; } + EPlayerMorphBallState GetMorphballTransitionState() const { return x2f8_morphBallState; } bool IsMorphBallTransitioning() const; void UpdateGrappleArmTransform(const zeus::CVector3f&, CStateManager& mgr, float); float GetGravity() const; @@ -557,7 +567,7 @@ public: bool WithinOrbitScreenBox(const zeus::CVector3f&, EPlayerZoneInfo, EPlayerZoneType) const; bool WithinOrbitScreenEllipse(const zeus::CVector3f&, EPlayerZoneInfo) const; bool CheckOrbitDisableSourceList(CStateManager& mgr); - bool CheckOrbitDisableSourceList() const { return x9e4_orbitDisableList.size() != 0; } + bool CheckOrbitDisableSourceList() const { return !x9e4_orbitDisableList.empty(); } void RemoveOrbitDisableSource(TUniqueId); void AddOrbitDisableSource(CStateManager& mgr, TUniqueId); void UpdateOrbitPreventionTimer(float); @@ -579,7 +589,7 @@ public: float GetUnbiasedEyeHeight() const; float GetStepUpHeight() const; float GetStepDownHeight() const; - void Teleport(const zeus::CTransform& xf, CStateManager& mgr, bool); + void Teleport(const zeus::CTransform& xf, CStateManager& mgr, bool resetBallCam); void BombJump(const zeus::CVector3f& pos, CStateManager& mgr); zeus::CTransform CreateTransformFromMovementDirection() const; const CCollisionPrimitive* GetCollisionPrimitive() const; @@ -607,7 +617,7 @@ public: const CScriptWater* GetVisorRunoffEffect(const CStateManager& mgr) const; void SetMorphBallState(EPlayerMorphBallState state, CStateManager& mgr); bool CanLeaveMorphBallState(CStateManager& mgr, zeus::CVector3f& pos) const; - void SetHudDisable(float f1, float f2, float f3); + void SetHudDisable(float staticTimer, float outSpeed, float inSpeed); void SetIntoBallReadyAnimation(CStateManager& mgr); void LeaveMorphBallState(CStateManager& mgr); bool CanEnterMorphBallState(CStateManager& mgr, float f1) const; @@ -637,17 +647,22 @@ public: CPlayerCameraBob* GetCameraBob() const { return x76c_cameraBob.get(); } float GetDeathTime() const { return x9f4_deathTime; } const CPlayerEnergyDrain& GetEnergyDrain() const { return x274_energyDrain; } - EPlayerZoneInfo GetOrbitZone() const { return x330_orbitZone; } + EPlayerZoneInfo GetOrbitZone() const { return x330_orbitZoneMode; } EPlayerZoneType GetOrbitType() const { return x334_orbitType; } const zeus::CTransform& GetFirstPersonCameraTransform(const CStateManager& mgr) const; const std::vector& GetNearbyOrbitObjects() const { return x344_nearbyOrbitObjects; } const std::vector& GetOnScreenOrbitObjects() const { return x354_onScreenOrbitObjects; } const std::vector& GetOffScreenOrbitObjects() const { return x364_offScreenOrbitObjects; } void SetPlayerHitWallDuringMove(); - + ESurfaceRestraints GetCurrentSurfaceRestraint() const { return x2ac_surfaceRestraint; } + ESurfaceRestraints GetSurfaceRestraint() const + { return x2b0_outOfWaterTicks == 2 ? GetCurrentSurfaceRestraint() : ESurfaceRestraints::Water; } void DecrementPhazon(); void IncrementPhazon(); void ApplySubmergedPitchBend(CSfxHandle& sfx); + void DetachActorFromPlayer(); + bool AttachActorToPlayer(TUniqueId id, bool disableGun); + float GetAttachedActorStruggle() const { return xa28_attachedActorStruggle; } }; } diff --git a/Runtime/World/CPlayerCameraBob.cpp b/Runtime/World/CPlayerCameraBob.cpp index fa5e08fc6..3194eceab 100644 --- a/Runtime/World/CPlayerCameraBob.cpp +++ b/Runtime/World/CPlayerCameraBob.cpp @@ -77,7 +77,7 @@ void CPlayerCameraBob::SetState(CPlayerCameraBob::ECameraBobState state, CStateM x20_oldState = x24_curState; x24_curState = state; - if (x20_oldState == ECameraBobState::Two) + if (x20_oldState == ECameraBobState::InAir) { x28_applyLandingTrans = true; x68_ = std::min(x68_, -35.f); @@ -91,7 +91,7 @@ void CPlayerCameraBob::SetState(CPlayerCameraBob::ECameraBobState state, CStateM } } - if (x24_curState == ECameraBobState::Three && x100_ != 0.f) + if (x24_curState == ECameraBobState::WalkNoBob && x100_ != 0.f) InitViewWander(mgr); } @@ -162,7 +162,7 @@ void CPlayerCameraBob::Update(float dt, CStateManager& mgr) x78_ = 0.f; } - if (x24_curState == ECameraBobState::Three) + if (x24_curState == ECameraBobState::WalkNoBob) x104_ = 1.f; else x104_ = 0.f; diff --git a/Runtime/World/CPlayerCameraBob.hpp b/Runtime/World/CPlayerCameraBob.hpp index 68f0454cb..49f2248b0 100644 --- a/Runtime/World/CPlayerCameraBob.hpp +++ b/Runtime/World/CPlayerCameraBob.hpp @@ -21,15 +21,15 @@ public: enum class ECameraBobState { - Zero, - One, - Two, - Three, - Four, - Five, - Six, - Seven, - Eight + Walk, + Orbit, + InAir, + WalkNoBob, + GunFireNoBob, + TurningNoBob, + FreeLookNoBob, + GrappleNoBob, + Unspecified }; static float kCameraBobExtentX; @@ -56,8 +56,8 @@ private: float x14_ = 0.f; float x18_bobTimeScale = 0.f; float x1c_bobTime = 0.f; - ECameraBobState x20_oldState = ECameraBobState::Eight; - ECameraBobState x24_curState = ECameraBobState::Eight; + ECameraBobState x20_oldState = ECameraBobState::Unspecified; + ECameraBobState x24_curState = ECameraBobState::Unspecified; bool x28_applyLandingTrans = false; bool x29_ = false; zeus::CTransform x2c_cameraBobTransform; diff --git a/Runtime/World/CScriptPlayerHint.hpp b/Runtime/World/CScriptPlayerHint.hpp index 81db1f437..ef2e203e0 100644 --- a/Runtime/World/CScriptPlayerHint.hpp +++ b/Runtime/World/CScriptPlayerHint.hpp @@ -8,8 +8,8 @@ namespace urde class CScriptPlayerHint : public CActor { - u32 xe8_ = 0; - bool xfc_ = false; + rstl::reserved_vector xe8_objectList; + bool xfc_deactivated = false; u32 x100_priority; u32 x104_overrideFlags; TUniqueId x108_actor = kInvalidUniqueId; @@ -20,6 +20,8 @@ public: u32 GetPriority() const { return x100_priority; } u32 GetOverrideFlags() const { return x104_overrideFlags; } TUniqueId GetActorId() const { return x108_actor; } + void ClearObjectList() { xe8_objectList.clear(); } + void SetDeactivated() { xfc_deactivated = true; } }; }