protected override bool Generate() { if (!ProgressUtilities.HaveModuleTech("ModuleDockingNode")) { return(false); } if (ExplorationPlusUtilities.ContractIsOffered(GetTitle())) { return(false); } SetExpiry(1, 7); SetScience(ExplorationPlusUtilities.SetCurrency(3.9f, prestige), targetBody); agent = AgentList.Instance.GetAgent("Kerbin World-Firsts Record-Keeping Society"); SetDeadlineYears(500, targetBody); SetReputation(ExplorationPlusUtilities.SetCurrency(7.95f, prestige), 0f, targetBody); if (!ProgressUtilities.GetBodyProgress(ProgressType.RENDEZVOUS, targetBody)) { AddParameter(new RendezvousParameter()); } if (!ProgressUtilities.GetBodyProgress(ProgressType.DOCKING, targetBody)) { AddParameter(new DockingParameter()); } if (!ProgressUtilities.GetBodyProgress(ProgressType.SPACEWALK, targetBody)) { throw new NotImplementedException(); //TODO: Spacewalk Parameter } SetFunds(0f, ExplorationPlusUtilities.SetCurrency(ParameterCount * 4000f, prestige), 0f, targetBody); if (ParameterCount == 0) { return(false); } return(true); }
protected override bool Generate() { if (!ProgressUtilities.GetBodyProgress(ProgressType.ORBIT, Planetarium.fetch.Home)) { return(false); } targetBody = ProgressUtilities.GetNextUnreached(1).FirstOrDefault(); if (targetBody == null) { return(false); } if (ExplorationPlusUtilities.ContractIsOffered(GetTitle())) { return(false); } SetExpiry(1, 7); SetScience(ExplorationPlusUtilities.SetCurrency(9.0f, prestige), targetBody); agent = AgentList.Instance.GetAgent("Kerbin World-Firsts Record-Keeping Society"); SetDeadlineYears(500, targetBody); SetReputation(ExplorationPlusUtilities.SetCurrency(4.5f, prestige), 0f, targetBody); SetFunds(0f, ExplorationPlusUtilities.SetCurrency(66000f, prestige), 0f, targetBody); if (!targetBody.isStar) { AddParameter(new FlybyParameter(targetBody)); } else { AddParameter(new OrbitParameter(targetBody)); } AddParameter(new CollectAnyScienceFromBodyParameter(targetBody)); return(true); }
protected override bool Generate() { //Let's find a body we've landed on for (int i = 0; i < FlightGlobals.Bodies.Count; i++) { //Let's Find a body we've landed on CelestialBody cb = FlightGlobals.Bodies.ElementAt(i); //Ignore the HomeWorld if (cb == Planetarium.fetch.Home) { continue; } //No landings if it doesn't have a surface! if (!cb.hasSolidSurface) { continue; } //Have we landed on it? if (!ProgressUtilities.GetBodyProgress(ProgressType.LANDING, cb) && !ProgressUtilities.GetBodyProgress(ProgressType.SPLASHDOWN, cb)) { continue; } //Yeah? Great, have we returned? if (ProgressUtilities.GetBodyProgress(ProgressType.LANDINGRETURN, cb, MannedStatus.MANNED)) { continue; } //Temporarily set targetBody so we can check the title. targetBody = cb; //If the contract already exists, keep searching, but reset targetBody to null so we know it's not valid if (ExplorationPlusUtilities.ContractIsOffered(GetTitle())) { targetBody = null; } } //If we didn't find a target, stop Contract Generation if (targetBody == null) { return(false); } SetExpiry(1, 7); SetScience(ExplorationPlusUtilities.SetCurrency(13.5f, prestige), targetBody); agent = AgentList.Instance.GetAgent("Kerbin World-Firsts Record-Keeping Society"); SetDeadlineYears(500, targetBody); SetReputation(ExplorationPlusUtilities.SetCurrency(27f, prestige), 0f, targetBody); SetFunds(0f, ExplorationPlusUtilities.SetCurrency(198000f, prestige), 0f, targetBody); AddParameter(new MannedLandingParameter(targetBody)); AddParameter(new MannedReturnParameter(targetBody, Vessel.Situations.LANDED)); return(true); }
protected override bool Generate() { for (int i = 0; i < FlightGlobals.Bodies.Count; i++) { CelestialBody cb = FlightGlobals.Bodies.ElementAt(i); //Must have orbited but not landed if (cb == Planetarium.fetch.Home) { continue; } if (!ProgressUtilities.GetBodyProgress(ProgressType.ORBIT, cb)) { continue; } if (ProgressUtilities.GetBodyProgress(ProgressType.LANDING, cb) || ProgressUtilities.GetBodyProgress(ProgressType.SPLASHDOWN, cb)) { continue; } targetBody = cb; //If the contract already exists set targetBody to null so the search can continue if (ExplorationPlusUtilities.ContractIsOffered(GetTitle())) { targetBody = null; } if (targetBody == null) { continue; } break; } if (targetBody == null) { return(false); } SetExpiry(1, 7); SetScience(ExplorationPlusUtilities.SetCurrency(9.0f, prestige), targetBody); agent = AgentList.Instance.GetAgent("Kerbin World-Firsts Record-Keeping Society"); SetDeadlineYears(500, targetBody); SetReputation(ExplorationPlusUtilities.SetCurrency(4.5f, prestige), 0f, targetBody); SetFunds(0f, ExplorationPlusUtilities.SetCurrency(66000f, prestige), 0f, targetBody); AddParameter(new LandingParameter(targetBody)); return(true); }
protected override bool Generate() { for (int i = 0; i < FlightGlobals.Bodies.Count; i++) { //Let's Find a body CelestialBody cb = FlightGlobals.Bodies.ElementAt(i); //Have we orbited? if (!ProgressUtilities.GetBodyProgress(ProgressType.ORBIT, cb)) { continue; } //Yeah? Great, have we returned? if (ProgressUtilities.GetBodyProgress(ProgressType.ORBIT, cb, MannedStatus.MANNED)) { continue; } //Temporarily set targetBody so we can check the title. targetBody = cb; //If the contract already exists, keep searching, but reset targetBody to null so we know it's not valid if (ExplorationPlusUtilities.ContractIsOffered(GetTitle())) { targetBody = null; } } //If we didn't find a target, stop Contract Generation if (targetBody == null) { return(false); } SetExpiry(1, 7); SetScience(ExplorationPlusUtilities.SetCurrency(13.5f, prestige), targetBody); agent = AgentList.Instance.GetAgent("Kerbin World-Firsts Record-Keeping Society"); SetDeadlineYears(500, targetBody); SetReputation(ExplorationPlusUtilities.SetCurrency(27f, prestige), 0f, targetBody); SetFunds(0f, ExplorationPlusUtilities.SetCurrency(198000f, prestige), 0f, targetBody); AddParameter(new MannedOrbitParameter(targetBody)); AddParameter(new MannedReturnParameter(targetBody, Vessel.Situations.ORBITING)); return(true); }