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: 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)
 {
     InfiltrateUtility.tempList.Clear();
     foreach (Thing item in things)
     {
         List <Thing> list = new List <Thing>
         {
             item
         };
         InfiltrateUtility.tempList.Add(list);
     }
     InfiltrateUtility.DropThingGroupsNear(dropCenter, map, InfiltrateUtility.tempList, openDelay, canInstaDropDuringInit, leaveSlag, canRoofPunch);
     InfiltrateUtility.tempList.Clear();
 }