mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 01:44:30 -05:00
Fixed Grapple Momentum & Added swappable buttons
This commit is contained in:
@@ -22,7 +22,7 @@ public class dMoveIdleState : dMoveBaseState
|
||||
}
|
||||
|
||||
//If Q or joystick button1 crouch state
|
||||
else if((Input.GetKey(KeyCode.JoystickButton1) || Input.GetKey(KeyCode.Q)) && (mSM.aSM.currentState != mSM.aSM.FallingState && mSM.aSM.currentState != mSM.aSM.GlidingState && mSM.aSM.currentState != mSM.aSM.WallRunState && mSM.aSM.currentState != mSM.aSM.WallIdleState) && !mSM.pStats.IsPaused){
|
||||
else if((Input.GetKey(KeyCode.JoystickButton1) || Input.GetKey(KeyCode.Q)) && (mSM.aSM.currentState != mSM.aSM.GrappleAirState && mSM.aSM.currentState != mSM.aSM.FallingState && mSM.aSM.currentState != mSM.aSM.GlidingState && mSM.aSM.currentState != mSM.aSM.WallRunState && mSM.aSM.currentState != mSM.aSM.WallIdleState) && !mSM.pStats.IsPaused){
|
||||
mSM.SwitchState(mSM.CrouchState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class dMoveJogState : dMoveBaseState
|
||||
}
|
||||
|
||||
//move to slide if Q or JoystickButton1
|
||||
else if((Input.GetKey(KeyCode.JoystickButton1) || Input.GetKey(KeyCode.Q)) && (mSM.aSM.currentState != mSM.aSM.FallingState && mSM.aSM.currentState != mSM.aSM.GlidingState && mSM.aSM.currentState != mSM.aSM.WallRunState && mSM.aSM.currentState != mSM.aSM.WallIdleState) && !mSM.pStats.IsPaused){
|
||||
else if((Input.GetKey(KeyCode.JoystickButton1) || Input.GetKey(KeyCode.Q)) && (mSM.aSM.currentState != mSM.aSM.GrappleAirState && mSM.aSM.currentState != mSM.aSM.FallingState && mSM.aSM.currentState != mSM.aSM.GlidingState && mSM.aSM.currentState != mSM.aSM.WallRunState && mSM.aSM.currentState != mSM.aSM.WallIdleState) && !mSM.pStats.IsPaused){
|
||||
mSM.SwitchState(mSM.SlideState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class dMoveRunState : dMoveBaseState
|
||||
}
|
||||
|
||||
//move to slide if Q or JoystickButton1
|
||||
else if((Input.GetKey(KeyCode.JoystickButton1) || Input.GetKey(KeyCode.Q)) && (mSM.aSM.currentState != mSM.aSM.FallingState && mSM.aSM.currentState != mSM.aSM.GlidingState && mSM.aSM.currentState != mSM.aSM.WallRunState && mSM.aSM.currentState != mSM.aSM.WallIdleState) && !mSM.pStats.IsPaused){
|
||||
else if((Input.GetKey(KeyCode.JoystickButton1) || Input.GetKey(KeyCode.Q)) && (mSM.aSM.currentState != mSM.aSM.GrappleAirState && mSM.aSM.currentState != mSM.aSM.FallingState && mSM.aSM.currentState != mSM.aSM.GlidingState && mSM.aSM.currentState != mSM.aSM.WallRunState && mSM.aSM.currentState != mSM.aSM.WallIdleState) && !mSM.pStats.IsPaused){
|
||||
mSM.SwitchState(mSM.SlideState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class dMoveWalkState : dMoveBaseState
|
||||
}
|
||||
|
||||
//move to slide if Q or JoystickButton1
|
||||
else if((Input.GetKey(KeyCode.JoystickButton1) || Input.GetKey(KeyCode.Q)) && (mSM.aSM.currentState != mSM.aSM.FallingState && mSM.aSM.currentState != mSM.aSM.GlidingState && mSM.aSM.currentState != mSM.aSM.WallRunState && mSM.aSM.currentState != mSM.aSM.WallIdleState) && !mSM.pStats.IsPaused){
|
||||
else if((Input.GetKey(KeyCode.JoystickButton1) || Input.GetKey(KeyCode.Q)) && (mSM.aSM.currentState != mSM.aSM.GrappleAirState && mSM.aSM.currentState != mSM.aSM.FallingState && mSM.aSM.currentState != mSM.aSM.GlidingState && mSM.aSM.currentState != mSM.aSM.WallRunState && mSM.aSM.currentState != mSM.aSM.WallIdleState) && !mSM.pStats.IsPaused){
|
||||
mSM.SwitchState(mSM.SlideState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,13 +134,6 @@ public class dMoveStateManager : NetworkBehaviour
|
||||
//calculates vel using driftVel will need to be relocated
|
||||
calculatedCurVel = driftVel.magnitude * 50f;
|
||||
|
||||
//if grappling in aerial state manager swap to grapple here
|
||||
if(currentState != GrappleAirState){
|
||||
if(aSM.currentState == aSM.GrappleAirState && (currentState != SlideState && currentState != CrouchState && currentState != CrouchWalkState && currentState != RagdollState && currentState != RecoveringState)){
|
||||
SwitchState(GrappleAirState);
|
||||
}
|
||||
}
|
||||
|
||||
//calls any logic in the update state from current state
|
||||
currentState.UpdateState(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user