public void CleanTick() { if (CleaningStationSettings.isDynamicPower()) { float powerFactor = -1f * (500f / (500f + (float)cleanableCells.Count())); compPowerTrader.PowerOutput = (float)Math.Round(CleaningStationSettings.GetPowerConsumption() * cleanableCells.Count() * powerFactor); } if (compPowerTrader.PowerOn) { foreach (IntVec3 cleanMe in cleanableCells) { FilthMaker.RemoveAllFilth(cleanMe, this.Map); } } }
public override void SpawnSetup(Map map, bool respawningAfterLoad) { base.SpawnSetup(map, respawningAfterLoad); this.compPowerTrader = base.GetComp <CompPowerTrader>(); HugsLibController.Instance.DistributedTicker.RegisterTickability(CleanTick, CleaningStationSettings.GetCleanTime(), this); }
public override void DrawGhost(ThingDef def, IntVec3 center, Rot4 rot, Color ghostCol) { Map currentMap = Find.CurrentMap; GenDraw.DrawRadiusRing(center, CleaningStationSettings.GetCleanRadius()); }