public override void Update()
    {
        if (I_Timer == 0)
        {
            controller.IASA = true;
        }
        else
        {
            I_Timer -= 1;
        }
        //				controller.Inputter.GetInput ();
        //				controller.Inputter.ProcessInput ();
        if (controller.IsGrounded(controller.groundedLookAhead) == false)
        {
            DoTransition(typeof(FitState_AM_Fall));
            return;
        }

        if (controller.IASA == true)
        {
            CheckIASA();
        }

        if (controller.EndAnim == true)
        {
            controller.EndAnim = false;
            DoTransition(typeof(FitState_AM_Idle));
            return;
        }
    }
    public override void Update()
    {
        //				controller.Inputter.GetInput ();
        //				controller.Inputter.ProcessInput ();

        if (controller.IsGrounded(controller.groundedLookAhead) == false)
        {
            DoTransition(typeof(FitState_AM_Fall));
            return;
        }

        CheckIASA();

        if (controller.Inputter.y <= -0.65f)
        {
            if (controller.Inputter.FramesYNeutral <= 4 && controller.OnPassThrough(controller.groundedLookAhead))
            {
                DoTransition(typeof(FitState_AM_Pass));
                return;
            }
            else
            {
                DoTransition(typeof(FitState_AM_Crouch));
                return;
            }
        }

        if (controller.EndAnim)
        {
            controller.EndAnim = false;
            DoTransition(typeof(FitState_AM_Idle));
            return;
        }
    }
Ejemplo n.º 3
0
    public override void Update()
    {
        //				controller.Inputter.GetInput ();
        //				controller.Inputter.ProcessInput ();

        if (controller.IsGrounded(controller.groundedLookAhead) == false)
        {
            DoTransition(typeof(FitState_AM_Fall));
            return;
        }

        CheckIASA();

        if (controller.Inputter.y <= -0.60f && controller.Inputter.y >= -0.85f)
        {
            if (controller.OnPassThrough(controller.groundedLookAhead))
            {
                DoTransition(typeof(FitState_AM_Pass));
                return;
            }
        }

        if (!controller.Inputter.ShieldButtonHeld)
        {
            controller.EndAnim = false;
            DoTransition(typeof(FitState_AM_ShieldOff));
            return;
        }
    }
    public override void Update()
    {
        if (IASA_Timer == 0)
        {
            controller.IASA = true;
        }
        else
        {
            IASA_Timer -= 1;
        }

        if (controller.IASA)
        {
            CheckIASAAir();
        }

        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
        {
            //						if (controller.PreviousBottom.y >= controller.CurrentBottom.y) {
            object[] args = new object[1];
            args[0] = IASA_Timer;
            DoTransition(typeof(FitState_AM_WavedashLand), args);
            return;
            //						}
        }
    }
Ejemplo n.º 5
0
    public override void Update()
    {
        //				controller.Inputter.GetInput ();
        //				controller.Inputter.ProcessInput ();
        if (controller.IsGrounded(controller.groundedLookAhead) == false)
        {
            DoTransition(typeof(FitState_AM_Fall));
            return;
        }

        if (controller.BfAction == BufferedAction.QA)
        {
            DoTransition(typeof(FitState_AM_Grab));
            return;
        }

        if (controller.BfAction == BufferedAction.ATTACK)
        {
            DoTransition(typeof(FitState_AM_GroundAttack));
            return;
        }

        if (controller.EndAnim == true)
        {
            controller.EndAnim = false;
            CheckJump();
        }
    }
Ejemplo n.º 6
0
    public override void Update()
    {
        if (controller.BfAction == BufferedAction.QA)
        {
            DoTransition(typeof(FitState_AM_Grab));
            return;
        }

        if (controller.BfAction == BufferedAction.ATTACK)
        {
            DoTransition(typeof(FitState_AM_GroundAttack));
        }

        if (controller.BfAction == BufferedAction.SPECIAL)
        {
            DoTransition(typeof(FitState_AM_GroundSpecial));
            return;
        }

        if (controller.BfAction == BufferedAction.JUMP)
        {
            DoTransition(typeof(FitState_AM_JumpSquat));
        }
        if (controller.IsGrounded(controller.groundedLookAhead) == false)
        {
            DoTransition(typeof(FitState_AM_Fall));
        }

        if (PivotTimer == 0)
        {
            if (Mathf.Abs(controller.Inputter.x) >= 0.7f)
            {
                object[] args = new object[1];
                args[0] = TurnVel;
                DoTransition(typeof(FitState_AM_InitDash), args);
                return;
            }
            else
            {
                DoTransition(typeof(FitState_AM_Idle));
            }
            //						if (Mathf.Abs(controller.Inputter.x) >= 0.5f) {
            //								DoTransition (typeof(FitState_AM_WalkFast));
            //								return;
            //						}
            //						if (Mathf.Abs(controller.Inputter.x) < 0.5f) {
            //								DoTransition (typeof(FitState_AM_WalkSlow));
            //								return;
            //						}
        }
        else
        {
            PivotTimer -= 1;
        }
    }
