public static void LaunchLandedFleet(LandedShip landedShip, int destinationTile, IntVec3 destinationCell, PawnsArriveMode pawnArriveMode, TravelingShipArrivalAction arrivalAction) { if (destinationTile < 0) { Log.Error("Tried launching landed ship, but its destination tile is " + destinationTile); return; } TravelingShips travelingShips = (TravelingShips)WorldObjectMaker.MakeWorldObject(ShipNamespaceDefOfs.TravelingSuborbitalShip); travelingShips.Tile = landedShip.Tile; travelingShips.SetFaction(landedShip.Faction); travelingShips.destinationTile = destinationTile; travelingShips.destinationCell = destinationCell; // travelingShips.destinationCell = this.destinationCell; travelingShips.arriveMode = pawnArriveMode; travelingShips.arrivalAction = arrivalAction; Find.WorldObjects.Add(travelingShips); foreach (ShipBase current in landedShip.ships) { travelingShips.AddShip(current, true); } TravelingShipsUtility.ReimbarkPawnsFromLandedShip(landedShip); travelingShips.SetFaction(landedShip.Faction); TravelingShipsUtility.RemoveLandedShipPawns(landedShip); landedShip.ReloadStockIntoShip(); if (Find.World.worldObjects.Contains(landedShip)) { Find.World.worldObjects.Remove(landedShip); } }
public static void EnterMapWithShip(LandedShip caravan, Map map) { TravelingShipsUtility.ReimbarkPawnsFromLandedShip(caravan); IntVec3 enterCell = TravelingShipsUtility.CenterCell(map); Func <ShipBase, IntVec3> spawnCellGetter = (ShipBase p) => CellFinder.RandomSpawnCellForPawnNear(enterCell, map); TravelingShipsUtility.Enter(caravan, map, spawnCellGetter); }
public static void EnterMapWithShip(LandedShip caravan, Map map) { TravelingShipsUtility.ReimbarkPawnsFromLandedShip(caravan); TravelingShipsUtility.Enter(caravan, map); }