private void DestroyBlight() { //Blight blight = this.PositionHeld.GetPlant(this.MapHeld).Blight; Blight blight = this.PositionHeld.GetFirstBlight(this.MapHeld); if (blight != null) { blight.Destroy(DestroyMode.Vanish); } }
public static Blight GetFirstBlight(this IntVec3 c, Map map) { List <Thing> thingList = c.GetThingList(map); for (int i = 0; i < thingList.Count; i++) { Blight blight = thingList[i] as Blight; if (blight != null) { return(blight); } } return(null); }
public void Print(Blight blight, SectionLayer layer, Graphic newGraphic) { Plant plant = blight.Plant; if (plant != null) { PlantUtility.SetWindExposureColors(Blight.workingColors, plant); } else { Blight.workingColors[0].a = (Blight.workingColors[1].a = (Blight.workingColors[2].a = (Blight.workingColors[3].a = 0))); } float num = Blight.SizeRange.LerpThroughRange(blight.severity); if (plant != null) { float a = newGraphic.drawSize.x * plant.def.plant.visualSizeRange.LerpThroughRange(plant.Growth); num *= Mathf.Min(a, 1f); } num = Mathf.Clamp(num, 0.5f, 0.9f); Printer_Plane.PrintPlane(layer, blight.TrueCenter(), blight.def.graphic.drawSize * num, newGraphic.MatAt(blight.Rotation, blight), 0f, flipUv: false, null, Blight.workingColors, 0.1f); }