From e4a287d3565d0bcfeec172f06350b06e21b6f44d Mon Sep 17 00:00:00 2001 From: Brooks Wagner Date: Mon, 10 Jun 2013 21:43:08 -0400 Subject: [PATCH] Added OrbitGoal: minGForce and maxGForce mission script variables --- plugin/OrbitGoal.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/plugin/OrbitGoal.cs b/plugin/OrbitGoal.cs index 48bddf5..93d1704 100644 --- a/plugin/OrbitGoal.cs +++ b/plugin/OrbitGoal.cs @@ -40,6 +40,9 @@ public class OrbitGoal : MissionGoal public double minVerticalSpeed = 0.0; public double maxVerticalSpeed = 0.0; + public double minGForce = 0.0; + public double maxGForce = 0.0; + public String body = "Kerbin"; protected override List values(Vessel vessel) { @@ -201,6 +204,24 @@ protected override List values(Vessel vessel) { } } + if (minGForce != 0.0) { + if (vessel == null) { + values.Add (new Value ("Min G Force", String.Format(MathTools.SingleDoubleValue, minGForce))); + } else { + values.Add (new Value ("Min G Force", String.Format(MathTools.SingleDoubleValue, minGForce), + vessel.geeForce, vessel.geeForce >= minGForce)); + } + } + + if (maxGForce != 0.0) { + if (vessel == null) { + values.Add (new Value ("Max G Force", String.Format(MathTools.SingleDoubleValue, maxGForce))); + } else { + values.Add (new Value ("Max G Force", String.Format(MathTools.SingleDoubleValue, maxGForce), + vessel.geeForce, vessel.geeForce <= maxGForce)); + } + } + return values; }