SmashBros.Controllers.CharacterController.HitKeyDown C# (CSharp) Method

HitKeyDown() private method

private HitKeyDown ( float directionX, float directionY, float downTimer, int playerIndex ) : void
directionX float
directionY float
downTimer float
playerIndex int
return void
        private void HitKeyDown(float directionX, float directionY, float downTimer, int playerIndex)
        {
            if (model.resetTimeLeft <= 0)
            {
                if (!model.attackMode)
                {
                    MoveStats moveStats;
                    if ((newXdir || newYdir) && (Math.Abs(navigation.X) > 0.9 || newYdir && Math.Abs(navigation.Y) > 0.9))
                    {
                        if (Math.Abs(navigation.X) >= Math.Abs(navigation.Y) || (!model.inAir && navigation.Y > 0) || (view.VelocityY < -stats.jumpStartVelocity + 2 && navigation.Y < 0)) moveStats = newXdir? stats.aLR : stats.a;
                        else moveStats = model.inAir && navigation.Y > 0 ? stats.aDown : stats.aUp;
                    }
                    else moveStats = stats.a;

                    if (moveStats != null)
                    {
                        currentMove = moves.newMove(moveStats, model.faceRight);
                        if (currentMove == null) return;
                        if (currentMove.Stats.Type == MoveType.Charge)
                        {
                            model.setState(CharacterState.charging, currentMove.Stats);
                        }
                        else
                        {
                            model.setState(CharacterState.attacking, currentMove.Stats);
                            if (currentMove.Stats.Start == 0) moves.StartMove(view.Position, view.Velocity, currentMove);
                            if (currentMove.Stats.Adjustable) adjustAngle = model.faceRight ? currentMove.Stats.StartAngle : Math.PI - currentMove.Stats.StartAngle;
                        }

                    }
                }
                else if (currentMove.Stats.Adjustable)
                {
                    model.attackMode = false;
                    NaturalState();
                }
            }
        }