public void RevealInfiltrators(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))
         {
             if (RCellFinder.TryFindRandomSpotJustOutsideColony(dropCenter, map, out dropCenter))
             {
                 InfiltrateUtility.DropThingsNear(dropCenter, map, Gen.YieldSingle <Thing>(pawns[i]), 50, true, false, true);
             }
             else
             {
                 InfiltrateUtility.DropThingsNear(dropCenter, map, Gen.YieldSingle <Thing>(pawns[i]), 50, true, false, true);
             }
         }
         else
         {
             dropCenter = DropCellFinder.FindRaidDropCenterDistant_NewTemp(map, true);
             if (RCellFinder.TryFindRandomSpotJustOutsideColony(dropCenter, map, out dropCenter))
             {
                 InfiltrateUtility.DropThingsNear(dropCenter, map, Gen.YieldSingle <Thing>(pawns[i]), 50, true, false, true);
             }
             else
             {
                 InfiltrateUtility.DropThingsNear(dropCenter, map, Gen.YieldSingle <Thing>(pawns[i]), 50, true, false, true);
             }
         }
     }
     Find.LetterStack.ReceiveLetter("AdeptusMechanicus.Infiltrators_Revealed".Translate(pawns.Find(x => x.Faction != null).Faction.def.pawnSingular), "AdeptusMechanicus.Infiltrators_Revealed_Letter".Translate(pawns.Find(x => x.Faction != null).Faction.def.pawnsPlural), LetterDefOf.ThreatBig, pawns, pawns.Find(x => x.Faction != null).Faction, null);
     //    Messages.Message("AdeptusMechanicus.Infiltrators_Revealed".Translate(pawns.Find(x=> x.Faction!=null).Faction.Name), pawns, MessageTypeDefOf.ThreatBig);
 }
Esempio n. 2
0
        // Token: 0x060045CC RID: 17868 RVA: 0x001780D4 File Offset: 0x001762D4
        public override void TravelingTransportPodsArrived(List <ActiveDropPodInfo> dropPods, Map map)
        {
            IntVec3 near;

            if (!DropCellFinder.TryFindRaidDropCenterClose(out near, map, true, true, true, -1))
            {
                near = DropCellFinder.FindRaidDropCenterDistant_NewTemp(map, false);
            }
            TunnelsArrivalActionUtility.PlaceTravelingTunnelers(dropPods, near, map);
        }
        // Token: 0x060045D5 RID: 17877 RVA: 0x0017826C File Offset: 0x0017646C
        public override bool TryResolveRaidSpawnCenter(IncidentParms parms)
        {
            Map map = (Map)parms.target;

            if (!parms.spawnCenter.IsValid)
            {
                parms.spawnCenter = DropCellFinder.FindRaidDropCenterDistant_NewTemp(map, false);
            }
            parms.spawnRotation = Rot4.Random;
            return(true);
        }
 // Token: 0x06003B20 RID: 15136 RVA: 0x001373B8 File Offset: 0x001355B8
 private static IntVec3 FindDropPodLocation(Map map, Predicate <IntVec3> validator)
 {
     for (int i = 0; i < 200; i++)
     {
         IntVec3 intVec = RCellFinder.FindSiegePositionFrom_NewTemp(DropCellFinder.FindRaidDropCenterDistant_NewTemp(map, true), map, true);
         if (validator(intVec))
         {
             return(intVec);
         }
     }
     return(IntVec3.Invalid);
 }
Esempio n. 5
0
        // Token: 0x060045EE RID: 17902 RVA: 0x00178914 File Offset: 0x00176B14
        private static IntVec3 FindNewMapEdgeGroupCenter(Map map, List <Pair <List <Pawn>, IntVec3> > groups, bool arriveInPods)
        {
            IntVec3 result = IntVec3.Invalid;
            float   num    = 0f;

            for (int i = 0; i < 4; i++)
            {
                IntVec3 intVec;
                if (arriveInPods)
                {
                    intVec = DropCellFinder.FindRaidDropCenterDistant_NewTemp(map, false);
                }
                else if (!RCellFinder.TryFindRandomPawnEntryCell(out intVec, map, CellFinder.EdgeRoadChance_Hostile, false, null))
                {
                    intVec = DropCellFinder.FindRaidDropCenterDistant_NewTemp(map, false);
                }
                if (!groups.Any <Pair <List <Pawn>, IntVec3> >())
                {
                    result = intVec;
                    break;
                }
                float num2 = float.MaxValue;
                for (int j = 0; j < groups.Count; j++)
                {
                    float num3 = (float)intVec.DistanceToSquared(groups[j].Second);
                    if (num3 < num2)
                    {
                        num2 = num3;
                    }
                }
                if (!result.IsValid || num2 > num)
                {
                    num    = num2;
                    result = intVec;
                }
            }
            return(result);
        }