public override void Generate(Map map, GenStepParams parms) { MechClusterSketch sketch = MechClusterGenerator.GenerateClusterSketch(DefaultPointsRange.RandomInRange, map, startDormant: false); IntVec3 center = IntVec3.Invalid; if (MapGenerator.TryGetVar("RectOfInterest", out CellRect var)) { center = var.ExpandedBy(20).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); } }
protected override bool TryCastShot() { if (currentTarget.HasThing && currentTarget.Thing.Map != caster.Map) { return(false); } MechClusterUtility.SpawnCluster(currentTarget.Cell, caster.Map, MechClusterGenerator.GenerateClusterSketch(2500f, caster.Map)); if (base.EquipmentSource != null && !base.EquipmentSource.Destroyed) { base.EquipmentSource.Destroy(); } return(true); }
protected override bool TryExecuteWorker(IncidentParms parms) { Map map = (Map)parms.target; MechClusterSketch sketch = MechClusterGenerator.GenerateClusterSketch(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; }
public override void TryGenerateThreats(IncidentParms parms) { parms.mechClusterSketch = MechClusterGenerator.GenerateClusterSketch(parms.points, parms.target as Map); }