fucked up
This commit is contained in:
@ -48,6 +48,8 @@ public partial class PlayerController : CharacterBody3D
|
||||
private Vector3 _inputMove = Vector3.Zero;
|
||||
private float _inputRotateY;
|
||||
private float _inputRotateFloorplane;
|
||||
|
||||
private int _framesSinceJumpAtApex = 0;
|
||||
|
||||
// Timers
|
||||
private Timer _timeScaleAimInAirTimer;
|
||||
@ -325,6 +327,7 @@ public partial class PlayerController : CharacterBody3D
|
||||
|
||||
_grounded.StateEntered += OnGrounded;
|
||||
_grounded.StatePhysicsProcessing += HandleGrounded;
|
||||
_airborne.StateEntered += OnAirborne;
|
||||
_airborne.StatePhysicsProcessing += HandleAirborne;
|
||||
|
||||
_coyoteEnabled.StateEntered += StartCoyoteTime;
|
||||
@ -364,7 +367,9 @@ public partial class PlayerController : CharacterBody3D
|
||||
_onJumpFromWall.Taken += OnJumpFromWall;
|
||||
_onMegajumpFromWall.Taken += OnMegajumpFromWall;
|
||||
}
|
||||
|
||||
|
||||
private bool _canDashAirborne = true;
|
||||
|
||||
public void OnWallDetected()
|
||||
{
|
||||
FinishPoweredDash();
|
||||
@ -373,9 +378,15 @@ public partial class PlayerController : CharacterBody3D
|
||||
public void OnGrounded()
|
||||
{
|
||||
_isWallJumpAvailable = true;
|
||||
_canDashAirborne = true;
|
||||
|
||||
if (_simpleDashCooldownTimer.IsStopped())
|
||||
_simpleDashCooldownTimer.Start();
|
||||
}
|
||||
|
||||
public void OnAirborne()
|
||||
{
|
||||
}
|
||||
public void DashCooldownTimeout()
|
||||
{
|
||||
_canDash = true;
|
||||
@ -409,8 +420,6 @@ public partial class PlayerController : CharacterBody3D
|
||||
}
|
||||
|
||||
// Jump
|
||||
private int _framesSinceJumpAtApex = 0;
|
||||
|
||||
public void OnInputJumpStarted()
|
||||
{
|
||||
if (CanMantle())
|
||||
@ -664,6 +673,8 @@ public partial class PlayerController : CharacterBody3D
|
||||
_playerState.SendEvent("empower_released");
|
||||
}
|
||||
|
||||
private bool _dashAvailable = true;
|
||||
|
||||
public void OnInputDashPressed()
|
||||
{
|
||||
if (_empowerOn.Active && CanPerformEmpoweredAction())
|
||||
@ -672,6 +683,14 @@ public partial class PlayerController : CharacterBody3D
|
||||
_playerState.SendEvent("powered_dash");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_airborne.Active)
|
||||
{
|
||||
if (!_canDashAirborne)
|
||||
return;
|
||||
_canDashAirborne = false;
|
||||
}
|
||||
|
||||
_playerState.SendEvent("dash");
|
||||
}
|
||||
|
||||
@ -771,8 +790,6 @@ public partial class PlayerController : CharacterBody3D
|
||||
{
|
||||
var effectiveJumpDirection = jumpDirection ?? Vector3.Up;
|
||||
var jumpVector = (effectiveJumpDirection.Normalized() + Vector3.Up).Normalized();
|
||||
if (jumpType == JumpTypes.DoubleJump)
|
||||
_canDash = false;
|
||||
|
||||
bool doesCapsuleHaveCrouchingHeight = CapsuleCollider.IsCrouchingHeight();
|
||||
bool isPlayerDead = HealthSystem.IsDead();
|
||||
@ -942,8 +959,7 @@ public partial class PlayerController : CharacterBody3D
|
||||
if (CanPerformEmpoweredAction())
|
||||
DashSystem.PrepareDash();
|
||||
}
|
||||
|
||||
|
||||
|
||||
///////////////////////////
|
||||
// Stateless logic ////////
|
||||
///////////////////////////
|
||||
|
Reference in New Issue
Block a user