Example #1
0
        public override void SetUpPowerVars()
        {
            base.SetUpPowerVars();
            CompProperties_Pipe props = base.Props;

            this.PowerOutput        = -1f * props.basePowerConsumption;
            this.powerLastOutputted = (props.basePowerConsumption <= 0f);
        }
Example #2
0
        /* public override string CompInspectStringExtra()
         * {
         *   string str;
         *   if (this.powerLastOutputted)
         *   {
         *       str = "VPE_LiquidOutput".Translate() + ": " + this.PowerOutput.ToString("#####0") + " ml";
         *   }
         *   else
         *   {
         *       str = "VPE_NutrientNeeded".Translate() + ": " + (-this.PowerOutput).ToString("#####0") + " ml";
         *   }
         *   return str + "\n" + base.CompInspectStringExtra();
         * }*/

        private void StartSustainerPoweredIfInactive()
        {
            CompProperties_Pipe props = base.Props;

            if (!props.soundAmbientPowered.NullOrUndefined() && this.sustainerPowered == null)
            {
                SoundInfo info = SoundInfo.InMap(this.parent, MaintenanceType.None);
                this.sustainerPowered = props.soundAmbientPowered.TrySpawnSustainer(info);
            }
        }
Example #3
0
 public static bool EverTransmitsGas(Thing thing)
 {
     for (int i = 0; i < thing.def.comps.Count; i++)
     {
         CompProperties_Pipe compProperties_Pipe = thing.def.comps[i] as CompProperties_Pipe;
         if (compProperties_Pipe != null && compProperties_Pipe.transmitsGas)
         {
             return(true);
         }
     }
     return(false);
 }
Example #4
0
        public override void TickRare()
        {
            CompPipeTrader compPipeTrader = this.GetComp <CompPipeTrader>();

            if (compPipeTrader.PowerOn)
            {
                float ambientTemperature = base.AmbientTemperature;
                float num;
                if (ambientTemperature < 20f)
                {
                    num = 1f;
                }
                else if (ambientTemperature > 120f)
                {
                    num = 0f;
                }
                else
                {
                    num = Mathf.InverseLerp(120f, 20f, ambientTemperature);
                }
                float energyLimit         = this.compTempControl.Props.energyPerSecond * num * 4.16666651f;
                float num2                = GenTemperature.ControlTemperatureTempChange(base.Position, base.Map, energyLimit, this.compTempControl.targetTemperature);
                bool  flag                = !Mathf.Approximately(num2, 0f);
                CompProperties_Pipe props = compPipeTrader.Props;
                if (flag)
                {
                    this.GetRoomGroup().Temperature += num2;
                    compPipeTrader.PowerOutput       = -props.basePowerConsumption;
                }
                else
                {
                    compPipeTrader.PowerOutput = -props.basePowerConsumption * this.compTempControl.Props.lowPowerConsumptionFactor;
                }
                this.compTempControl.operatingAtHighPower = flag;
            }
        }