public static Thing DropShuttle_NewTemp(List <ActiveDropPodInfo> pods, Map map, IntVec3 cell, Faction faction = null) { RemovePawnsFromWorldPawns(pods); Thing thing = QuestGen_Shuttle.GenerateShuttle(faction, null, null, acceptColonists: false, onlyAcceptColonists: false, onlyAcceptHealthy: false, 0, dropEverythingIfUnsatisfied: false, leaveImmediatelyWhenSatisfied: false, dropEverythingOnArrival: true); thing.TryGetComp <CompShuttle>().hideControls = true; CompTransporter compTransporter = thing.TryGetComp <CompTransporter>(); for (int i = 0; i < pods.Count; i++) { compTransporter.innerContainer.TryAddRangeOrTransfer(pods[i].innerContainer); } if (!cell.IsValid) { cell = DropCellFinder.GetBestShuttleLandingSpot(map, Faction.OfPlayer, out var _); } GenPlace.TryPlaceThing(SkyfallerMaker.MakeSkyfaller(ThingDefOf.ShuttleIncoming, thing), cell, map, ThingPlaceMode.Near); return(thing); }
public static Thing DropShuttle(List <ActiveDropPodInfo> pods, Map map, IntVec3 cell, Faction faction = null) { ByakheeArrivalActionUtility.RemovePawnsFromWorldPawns(pods); Thing thing = QuestGen_Shuttle.GenerateShuttle(faction, null, null, false, false, false, 0, false, false, true, false, null, null, -1, null, false, true, false, false); TransportShip transportShip = TransportShipMaker.MakeTransportShip(TransportShipDefOf.Ship_Shuttle, null, thing); CompTransporter compTransporter = thing.TryGetComp <CompTransporter>(); for (int i = 0; i < pods.Count; i++) { compTransporter.innerContainer.TryAddRangeOrTransfer(pods[i].innerContainer, true, false); } if (!cell.IsValid) { cell = DropCellFinder.GetBestShuttleLandingSpot(map, Faction.OfPlayer); } transportShip.ArriveAt(cell, map.Parent); transportShip.AddJobs(new ShipJobDef[] { ShipJobDefOf.Unload, ShipJobDefOf.FlyAway }); return(thing); }
private static void SendShuttle(FCEvent evt) { Map playerHomeMap = Find.World.GetComponent <FactionFC>().TaxMap; List <ShipLandingArea> landingZones = ShipLandingBeaconUtility.GetLandingZones(playerHomeMap); IntVec3 landingCell = DropCellFinder.GetBestShuttleLandingSpot(playerHomeMap, Faction.OfPlayer); if (!landingZones.Any() || landingZones.Any(zone => zone.Clear)) { MakeDeliveryLetterAndMessage(evt); Thing shuttle = ThingMaker.MakeThing(ThingDefOf.Shuttle); TransportShip transportShip = TransportShipMaker.MakeTransportShip(TransportShipDefOf.Ship_Shuttle, evt.goods, shuttle); transportShip.ArriveAt(landingCell, playerHomeMap.Parent); transportShip.AddJobs(new ShipJobDef[] { ShipJobDefOf.Unload, ShipJobDefOf.FlyAway }); } else { if (!evt.isDelayed) { Messages.Message(((string)"shuttleLandingBlockedWithItems".Translate(evt.goods.ToLetterString())).Replace("\n", " "), MessageTypeDefOf.RejectInput); evt.isDelayed = true; } if (evt.source == -1) { evt.source = playerHomeMap.Tile; } evt.timeTillTrigger = Find.TickManager.TicksGame + 1000; CreateDeliveryEvent(evt); } }