public override void SetUpPowerVars() { base.SetUpPowerVars(); CompProperties_Pipe props = base.Props; this.PowerOutput = -1f * props.basePowerConsumption; this.powerLastOutputted = (props.basePowerConsumption <= 0f); }
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); } }
public bool EverTransmitsPipe(ThingDef thingdef) { for (int i = 0; i < thingdef.comps.Count; i++) { CompProperties_Pipe compProperties_Pipe = thingdef.comps[i] as CompProperties_Pipe; if (compProperties_Pipe != null && compProperties_Pipe.transmitsPower) { return(true); } } return(false); }