Advertisement
Guest User

Untitled

a guest
Aug 29th, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.77 KB | None | 0 0
  1.  
  2.             WaypointManager.ChooseRandomPosition(out centerLatitude, out centerLongitude, targetBody.GetName(), true, false);
  3.  
  4.             if (this.prestige == Contract.ContractPrestige.Trivial)
  5.             {
  6.                 waypointCount = 1;
  7.                 waypointCount += additionalWaypoints;
  8.                 range = 100000.0;
  9.                 if (targetBody.GetName() == "Kerbin") {
  10.                     // Old Airfield island flights
  11.                     minAltitude = 500.0;
  12.                     maxAltitude = 3500.0;
  13.                     range = 20000.0;
  14.                     centerLatitude = -2;
  15.                     centerLongitude = -72.5;
  16.                 }
  17.             }
  18.             else if (this.prestige == Contract.ContractPrestige.Significant)
  19.             {
  20.                 waypointCount = 1;
  21.                 waypointCount += additionalWaypoints;
  22.                 range = 200000.0;
  23.                 if (targetBody.GetName() == "Kerbin") {
  24.                     // Mountain flights
  25.                     minAltitude = 2000.0;
  26.                     maxAltitude = 8000.0;
  27.                     range = 30000.0;
  28.                     centerLatitude = 1;
  29.                     centerLongitude = -79;
  30.                 }
  31.             }
  32.             else if (this.prestige == Contract.ContractPrestige.Exceptional)
  33.             {
  34.                 waypointCount = 1;
  35.                 waypointCount += additionalWaypoints;
  36.                 range = 300000.0;
  37.                 if (targetBody.GetName() == "Kerbin") {
  38.                     // High altitude flights
  39.                     minAltitude = 8000.0;
  40.                     maxAltitude = 20000.0;
  41.                     range = 50000.0;
  42.                     centerLatitude = -3.5;
  43.                     centerLongitude = -85.5;
  44.                 }
  45.             }
  46.  
  47.             double altitudeHalfQuarterRange = Math.Abs(maxAltitude - minAltitude) * 0.125;
  48.             double upperMidAltitude = ((maxAltitude + minAltitude) / 2.0) + altitudeHalfQuarterRange;
  49.             double lowerMidAltitude = ((maxAltitude + minAltitude) / 2.0) - altitudeHalfQuarterRange;
  50.             minAltitude = Math.Round((minAltitude + (generator.NextDouble() * (lowerMidAltitude - minAltitude))) / 100.0) * 100.0;
  51.             maxAltitude = Math.Round((upperMidAltitude + (generator.NextDouble() * (maxAltitude - upperMidAltitude))) / 100.0) * 100.0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement