コード例 #1
0
ファイル: BoostAction.cs プロジェクト: zdravkotatic/FlyCasual
        private void StartBoostExecution()
        {
            Movement.GenericMovement boostMovement;
            switch ((PreviousSubPhase as BoostPlanningSubPhase).SelectedBoostHelper)
            {
            case "Straight 1":
                boostMovement = new Movement.StraightBoost(1, Movement.ManeuverDirection.Forward, Movement.ManeuverBearing.Straight, Movement.ManeuverColor.None);
                break;

            case "Bank 1 Left":
                boostMovement = new Movement.BankBoost(1, Movement.ManeuverDirection.Left, Movement.ManeuverBearing.Bank, Movement.ManeuverColor.None);
                break;

            case "Bank 1 Right":
                boostMovement = new Movement.BankBoost(1, Movement.ManeuverDirection.Right, Movement.ManeuverBearing.Bank, Movement.ManeuverColor.None);
                break;

            case "Turn 1 Right":
                boostMovement = new Movement.TurnBoost(1, Movement.ManeuverDirection.Right, Movement.ManeuverBearing.Turn, Movement.ManeuverColor.None);
                break;

            case "Turn 1 Left":
                boostMovement = new Movement.TurnBoost(1, Movement.ManeuverDirection.Left, Movement.ManeuverBearing.Turn, Movement.ManeuverColor.None);
                break;

            default:
                boostMovement = new Movement.StraightBoost(1, Movement.ManeuverDirection.Forward, Movement.ManeuverBearing.Straight, Movement.ManeuverColor.None);
                break;
            }

            MovementTemplates.ApplyMovementRuler(Selection.ThisShip, boostMovement);

            boostMovement.Perform();
            Sounds.PlayFly();
        }
コード例 #2
0
        private void StartBoostExecution()
        {
            Rules.Collision.ClearBumps(TheShip);

            Movement.GenericMovement boostMovement;
            switch (SelectedBoostHelper)
            {
            case "Straight 1":
                boostMovement = new Movement.StraightBoost(1, Movement.ManeuverDirection.Forward, Movement.ManeuverBearing.Straight, Movement.MovementComplexity.None);
                break;

            case "Bank 1 Left":
                boostMovement = new Movement.BankBoost(1, Movement.ManeuverDirection.Left, Movement.ManeuverBearing.Bank, Movement.MovementComplexity.None);
                break;

            case "Bank 1 Right":
                boostMovement = new Movement.BankBoost(1, Movement.ManeuverDirection.Right, Movement.ManeuverBearing.Bank, Movement.MovementComplexity.None);
                break;

            case "Turn 1 Right":
                boostMovement = new Movement.TurnBoost(1, Movement.ManeuverDirection.Right, Movement.ManeuverBearing.Turn, Movement.MovementComplexity.None);
                break;

            case "Turn 1 Left":
                boostMovement = new Movement.TurnBoost(1, Movement.ManeuverDirection.Left, Movement.ManeuverBearing.Turn, Movement.MovementComplexity.None);
                break;

            case "Straight 2":
                boostMovement = new Movement.StraightBoost(2, Movement.ManeuverDirection.Forward, Movement.ManeuverBearing.Straight, Movement.MovementComplexity.None);
                break;

            case "Bank 2 Left":
                boostMovement = new Movement.BankBoost(2, Movement.ManeuverDirection.Left, Movement.ManeuverBearing.Bank, Movement.MovementComplexity.None);
                break;

            case "Bank 2 Right":
                boostMovement = new Movement.BankBoost(2, Movement.ManeuverDirection.Right, Movement.ManeuverBearing.Bank, Movement.MovementComplexity.None);
                break;

            default:
                boostMovement = new Movement.StraightBoost(1, Movement.ManeuverDirection.Forward, Movement.ManeuverBearing.Straight, Movement.MovementComplexity.None);
                break;
            }

            boostMovement.TheShip = TheShip;

            MovementTemplates.ApplyMovementRuler(TheShip, boostMovement);

            boostMovement.Perform();
            if (!IsTractorBeamBoost)
            {
                Sounds.PlayFly(TheShip);
            }
        }