Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
ef16d6c83f | |||
85eab200ea |
@ -47,7 +47,7 @@ jobs:
|
||||
run: |
|
||||
apt update && apt -y install curl zip nodejs
|
||||
- name: Checkout with LFS
|
||||
uses: https://git.game-dev.space/minimata/checkout-lfs.git@main
|
||||
uses: https://git.game-dev.space/minimata/checkout-with-lfs.git@main
|
||||
with:
|
||||
checkout-version: 3
|
||||
|
||||
|
@ -320,29 +320,29 @@ delay_in_seconds = "0.0"
|
||||
|
||||
[node name="OnCrouch" type="Node" parent="StateChart/Root/Movement/Grounded/Standing"]
|
||||
script = ExtResource("28_n7qhm")
|
||||
to = NodePath("../../Crouch")
|
||||
to = NodePath("../../Crouched")
|
||||
event = &"crouch"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Crouch" type="Node" parent="StateChart/Root/Movement/Grounded"]
|
||||
[node name="Crouched" type="Node" parent="StateChart/Root/Movement/Grounded"]
|
||||
script = ExtResource("27_34snm")
|
||||
|
||||
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/Grounded/Crouch"]
|
||||
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/Grounded/Crouched"]
|
||||
script = ExtResource("28_n7qhm")
|
||||
to = NodePath("../../../Airborne/Jump")
|
||||
event = &"jump"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="OnAirborne" type="Node" parent="StateChart/Root/Movement/Grounded/Crouch"]
|
||||
[node name="OnAirborne" type="Node" parent="StateChart/Root/Movement/Grounded/Crouched"]
|
||||
script = ExtResource("28_n7qhm")
|
||||
to = NodePath("../../../Airborne/CoyoteEnabled")
|
||||
event = &"start_falling"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="OnStandUp" type="Node" parent="StateChart/Root/Movement/Grounded/Crouch"]
|
||||
[node name="OnStandUp" type="Node" parent="StateChart/Root/Movement/Grounded/Crouched"]
|
||||
script = ExtResource("28_n7qhm")
|
||||
to = NodePath("../../Standing")
|
||||
event = &"stand_up"
|
||||
event = &"crouch"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Mantling" type="Node" parent="StateChart/Root/Movement"]
|
||||
|
@ -66,6 +66,8 @@ public partial class PlayerController : CharacterBody3D
|
||||
private StateChartState _actionHanging;
|
||||
// Movement state
|
||||
private StateChartState _grounded;
|
||||
private StateChartState _crouched;
|
||||
private StateChartState _standing;
|
||||
private StateChartState _mantling;
|
||||
private StateChartState _movHanging;
|
||||
private StateChartState _wallHugging;
|
||||
@ -132,6 +134,8 @@ public partial class PlayerController : CharacterBody3D
|
||||
_actionHanging = StateChartState.Of(GetNode("StateChart/Root/Actions/Hanging"));
|
||||
// Movement states
|
||||
_grounded = StateChartState.Of(GetNode("StateChart/Root/Movement/Grounded"));
|
||||
_standing = StateChartState.Of(GetNode("StateChart/Root/Movement/Grounded/Standing"));
|
||||
_crouched = StateChartState.Of(GetNode("StateChart/Root/Movement/Grounded/Crouched"));
|
||||
_mantling = StateChartState.Of(GetNode("StateChart/Root/Movement/Mantling"));
|
||||
_movHanging = StateChartState.Of(GetNode("StateChart/Root/Movement/Hanging"));
|
||||
_airborne = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne"));
|
||||
@ -200,6 +204,8 @@ public partial class PlayerController : CharacterBody3D
|
||||
_aiming.StateEntered += OnAimingEntered;
|
||||
_aiming.StateExited += ResetTimeScale;
|
||||
|
||||
_crouched.StatePhysicsProcessing += HandleGroundedCrouched;
|
||||
_standing.StatePhysicsProcessing += HandleGroundedStanding;
|
||||
_grounded.StateEntered += OnGrounded;
|
||||
_grounded.StatePhysicsProcessing += HandleGrounded;
|
||||
_airborne.StatePhysicsProcessing += HandleAirborne;
|
||||
@ -280,6 +286,16 @@ public partial class PlayerController : CharacterBody3D
|
||||
_isWallJumpAvailable = true;
|
||||
}
|
||||
|
||||
public void OnStanding()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnCrouched()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public bool CanPerformDashAction()
|
||||
{
|
||||
return DashActionsLeft > 0 && _dashCooldownTimer.IsStopped();
|
||||
@ -495,6 +511,16 @@ public partial class PlayerController : CharacterBody3D
|
||||
if (!isOnFloorCustom())
|
||||
_playerState.SendEvent("start_falling");
|
||||
}
|
||||
public void HandleGroundedStanding(float delta)
|
||||
{
|
||||
CapsuleCollider.UndoCrouching(delta, 1);
|
||||
HeadSystem.SetHeight(CapsuleCollider.GetCurrentHeight());
|
||||
}
|
||||
public void HandleGroundedCrouched(float delta)
|
||||
{
|
||||
CapsuleCollider.Crouch(delta, 1);
|
||||
HeadSystem.SetHeight(CapsuleCollider.GetCurrentHeight());
|
||||
}
|
||||
public void HandleAirborne(float delta)
|
||||
{
|
||||
if (isOnFloorCustom())
|
||||
|
@ -34,4 +34,9 @@ public partial class HeadSystem : Node3D
|
||||
{
|
||||
return GetGlobalTransform().Basis.Z;
|
||||
}
|
||||
|
||||
public void SetHeight(float height)
|
||||
{
|
||||
Position = new Vector3(Position.X, height, Position.Z);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user