public ReturnHome(string title) : base(title) { CelestialBody home = FlightGlobals.Bodies.Where(cb => cb.isHomeWorld).First(); this.title = title != null ? title : "Land or splashdown on " + home.CleanDisplayName(true); }
public override string ToString() { if (biome == "KSC") { return(biome); } return((body == null ? "" : IsKSC() ? "KSC's " : (body.CleanDisplayName() + "'s ")) + PrintBiomeName(biome)); }
public static string BodyList(IEnumerable <CelestialBody> bodies, string conjunction) { CelestialBody first = bodies.First(); CelestialBody last = bodies.Last(); string result = first.CleanDisplayName(); foreach (CelestialBody body in bodies.Where(cb => cb != first && cb != last)) { result += ", " + body.CleanDisplayName(true); } if (last != first) { result += " " + conjunction + " " + last.CleanDisplayName(true); } return(result); }
public string BodyList() { CelestialBody first = targetBodies.First(); CelestialBody last = targetBodies.Last(); string result = first.CleanDisplayName(); foreach (CelestialBody body in targetBodies.Where(b => b != first && b != last)) { result += ", " + body.CleanDisplayName(true); } if (last != first) { result += " or " + last.CleanDisplayName(true); } return(result); }
public string FormatBodyString(string input, CelestialBody body) { string result = input. Replace("$body", body.name). Replace("$theBody", body.CleanDisplayName()); if (result.Contains("$theBodies")) { result = result.Replace("$theBodies", CelestialBodyUtil.BodyList(Enumerable.Repeat(body, 1).Union(body.orbitingBodies), "and")); } if (result.Contains("$childBodies")) { result = result.Replace("$childBodies", CelestialBodyUtil.BodyList(body.orbitingBodies, "and")); } if (result.Contains("$childBodyCount")) { result = result.Replace("$childBodyCount", StringUtil.IntegerToRoman(body.orbitingBodies.Count())); } return(result); }
public IEnumerable <string> EffectText() { if (KSCScienceMultiplier > 0.0) { yield return(ToPercentage(KSCScienceMultiplier, "N0") + " bonus to KSC Science."); } if (nonKSCScienceMultiplier > 0.0) { CelestialBody home = FlightGlobals.Bodies.Where(cb => cb.isHomeWorld).First(); yield return(ToPercentage(nonKSCScienceMultiplier, "N0") + " bonus to " + home.CleanDisplayName(true) + " Science."); } }
public string RequirementText() { string mannedStr = manned == null ? "" : manned.Value ? "crewed " : "uncrewed "; return("Must " + (invert ? "not have any " + mannedStr + "vessels" : "have a " + mannedStr + "vessel") + " en route to " + body.CleanDisplayName(true)); }
public VesselHasVisited(CelestialBody destination, FlightLog.EntryType entryType, string title) : base(title) { if (title == null) { this.title = "Perform "; switch (entryType) { case FlightLog.EntryType.BoardVessel: this.title = "Board a vessel on "; break; case FlightLog.EntryType.Die: this.title = "Die on "; break; case FlightLog.EntryType.Escape: this.title += "an escape from"; break; case FlightLog.EntryType.ExitVessel: this.title = "Exit a vessel on "; break; case FlightLog.EntryType.Flight: this.title += "a flight on "; break; case FlightLog.EntryType.Flyby: this.title += "a flyby of "; break; case FlightLog.EntryType.Land: this.title += "a landing on "; break; case FlightLog.EntryType.Launch: this.title += "a launch from "; break; case FlightLog.EntryType.Orbit: this.title += "an orbit of "; break; case FlightLog.EntryType.PlantFlag: this.title = "Plant a flag on "; break; case FlightLog.EntryType.Recover: this.title += " a recovery on "; break; case FlightLog.EntryType.Spawn: this.title = "Spawn on "; break; case FlightLog.EntryType.Suborbit: this.title += "a sub-orbital trajectory of "; break; } if (destination != null) { this.title += destination.CleanDisplayName(true); } else { this.title += "any body"; } } else { this.title = title; } this.destination = destination; this.entryType = entryType; }