public override void Decorate(Stencil s) { Stencil.Mask mask = p => TerrainUtility.IsNatural(p.GetTerrain(s.map)); for (var dir = 0; dir < 4; dir++) { var sDir = s.Rotate(dir); sDir.Bound(sDir.MinX - distance, sDir.MaxZ + distance, sDir.MinX / 2, sDir.MaxZ + distance) .Fill(ThingDefOf.Sandbags, mask: mask); sDir.Bound(sDir.MaxX / 2, sDir.MaxZ + distance, sDir.MaxX + distance, sDir.MaxZ + distance) .Fill(ThingDefOf.Sandbags, mask: mask); } }
public override void Generate(Map map, GenStepParams parms) { if (map.Parent is City city && city.Abandoned) { return; } foreach (var pos in map.AllCells) { var things = pos.GetThingList(map); for (var i = things.Count - 1; i >= 0; i--) { var thing = things[i]; if (!TerrainUtility.IsNatural(pos.GetTerrain(map))) { if (thing is Pawn pawn && pawn.AnimalOrWildMan() && !pawn.IsWildMan()) { thing.Destroy(); } } } } }
bool IsValidTile(Map map, IntVec3 pos) { return(TerrainUtility.IsNatural(pos.GetTerrain(map))); }
bool IsValidTile(Map map, IntVec3 pos) { return(TerrainUtility.IsNatural(pos.GetTerrain(map)) && pos.GetFirstThing <Building>(map) == null); // return pos.GetFirstThing<Building>(map) == null; }
bool IsValidSidewalkTerrain(TerrainDef terrain) { return(TerrainUtility.IsNatural(terrain) || terrain == TerrainUtility.Bridge || terrain.IsWater); }
protected virtual bool IsValidTerrain(Map map, TerrainDef terrain) { return(TerrainUtility.IsNaturalExcludingRock(terrain)); }