Exemplo n.º 1
0
        // Token: 0x060045EC RID: 17900 RVA: 0x0017880C File Offset: 0x00176A0C
        public static void PlaceInTunnelsNearSpawnCenter(IncidentParms parms, List <Pawn> pawns)
        {
            Map  map  = (Map)parms.target;
            bool flag = parms.faction != null && parms.faction.HostileTo(Faction.OfPlayer);

            TunnelRaidUtility.DropThingsNear(parms.spawnCenter, map, pawns.Cast <Thing>(), parms.podOpenDelay, false, true, flag || parms.raidArrivalModeForQuickMilitaryAid, parms.faction);
        }
 // Token: 0x0600738E RID: 29582 RVA: 0x002893F0 File Offset: 0x002875F0
 public static void PlaceTravelingTunnelers(List <ActiveDropPodInfo> dropPods, IntVec3 near, Map map)
 {
     TransportPodsArrivalActionUtility.RemovePawnsFromWorldPawns(dropPods);
     for (int i = 0; i < dropPods.Count; i++)
     {
         IntVec3 c;
         DropCellFinder.TryFindDropSpotNear(near, map, out c, false, true, true, null);
         TunnelRaidUtility.MakeTunnelAt(c, map, dropPods[i]);
     }
 }
Exemplo n.º 3
0
        // Token: 0x060045E0 RID: 17888 RVA: 0x00178498 File Offset: 0x00176698
        public override void Arrive(List <Pawn> pawns, IncidentParms parms)
        {
            Map  map          = (Map)parms.target;
            bool canRoofPunch = parms.faction != null && parms.faction.HostileTo(Faction.OfPlayer);

            for (int i = 0; i < pawns.Count; i++)
            {
                TunnelRaidUtility.DropThingsNear(DropCellFinder.RandomDropSpot(map), map, Gen.YieldSingle <Thing>(pawns[i]), parms.podOpenDelay, false, true, canRoofPunch);
            }
        }
        // Token: 0x060045D7 RID: 17879 RVA: 0x001782AC File Offset: 0x001764AC
        public override void Arrive(List <Pawn> pawns, IncidentParms parms)
        {
            Map  map          = (Map)parms.target;
            bool canRoofPunch = parms.faction != null && parms.faction.HostileTo(Faction.OfPlayer);
            List <Pair <List <Pawn>, IntVec3> > list = PawnsArrivalModeWorkerUtility.SplitIntoRandomGroupsNearMapEdge(pawns, map, true);

            PawnsArrivalModeWorkerUtility.SetPawnGroupsInfo(parms, list);
            for (int i = 0; i < list.Count; i++)
            {
                TunnelRaidUtility.DropThingsNear(list[i].Second, map, list[i].First.Cast <Thing>(), parms.podOpenDelay, false, true, canRoofPunch);
            }
        }
Exemplo n.º 5
0
 // Token: 0x06002763 RID: 10083 RVA: 0x0012C48C File Offset: 0x0012A88C
 public static void DropThingsNear(IntVec3 dropCenter, Map map, IEnumerable <Thing> things, int openDelay = 110, bool canInstaDropDuringInit = false, bool leaveSlag = false, bool canRoofPunch = true, Faction faction = null)
 {
     TunnelRaidUtility.tempList.Clear();
     foreach (Thing item in things)
     {
         List <Thing> list = new List <Thing>
         {
             item
         };
         TunnelRaidUtility.tempList.Add(list);
     }
     TunnelRaidUtility.DropThingGroupsNear(dropCenter, map, TunnelRaidUtility.tempList, openDelay, canInstaDropDuringInit, leaveSlag, canRoofPunch, faction);
     TunnelRaidUtility.tempList.Clear();
 }
Exemplo n.º 6
0
        // Token: 0x06002764 RID: 10084 RVA: 0x0012C518 File Offset: 0x0012A918
        public static void DropThingGroupsNear(IntVec3 dropCenter, Map map, List <List <Thing> > thingsGroups, int openDelay = 110, bool instaDrop = false, bool leaveSlag = false, bool canRoofPunch = true, Faction faction = null)
        {
            foreach (List <Thing> list in thingsGroups)
            {
                List <Thing> list2 = list.Where(x => x.def.thingClass == typeof(Pawn)).ToList();
                IntVec3      intVec;
                if (!DropCellFinder.TryFindDropSpotNear(dropCenter, map, out intVec, true, canRoofPunch))
                {
                    Log.Warning(string.Concat(new object[]
                    {
                        "DropThingsNear failed to find a place to drop ",
                        list.FirstOrDefault <Thing>(),
                        " near ",
                        dropCenter,
                        ". Dropping on random square instead."
                    }), false);
                    intVec = CellFinderLoose.RandomCellWith((IntVec3 c) => c.Walkable(map) && (c.Roofed(map) && c.GetRoof(map) != RoofDefOf.RoofRockThick), map, 1000);
                }
                for (int i = 0; i < list.Count; i++)
                {
                    list[i].SetForbidden(true, false);
                }
                if (instaDrop)
                {
                    foreach (Thing thing in list)
                    {
                        GenPlace.TryPlaceThing(thing, intVec, map, ThingPlaceMode.Near, null, null);
                    }
                }
                else
                {
                    ActiveDropPodInfo activeDropPodInfo = new ActiveDropPodInfo();
                    foreach (Thing item in list)
                    {
                        activeDropPodInfo.innerContainer.TryAddOrTransfer(item, true);
                    }
                    activeDropPodInfo.openDelay = openDelay;
                    activeDropPodInfo.leaveSlag = leaveSlag;

                    TunnelRaidUtility.MakeTunnelAt(intVec, map, activeDropPodInfo, faction);
                }
            }
        }