public override void DrawGhost(ThingDef def, IntVec3 center, Rot4 rot, Color ghostCol, Thing thing = null) { var ownEffectiveRadius = RemoteTechUtility.TryGetExplosiveRadius(def); var map = Find.CurrentMap; if (map == null || ownEffectiveRadius <= 0) { return; } if (Find.Selector.NumSelected <= 1) { // highlight nearby thick mountain roof cells var fogGrid = map.fogGrid; var roofGrid = map.roofGrid; GatherCellsInRadius(center, map, ownEffectiveRadius + AdditionalRoofDisplayRadius, cell => fogGrid.IsFogged(cell) || (roofGrid.RoofAt(cell)?.isThickRoof ?? false) ); OverlayDrawer.DrawFieldEdges(cellBuffer, ThickRoofHighlightColor); void DrawMatchingEdgesAroundThing(Thing t) { GatherCellsInRadius(t.Position, map, ownEffectiveRadius); OverlayDrawer.DrawSolidField(cellBuffer, OtherEffectiveAreasColor); } // highlight effective areas of already built charges of same type var colonistBuildings = map.listerBuildings.allBuildingsColonist; for (var i = 0; i < colonistBuildings.Count; i++) { if (colonistBuildings[i]?.def == def) { DrawMatchingEdgesAroundThing(colonistBuildings[i]); } } // highlight effective areas of blueprints for charges of same type var blueprints = map.listerThings.ThingsMatching(ThingRequest.ForGroup(ThingRequestGroup.Blueprint)); for (var i = 0; i < blueprints.Count; i++) { if (blueprints[i]?.def?.entityDefToBuild == def) { DrawMatchingEdgesAroundThing(blueprints[i]); } } } // highlight own effective radius with color-coded effectiveness var effectiveRadiusColor = RemoteTechUtility.IsEffectiveRoofBreakerPlacement(ownEffectiveRadius, center, map, true) ? EffectivePlacementColor : IneffectivePlacementColor; GatherCellsInRadius(center, map, ownEffectiveRadius); OverlayDrawer.DrawFieldEdges(cellBuffer, effectiveRadiusColor); }