public override void OnUpdate() { base.OnUpdate(); /* Only perform the max-G check if we are attached to a vessel. * During KAS grab, vessel can be itself or a Kerbal, and we may * get spurious high G's. */ bool isVesselShip = part.parent != null && vessel != null && !vessel.isEVA; if (decoupled && vessel.vesselType != VesselType.Debris) { NE_Helper.log("Decoupled PEC recoverd"); decoupled = false; } if (!decoupled && isVesselShip && vessel.geeForce > maxGforce) { NE_Helper.log("KEES PEC over max G, decouple\n" + this.ToString()); decouple(); } //Decouple for testing if (NE_Helper.debugging() && Input.GetKeyDown(KeyCode.LeftAlt) && Input.GetKeyDown(KeyCode.D)) { decouple(); } if (!decoupled && counter == 0)//don't run this every frame { checkForExp(); } counter = (++counter) % 6; }
public static bool checkBoring(Vessel vessel, bool msg = false) { if (NE_Helper.debugging()) { return(false); } if ((vessel.orbit.referenceBody.name == "Kerbin") && (vessel.situation == Vessel.Situations.LANDED || vessel.situation == Vessel.Situations.PRELAUNCH || vessel.situation == Vessel.Situations.SPLASHED || vessel.altitude <= vessel.orbit.referenceBody.maxAtmosphereAltitude)) { if (msg) { ScreenMessages.PostScreenMessage("Too boring here. Go to space!", 6, ScreenMessageStyle.UPPER_CENTER); } return(true); } return(false); }
public static bool checkBoring(Vessel vessel, bool msg = false) { if (NE_Helper.debugging()) { return(false); } // MKW TODO: Check if CelestialBody can be compared like this if ((vessel.orbit.referenceBody == Planetarium.fetch.Home) && (vessel.situation == Vessel.Situations.LANDED || vessel.situation == Vessel.Situations.PRELAUNCH || vessel.situation == Vessel.Situations.SPLASHED || vessel.altitude <= vessel.orbit.referenceBody.atmosphereDepth)) { if (msg) { ScreenMessages.PostScreenMessage("#ne_Too_boring_here_Go_to_space", 6, ScreenMessageStyle.UPPER_CENTER); } return(true); } return(false); }