protected override void ScatterAt(IntVec3 c, Map map, int stackCount = 1) { ThingDef thingDef = this.ChooseThingDef(); int numCells = Mathf.CeilToInt((float)this.GetScatterLumpSizeRange(thingDef).RandomInRange * 1.6f); foreach (IntVec3 current in GridShapeMaker.IrregularLump(c, map, numCells)) { map.deepResourceGrid.SetAt(current, thingDef, thingDef.deepCountPerCell); } }
protected override void ScatterAt(IntVec3 c, Map map, int stackCount = 1) { ThingDef thingDef = this.ChooseThingDef(); int numCells = (this.forcedLumpSize <= 0) ? thingDef.building.mineableScatterLumpSizeRange.RandomInRange : this.forcedLumpSize; this.recentLumpCells.Clear(); foreach (IntVec3 item in GridShapeMaker.IrregularLump(c, map, numCells)) { GenSpawn.Spawn(thingDef, item, map); this.recentLumpCells.Add(item); } }
protected override void ScatterAt(IntVec3 c, Map map, int stackCount = 1) { ThingDef thingDef = ChooseThingDef(); int numCells = Mathf.CeilToInt((float)thingDef.deepLumpSizeRange.RandomInRange); foreach (IntVec3 item in GridShapeMaker.IrregularLump(c, map, numCells)) { if (!item.InNoBuildEdgeArea(map)) { map.deepResourceGrid.SetAt(item, thingDef, thingDef.deepCountPerCell); } } }
protected override void ScatterAt(IntVec3 c, Map map, GenStepParams parms, int stackCount = 1) { ThingDef thingDef = ChooseThingDef(); if (thingDef != null) { int numCells = (forcedLumpSize > 0) ? forcedLumpSize : thingDef.building.mineableScatterLumpSizeRange.RandomInRange; recentLumpCells.Clear(); foreach (IntVec3 item in GridShapeMaker.IrregularLump(c, map, numCells)) { GenSpawn.Spawn(thingDef, item, map); recentLumpCells.Add(item); } } }
protected override void ScatterAt(IntVec3 c, Map map, int stackCount = 1) { ThingDef thingDef = this.ChooseThingDef(); if (thingDef == null) { return; } int numCells = (this.forcedLumpSize <= 0) ? thingDef.building.mineableScatterLumpSizeRange.RandomInRange : this.forcedLumpSize; this.recentLumpCells.Clear(); foreach (IntVec3 current in GridShapeMaker.IrregularLump(c, map, numCells)) { GenSpawn.Spawn(thingDef, current, map, WipeMode.Vanish); this.recentLumpCells.Add(current); } }
protected override void DoFind(Pawn worker) { Map map = parent.Map; if (!CellFinderLoose.TryFindRandomNotEdgeCellWith(10, (IntVec3 x) => CanScatterAt(x, map), map, out var result)) { Log.Error("Could not find a center cell for deep scanning lump generation!"); } ThingDef thingDef = ChooseLumpThingDef(); int numCells = Mathf.CeilToInt(thingDef.deepLumpSizeRange.RandomInRange); foreach (IntVec3 item in GridShapeMaker.IrregularLump(result, map, numCells)) { if (CanScatterAt(item, map) && !item.InNoBuildEdgeArea(map)) { map.deepResourceGrid.SetAt(item, thingDef, thingDef.deepCountPerCell); } } string key = ("LetterDeepScannerFoundLump".CanTranslate() ? "LetterDeepScannerFoundLump" : ((!"DeepScannerFoundLump".CanTranslate()) ? "LetterDeepScannerFoundLump" : "DeepScannerFoundLump")); Find.LetterStack.ReceiveLetter("LetterLabelDeepScannerFoundLump".Translate() + ": " + thingDef.LabelCap, key.Translate(thingDef.label, worker.Named("FINDER")), LetterDefOf.PositiveEvent, new LookTargets(result, map)); }