예제 #1
0
        public override void GenerateIntoMap(Map map)
        {
            ShipBase newShip = (ShipBase)ThingMaker.MakeThing(this.ShipDef);

            newShip.SetFaction(Faction.OfPlayer);
            newShip.ShouldSpawnFueled = true;
            this.StartingShips.Add(newShip);
            DropShipUtility.LoadNewCargoIntoRandomShips(this.PlayerStartingThings().ToList(), this.StartingShips);
            DropShipUtility.DropShipGroups(map.Center, map, this.StartingShips, TravelingShipArrivalAction.EnterMapFriendly);
        }
예제 #2
0
        public static void InitiateGovernorArrestEvent(Map map)
        {
            if (CorruptionStoryTrackerUtilities.currentStoryTracker.PlanetaryGovernor == null)
            {
                return;
            }
            Faction     faction = CorruptionStoryTrackerUtilities.currentStoryTracker.ImperialGuard;
            List <Pawn> arbites = new List <Pawn>();

            for (int i = 0; i < 5; i++)
            {
                Pawn member = PawnGenerator.GeneratePawn(PawnKindDef.Named("IoM_Arbites"), faction);
                arbites.Add(member);
            }

            OHUShips.ShipBase dropShip = (OHUShips.ShipBase)ThingMaker.MakeThing(ThingDef.Named("AquilaLander"));
            dropShip.shipState      = OHUShips.ShipState.Incoming;
            dropShip.drawTickOffset = dropShip.compShip.sProps.TicksToImpact;
            Thing initialFuel = ThingMaker.MakeThing(DefOfs.C_ThingDefOfs.Chemfuel);

            initialFuel.stackCount = 2000;
            dropShip.refuelableComp.Refuel(initialFuel);
            dropShip.SetFaction(arbites[0].Faction);
            foreach (Pawn current in arbites)
            {
                dropShip.GetInnerContainer().TryAdd(current);
            }

            List <ShipBase> tmp = new List <ShipBase>();

            tmp.Add(dropShip);
            IntVec3 dropCenter;

            if (!DropCellFinder.TryFindRaidDropCenterClose(out dropCenter, map))
            {
                dropCenter = DropCellFinder.FindRaidDropCenterDistant(map);
            }
            DropShipUtility.DropShipGroups(dropCenter, map, tmp, TravelingShipArrivalAction.EnterMapFriendly);
            LordMaker.MakeNewLord(dropShip.Faction, new IoM.LordJob_ArrestGovernor(dropShip, dropCenter), map, arbites);
        }