Пример #1
0
 public override void TravelingTransportPodsArrived(List <ActiveDropPodInfo> dropPods, Map map)
 {
     if (!DropCellFinder.TryFindRaidDropCenterClose(out IntVec3 spot, map))
     {
         spot = DropCellFinder.FindRaidDropCenterDistant_NewTemp(map);
     }
     TransportPodsArrivalActionUtility.DropTravelingTransportPods(dropPods, spot, map);
 }
Пример #2
0
        public override bool TryResolveRaidSpawnCenter(IncidentParms parms)
        {
            Map map = (Map)parms.target;

            if (!parms.spawnCenter.IsValid)
            {
                parms.spawnCenter = DropCellFinder.FindRaidDropCenterDistant_NewTemp(map);
            }
            parms.spawnRotation = Rot4.Random;
            return(true);
        }
 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, allowRoofed: true), map, allowRoofed: true);
         if (validator(intVec))
         {
             return(intVec);
         }
     }
     return(IntVec3.Invalid);
 }
        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 result2;
                if (arriveInPods)
                {
                    result2 = DropCellFinder.FindRaidDropCenterDistant_NewTemp(map);
                }
                else if (!RCellFinder.TryFindRandomPawnEntryCell(out result2, map, CellFinder.EdgeRoadChance_Hostile))
                {
                    result2 = DropCellFinder.FindRaidDropCenterDistant_NewTemp(map);
                }
                if (!groups.Any())
                {
                    result = result2;
                    break;
                }
                float num2 = float.MaxValue;
                for (int j = 0; j < groups.Count; j++)
                {
                    float num3 = result2.DistanceToSquared(groups[j].Second);
                    if (num3 < num2)
                    {
                        num2 = num3;
                    }
                }
                if (!result.IsValid || num2 > num)
                {
                    num    = num2;
                    result = result2;
                }
            }
            return(result);
        }
        public override void TravelingTransportPodsArrived(List <ActiveDropPodInfo> dropPods, Map map)
        {
            IntVec3 near = DropCellFinder.FindRaidDropCenterDistant_NewTemp(map);

            TransportPodsArrivalActionUtility.DropTravelingTransportPods(dropPods, near, map);
        }