private IEnumerator blastOffWatcher(Vessel v, Notes_CheckListItem n) { float timer = 0; double targetAlt = 0; if (v.mainBody.atmosphere) targetAlt = v.mainBody.atmosphereDepth / 20; else targetAlt = v.mainBody.Radius / 200; while (timer < 300) { switch (v.situation) { case Vessel.Situations.LANDED: case Vessel.Situations.SPLASHED: yield break; default: if (v.altitude >= targetAlt) { n.setComplete(); yield break; } timer += TimeWarp.deltaTime; n.Text = string.Format("Take off from {0}\n(Achieve {1:F0}m within {2:F0}sec)", n.TargetBody.theName, targetAlt, timer); yield return null; break; } } n.Text = string.Format("Take off from {0}", n.TargetBody.theName); }
public static void deRegisterCheckList(Notes_CheckListItem n) { switch (n.CheckType) { case Notes_CheckListType.launch: if (launchNotes.ContainsKey(n.ID)) launchNotes.Remove(n.ID); break; case Notes_CheckListType.orbit: if (orbitNotes.ContainsKey(n.ID)) orbitNotes.Remove(n.ID); break; case Notes_CheckListType.enterOrbit: if (enterOrbitNotes.ContainsKey(n.ID)) enterOrbitNotes.Remove(n.ID); break; case Notes_CheckListType.returnToOrbit: if (returnToOrbitNotes.ContainsKey(n.ID)) returnToOrbitNotes.Remove(n.ID); break; case Notes_CheckListType.land: if (landNotes.ContainsKey(n.ID)) landNotes.Remove(n.ID); break; case Notes_CheckListType.plantFlag: if (flagNotes.ContainsKey(n.ID)) flagNotes.Remove(n.ID); break; case Notes_CheckListType.spacewalk: if (SpacewalkNotes.ContainsKey(n.ID)) SpacewalkNotes.Remove(n.ID); break; case Notes_CheckListType.surfaceEVA: if (EVAnotes.ContainsKey(n.ID)) EVAnotes.Remove(n.ID); break; case Notes_CheckListType.returnHome: if (returnHomeNotes.ContainsKey(n.ID)) returnHomeNotes.Remove(n.ID); break; case Notes_CheckListType.rendezvousVessel: if (rendezvousVesselNotes.ContainsKey(n.ID)) rendezvousVesselNotes.Remove(n.ID); break; case Notes_CheckListType.dockVessel: if (dockVesselNotes.ContainsKey(n.ID)) dockVesselNotes.Remove(n.ID); break; case Notes_CheckListType.rendezvousAsteroid: if (rendezvousAsteroidNotes.ContainsKey(n.ID)) rendezvousAsteroidNotes.Remove(n.ID); break; case Notes_CheckListType.dockAsteroid: if (dockAsteroidNotes.ContainsKey(n.ID)) dockAsteroidNotes.Remove(n.ID); break; case Notes_CheckListType.blastOff: if (blastOffNotes.ContainsKey(n.ID)) blastOffNotes.Remove(n.ID); break; case Notes_CheckListType.science: case Notes_CheckListType.scienceFromPlanet: if (scienceNotes.ContainsKey(n.ID)) scienceNotes.Remove(n.ID); break; default: break; } }
public void startBlastOffWatcher(Vessel v, Notes_CheckListItem n) { StartCoroutine(blastOffWatcher(v, n)); }