Ejemplo n.º 7
0
    public override void Update()
    {
//				controller.Inputter.GetInput ();
//				controller.Inputter.ProcessInput ();

        if (controller.IsGrounded(controller.groundedLookAhead) == false)
        {
            DoTransition(typeof(FitState_AM_Fall));
            return;
        }

        CheckIASAIdle();
//				if (controller.BfAction == BufferedAction.JAB) {
//								DoTransition (typeof(FitState_AM_GroundAttack));
//								return;
//						}
//
//						if (controller.BfAction == BufferedAction.JUMP) {
//
//								DoTransition (typeof(FitState_AM_JumpSquat));
//								return;
//						}
//
//
//				if (controller.BfAction == BufferedAction.WALKING) {
//						if (Mathf.Abs (controller.Inputter.x) >= 0.5f) {
//								DoTransition (typeof(FitState_AM_WalkFast));
//								return;
//						} else {
//								DoTransition (typeof(FitState_AM_WalkSlow));
//								return;
//						}
//				}
//
//				if (controller.BfAction == BufferedAction.INIT_DASH) {
//						DoTransition (typeof(FitState_AM_InitDash));
//						return;
//				}

        if (controller.Inputter.y <= -0.65f)
        {
            if (controller.Inputter.FramesYNeutral <= 4 && controller.OnPassThrough(controller.groundedLookAhead))
            {
                DoTransition(typeof(FitState_AM_Pass));
                return;
            }
            else
            {
                DoTransition(typeof(FitState_AM_Crouch));
                return;
            }
        }
    }
Ejemplo n.º 8
0
    public override void Update()
    {
        if (controller.BfAction == BufferedAction.JUMP)
        {
            DoTransition(typeof(FitState_AM_JumpSquat));
        }
        if (controller.IsGrounded(controller.groundedLookAhead) == false)
        {
            DoTransition(typeof(FitState_AM_Fall));
        }

        if (controller.EndAnim == true)
        {
            controller.EndAnim = false;
            if (Mathf.Abs(controller.Inputter.x_prev) >= 0.18f)
            {
                if (Mathf.Abs(controller.Inputter.x) >= 0.7f)
                {
                    DoTransition(typeof(FitState_AM_Run));
                    return;
                }
                if (Mathf.Abs(controller.Inputter.x) >= 0.5f)
                {
                    DoTransition(typeof(FitState_AM_WalkFast));
                    return;
                }
                if (Mathf.Abs(controller.Inputter.x) < 0.5f)
                {
                    DoTransition(typeof(FitState_AM_WalkSlow));
                    return;
                }
            }
            else
            {
                DoTransition(typeof(FitState_AM_Idle));
            }
        }

        if (BrakeTimer == 0)
        {
            controller.ApplyFriction = true;
        }
        else
        {
            BrakeTimer -= 1;
        }
    }
