Beispiel #1
0
        public override void Generate(Map map, GenStepParams parms)
        {
            MechClusterSketch sketch = MechClusterGenerator.GenerateClusterSketch_NewTemp(DefaultPointsRange.RandomInRange, map, startDormant: true, forceNoConditionCauser);
            IntVec3           center = IntVec3.Invalid;

            if (MapGenerator.TryGetVar <CellRect>("RectOfInterest", out var var))
            {
                center = var.ExpandedBy(extraRangeToRectOfInterest).MaxBy((IntVec3 x) => MechClusterUtility.GetClusterPositionScore(x, map, sketch));
            }
            if (!center.IsValid)
            {
                center = MechClusterUtility.FindClusterPosition(map, sketch);
            }
            List <Thing> list  = MechClusterUtility.SpawnCluster(center, map, sketch, dropInPods: false);
            List <Pawn>  list2 = new List <Pawn>();

            foreach (Thing item in list)
            {
                if (item is Pawn)
                {
                    list2.Add((Pawn)item);
                }
            }
            if (list2.Any())
            {
                GenStep_SleepingMechanoids.SendMechanoidsToSleepImmediately(list2);
            }
        }
Beispiel #2
0
 protected override bool TryCastShot()
 {
     if (currentTarget.HasThing && currentTarget.Thing.Map != caster.Map)
     {
         return(false);
     }
     MechClusterUtility.SpawnCluster(currentTarget.Cell, caster.Map, MechClusterGenerator.GenerateClusterSketch_NewTemp(2500f, caster.Map, startDormant: true, forceNoConditionCauser: true));
     base.ReloadableCompSource?.UsedOnce();
     return(true);
 }
        protected override bool TryExecuteWorker(IncidentParms parms)
        {
            Map map = (Map)parms.target;
            MechClusterSketch sketch = MechClusterGenerator.GenerateClusterSketch_NewTemp(parms.points, map);
            IntVec3           center = MechClusterUtility.FindClusterPosition(map, sketch, 100, 0.5f);

            if (!center.IsValid)
            {
                return(false);
            }
            IEnumerable <Thing> targets = from t in MechClusterUtility.SpawnCluster(center, map, sketch, dropInPods: true, canAssaultColony: true, parms.questTag)
                                          where t.def != ThingDefOf.Wall && t.def != ThingDefOf.Barricade
                                          select t;

            SendStandardLetter(parms, new LookTargets(targets));
            return(true);
        }
Beispiel #4
0
 public override void TryGenerateThreats(IncidentParms parms)
 {
     parms.mechClusterSketch = MechClusterGenerator.GenerateClusterSketch_NewTemp(parms.points, parms.target as Map);
 }