mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 09:54:28 -05:00
Did some bugfixing and commented on everything
This commit is contained in:
@@ -15,26 +15,27 @@ public class AerialFallingState : AerialBaseState
|
||||
public override void UpdateState(AerialStateManager aSM){
|
||||
|
||||
//if Grav Vel > 0 then jumping
|
||||
if(aSM.pStats.GravVel > 0){
|
||||
if(aSM.pStats.GravVel > 0 && (aSM.mSM.currentState != aSM.mSM.SlideState && aSM.mSM.currentState != aSM.mSM.RagdollState && aSM.mSM.currentState != aSM.mSM.RecoveringState)){
|
||||
aSM.SwitchState(aSM.JumpingState);
|
||||
}
|
||||
|
||||
//if jump has been pressed and has glider and is in a state that allows it glide
|
||||
else if(Input.GetButton("Jump") && aSM.pStats.HasGlider && (aSM.mSM.currentState != aSM.mSM.SlideState && aSM.mSM.currentState != aSM.mSM.RagdollState && aSM.mSM.currentState != aSM.mSM.RecoveringState)){
|
||||
aSM.SwitchState(aSM.GlidingState);
|
||||
}
|
||||
|
||||
//if is grounded then grounded
|
||||
if(aSM.isGrounded){
|
||||
else if(aSM.isGrounded){
|
||||
aSM.SwitchState(aSM.GroundedState);
|
||||
}
|
||||
|
||||
//if is wallrunning ands is in a state that allows it wallrun
|
||||
if(aSM.isWallRunning && (aSM.mSM.currentState != aSM.mSM.SlideState && aSM.mSM.currentState != aSM.mSM.RagdollState && aSM.mSM.currentState != aSM.mSM.RecoveringState)){
|
||||
else if(aSM.isWallRunning && (aSM.mSM.currentState != aSM.mSM.SlideState && aSM.mSM.currentState != aSM.mSM.RagdollState && aSM.mSM.currentState != aSM.mSM.RecoveringState)){
|
||||
aSM.SwitchState(aSM.WallRunState);
|
||||
}
|
||||
|
||||
//if grapple is possible and in state that allows it grapple air
|
||||
if(aSM.CheckGrapple() && (aSM.mSM.currentState != aSM.mSM.SlideState && aSM.mSM.currentState != aSM.mSM.RagdollState && aSM.mSM.currentState != aSM.mSM.RecoveringState)){
|
||||
else if(aSM.CheckGrapple() && (aSM.mSM.currentState != aSM.mSM.SlideState && aSM.mSM.currentState != aSM.mSM.RagdollState && aSM.mSM.currentState != aSM.mSM.RecoveringState)){
|
||||
aSM.SwitchState(aSM.GrappleAirState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,22 +22,22 @@ public class AerialGlidingState : AerialBaseState
|
||||
public override void UpdateState(AerialStateManager aSM){
|
||||
|
||||
//if not holding jump fall
|
||||
if(!Input.GetButton("Jump")){
|
||||
if(!Input.GetButton("Jump") || (aSM.mSM.currentState == aSM.mSM.RagdollState)){
|
||||
aSM.SwitchState(aSM.FallingState);
|
||||
}
|
||||
|
||||
//if is grounded then grounded
|
||||
if(aSM.isGrounded){
|
||||
else if(aSM.isGrounded){
|
||||
aSM.SwitchState(aSM.GroundedState);
|
||||
}
|
||||
|
||||
//if isWallrunning and in state that allows it wallrun
|
||||
if(aSM.isWallRunning && (aSM.mSM.currentState != aSM.mSM.SlideState && aSM.mSM.currentState != aSM.mSM.RagdollState && aSM.mSM.currentState != aSM.mSM.RecoveringState)){
|
||||
else if(aSM.isWallRunning){
|
||||
aSM.SwitchState(aSM.WallRunState);
|
||||
}
|
||||
|
||||
//if can grapple and in state that allows it grapple
|
||||
if(aSM.CheckGrapple() && (aSM.mSM.currentState != aSM.mSM.SlideState && aSM.mSM.currentState != aSM.mSM.RagdollState && aSM.mSM.currentState != aSM.mSM.RecoveringState)){
|
||||
else if(aSM.CheckGrapple()){
|
||||
aSM.SwitchState(aSM.GrappleAirState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,16 +17,16 @@ public class AerialGroundedState : AerialBaseState
|
||||
public override void UpdateState(AerialStateManager aSM){
|
||||
|
||||
//if grav vel < 0 then falling
|
||||
if(aSM.pStats.GravVel < 0){
|
||||
if(aSM.pStats.GravVel < 0 || (aSM.pStats.GravVel > 0 && (aSM.mSM.currentState == aSM.mSM.SlideState || aSM.mSM.currentState == aSM.mSM.RagdollState || aSM.mSM.currentState == aSM.mSM.RecoveringState))){
|
||||
aSM.SwitchState(aSM.FallingState);
|
||||
}
|
||||
//if grav vel > 0 then jumping
|
||||
else if(aSM.pStats.GravVel > 0){
|
||||
else if(aSM.pStats.GravVel > 0 && (aSM.mSM.currentState != aSM.mSM.SlideState && aSM.mSM.currentState != aSM.mSM.RagdollState && aSM.mSM.currentState != aSM.mSM.RecoveringState)){
|
||||
aSM.SwitchState(aSM.JumpingState);
|
||||
}
|
||||
|
||||
//can grapple and in state that allows grapple
|
||||
if(aSM.CheckGrapple() && (aSM.mSM.currentState != aSM.mSM.SlideState && aSM.mSM.currentState != aSM.mSM.RagdollState && aSM.mSM.currentState != aSM.mSM.RecoveringState)){
|
||||
else if(aSM.CheckGrapple() && (aSM.mSM.currentState != aSM.mSM.SlideState && aSM.mSM.currentState != aSM.mSM.RagdollState && aSM.mSM.currentState != aSM.mSM.RecoveringState)){
|
||||
aSM.SwitchState(aSM.GrappleGroundedState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,22 +16,22 @@ public class AerialJumpingState : AerialBaseState
|
||||
public override void UpdateState(AerialStateManager aSM){
|
||||
|
||||
//if grav vel < 0 falling
|
||||
if(aSM.pStats.GravVel < 0){
|
||||
if(aSM.pStats.GravVel < 0 || aSM.mSM.currentState == aSM.mSM.RagdollState){
|
||||
aSM.SwitchState(aSM.FallingState);
|
||||
}
|
||||
|
||||
//if is grounded then grounded
|
||||
if(aSM.isGrounded){
|
||||
else if(aSM.isGrounded){
|
||||
aSM.SwitchState(aSM.GroundedState);
|
||||
}
|
||||
|
||||
//if is wall running and in a state that allows it wallrun
|
||||
if(aSM.isWallRunning && (aSM.mSM.currentState != aSM.mSM.SlideState && aSM.mSM.currentState != aSM.mSM.RagdollState && aSM.mSM.currentState != aSM.mSM.RecoveringState)){
|
||||
else if(aSM.isWallRunning){
|
||||
aSM.SwitchState(aSM.WallRunState);
|
||||
}
|
||||
|
||||
//if can grapple and in a state that allows it grapple
|
||||
if(aSM.CheckGrapple() && (aSM.mSM.currentState != aSM.mSM.SlideState && aSM.mSM.currentState != aSM.mSM.RagdollState && aSM.mSM.currentState != aSM.mSM.RecoveringState)){
|
||||
else if(aSM.CheckGrapple()){
|
||||
aSM.SwitchState(aSM.GrappleAirState);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user