public void CheckIASAAir() { if (controller.BfAction == BufferedAction.ATTACK) { CheckAerial(); SeedUp(); controller.ClearBuffer(); controller.EndAnim = false; controller.IASA = false; } if (controller.BfAction == BufferedAction.SHIELD) { if (controller.CanWavedash(controller.jump.AirdashHeight)) { DoTransition(typeof(FitState_AM_Wavedash)); return; } } if (controller.BfAction == BufferedAction.JUMP) { CheckJump(); return; } }
public void CheckIASAAir() { // if (controller.BfAction == BufferedAction.ATTACK) { // controller.EndAnim = false; // controller.IASA = false; // DoTransition (typeof(FitState_AM_AirAttack)); // return; // } // if (controller.BfAction == BufferedAction.SPECIAL) { // DoTransition (typeof(FitState_AM_AirSpecial)); // return; // // } if (controller.BfAction == BufferedAction.SHIELD) { if (controller.CanWavedash(controller.jump.AirdashHeight)) { DoTransition(typeof(FitState_AM_Wavedash)); return; } } if (controller.BfAction == BufferedAction.JUMP) { CheckJump(); return; } }
public override void Update() { if (controller.FitAnima.enabled && controller.Animator.ApplyGravity) { ApplyGravity(); } if (controller.IASA) { CheckIASAAir(); } if (controller.BfAction == BufferedAction.SHIELD) { if (controller.CanWavedash(controller.jump.AirdashHeight)) { DoTransition(typeof(FitState_AM_Wavedash)); return; } } if (controller.BfAction == BufferedAction.SPECIAL) { CheckSpecialCancel(); } if (controller.BfAction == BufferedAction.JUMP) { if (controller.Animator.CancelWindow) { CheckJump(); return; } } if (controller.EndAnim == true) { controller.EndAnim = false; DoTransition(typeof(FitState_AM_Fall)); return; } }
public override void Update() { if (HopTimer == 0 && HopWindow == false) { if (controller.velocity.y > 0 && controller.Inputter.jumpButtonHeld == false && controller.Inputter.TapjumpButtonHeld == false) { HopDccel = true; } HopWindow = true; } if (HopTimer != 0) { HopTimer -= 1; } if (HopDccel == true && controller.velocity.y > 0) { controller.velocity.y = controller.velocity.y * controller.jump.AirHopMultiplier; } //Check for Fast Fall if (controller.Inputter.y <= -0.7f && controller.Inputter.FramesYNeutral <= 5 && controller.velocity.y <= 0) { FastFall = true; } // If stick is neutral, apply friction. if (controller.Inputter.x > 0.7f) { controller.x_direction = 1; controller.ApplyFriction = false; } else if (controller.Inputter.x < -0.7f) { controller.x_direction = -1; controller.ApplyFriction = false; } else { controller.ApplyFriction = true; } if (controller.ApplyFriction == false) { AxisVel = controller.velocity.x + (controller.jump.AirMobility * controller.x_direction); if (controller.velocity.x > 0) { localXAxl = 1; } else if (controller.velocity.x < 0) { localXAxl = -1; } else if (controller.velocity.x == 0) { localXAxl = controller.x_facing; } if (Mathf.Abs(AxisVel) > controller.jump.jumpMaxHVelocity) { AxisVel = controller.jump.jumpMaxHVelocity * localXAxl; } if (Mathf.Abs(AxisVel) <= controller.jump.jumpMaxHVelocity) { controller.velocity.x = AxisVel; } } // controller.Inputter.GetInput (); // controller.Inputter.ProcessInput (); if (controller.IsGrounded(controller.groundedLookAhead) == false) { if (FastFall == false) { controller.velocity.y += controller.jump.fallGravity; if (controller.velocity.y <= controller.jump.MaxFallSpeed) { controller.velocity.y = controller.jump.MaxFallSpeed; } } else { controller.velocity.y = controller.jump.fastFallGravity; if (controller.velocity.y <= controller.jump.MaxFallSpeed) { controller.velocity.y = controller.jump.fastFallGravity; } } } else { DoTransition(typeof(FitState_AM_Land)); return; } if (controller.BfAction == BufferedAction.SHIELD) { if (controller.CanWavedash(controller.jump.AirdashHeight)) { DoTransition(typeof(FitState_AM_Wavedash)); return; } } if (controller.BfAction == BufferedAction.ATTACK) { object[] args = new object[3]; args[0] = InitVel; args[1] = false; args[2] = FastFall; DoTransition(typeof(FitState_AM_AirAttack), args); return; } if (controller.BfAction == BufferedAction.BULLET) { object[] args = new object[3]; args[0] = InitVel; args[1] = false; args[2] = FastFall; DoTransition(typeof(FitState_AM_AirBullet), args); return; } if (controller.BfAction == BufferedAction.SPECIAL) { DoTransition(typeof(FitState_AM_AirSpecial)); return; } if (controller.EndAnim == true) { controller.EndAnim = false; DoTransition(typeof(FitState_AM_Fall)); return; } }
public override void Update() { //Check for Fast Fall if (controller.Inputter.y <= -0.7f && controller.Inputter.FramesYNeutral <= 5 && controller.velocity.y <= 0) { FastFall = true; } // If stick is neutral, apply friction. if (controller.Inputter.x > 0.7f) { controller.x_direction = 1; controller.ApplyFriction = false; } else if (controller.Inputter.x < -0.7f) { controller.x_direction = -1; controller.ApplyFriction = false; } else { controller.ApplyFriction = true; } if (controller.ApplyFriction == false) { if (JuDccel == true) { if (Mathf.Abs(controller.velocity.x) <= controller.jump.jumpMaxHVelocity) { JuDccel = false; } float newVelocity = (Mathf.Abs(controller.velocity.x) - controller.C_Drag); int localXdir; if (controller.velocity.x > 0) { localXdir = 1; } else { localXdir = -1; } if (newVelocity <= controller.jump.jumpMaxHVelocity) { newVelocity = controller.jump.jumpMaxHVelocity; JuDccel = false; } controller.velocity.x = newVelocity * localXdir; } float AxisVel = (controller.velocity.x + (controller.jump.AirMobility * controller.x_direction)); if (controller.velocity.x > 0) { localXAxl = 1; } else if (controller.velocity.x < 0) { localXAxl = -1; } else if (controller.velocity.x == 0) { localXAxl = controller.x_facing; } if (Mathf.Abs(AxisVel) >= controller.jump.jumpMaxHVelocity && JuDccel == false) { AxisVel = controller.jump.jumpMaxHVelocity * localXAxl; } if (Mathf.Abs(AxisVel) <= Mathf.Abs(InitVel) || Mathf.Abs(AxisVel) <= controller.jump.jumpMaxHVelocity) { // if (JuDccel == false) { controller.velocity.x = AxisVel; // } } } // controller.Inputter.GetInput (); // controller.Inputter.ProcessInput (); if (controller.BfAction == BufferedAction.ATTACK) { object[] args = new object[3]; args[0] = InitVel; args[1] = JuDccel; args[2] = FastFall; DoTransition(typeof(FitState_AM_AirAttack), args); return; } if (controller.BfAction == BufferedAction.BULLET) { object[] args = new object[3]; args[0] = InitVel; args[1] = false; args[2] = FastFall; DoTransition(typeof(FitState_AM_AirBullet), args); return; } if (controller.BfAction == BufferedAction.BULLET) { object[] args = new object[3]; args[0] = InitVel; args[1] = false; args[2] = FastFall; DoTransition(typeof(FitState_AM_AirBullet), args); return; } if (controller.BfAction == BufferedAction.SPECIAL) { DoTransition(typeof(FitState_AM_AirSpecial)); return; } // DEPRECATED // if (controller.IsGrounded (controller.groundedLookAhead) == false) { // if (FastFall == false) { // // controller.velocity.y += controller.jump.fallGravity; // if (controller.velocity.y <= controller.jump.MaxFallSpeed) { // controller.velocity.y = controller.jump.MaxFallSpeed; // } // // } else { // // controller.velocity.y = controller.jump.fastFallGravity; // if (controller.velocity.y <= controller.jump.MaxFallSpeed) { // controller.velocity.y = controller.jump.fastFallGravity; // } // // } // } else // { //// if (controller.PreviousBottom.y >= controller.CurrentBottom.y) { // DoTransition (typeof(FitState_AM_Land)); // return; //// } // // } if (FastFall) { bool input = (controller.Inputter.y <= -0.7f); if (controller.IsGrounded(controller.groundedLookAhead, input) == false) { controller.velocity.y = controller.jump.fastFallGravity; if (controller.velocity.y <= controller.jump.MaxFallSpeed) { controller.velocity.y = controller.jump.fastFallGravity; } controller.Animator.PassThroughTimer = 1; } else { controller.Animator.PassThroughTimer = 0; DoTransition(typeof(FitState_AM_Land)); return; } } else { if (controller.IsGrounded(controller.groundedLookAhead) == false) { controller.velocity.y += controller.jump.fallGravity; if (controller.velocity.y <= controller.jump.MaxFallSpeed) { controller.velocity.y = controller.jump.MaxFallSpeed; } } else { DoTransition(typeof(FitState_AM_Land)); return; } } if (controller.BfAction == BufferedAction.JUMP) { CheckJump(); return; } if (controller.BfAction == BufferedAction.SHIELD) { if (controller.CanWavedash(controller.jump.AirdashHeight)) { DoTransition(typeof(FitState_AM_Wavedash)); return; } } CheckLedge(); if (controller.EndAnim == true) { controller.EndAnim = false; DoTransition(typeof(FitState_AM_Fall)); return; } }