public ManeuverColor GetLastManeuverColor() { ManeuverColor result = ManeuverColor.None; result = AssignedManeuver.ColorComplexity; return(result); }
private void AskChangeManeuver(object sender, System.EventArgs e) { Messages.ShowInfoToHuman("Juno Eclipse: You can increase or decrease your maneuver speed"); allowedMovements.Clear(); string key = HostShip.AssignedManeuver.ToString(); int speed = HostShip.AssignedManeuver.Speed; allowedMovements.Add(key); //Generate key for maneuvre + 1. If exist backups old color, and change to actual keyPlus = key.Replace(speed.ToString()[0], (speed + 1).ToString()[0]); plusColor = ManeuverColor.None; if (HostShip.Maneuvers.ContainsKey(keyPlus)) { allowedMovements.Add(keyPlus); plusColor = HostShip.Maneuvers[keyPlus]; HostShip.Maneuvers[keyPlus] = HostShip.AssignedManeuver.ColorComplexity; } //Generate key for maneuvre - 1. If exist backups old color, and change to actual keyMinus = key.Replace(speed.ToString()[0], (speed - 1).ToString()[0]); minusColor = ManeuverColor.None; if (HostShip.Maneuvers.ContainsKey(keyMinus)) { allowedMovements.Add(keyMinus); minusColor = HostShip.Maneuvers[keyMinus]; HostShip.Maneuvers[keyMinus] = HostShip.AssignedManeuver.ColorComplexity; } HostShip.Owner.ChangeManeuver((maneuverCode) => { GameMode.CurrentGameMode.AssignManeuver(maneuverCode); HostShip.OnMovementFinish += RestoreManuvers; }, StraightOrKoiogran); }
public GenericMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, ManeuverColor color) { Speed = speed; ManeuverSpeed = GetManeuverSpeed(speed); Direction = direction; Bearing = bearing; ColorComplexity = color; }
public void UpdateColorComplexity() { string parameters = this.ToString(); 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); }
private void AskChangeManeuver(object sender, System.EventArgs e) { Messages.ShowInfoToHuman("Countess Ryad: You can change your maneuver to Koiogran turn"); maneuverKey = HostShip.AssignedManeuver.Speed + ".F.R"; originalColor = HostShip.Maneuvers[maneuverKey]; HostShip.Maneuvers[maneuverKey] = HostShip.AssignedManeuver.ColorComplexity; HostShip.Owner.ChangeManeuver((maneuverCode) => { GameMode.CurrentGameMode.AssignManeuver(maneuverCode); HostShip.OnMovementFinish += RestoreManuvers; }, StraightOrKoiogran); }
public void UpdateColorComplexity() { string parameters = this.ToString(); if (!Selection.ThisShip.Maneuvers.ContainsKey(parameters)) { Console.Write(Selection.ThisShip.Type + " doesn't have " + parameters + " maneuver!", LogTypes.Errors, true, "red"); } ColorComplexity = Selection.ThisShip.Maneuvers[parameters]; ColorComplexity = Selection.ThisShip.GetColorComplexityOfManeuver(this); }
public void UpdateColorComplexity() { string parameters = this.ToString(); Ship.GenericShip ship = Roster.GetShipById(shipTag) ?? Selection.ThisShip; if (!ship.Maneuvers.ContainsKey(parameters)) { Console.Write(ship.Type + " doesn't have " + parameters + " maneuver!", LogTypes.Errors, true, "red"); } else { ColorComplexity = ship.Maneuvers[parameters]; ColorComplexity = ship.GetColorComplexityOfManeuver(this); } }
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); }
public BankBoost(int speed, ManeuverDirection direction, ManeuverBearing bearing, ManeuverColor color) : base(speed, direction, bearing, color) { }
public StraightMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, ManeuverColor color) : base(speed, direction, bearing, color) { }
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); }
public KoiogranTurnMovement(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) { }
public TallonRollMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, ManeuverColor color) : base(speed, direction, bearing, color) { }