Ejemplo n.º 9
0
    public override void Update()
    {
        //				controller.Inputter.GetInput ();
        //				controller.Inputter.ProcessInput ();

        if (controller.BfAction == BufferedAction.ATTACK)
        {
            DoTransition(typeof(FitState_AM_GroundAttack));
            return;
        }
        if (controller.BfAction == BufferedAction.JUMP)
        {
            DoTransition(typeof(FitState_AM_JumpSquat));
            return;
        }
        if (controller.IsGrounded(controller.groundedLookAhead) == false)
        {
            DoTransition(typeof(FitState_AM_Fall));
            return;
        }

        if (controller.BfAction == BufferedAction.WALKING && controller.Inputter.y > -0.65f)
        {
            if (Mathf.Abs(controller.Inputter.x) >= 0.5f)
            {
                DoTransition(typeof(FitState_AM_WalkFast));
                return;
            }
            else
            {
                DoTransition(typeof(FitState_AM_WalkSlow));
                return;
            }
        }

        if (controller.BfAction == BufferedAction.INIT_DASH)
        {
            DoTransition(typeof(FitState_AM_InitDash));
            return;
        }

        if (controller.Inputter.y > -0.65f)
        {
            DoTransition(typeof(FitState_AM_Idle));
            return;
        }
    }
    public override void Update()
    {
        //				controller.Inputter.GetInput ();
        //				controller.Inputter.ProcessInput ();
        if (controller.IsGrounded(controller.groundedLookAhead) == false)
        {
            DoTransition(typeof(FitState_AM_Fall));
            return;
        }

        if (controller.EndAnim == true)
        {
            controller.EndAnim = false;
            DoTransition(typeof(FitState_AM_Idle));
            return;
        }

        if (controller.Inputter.x > 0.7f)
        {
            controller.x_direction = 1;
        }
        else if (controller.Inputter.x < -0.7f)
        {
            controller.x_direction = -1;
        }

        if (controller.x_facing != controller.x_direction)
        {
            DoTransition(typeof(FitState_AM_RunTurn));
        }

        if (BrakeTimer == 0)
        {
            controller.IASA          = true;
            controller.ApplyFriction = true;
        }
        else
        {
            BrakeTimer -= 1;
        }

        if (controller.Inputter.y <= -0.9f)
        {
            DoTransition(typeof(FitState_AM_Crouch));
            return;
        }
    }
    public override void Update()
    {
        //				controller.Inputter.GetInput ();
        //				controller.Inputter.ProcessInput ();

        AnimTimer += 1;

        if (controller.IsGrounded(controller.groundedLookAhead) == false)
        {
            DoTransition(typeof(FitState_AM_Fall));
            return;
        }

        CheckIASA();

        if (controller.Inputter.y > -0.60f && AnimTimer >= 2)
        {
            HoldDown = false;
        }

        if (AnimTimer == 2 && HoldDown)
        {
            controller.FitAnima.Play("Shielding");
        }

        if (AnimTimer == 3 && HoldDown)
        {
            if (controller.Inputter.y <= -0.65f && controller.Inputter.y >= -0.85f && controller.OnPassThrough(controller.groundedLookAhead))
            {
                DoTransition(typeof(FitState_AM_Pass));
                return;
            }
            else
            {
            }
        }

        if (controller.EndAnim == true || AnimTimer == 8)
        {
            controller.EndAnim = false;
            DoTransition(typeof(FitState_AM_Shield));
            return;
        }
    }
Ejemplo n.º 12
0
    public void ApplyGravity()
    {
        bool input = (controller.Inputter.y <= -0.7f);

        if (controller.IsGrounded(controller.groundedLookAhead, input) == false)
        {
            controller.velocity.y += controller.jump.fallGravity;
            if (controller.velocity.y <= controller.jump.MaxFallSpeed)
            {
                controller.velocity.y = controller.jump.MaxFallSpeed;
            }
            controller.Animator.PassThroughTimer = 1;
        }
        else
        {
            if (controller.Animator.CanLand)
            {
                controller.Animator.PassThroughTimer = 0;
                DoTransition(typeof(FitState_AM_Land));
                return;
            }
        }
    }
Ejemplo n.º 13
0
    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;
        }
    }
Ejemplo n.º 14
0
    public override void Update()
    {
        if (Mathf.Abs(controller.Inputter.x) <= 0.65f && Mathf.Abs(controller.velocity.x) == controller.movement.initDashVelocity)
        {
            DeAccel = true;
        }

        if (DeAccel == false)
        {
            controller.velocity.x += controller.movement.acceleration * Init_direction;
            if (Mathf.Abs(controller.velocity.x) >= controller.movement.initDashVelocity)
            {
                controller.velocity.x = controller.movement.initDashVelocity * Init_direction;
            }
        }


        if (controller.Inputter.x > 0.65f)
        {
            controller.x_direction = 1;
        }
        else if (controller.Inputter.x < -0.65f)
        {
            controller.x_direction = -1;
        }

        if (DeAccel == true)
        {
            float newVelocity = (Mathf.Abs(controller.velocity.x) - controller.movement.Drag);
            if (newVelocity < 0)
            {
                newVelocity = 0;
            }
            newVelocity           = newVelocity * Init_direction;
            controller.velocity.x = newVelocity;
        }

        if (controller.BfAction == BufferedAction.JUMP)
        {
            DoTransition(typeof(FitState_AM_JumpSquat));
            return;
        }

        if (controller.IsGrounded(controller.groundedLookAhead) == false)
        {
            DoTransition(typeof(FitState_AM_Fall));
            return;
        }

        if (Init_direction != controller.x_direction)
        {
            DoTransition(typeof(FitState_AM_Pivot));
        }

        if (controller.BfAction == BufferedAction.SHIELD)
        {
            DoTransition(typeof(FitState_AM_ShieldEnter));
            return;
        }

        if (controller.BfAction == BufferedAction.SPECIAL)
        {
            DoTransition(typeof(FitState_AM_GroundSpecial));
            return;
        }

        if (controller.EndAnim == true || controller.velocity.x == 0)
        {
            if (DeAccel == true)
            {
                controller.EndAnim = false;
                DoTransition(typeof(FitState_AM_Idle));
                return;
            }
            if (DeAccel == false)
            {
                controller.EndAnim = false;
                DoTransition(typeof(FitState_AM_Run));
                return;
            }
        }
    }
