public ManeuverTemplate(ManeuverBearing bearing, ManeuverDirection direction, ManeuverSpeed speed, bool isBombTemplate = false, bool isSideTemplate = false)
        {
            Bearing        = bearing;
            Direction      = direction;
            Speed          = speed;
            IsSideTemplate = isSideTemplate;

            string bearingString = bearing.ToString();
            string speedString   = speed.ToString().Replace("Speed", "");

            if (isBombTemplate)
            {
                if (direction == ManeuverDirection.Left)
                {
                    direction = ManeuverDirection.Right;
                }
                else if (direction == ManeuverDirection.Right)
                {
                    direction = ManeuverDirection.Left;
                }
            }

            TemplatePrefabName = bearingString + speedString + ((IsSideTemplate) ? "Alt" : "");

            NameNoDirection = bearingString + " " + speedString;
            string directionString = (direction == ManeuverDirection.Forward) ? "" : " " + direction.ToString();

            Name = NameNoDirection + directionString;
        }
Example #2
0
 public GenericMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, ManeuverColor color)
 {
     Speed           = speed;
     ManeuverSpeed   = GetManeuverSpeed(speed);
     Direction       = direction;
     Bearing         = bearing;
     ColorComplexity = color;
 }
Example #3
0
        public ManeuverHolder(ManeuverSpeed speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity complexity = MovementComplexity.None)
        {
            Speed           = speed;
            Direction       = direction;
            Bearing         = bearing;
            ColorComplexity = complexity;

            shipTag = null;
        }
Example #4
0
        private void ChangeBearing(ManeuverBearing bearing)
        {
            int speed = HostShip.AssignedManeuver.Speed;
            ManeuverDirection direction = HostShip.AssignedManeuver.Direction;

            string newManeuverString = "";

            switch (bearing)
            {
            case ManeuverBearing.KoiogranTurn:
                newManeuverString = speed + ".F.R";
                break;

            case ManeuverBearing.SegnorsLoopUsingTurnTemplate:
                newManeuverString = speed + "." + ((direction == ManeuverDirection.Left) ? "L" : "R") + ".r";
                break;
            }

            AddTemporaryManeuvers(newManeuverString);
            HostShip.OnMovementExecuted += RemoveTemporaryManeuvers;

            HostShip.SetAssignedManeuver(ShipMovementScript.MovementFromString(newManeuverString));
            DecisionSubPhase.ConfirmDecision();
        }
Example #5
0
 public StraightBoost(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color)
 {
 }
Example #6
0
 public SegnorsLoopMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color)
 {
     RotationEndDegrees = 180;
 }
Example #7
0
 public BankBoost(int speed, ManeuverDirection direction, ManeuverBearing bearing, ManeuverColor color) : base(speed, direction, bearing, color)
 {
 }
Example #8
0
        public MovementStruct(string parameters, Ship.GenericShip ship = null)
        {
            string[] arrParameters = parameters.Split('.');

            ManeuverSpeed speed = ManeuverSpeed.Speed1;

            switch (arrParameters[0])
            {
            case "0":
                speed = ManeuverSpeed.Speed0;
                break;

            case "1":
                speed = ManeuverSpeed.Speed1;
                break;

            case "2":
                speed = ManeuverSpeed.Speed2;
                break;

            case "3":
                speed = ManeuverSpeed.Speed3;
                break;

            case "4":
                speed = ManeuverSpeed.Speed4;
                break;

            case "5":
                speed = ManeuverSpeed.Speed5;
                break;
            }

            ManeuverDirection direction = ManeuverDirection.Forward;

            switch (arrParameters[1])
            {
            case "F":
                direction = ManeuverDirection.Forward;
                break;

            case "L":
                direction = ManeuverDirection.Left;
                break;

            case "R":
                direction = ManeuverDirection.Right;
                break;
            }

            ManeuverBearing bearing = ManeuverBearing.Straight;

            switch (arrParameters[2])
            {
            case "S":
                bearing = (speed != ManeuverSpeed.Speed0) ? ManeuverBearing.Straight : ManeuverBearing.Stationary;
                break;

            case "R":
                bearing = (direction == ManeuverDirection.Forward) ? ManeuverBearing.KoiogranTurn : ManeuverBearing.SegnorsLoop;
                break;

            case "E":
                bearing = ManeuverBearing.TallonRoll;
                break;

            case "B":
                bearing = ManeuverBearing.Bank;
                break;

            case "T":
                bearing = ManeuverBearing.Turn;
                break;
            }

            Speed     = speed;
            Direction = direction;
            Bearing   = bearing;

            ship    = ship ?? Selection.ThisShip;
            shipTag = ship.GetTag();

            if (!ship.Maneuvers.ContainsKey(parameters))
            {
                Console.Write("<b>Ship " + ship.Type + " doesn't have maneuver " + parameters + "</b>", LogTypes.Errors, true, "red");
            }
            ColorComplexity = ship.Maneuvers[parameters];
            ColorComplexity = ship.GetColorComplexityOfManeuver(this);
        }
Example #9
0
 public StraightMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, ManeuverColor color) : base(speed, direction, bearing, color)
 {
 }
 public SegnorsLoopMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, ManeuverColor color) : base(speed, direction, bearing, color)
 {
 }
Example #11
0
 public KoiogranTurnMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, ManeuverColor color) : base(speed, direction, bearing, color)
 {
 }
