fucked up
This commit is contained in:
@ -393,7 +393,6 @@ initial_state = NodePath("Grounded")
|
||||
|
||||
[node name="Reset" type="Node" parent="StateChart/Root/Movement"]
|
||||
script = ExtResource("41_ruloh")
|
||||
deep = true
|
||||
default_state = NodePath("../Grounded")
|
||||
|
||||
[node name="OnFall" type="Node" parent="StateChart/Root/Movement"]
|
||||
@ -429,28 +428,6 @@ to = NodePath("../../Grounded")
|
||||
event = &"grounded"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Dashing" type="Node" parent="StateChart/Root/Movement"]
|
||||
script = ExtResource("26_infe6")
|
||||
initial_state = NodePath("Dash")
|
||||
|
||||
[node name="OnDashEnded" type="Node" parent="StateChart/Root/Movement/Dashing"]
|
||||
script = ExtResource("28_n7qhm")
|
||||
to = NodePath("../../Airborne/Reset")
|
||||
event = &"dash_finished"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="OnMantle" type="Node" parent="StateChart/Root/Movement/Dashing"]
|
||||
script = ExtResource("28_n7qhm")
|
||||
to = NodePath("../../Mantling")
|
||||
event = &"mantle"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Dash" type="Node" parent="StateChart/Root/Movement/Dashing"]
|
||||
script = ExtResource("27_34snm")
|
||||
|
||||
[node name="PoweredDash" type="Node" parent="StateChart/Root/Movement/Dashing"]
|
||||
script = ExtResource("27_34snm")
|
||||
|
||||
[node name="Jump" type="Node" parent="StateChart/Root/Movement"]
|
||||
script = ExtResource("26_infe6")
|
||||
initial_state = NodePath("SimpleJump")
|
||||
@ -494,6 +471,28 @@ to = NodePath("../../../Airborne/Falling")
|
||||
event = &"jump_ended"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Dashing" type="Node" parent="StateChart/Root/Movement"]
|
||||
script = ExtResource("26_infe6")
|
||||
initial_state = NodePath("Dash")
|
||||
|
||||
[node name="OnDashEnded" type="Node" parent="StateChart/Root/Movement/Dashing"]
|
||||
script = ExtResource("28_n7qhm")
|
||||
to = NodePath("../../Airborne/Reset")
|
||||
event = &"dash_finished"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="OnMantle" type="Node" parent="StateChart/Root/Movement/Dashing"]
|
||||
script = ExtResource("28_n7qhm")
|
||||
to = NodePath("../../Mantling")
|
||||
event = &"mantle"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Dash" type="Node" parent="StateChart/Root/Movement/Dashing"]
|
||||
script = ExtResource("27_34snm")
|
||||
|
||||
[node name="PoweredDash" type="Node" parent="StateChart/Root/Movement/Dashing"]
|
||||
script = ExtResource("27_34snm")
|
||||
|
||||
[node name="Grounded" type="Node" parent="StateChart/Root/Movement"]
|
||||
script = ExtResource("27_34snm")
|
||||
|
||||
|
@ -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