more tuts, respawn mechanic when falling, reworked wall run again
Some checks failed
Create tag and build when new code gets to main / BumpTag (push) Successful in 19s
Create tag and build when new code gets to main / Test (push) Successful in 7m37s
Create tag and build when new code gets to main / Export (push) Has been cancelled
Create tag and build when new code gets to main / ReleaseName (push) Successful in 10s
Create tag and build when new code gets to main / Release (push) Failing after 4m53s
Some checks failed
Create tag and build when new code gets to main / BumpTag (push) Successful in 19s
Create tag and build when new code gets to main / Test (push) Successful in 7m37s
Create tag and build when new code gets to main / Export (push) Has been cancelled
Create tag and build when new code gets to main / ReleaseName (push) Successful in 10s
Create tag and build when new code gets to main / Release (push) Failing after 4m53s
This commit is contained in:
@@ -160,7 +160,7 @@ WallHugHorizontalDeceleration = 1.0
|
||||
WallRunUpwardVelocityFactor = 0.5
|
||||
MinimumWallRunUpwardSpeed = 4.0
|
||||
WallRunAltitudeLossSpeed = 8.0
|
||||
WallRunSpeedThreshold = 7.0
|
||||
WallRunSpeedThreshold = 2.0
|
||||
|
||||
[node name="CHealth" parent="." unique_id=1244478698 instance=ExtResource("3_q7bng")]
|
||||
RHealth = ExtResource("4_m8gvy")
|
||||
@@ -1129,6 +1129,18 @@ to = NodePath("../../Dashing/Dash")
|
||||
event = &"dash"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="OnSlam" type="Node" parent="StateChart/Root/Movement/OnWall" unique_id=448306362]
|
||||
script = ExtResource("28_n7qhm")
|
||||
to = NodePath("../../Slamming")
|
||||
event = &"slam"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="OnMantle2" type="Node" parent="StateChart/Root/Movement/OnWall" unique_id=7136911]
|
||||
script = ExtResource("28_n7qhm")
|
||||
to = NodePath("../../Mantling")
|
||||
event = &"mantle"
|
||||
delay_in_seconds = "0.0"
|
||||
|
||||
[node name="Hugging" type="Node" parent="StateChart/Root/Movement/OnWall" unique_id=162057636]
|
||||
script = ExtResource("27_34snm")
|
||||
|
||||
|
||||
@@ -193,6 +193,11 @@ public partial class HeadSystem : Node3D
|
||||
private bool _footstepEmitted;
|
||||
private bool _isPlayingForcingAnim;
|
||||
|
||||
public void ResetHeadBobbing()
|
||||
{
|
||||
_bobbingAccumulator = 0;
|
||||
}
|
||||
|
||||
public void LookAround(CameraParameters inputs)
|
||||
{
|
||||
if (_isPlayingForcingAnim)
|
||||
|
||||
@@ -1267,6 +1267,8 @@ public partial class PlayerController : CharacterBody3D,
|
||||
|
||||
_currentWallContactPoint = WallHugSystem.WallHugLocation.UnwrapOr(Vector3.Zero);
|
||||
|
||||
if (MantleSystem.IsMantlePossible && IsPlayerInputtingForward())
|
||||
_playerState.SendEvent("mantle");
|
||||
if (isOnFloorCustom())
|
||||
_playerState.SendEvent("grounded");
|
||||
if (!WallHugSystem.IsWallHugging())
|
||||
@@ -1286,23 +1288,23 @@ public partial class PlayerController : CharacterBody3D,
|
||||
{
|
||||
var wallNormal = WallHugSystem.WallHugNormal.UnwrapOr(Vector3.Zero);
|
||||
var isIndeedWall = wallNormal.Y < 0.1;
|
||||
var isThereInput = GetMoveInput().Length() > Mathf.Epsilon;
|
||||
var hvel = new Vector3(Velocity.X, 0, Velocity.Z);
|
||||
var hvelProjected = hvel.Slide(_wallHugStartNormal);
|
||||
var haveEnoughSpeed = Velocity.Length() > WallRunSpeedThreshold;
|
||||
var isCoplanarEnough = Velocity.AngleTo(wallNormal) > Math.PI/4 && Velocity.AngleTo(wallNormal) < 3*Math.PI/4;
|
||||
var isGoingDownwards = Velocity.AngleTo(Vector3.Down) < Math.PI/4;
|
||||
var isLookingInDirectionOfRun = hvelProjected.AngleTo(-HeadSystem.GetForwardHorizontalVector()) < Math.PI/2;
|
||||
var shouldStart = haveEnoughSpeed && !isGoingDownwards && isIndeedWall && isCoplanarEnough && isLookingInDirectionOfRun;
|
||||
var hvelProjected = Velocity.Slide(_wallHugStartNormal);
|
||||
var haveEnoughSpeed = hvelProjected.Length() > WallRunSpeedThreshold;
|
||||
var isCoplanarEnough = Math.Abs(Velocity.Dot(wallNormal)) < 0.3;
|
||||
var isGoingDownwards = Velocity.Dot(Vector3.Down) > 0.9;
|
||||
var isLookingInDirectionOfRun = true; // hvelProjected.Dot(-HeadSystem.GetForwardHorizontalVector()) > 0.5;
|
||||
var shouldStart = haveEnoughSpeed && isThereInput && !isGoingDownwards && isIndeedWall && isCoplanarEnough && isLookingInDirectionOfRun;
|
||||
|
||||
var debugText = "--------------\n";
|
||||
debugText += shouldStart ? "WALL RUN STARTED\n" : "NO WALL RUN\n";
|
||||
debugText += $"Enough speed? {haveEnoughSpeed}\n";
|
||||
debugText += $"Coplanar enough? {isCoplanarEnough}\n";
|
||||
debugText += $"Going downwards? {isGoingDownwards} with angle {Velocity.AngleTo(Vector3.Down)}\n";
|
||||
debugText += $"Is looking in direction of run? {isLookingInDirectionOfRun} with angle {hvelProjected.AngleTo(-HeadSystem.GetForwardHorizontalVector())}\n";
|
||||
debugText += $"HVelocity on wall: {hvelProjected} - Forward H Vector: {-HeadSystem.GetForwardHorizontalVector()}\n";
|
||||
debugText += $"Going downwards? {isGoingDownwards}\n";
|
||||
debugText += $"Is looking in direction of run? {isLookingInDirectionOfRun}\n";
|
||||
debugText += "--------------\n";
|
||||
//GD.Print(debugText);
|
||||
GD.Print(debugText);
|
||||
|
||||
return shouldStart;
|
||||
}
|
||||
@@ -1524,6 +1526,10 @@ public partial class PlayerController : CharacterBody3D,
|
||||
// SimpleDashInDirection(directionHorizontal.Normalized());
|
||||
SetVelocity(directionHorizontal.Normalized() * _velocityOnMantleStarted.Length());
|
||||
}
|
||||
else
|
||||
{
|
||||
SetVelocity(Vector3.Zero);
|
||||
}
|
||||
|
||||
_customMantle = false;
|
||||
_playerState.SendEvent("grounded");
|
||||
@@ -2053,6 +2059,8 @@ public partial class PlayerController : CharacterBody3D,
|
||||
}
|
||||
public void DashToPlantedWeaponTweenEnded()
|
||||
{
|
||||
HeadSystem.ResetHeadBobbing();
|
||||
|
||||
// Store the weapon state before resetting it
|
||||
var isPlantedOnWall = WeaponSystem.IsPlantedInWall();
|
||||
var isPlantedUnderPlatform = WeaponSystem.IsPlantedUnderPlatform();
|
||||
|
||||
Reference in New Issue
Block a user