Example #12
0
        public MovementStruct(string parameters)
        {
            string[] arrParameters = parameters.Split('.');

            ManeuverSpeed speed = ManeuverSpeed.Speed1;

            switch (arrParameters[0])
            {
            case "0":
                speed = ManeuverSpeed.Speed0;
                break;

            case "1":
                speed = ManeuverSpeed.Speed1;
                break;

            case "2":
                speed = ManeuverSpeed.Speed2;
                break;

            case "3":
                speed = ManeuverSpeed.Speed3;
                break;

            case "4":
                speed = ManeuverSpeed.Speed4;
                break;

            case "5":
                speed = ManeuverSpeed.Speed5;
                break;
            }

            ManeuverDirection direction = ManeuverDirection.Forward;

            switch (arrParameters[1])
            {
            case "F":
                direction = ManeuverDirection.Forward;
                break;

            case "L":
                direction = ManeuverDirection.Left;
                break;

            case "R":
                direction = ManeuverDirection.Right;
                break;
            }

            ManeuverBearing bearing = ManeuverBearing.Straight;

            switch (arrParameters[2])
            {
            case "S":
                bearing = (speed != ManeuverSpeed.Speed0) ? ManeuverBearing.Straight : ManeuverBearing.Stationary;
                break;

            case "R":
                bearing = (direction == ManeuverDirection.Forward) ? ManeuverBearing.KoiogranTurn : ManeuverBearing.SegnorsLoop;
                break;

            case "E":
                bearing = ManeuverBearing.TallonRoll;
                break;

            case "B":
                bearing = ManeuverBearing.Bank;
                break;

            case "T":
                bearing = ManeuverBearing.Turn;
                break;
            }

            Speed     = speed;
            Direction = direction;
            Bearing   = bearing;

            if (!Selection.ThisShip.Maneuvers.ContainsKey(parameters))
            {
                Debug.Log("ERROR: Ship doesn't have required maneuver. Seems that AI maneuver table is wrong.");
            }
            ColorComplexity = Selection.ThisShip.Maneuvers[parameters];
            ColorComplexity = Selection.ThisShip.GetColorComplexityOfManeuver(this);
        }
Example #13
0
        public ManeuverHolder(string parameters, Ship.GenericShip ship = null)
        {
            string[] arrParameters = parameters.Split('.');
            if (arrParameters.Length < 3)
            {
                Messages.ShowError($"Error: maneuverCode is invalid, only {arrParameters.Length} blocks. String: \"{parameters}\"");
            }

            ManeuverSpeed speed = ManeuverSpeed.Speed1;

            switch (arrParameters[0])
            {
            case "0":
                speed = ManeuverSpeed.Speed0;
                break;

            case "1":
                speed = ManeuverSpeed.Speed1;
                break;

            case "2":
                speed = ManeuverSpeed.Speed2;
                break;

            case "3":
                speed = ManeuverSpeed.Speed3;
                break;

            case "4":
                speed = ManeuverSpeed.Speed4;
                break;

            case "5":
                speed = ManeuverSpeed.Speed5;
                break;

            default:
                Messages.ShowError($"Error: Speed in maneuverCode is invalid, \"{arrParameters[0]}\"");
                break;
            }

            ManeuverDirection direction = ManeuverDirection.Forward;

            switch (arrParameters[1])
            {
            case "F":
                direction = ManeuverDirection.Forward;
                break;

            case "L":
                direction = ManeuverDirection.Left;
                break;

            case "R":
                direction = ManeuverDirection.Right;
                break;

            case "S":
                direction = ManeuverDirection.Stationary;
                break;

            default:
                Messages.ShowError($"Error: Direction in maneuverCode is invalid, \"{arrParameters[1]}\"");
                break;
            }

            ManeuverBearing bearing = ManeuverBearing.Straight;

            switch (arrParameters[2])
            {
            case "S":
                bearing = (speed != ManeuverSpeed.Speed0) ? ManeuverBearing.Straight : ManeuverBearing.Stationary;
                break;

            case "R":
                bearing = (direction == ManeuverDirection.Forward) ? ManeuverBearing.KoiogranTurn : ManeuverBearing.SegnorsLoop;
                break;

            case "r":
                bearing = ManeuverBearing.SegnorsLoopUsingTurnTemplate;
                break;

            case "E":
                bearing = ManeuverBearing.TallonRoll;
                break;

            case "B":
                bearing = ManeuverBearing.Bank;
                break;

            case "b":
                bearing = ManeuverBearing.SideslipBank;
                break;

            case "T":
                bearing = ManeuverBearing.Turn;
                break;

            case "t":
                bearing = ManeuverBearing.SideslipTurn;
                break;

            case "V":
                bearing = ManeuverBearing.ReverseStraight;
                break;

            default:
                Messages.ShowError($"Error: Bearing in maneuverCode is invalid, \"{arrParameters[2]}\"");
                break;
            }

            Speed     = speed;
            Direction = direction;
            Bearing   = bearing;

            ship    = ship ?? Selection.ThisShip;
            shipTag = ship.GetTag();

            if (!ship.Maneuvers.ContainsKey(parameters))
            {
                //
            }
            ColorComplexity = ship.Maneuvers[parameters];
            ColorComplexity = ship.GetColorComplexityOfManeuver(this);
        }
Example #14
0
 public TallonRollMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color)
 {
     RotationEndDegrees = (direction == ManeuverDirection.Left) ? -90 : 90;
 }
Example #15
0
 public SideslipTurnMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color)
 {
 }
Example #16
0
 public RocketInput()
 {
     Maneuver = ManeuverDirection.None;
 }
Example #17
0
 public ManeuverInfo(ManeuverSpeed speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity complexity)
 {
     Movement   = new ManeuverHolder(speed, direction, bearing);
     Complexity = complexity;
 }
Example #18
0
 public TallonRollMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color)
 {
 }
Example #19
0
 public ReverseBankMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color)
 {
 }
Example #20
0
 public SegnorsLoopUsingTurnTemplateMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color)
 {
 }