Exemplo n.º 1
0
        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);
                //            current.SavePotentialWorldPawns();
                DropShipUtility.ReimbarkWorldPawnsForLandedShip(current);
            }
            travelingShips.SetFaction(landedShip.Faction);
            TravelingShipsUtility.AddAllLandedPawnsToWorld(landedShip);
            if (Find.World.worldObjects.Contains(landedShip))
            {
                Find.World.worldObjects.Remove(landedShip);
            }
        }
Exemplo n.º 2
0
        public static void Enter(LandedShip caravan, Map map, Func <ShipBase, IntVec3> spawnCellGetter)
        {
            List <ShipBase> ships = caravan.ships;

            foreach (ShipBase ship in ships)
            {
                DropShipUtility.ReimbarkWorldPawnsForLandedShip(ship);
            }
            DropShipUtility.DropShipGroups(TravelingShipsUtility.CenterCell(map), map, ships, TravelingShipArrivalAction.EnterMapFriendly);
            caravan.RemoveAllPawns();
            if (caravan.Spawned)
            {
                Find.WorldObjects.Remove(caravan);
            }
        }
Exemplo n.º 3
0
        public static void Enter(List <ShipBase> ships, Map map, bool centerDrop = true)
        {
            foreach (ShipBase ship in ships)
            {
                DropShipUtility.ReimbarkWorldPawnsForLandedShip(ship);
            }
            IntVec3 loc;

            if (centerDrop)
            {
                loc = TravelingShipsUtility.CenterCell(map);
            }
            else
            {
                loc = DropCellFinder.FindRaidDropCenterDistant(map);
            }
            DropShipUtility.DropShipGroups(loc, map, ships, TravelingShipArrivalAction.EnterMapFriendly);
        }