public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag) { go.AddOrGet <Reservoir>(); Storage storage = BuildingTemplates.CreateDefaultStorage(go, false); storage.showDescriptor = true; storage.allowItemRemoval = false; storage.storageFilters = STORAGEFILTERS.GASES; storage.capacityKg = HighFlowStorageConfig.Config.Gas5StorageCapacity; storage.SetDefaultStoredItemModifiers(GasReservoirConfig.ReservoirStoredItemModifiers); go.AddComponent <HighFlowStorage_PortConduitDispenser>().AssignPort(outputPort0); go.AddComponent <HighFlowStorage_PortConduitDispenser>().AssignPort(outputPort1); go.AddComponent <HighFlowStorage_PortConduitDispenser>().AssignPort(outputPort2); go.AddComponent <HighFlowStorage_PortConduitDispenser>().AssignPort(outputPort3); go.AddComponent <HighFlowStorage_PortConduitDispenser>().AssignPort(outputPort4); foreach (PortDisplayInput port in inputPorts) { PortConduitConsumer consumer = go.AddComponent <PortConduitConsumer>(); consumer.ignoreMinMassCheck = true; consumer.forceAlwaysSatisfied = true; consumer.alwaysConsume = true; consumer.capacityKG = storage.capacityKg; consumer.AssignPort(port); } go.AddComponent <HighFlowStorage.BuildingColor>().color = BuildingColor(); this.AttachPort(go); }
public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag) { go.AddOrGet <Reservoir>(); Storage storage = BuildingTemplates.CreateDefaultStorage(go, false); storage.showDescriptor = true; storage.allowItemRemoval = false; storage.storageFilters = STORAGEFILTERS.LIQUIDS; storage.capacityKg = HighFlowStorageConfig.Config.liquidStorageCapacity; storage.SetDefaultStoredItemModifiers(GasReservoirConfig.ReservoirStoredItemModifiers); PortConduitDispenser conduitDispenser0 = go.AddComponent <HighFlowStorage_PortConduitDispenser>(); conduitDispenser0.AssignPort(outputPort0); PortConduitDispenser conduitDispenser1 = go.AddComponent <HighFlowStorage_PortConduitDispenser>(); conduitDispenser1.AssignPort(outputPort1); PortConduitDispenser conduitDispenser2 = go.AddComponent <HighFlowStorage_PortConduitDispenser>(); conduitDispenser2.AssignPort(outputPort2); PortConduitConsumer consumer0 = go.AddComponent <PortConduitConsumer>(); consumer0.conduitType = ConduitType.Liquid; consumer0.ignoreMinMassCheck = true; consumer0.forceAlwaysSatisfied = true; consumer0.alwaysConsume = true; consumer0.capacityKG = storage.capacityKg; consumer0.AssignPort(inputPort0); PortConduitConsumer consumer1 = go.AddComponent <PortConduitConsumer>(); consumer1.conduitType = ConduitType.Liquid; consumer1.ignoreMinMassCheck = true; consumer1.forceAlwaysSatisfied = true; consumer1.alwaysConsume = true; consumer1.capacityKG = storage.capacityKg; consumer1.AssignPort(inputPort1); PortConduitConsumer consumer2 = go.AddComponent <PortConduitConsumer>(); consumer2.conduitType = ConduitType.Liquid; consumer2.ignoreMinMassCheck = true; consumer2.forceAlwaysSatisfied = true; consumer2.alwaysConsume = true; consumer2.capacityKG = storage.capacityKg; consumer2.AssignPort(inputPort2); go.AddComponent <HighFlowStorage.BuildingColor>().color = BuildingColor(); this.AttachPort(go); }