/// <summary> /// Constructor for Failure object. /// </summary> public Failure() { Instance = this; // Gather info about current active vessel. activeVessel = FlightGlobals.ActiveVessel; activeVesselCost = CalcVesselCosts(activeVessel); //scienceAfterFailure = CalcScienceReward(activeVesselCost, activeVessel); currentCelestialBody = activeVessel.mainBody; // This plugin is only targeted at atmospheric failures. if (currentCelestialBody.atmosphere) { altitudeFailureOccurs = KLFUtils.RNG.Next(0, (int)(currentCelestialBody.atmosphereDepth * KLFSettings.Instance.MaxFailureAltitudePercentage)); #if DEBUG KLFUtils.LogDebugMessage("Failure will occur at an altitude of " + altitudeFailureOccurs); Log.Info("currentCelestialBody.atmosphereDepth: " + currentCelestialBody.atmosphereDepth.ToString()); Log.Info("KLFSettings.Instance.MaxFailureAltitudePercentage: " + KLFSettings.Instance.MaxFailureAltitudePercentage.ToString()); #endif } else { altitudeFailureOccurs = 0; } //alarm = new KerbalLaunchFailure.Alarm(); }
/// <summary> /// Constructor for Failure object. /// </summary> public Failure() { // Gather info about current active vessel. activeVessel = FlightGlobals.ActiveVessel; currentCelestialBody = activeVessel.mainBody; // This plugin is only targeted at atmospheric failures. if (currentCelestialBody.atmosphere) { altitudeFailureOccurs = KLFUtils.RNG.Next(0, (int)(currentCelestialBody.atmosphereDepth * KLFSettings.Instance.MaxFailureAltitudePercentage)); #if DEBUG KLFUtils.LogDebugMessage("Failure will occur at an altitude of " + altitudeFailureOccurs); #endif } else { altitudeFailureOccurs = 0; } }