Exemplo n.º 1
0
        // Token: 0x060015AA RID: 5546 RVA: 0x000A92C8 File Offset: 0x000A76C8
        public override void Arrive(List <Pawn> pawns, IncidentParms parms)
        {
            Map map = (Map)parms.target;

            for (int i = 0; i < pawns.Count; i++)
            {
                IntVec3 dropCenter = map.listerBuildings.allBuildingsColonist.FindAll(x => x.TryGetCompFast <CompPowerPlant>() != null).RandomElement().Position;
                DeepStrikeUtility.DropThingsNear(dropCenter, map, Gen.YieldSingle <Thing>(pawns[i]), parms.podOpenDelay, true, false, true);
            }
        }
        // Token: 0x060015AA RID: 5546 RVA: 0x000A92C8 File Offset: 0x000A76C8
        public override void Arrive(List <Pawn> pawns, IncidentParms parms)
        {
            Map map = (Map)parms.target;

            for (int i = 0; i < pawns.Count; i++)
            {
                IntVec3 dropCenter = DropCellFinder.RandomDropSpot(map);
                DeepStrikeUtility.DropThingsNear(dropCenter, map, Gen.YieldSingle <Thing>(pawns[i]), parms.podOpenDelay, true, false, true);
            }
        }
 public void ArriveTeleport(List <Pawn> pawns)
 {
     for (int i = 0; i < pawns.Count; i++)
     {
         //    IntVec3 dropCenter = map.listerBuildings.allBuildingsColonist.FindAll(x => x.TryGetCompFast<CompPowerPlant>() != null).RandomElement().Position;
         IntVec3 dropCenter;
         if (DropCellFinder.TryFindRaidDropCenterClose(out dropCenter, map))
         {
             DeepStrikeUtility.DropThingsNear(dropCenter, map, Gen.YieldSingle <Thing>(pawns[i]), 0, true, false, true, DeepStrikeType.Teleport);
         }
     }
     Teleporters.Clear();
 }
Exemplo n.º 4
0
        private static void CallDeepstrikeOf()
        {
            List <DebugMenuOption> list = new List <DebugMenuOption>();

            foreach (PawnKindDef localKindDef2 in from f in DefDatabase <PawnKindDef> .AllDefs
                     //  where f.RoyalTitlesAwardableInSeniorityOrderForReading.Count > 0
                     orderby f.defName
                     select f)
            {
                PawnKindDef localKindDef = localKindDef2;

                /*
                 * if (!localKindDef.HasModExtension<DeepStrikeExtension>())
                 * {
                 *  continue;
                 * }
                 */
                list.Add(new DebugMenuOption(localKindDef.defName, DebugMenuOptionMode.Tool, delegate()
                {
                    List <FloatMenuOption> list2 = new List <FloatMenuOption>();
                    IntVec3 cell = UI.MouseCell();
                    for (int i = 0; i < 6; i++)
                    {
                        DeepStrikeType strikeType = (DeepStrikeType)i;
                        list2.Add(new FloatMenuOption(DeepStrikeUtility.DeepstrikeArrivalmode(strikeType) + " - ", delegate()
                        {
                            Faction faction = FactionUtility.DefaultFactionFrom(localKindDef.defaultFactionType);
                            Pawn newPawn    = PawnGenerator.GeneratePawn(localKindDef, faction);
                            DeepStrikeUtility.DropThingsNear(cell, Find.CurrentMap, Gen.YieldSingle <Thing>(newPawn), 110, false, false, true, strikeType);
                            if (faction != null && faction != Faction.OfPlayer)
                            {
                                Lord lord = null;
                                if (Find.CurrentMap.mapPawns.SpawnedPawnsInFaction(faction).Any((Pawn p) => p != newPawn))
                                {
                                    lord = ((Pawn)GenClosest.ClosestThing_Global(cell, Find.CurrentMap.mapPawns.SpawnedPawnsInFaction(faction), 99999f, (Thing p) => p != newPawn && ((Pawn)p).GetLord() != null, null)).GetLord();
                                }
                                if (lord == null)
                                {
                                    LordJob_DefendPoint lordJob = new LordJob_DefendPoint(cell, null, false, true);
                                    lord = LordMaker.MakeNewLord(faction, lordJob, Find.CurrentMap, null);
                                }
                                lord.AddPawn(newPawn);
                            }
                        }, MenuOptionPriority.Default, null, null, 0f, null, null));
                    }
                    Find.WindowStack.Add(new FloatMenu(list2));
                }));
            }
            Find.WindowStack.Add(new Dialog_DebugOptionListLister(list));
        }