Example #1
0
        public override void CompTick()
        {
            base.CompTick();
            bool flag = faction == null;

            if (flag)
            {
                faction = Find.FactionManager.AllFactionsListForReading.FirstOrDefault((Faction x) => x.def.defName.Contains("Neko"));
            }
            bool flag2 = !BreakdownableUtility.IsBrokenDown(parent) && faction != null;

            if (flag2)
            {
                base.PowerOutput = Math.Max(0f, (faction.IsPlayer ? 100f : faction.PlayerGoodwill) * 100f);
            }
            else
            {
                base.PowerOutput = 0f;
            }
        }
        private void DoTickerWork(int tickerAmount)
        {
            bool flag = (this.powerComp == null || this.powerComp.PowerOn);

            if (flag && base.Spawned)
            {
                if (GridsUtility.Roofed(base.Position, this.Map))
                {
                    if (!BreakdownableUtility.IsBrokenDown(this))
                    {
                        SetRoofInRange();
                        ResetRemovedRoof();
                    }
                }
                CompProperties_Power props = powerComp.Props;
                powerComp.PowerOutput = -props.basePowerConsumption;
            }
            else
            {
                // Set roofs that were changed back to being thickRoof
                ResetRoofInRange();
            }
        }