Ejemplo n.º 15
0
    public override void Update()
    {
        if (Mathf.Abs(controller.Inputter.x) <= 0.7f && Mathf.Abs(controller.velocity.x) == controller.movement.initDashVelocity)
        {
            DeAccel = true;
        }

        if (DeAccel == false)
        {
            controller.velocity.x += controller.movement.acceleration * Init_direction;
            if (Mathf.Abs(controller.velocity.x) >= controller.movement.initDashVelocity)
            {
                controller.velocity.x = controller.movement.initDashVelocity * Init_direction;
            }
        }


        if (controller.Inputter.x > 0.7f)
        {
            controller.x_direction = 1;
        }
        else if (controller.Inputter.x < -0.7f)
        {
            controller.x_direction = -1;
        }

        if (controller.BfAction == BufferedAction.JUMP)
        {
            DoTransition(typeof(FitState_AM_JumpSquat));
            return;
        }

        if (controller.BfAction == BufferedAction.SPECIAL)
        {
            DoTransition(typeof(FitState_AM_GroundSpecial));
            return;
        }

        if (DeAccel == true)
        {
            DoTransition(typeof(FitState_AM_RunBrake));
            return;
        }

        if (controller.IsGrounded(controller.groundedLookAhead) == false)
        {
            DoTransition(typeof(FitState_AM_Fall));
            return;
        }

        if (Init_direction != controller.x_direction)
        {
            DoTransition(typeof(FitState_AM_RunTurn));
        }
        if (controller.velocity.x == 0)
        {
            controller.BfAction = BufferedAction.NONE;
            DoTransition(typeof(FitState_AM_Idle));
            return;
        }

        if (controller.Inputter.y <= -0.9f)
        {
            DoTransition(typeof(FitState_AM_Crouch));
            return;
        }
    }
Ejemplo n.º 16
0
    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;
        }
    }
    public override void Update()
    {
        controller.velocity.x = controller.movement.WalkSpeedFast * Init_direction;

        if (controller.Inputter.x > 0.05f)
        {
            controller.x_direction = 1;
        }
        else if (controller.Inputter.x < -0.05f)
        {
            controller.x_direction = -1;
        }

        if (controller.BfAction == BufferedAction.ATTACK)
        {
            controller.velocity.x = 0;
            DoTransition(typeof(FitState_AM_GroundAttack));
            return;
        }

        if (controller.BfAction == BufferedAction.SPECIAL)
        {
            DoTransition(typeof(FitState_AM_GroundSpecial));
            return;
        }

        if (controller.BfAction == BufferedAction.JUMP)
        {
            DoTransition(typeof(FitState_AM_JumpSquat));
            return;
        }
        if (controller.IsGrounded(controller.groundedLookAhead) == false)
        {
            DoTransition(typeof(FitState_AM_Fall));
            return;
        }

        if (Init_direction != controller.x_direction)
        {
            DoTransition(typeof(FitState_AM_Pivot));
        }
        if (Mathf.Abs(controller.Inputter.x) >= 0.7f && controller.Inputter.FramesXNeutral <= 2)
        {
            DoTransition(typeof(FitState_AM_InitDash));
            return;
        }
        if (Mathf.Abs(controller.Inputter.x) < 0.5f)
        {
            DoTransition(typeof(FitState_AM_WalkSlow));
            return;
        }


        if (controller.BfAction == BufferedAction.SHIELD)
        {
            DoTransition(typeof(FitState_AM_ShieldEnter));
            return;
        }

        if (Mathf.Abs(controller.Inputter.x) <= 0.05f)
        {
            controller.ClearBuffer();
            DoTransition(typeof(FitState_AM_Idle));
            return;
        }

        if (controller.Inputter.y <= -0.65f)
        {
            if (controller.Inputter.FramesYNeutral <= 5 && controller.OnPassThrough(controller.groundedLookAhead))
            {
                DoTransition(typeof(FitState_AM_Pass));
                return;
            }
            else
            {
                DoTransition(typeof(FitState_AM_Crouch));
                return;
            }
        }
    }
    public void ApplyGravity()
    {
        //Check for Fast Fall
        if (controller.Inputter.y <= -0.7f && controller.Inputter.FramesYNeutral <= 5 && controller.velocity.y <= 0 && controller.Animator.CanFastFall)
        {
            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.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;
            //						}
        }
    }
