Fixed a lot of the issues we addressed on Monday

This commit is contained in:
Melbyj1125
2022-03-09 02:16:56 -06:00
parent 03a96b8c67
commit 7ae4b643a1
31 changed files with 161 additions and 222 deletions

View File

@@ -276,7 +276,7 @@ public class AerialStateManager : NetworkBehaviour
void Jump(){
if(!pStats.IsPaused){
//If space/south gamepad button is pressed apply an upwards force to the player
if (Input.GetAxis("Jump") != 0 && !jumpHeld && curJumpNum < pStats.JumpNum && (mSM.currentState != mSM.SlideState && mSM.currentState != mSM.CrouchState && mSM.currentState != mSM.RagdollState && mSM.currentState != mSM.RecoveringState))
if (Input.GetAxis("Jump") != 0 && !jumpHeld && curJumpNum < pStats.JumpNum && (mSM.currentState != mSM.SlideState && mSM.currentState != mSM.CrouchState && mSM.currentState != mSM.RagdollState && mSM.currentState != mSM.RecoveringState && currentState != GlidingState))
{
if(currentState == WallRunState){
AddImpact((GetWallJumpDirection()), pStats.JumpPow * 8.5f);

View File

@@ -23,6 +23,10 @@ public class AerialGrappleAirState : AerialBaseState
Vector3 momDirection; // momentum direction
Vector3 tensionMomDirection; // tension momentum direction
float defaultGraceTimer = 1.0f; // default timer
float graceTimer; // grace period at the end of the swing so the player has time to let go
bool swingGrace = true; // is the grace timer over
public override void EnterState(AerialStateManager aSM, AerialBaseState previousState){
//refresh jump number
@@ -47,6 +51,7 @@ public class AerialGrappleAirState : AerialBaseState
aSM.release = false; // player hasn't released
aSM.lerpRelease = Vector3.zero; // reset lerp release
spaceHeld = true;
graceTimer = defaultGraceTimer; //sets grace timer
}
public override void ExitState(AerialStateManager aSM, AerialBaseState nextState){
@@ -156,8 +161,17 @@ public class AerialGrappleAirState : AerialBaseState
//if player is on the other side of hookpoint and swingMom is lower then update oldXZDir
if(oldXZDir != curXZDir && swingMom <= (oldSwingMom*(.75f))){
oldSwingMom = swingMom;
oldXZDir = (new Vector3(aSM.hookPoint.transform.position.x,0,aSM.hookPoint.transform.position.z) - new Vector3(aSM.transform.position.x,0,aSM.transform.position.z)).normalized;
if(graceTimer >= 0){
swingGrace = false;
graceTimer -= .1f;
}
else{
oldSwingMom = swingMom;
oldXZDir = (new Vector3(aSM.hookPoint.transform.position.x,0,aSM.hookPoint.transform.position.z) - new Vector3(aSM.transform.position.x,0,aSM.transform.position.z)).normalized;
swingGrace = true;
graceTimer = defaultGraceTimer;
}
}
//current line between hookpoint and player