diff --git a/animgraphs/faith_arms.vanmgrph b/animgraphs/faith_arms.vanmgrph index eb8c017..85b9267 100644 --- a/animgraphs/faith_arms.vanmgrph +++ b/animgraphs/faith_arms.vanmgrph @@ -206,6 +206,19 @@ m_data = 10.0 } }, + { + _class = "CParameterAnimCondition" + m_comparisonOp = 0 + m_paramID = + { + m_id = 1226064506 + } + m_comparisonValue = + { + m_nType = 1 + m_data = true + } + }, ] m_blendDuration = 0.2 m_destState = @@ -273,6 +286,19 @@ m_data = 10.0 } }, + { + _class = "CParameterAnimCondition" + m_comparisonOp = 0 + m_paramID = + { + m_id = 1226064506 + } + m_comparisonValue = + { + m_nType = 1 + m_data = false + } + }, ] m_blendDuration = 0.2 m_destState = @@ -2712,7 +2738,7 @@ }, { _class = "CBoolAnimParameter" - m_name = "jumping" + m_name = "airborne" m_id = { m_id = 1731058928 @@ -2836,6 +2862,20 @@ m_fMaxValue = 1000.0 m_bInterpolate = false }, + { + _class = "CBoolAnimParameter" + m_name = "jumping" + m_id = + { + m_id = 1226064506 + } + m_previewButton = "ANIMPARAM_BUTTON_NONE" + m_bNetwork = true + m_bUseMostRecentValue = false + m_bAutoReset = false + m_bPredicted = false + m_bDefaultValue = false + }, ] } m_pTagManager = diff --git a/code/pawn/Pawn.cs b/code/pawn/Pawn.cs index 37bcaeb..c91be46 100644 --- a/code/pawn/Pawn.cs +++ b/code/pawn/Pawn.cs @@ -154,7 +154,8 @@ void UpdateAnimParameters() { SetAnimParameter( "speed", Velocity.Length ); SetAnimParameter( "horizontal_speed", Velocity.WithZ(0).Length ); - SetAnimParameter( "jumping", !Controller.Grounded ); + SetAnimParameter( "airborne", !Controller.Grounded ); + SetAnimParameter( "jumping", Controller.Jumping ); SetAnimParameter( "dashing", Controller.Dashing ); SetAnimParameter( "wallrunning", (int)Controller.Wallrunning ); SetAnimParameter( "vaulting", (int)Controller.Vaulting ); diff --git a/code/pawn/PawnController.Util.cs b/code/pawn/PawnController.Util.cs index 29b06ff..549e3b5 100644 --- a/code/pawn/PawnController.Util.cs +++ b/code/pawn/PawnController.Util.cs @@ -110,6 +110,8 @@ void InitiateLandingOnFloor() parkouredSinceJumping = false; parkouredBeforeLanding = false; + Jumping = false; + if ( Entity.Velocity.Length > 100f ) { CurrentMaxSpeed += 500; @@ -238,6 +240,7 @@ void InitiateJump() { if ( CanJump() ) { + Jumping = true; Entity.Velocity = ApplyJump( Entity.Velocity, "jump" ); } } diff --git a/code/pawn/PawnController.Vaulting.cs b/code/pawn/PawnController.Vaulting.cs index dc7c782..e0c6009 100644 --- a/code/pawn/PawnController.Vaulting.cs +++ b/code/pawn/PawnController.Vaulting.cs @@ -15,6 +15,7 @@ public enum VaultType float showDebugTime => 3f; float boxRadius => 20f; + Vector3 velocityAfterVault = Vector3.Zero; void InitiateVault() { @@ -46,7 +47,7 @@ void ProgressVault() t: bezierCounter ); - bezierCounter += (vaultSpeed / 100) * Time.Delta; + bezierCounter += (vaultSpeed / 85) * Time.Delta; Entity.Position = Entity.Position.LerpTo( pos, Time.Delta * 50f ); @@ -74,6 +75,8 @@ float GetSpeedAfterVault() { case VaultType.OntoHigh: return 0; + case VaultType.Over: + return Entity.Velocity.WithZ( -50 ).Length * 2f; } return Entity.Velocity.WithZ( 0 ).Length; @@ -323,19 +326,28 @@ void VaultOver( BBox boxBehindObstacle ) color: Color.Blue, duration: showDebugTime ); + Vaulting = VaultType.Over; + vaultSpeed = 200f; + if ( traceObstacleSurface.Hit ) { - var groundPosition = traceObstacleSurface.HitPosition; - - VaultTargetPos = groundPosition; + VaultOverAndLand( traceObstacleSurface ); } else { - VaultTargetPos = boxBehindObstacle.Center + Entity.Rotation.Up * -40f; + VaultOverAndFall( boxBehindObstacle ); } + } - Vaulting = VaultType.Over; - vaultSpeed = 200f; + void VaultOverAndLand(TraceResult traceObstacleSurface ) + { + var groundPosition = traceObstacleSurface.HitPosition; + VaultTargetPos = groundPosition; + } + + void VaultOverAndFall( BBox boxBehindObstacle ) + { + VaultTargetPos = boxBehindObstacle.Center + Entity.Rotation.Up * -40f; } bool CanVaultOnto( BBox topBoxLarge ) diff --git a/code/pawn/PawnController.cs b/code/pawn/PawnController.cs index 8f25a90..97609c0 100644 --- a/code/pawn/PawnController.cs +++ b/code/pawn/PawnController.cs @@ -32,6 +32,7 @@ public partial class PawnController : EntityComponent public float TimeSinceClimbing { get; set; } public float TimeSinceWallrun { get; set; } public TraceResult CurrentWall { get; set; } = new TraceResult(); + public bool Jumping { get; set; } private int CurrentClimbAmount { get; set; } public float CurrentMaxSpeed { get; set; }