Ejemplo n.º 19
0
    // Update is called once per frame
    public override void Update()
    {
        AnimRot -= 3f;

        if (controller.IASA == true)
        {
            CheckIASA();
        }

        // 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;
            }
        }

        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
        {
            if (controller.PreviousBottom.y >= controller.CurrentBottom.y)
            {
                controller.kbvelocity = Vector3.zero;
                if (controller.Inputter.FramesLPressed <= 10)
                {
                    if (Mathf.Abs(controller.Inputter.x) >= 0.7f)
                    {
                        if (Mathf.Sign(controller.Inputter.x) == controller.x_facing)
                        {
                            Teching(1);
                            return;
                        }
                        else
                        {
                            Teching(2);
                            return;
                        }
                    }
                    else
                    {
                        Teching(3);
                        return;
                    }
                }
                else
                {
                    DoTransition(typeof(FitState_AM_Land));
                    return;
                }
            }
        }

        //Teching
        // 1=RollF 2=RollB 3=TechNGround
//		if (controller.Inputter.ShieldButtonDown) {
//			if (controller.Inputter.FramesLPressed <= 10) {
//				if (controller.CanTech((Vector3.up * -1),Vector2.Distance(controller.CurrentLeft,controller.CurrentBottom),true))
//					{
//						if (Mathf.Abs(controller.Inputter.x) >= 0.7f)
//						{
//							if (Mathf.Sign(controller.Inputter.x) == controller.x_facing)
//							{
//								Teching(1);
//								return;
//							} else
//							{
//								Teching(2);
//								return;
//							}
//						} else
//						{
//							Teching(3);
//							return;
//						}
//					}
//
//
//			}
//
//		}
    }
Ejemplo n.º 20
0
    // Update is called once per frame
    public override void Update()
    {
//				if (controller.EndAnim == true) {
//						controller.EndAnim = false;
//						DoTransition (typeof(FitState_AM_Tumble));
//						return;
//				}

        if (controller.IASA == true)
        {
            CheckIASA();
        }

        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
        {
            if (controller.PreviousBottom.y >= controller.CurrentBottom.y)
            {
                if (controller.Inputter.FramesLPressed <= 10)
                {
                    controller.kbvelocity = Vector3.zero;
                    if (Mathf.Abs(controller.Inputter.x) >= 0.7f)
                    {
                        if (Mathf.Sign(controller.Inputter.x) == controller.x_facing)
                        {
                            Teching(1);
                            return;
                        }
                        else
                        {
                            Teching(2);
                            return;
                        }
                    }
                    else
                    {
                        Teching(3);
                        return;
                    }
                }
                else
                {
                    controller.KBVelocity = Vector2.Reflect(controller.KBVelocity, Vector2.up);
                    controller.kbvelocity = controller.KBVelocity;
                }
            }
        }

        //Teching
        // 1=RollF 2=RollB 3=TechNGround
//		if (controller.Inputter.ShieldButtonDown) {
//			if (controller.Inputter.FramesLPressed <= 10) {
//				if (controller.CanTech((Vector3.up * -1),Vector2.Distance(controller.CurrentLeft,controller.CurrentBottom),true))
//					{
//						if (Mathf.Abs(controller.Inputter.x) >= 0.7f)
//						{
//							if (Mathf.Sign(controller.Inputter.x) == controller.x_facing)
//							{
//								Teching(1);
//								return;
//							} else
//							{
//								Teching(2);
//								return;
//							}
//						} else
//						{
//							Teching(3);
//							return;
//						}
//					}
//
//
//			}
//
//		}
    }