public override void DrawGhost(ThingDef def, IntVec3 center, Rot4 rot, Color ghostCol) { Map currentMap = Find.CurrentMap; // Display potential build cells. foreach (Thing pylon in currentMap.listerThings.ThingsOfDef(Util_LaserFence.LaserFencePylonDef.blueprintDef)) { if (pylon.Position.InHorDistOf(center, Settings.laserFenceMaxRange + 2f)) { Building_LaserFencePylon.DrawPotentialBuildCells(currentMap, pylon.Position); } } foreach (Thing pylon in currentMap.listerThings.ThingsOfDef(Util_LaserFence.LaserFencePylonDef.frameDef)) { if (pylon.Position.InHorDistOf(center, Settings.laserFenceMaxRange + 2f)) { Building_LaserFencePylon.DrawPotentialBuildCells(currentMap, pylon.Position); } } foreach (Thing pylon in currentMap.listerThings.ThingsOfDef(Util_LaserFence.LaserFencePylonDef)) { if (pylon.Position.InHorDistOf(center, Settings.laserFenceMaxRange + 2f)) { Building_LaserFencePylon.DrawPotentialBuildCells(currentMap, pylon.Position); } } }
public override AcceptanceReport AllowsPlacing(BuildableDef checkingDef, IntVec3 loc, Rot4 rot, Map map, Thing thingToIgnore = null) { // Display potential build cells. foreach (Thing pylon in map.listerThings.ThingsOfDef(Util_LaserFence.LaserFencePylonDef.blueprintDef)) { if (pylon.Position.InHorDistOf(loc, 6f)) { Building_LaserFencePylon.DrawPotentialBuildCells(map, pylon.Position); } } foreach (Thing pylon in map.listerThings.ThingsOfDef(Util_LaserFence.LaserFencePylonDef.frameDef)) { if (pylon.Position.InHorDistOf(loc, 6f)) { Building_LaserFencePylon.DrawPotentialBuildCells(map, pylon.Position); } } foreach (Thing pylon in map.listerThings.ThingsOfDef(Util_LaserFence.LaserFencePylonDef)) { if (pylon.Position.InHorDistOf(loc, 6f)) { Building_LaserFencePylon.DrawPotentialBuildCells(map, pylon.Position); } } return(true); }