コード例 #1
0
        public override void DoPostConfigureComplete(GameObject go)
        {
            //go.AddOrGetDef<StorageController.Def>();

            GeneratedBuildings.RegisterSingleLogicInputPort(go);
            go.AddOrGet <LogicOperationalController>();
            go.AddOrGet <EnergyConsumer>();
            go.AddOrGet <RotatablePump>();
            Storage storage = go.AddOrGet <Storage>();

            storage.capacityKg = WallPumpsConfig.GetConfig().gasWallPump.pumpRate * 2;
            RotatableElementConsumer elementConsumer = go.AddOrGet <RotatableElementConsumer>();

            elementConsumer.configuration       = ElementConsumer.Configuration.AllGas;
            elementConsumer.consumptionRate     = WallPumpsConfig.GetConfig().gasWallPump.pumpRate;
            elementConsumer.storeOnConsume      = true;
            elementConsumer.showInStatusPanel   = false;
            elementConsumer.rotatableCellOffset = new Vector3(0, 1);
            elementConsumer.consumptionRadius   = 2;
            ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

            conduitDispenser.conduitType    = ConduitType.Gas;
            conduitDispenser.alwaysDispense = true;
            conduitDispenser.elementFilter  = null;
            go.AddOrGetDef <OperationalController.Def>();
            AddVisualizer(go, false);

            GeneratedBuildings.RemoveLoopingSounds(go);
        }
コード例 #2
0
        // Token: 0x0600606B RID: 24683 RVA: 0x001D97E8 File Offset: 0x001D7BE8
        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       = BigStorageConfigMod._configManager.Config.BigLiquidStorageCapacity;
            storage.SetDefaultStoredItemModifiers(GasReservoirConfig.ReservoirStoredItemModifiers);
            storage.showCapacityStatusItem   = true;
            storage.showCapacityAsMainStatus = true;
            go.AddOrGet <SmartReservoir>();
            ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>();

            conduitConsumer.conduitType          = ConduitType.Liquid;
            conduitConsumer.ignoreMinMassCheck   = true;
            conduitConsumer.forceAlwaysSatisfied = true;
            conduitConsumer.alwaysConsume        = true;
            conduitConsumer.capacityKG           = storage.capacityKg;
            ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

            conduitDispenser.conduitType   = ConduitType.Liquid;
            conduitDispenser.elementFilter = null;
        }
コード例 #3
0
    public override void DoPostConfigureComplete(GameObject go)
    {
        GeneratedBuildings.RegisterLogicPorts(go, LiquidReservoirSmartConfig.OUTPUT_PORT);
        SoundEventVolumeCache.instance.AddVolume("storagelocker_kanim", "StorageLocker_Hit_metallic_low", TUNING.NOISE_POLLUTION.NOISY.TIER1);
        Prioritizable.AddRef(go);

        Storage storage = go.AddOrGet <Storage>();

        storage.showInUI          = true;
        storage.allowItemRemoval  = true;
        storage.showDescriptor    = true;
        storage.storageFilters    = STORAGEFILTERS.LIQUIDS;
        storage.storageFullMargin = TUNING.STORAGE.STORAGE_LOCKER_FILLED_MARGIN;
        storage.fetchCategory     = Storage.FetchCategory.GeneralStorage;
        storage.capacityKg        = 100000f;
        storage.SetDefaultStoredItemModifiers(GasReservoirConfig.ReservoirStoredItemModifiers);

        ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>();

        conduitConsumer.conduitType          = ConduitType.Liquid;
        conduitConsumer.ignoreMinMassCheck   = true;
        conduitConsumer.forceAlwaysSatisfied = true;
        conduitConsumer.alwaysConsume        = true;
        conduitConsumer.capacityKG           = storage.capacityKg;
        ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

        conduitDispenser.conduitType   = ConduitType.Liquid;
        conduitDispenser.elementFilter = (SimHashes[])null;

        go.AddOrGet <LiquidReservoirSmart>();
        go.AddOrGetDef <StorageController.Def>();    //plays animations
    }
コード例 #4
0
 public Instance(Shower master)
     : base(master)
 {
     operational = master.GetComponent <Operational>();
     consumer    = master.GetComponent <ConduitConsumer>();
     dispenser   = master.GetComponent <ConduitDispenser>();
 }
コード例 #5
0
 public SMInstance(PipedAlgaeTerrarium master)
     : base(master)
 {
     this.operational = master.GetComponent <Operational>();
     this.converter   = master.GetComponent <ElementConverter>();
     this.dispenser   = master.GetComponent <ConduitDispenser>();
 }
コード例 #6
0
    public override void DoPostConfigureComplete(GameObject go)
    {
        GeneratedBuildings.RegisterLogicPorts(go, LogicOperationalController.INPUT_PORTS_0_1);
        go.AddOrGet <LogicOperationalController>();
        go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.IndustrialMachinery, false);
        go.AddOrGet <LoopingSounds>();
        go.AddOrGet <EnergyConsumer>();
        go.AddOrGet <Pump>();
        Storage storage = go.AddOrGet <Storage>();

        storage.capacityKg = 1f;
        ElementConsumer elementConsumer = go.AddOrGet <ElementConsumer>();

        elementConsumer.configuration     = ElementConsumer.Configuration.AllGas;
        elementConsumer.consumptionRate   = 0.5f;
        elementConsumer.storeOnConsume    = true;
        elementConsumer.showInStatusPanel = false;
        elementConsumer.consumptionRadius = 2;
        ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

        conduitDispenser.conduitType    = ConduitType.Gas;
        conduitDispenser.alwaysDispense = true;
        conduitDispenser.elementFilter  = null;
        go.AddOrGetDef <OperationalController.Def>();
    }
コード例 #7
0
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            go.AddOrGet <DropAllWorkable>();
            go.AddOrGet <BuildingComplete>().isManuallyOperated = true;
            GlassForge inductor = go.AddOrGet <GlassForge>();

            inductor.sideScreenStyle = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid;
            go.AddOrGet <CopyBuildingSettings>();
            ComplexFabricatorWorkable complexFabricatorWorkable = go.AddOrGet <ComplexFabricatorWorkable>();

            inductor.duplicantOperated = false;
            BuildingTemplates.CreateComplexFabricatorStorage(go, inductor);
            inductor.outStorage.capacityKg = 2000f;
            inductor.storeProduced         = true;
            inductor.inStorage.SetDefaultStoredItemModifiers(InductorConfig.RefineryStoredItemModifiers);
            inductor.buildStorage.SetDefaultStoredItemModifiers(InductorConfig.RefineryStoredItemModifiers);
            inductor.outStorage.SetDefaultStoredItemModifiers(InductorConfig.RefineryStoredItemModifiers);
            inductor.outputOffset = new Vector3(1f, 0.5f);

            complexFabricatorWorkable.overrideAnims = new KAnimFile[]
            {
                Assets.GetAnim("anim_interacts_metalrefinery_kanim")
            };

            inductor.resultState = ComplexFabricator.ResultState.Melted;
            ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

            conduitDispenser.storage        = inductor.outStorage;
            conduitDispenser.conduitType    = ConduitType.Liquid;
            conduitDispenser.elementFilter  = null;
            conduitDispenser.alwaysDispense = true;

            this.ConfigureRecipes();
            Prioritizable.AddRef(go);
        }
コード例 #8
0
        //ConfigureBuildingTemplate from rafinnery example
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.IndustrialMachinery, false);
            go.AddOrGet <BuildingComplete>().isManuallyOperated = true;
            HeliumExtractor heliumExtractor = go.AddOrGet <HeliumExtractor>();

            heliumExtractor.overpressureMass = 10f;
            ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>();

            conduitConsumer.conduitType          = ConduitType.Gas;
            conduitConsumer.consumptionRate      = totalConversion;
            conduitConsumer.capacityTag          = SimHashes.Methane.CreateTag();
            conduitConsumer.wrongElementResult   = ConduitConsumer.WrongElementResult.Dump;
            conduitConsumer.capacityKG           = 10f;
            conduitConsumer.forceAlwaysSatisfied = true;


            ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

            conduitDispenser.conduitType         = ConduitType.Gas;
            conduitDispenser.invertElementFilter = true;
            conduitDispenser.elementFilter       = new SimHashes[]
            {
                SimHashes.Methane,
                SimHashes.Propane
            };

            ConduitDispenser conduitDispenser2 = go.AddComponent <ConduitDispenser>();

            conduitDispenser2.conduitType         = ConduitType.Gas;
            conduitDispenser2.invertElementFilter = true;
            conduitDispenser2.elementFilter       = new SimHashes[]
            {
                SimHashes.Methane,
                SimHashes.Helium
            };
            conduitDispenser2.useSecondaryOutput = true;


            ConduitSecondaryOutput secondOutput = go.AddOrGet <ConduitSecondaryOutput>();

            secondOutput.portInfo = secondaryPort;

            Storage storage = go.AddOrGet <Storage>();

            storage.showInUI = true;
            ElementConverter elementConverter = go.AddOrGet <ElementConverter>();

            elementConverter.consumedElements = new ElementConverter.ConsumedElement[]
            {
                new ElementConverter.ConsumedElement(SimHashes.Methane.CreateTag(), totalConversion)
            };
            elementConverter.outputElements = new ElementConverter.OutputElement[]
            {
                new ElementConverter.OutputElement(heliumConversionRate, SimHashes.Sulfur, 350.15f, false, false),
                new ElementConverter.OutputElement(heliumConversionRate, SimHashes.Helium, 80.15f, false, true),
                new ElementConverter.OutputElement(propaneConversionRate, SimHashes.Propane, 81.15f, false, true)
            };
            Prioritizable.AddRef(go);
        }
コード例 #9
0
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.IndustrialMachinery);
            var energyGenerator = go.AddOrGet <EnergyGenerator>();

            energyGenerator.formula = EnergyGenerator.CreateSimpleFormula(SimHashes.RefinedCarbon.CreateTag(), 1f, 600f,
                                                                          SimHashes.CarbonDioxide, 0.25f, true, CellOffset.none, 700f);
            energyGenerator.meterOffset = Meter.Offset.Behind;
            energyGenerator.SetSliderValue(50f, 0);
            energyGenerator.powerDistributionOrder = 9;
            var storage = go.AddOrGet <Storage>();

            storage.capacityKg = 600f;
            go.AddOrGet <LoopingSounds>();
            Prioritizable.AddRef(go);
            var manualDeliveryKg = go.AddOrGet <ManualDeliveryKG>();

            manualDeliveryKg.SetStorage(storage);
            manualDeliveryKg.requestedItemTag = SimHashes.RefinedCarbon.CreateTag();
            manualDeliveryKg.capacity         = storage.capacityKg;
            manualDeliveryKg.refillMass       = 100f;
            manualDeliveryKg.choreTypeIDHash  = Db.Get().ChoreTypes.PowerFetch.IdHash;
            Tinkerable.MakePowerTinkerable(go);

            ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

            conduitDispenser.conduitType         = ConduitType.Gas;
            conduitDispenser.invertElementFilter = false;
            conduitDispenser.elementFilter       = new []
            {
                SimHashes.CarbonDioxide
            };
        }
コード例 #10
0
        protected override void OnSpawn()
        {
            base.OnSpawn();
            // вторичные входы и выходы для керосина и отходов
            fuelTag                  = SimHashes.Petroleum.CreateTag();
            fuelInputCell            = GetSecondaryUtilityCell(fuelPortInfo.offset);
            fuelConsumer             = CreateConduitConsumer(ConduitType.Liquid, fuelInputCell, out fuelNetworkItem);
            fuelConsumer.capacityTag = fuelTag;
            fuelConsumer.capacityKG  = SuitRechargerConfig.FUEL_CAPACITY;

            liquidWasteOutputCell = GetSecondaryUtilityCell(liquidWastePortInfo.offset);
            liquidWasteDispenser  = CreateConduitDispenser(ConduitType.Liquid, liquidWasteOutputCell, out liquidWasteNetworkItem);
            liquidWasteDispenser.elementFilter       = new SimHashes[] { SimHashes.Petroleum };
            liquidWasteDispenser.invertElementFilter = true;

            gasWasteOutputCell = GetSecondaryUtilityCell(gasWastePortInfo.offset);
            gasWasteDispenser  = CreateConduitDispenser(ConduitType.Gas, gasWasteOutputCell, out gasWasteNetworkItem);
            gasWasteDispenser.elementFilter       = new SimHashes[] { SimHashes.Oxygen };
            gasWasteDispenser.invertElementFilter = true;

            // создаём метеры
            oxygenMeter = new MeterController(GetComponent <KBatchedAnimController>(), "meter_target", "meter", Meter.Offset.Infront, Grid.SceneLayer.NoLayer, new string[] { "meter_target" });
            fuelMeter   = new MeterController(GetComponent <KBatchedAnimController>(), "meter_target_fuel", "meter_fuel", Meter.Offset.Infront, Grid.SceneLayer.NoLayer, new string[] { "meter_target_fuel" });

            Subscribe((int)GameHashes.ConduitConnectionChanged, CheckPipesDelegate);
            Subscribe((int)GameHashes.OnStorageChange, OnStorageChangeDelegate);
            Subscribe((int)GameHashes.CopySettings, OnCopySettingsDelegate);
            Game.Instance.liquidConduitFlow.AddConduitUpdater(OnLiquidConduitUpdate, ConduitFlowPriority.Default);
            Game.Instance.gasConduitFlow.AddConduitUpdater(OnGasConduitUpdate, ConduitFlowPriority.Default);
            OnStorageChange();
            smi.StartSM();
        }
コード例 #11
0
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            Debug.Log("=== GasReservoirSmart.ConfigureBuildingTemplate ===");
            Storage storage = BuildingTemplates.CreateDefaultStorage(go);

            storage.showDescriptor   = true;
            storage.allowItemRemoval = false;
            storage.storageFilters   = STORAGEFILTERS.GASES;
            storage.capacityKg       = 90.0f;
            storage.SetDefaultStoredItemModifiers(GasReservoirConfig.ReservoirStoredItemModifiers);

            go.AddOrGet <ReservoirSmart>();

            ConduitConsumer cc = go.AddOrGet <ConduitConsumer>();

            cc.conduitType          = ConduitType.Gas;
            cc.ignoreMinMassCheck   = true;
            cc.forceAlwaysSatisfied = true;
            cc.alwaysConsume        = true;
            cc.capacityKG           = storage.capacityKg;

            ConduitDispenser cd = go.AddOrGet <ConduitDispenser>();

            cd.conduitType   = ConduitType.Gas;
            cd.elementFilter = null;
        }
コード例 #12
0
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            go.AddOrGet <LoopingSounds>();
            go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.WashStation);
            go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.AdvancedWashStation);
            Shower shower = go.AddOrGet <Shower>();

            shower.overrideAnims = new KAnimFile[1]
            {
                Assets.GetAnim((HashedString)"anim_interacts_shower_kanim")
            };
            shower.workTime                 = 15f;
            shower.outputTargetElement      = SimHashes.DirtyWater;
            shower.fractionalDiseaseRemoval = 0.95f;
            shower.absoluteDiseaseRemoval   = -2000;
            shower.workLayer                = Grid.SceneLayer.BuildingFront;
            shower.trackUses                = true;
            ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>();

            conduitConsumer.conduitType        = ConduitType.Liquid;
            conduitConsumer.capacityTag        = ElementLoader.FindElementByHash(SimHashes.Water).tag;
            conduitConsumer.wrongElementResult = ConduitConsumer.WrongElementResult.Store;
            conduitConsumer.capacityKG         = 5f;
            ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

            conduitDispenser.conduitType         = ConduitType.Liquid;
            conduitDispenser.invertElementFilter = true;
            conduitDispenser.elementFilter       = new SimHashes[1]
            {
                SimHashes.Water
            };
            ElementConverter elementConverter = go.AddOrGet <ElementConverter>();

            elementConverter.consumedElements = new ElementConverter.ConsumedElement[2]
            {
                new ElementConverter.ConsumedElement(new Tag("Water"), 1f),
                new ElementConverter.ConsumedElement(SimHashes.BleachStone.CreateTag(), 0.0005f),
            };
            elementConverter.outputElements = new ElementConverter.OutputElement[1]
            {
                new ElementConverter.OutputElement(1f, SimHashes.DirtyWater, 0.0f, true, 0.0f, 0.5f, true, 0f, 0, 0)
            };
            Storage storage = go.AddOrGet <Storage>();

            storage.capacityKg = 12f;
            storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
            go.AddOrGet <RequireOutputs>().ignoreFullPipe = true;

            ManualDeliveryKG manualDeliveryKg1 = go.AddOrGet <ManualDeliveryKG>();

            manualDeliveryKg1.SetStorage(storage);
            manualDeliveryKg1.requestedItemTag = SimHashes.BleachStone.CreateTag();
            manualDeliveryKg1.capacity         = 2f;
            manualDeliveryKg1.refillMass       = 1f;
            manualDeliveryKg1.minimumMass      = 1f;
            manualDeliveryKg1.choreTypeIDHash  = Db.Get().ChoreTypes.FetchCritical.IdHash;
        }
コード例 #13
0
    public void OnLaunch(object data)
    {
        ReserveResources();
        ConduitDispenser component = GetComponent <ConduitDispenser>();

        if ((UnityEngine.Object)component != (UnityEngine.Object)null)
        {
            component.conduitType = ConduitType.None;
        }
    }
コード例 #14
0
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.IndustrialMachinery, false);
        Storage storage = go.AddOrGet <Storage>();

        storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
        storage.showInUI = true;
        Desalinator desalinator = go.AddOrGet <Desalinator>();

        desalinator.maxSalt = 945f;
        ElementConverter elementConverter = go.AddComponent <ElementConverter>();

        elementConverter.consumedElements = new ElementConverter.ConsumedElement[1]
        {
            new ElementConverter.ConsumedElement(new Tag("SaltWater"), 5f)
        };
        elementConverter.outputElements = new ElementConverter.OutputElement[2]
        {
            new ElementConverter.OutputElement(4.65f, SimHashes.Water, 0f, false, true, 0f, 0.5f, 0.75f, byte.MaxValue, 0),
            new ElementConverter.OutputElement(0.35f, SimHashes.Salt, 0f, false, true, 0f, 0.5f, 0.25f, byte.MaxValue, 0)
        };
        ElementConverter elementConverter2 = go.AddComponent <ElementConverter>();

        elementConverter2.consumedElements = new ElementConverter.ConsumedElement[1]
        {
            new ElementConverter.ConsumedElement(new Tag("Brine"), 5f)
        };
        elementConverter2.outputElements = new ElementConverter.OutputElement[2]
        {
            new ElementConverter.OutputElement(3.5f, SimHashes.Water, 313.15f, false, true, 0f, 0.5f, 0.75f, byte.MaxValue, 0),
            new ElementConverter.OutputElement(1.5f, SimHashes.Salt, 313.15f, false, true, 0f, 0.5f, 0.25f, byte.MaxValue, 0)
        };
        DesalinatorWorkableEmpty desalinatorWorkableEmpty = go.AddOrGet <DesalinatorWorkableEmpty>();

        desalinatorWorkableEmpty.workTime  = 90f;
        desalinatorWorkableEmpty.workLayer = Grid.SceneLayer.BuildingFront;
        ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>();

        conduitConsumer.conduitType          = ConduitType.Liquid;
        conduitConsumer.consumptionRate      = 10f;
        conduitConsumer.capacityKG           = 20f;
        conduitConsumer.capacityTag          = GameTags.AnyWater;
        conduitConsumer.forceAlwaysSatisfied = true;
        conduitConsumer.wrongElementResult   = ConduitConsumer.WrongElementResult.Store;
        ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

        conduitDispenser.conduitType         = ConduitType.Liquid;
        conduitDispenser.invertElementFilter = true;
        conduitDispenser.elementFilter       = new SimHashes[2]
        {
            SimHashes.SaltWater,
            SimHashes.Brine
        };
        Prioritizable.AddRef(go);
    }
コード例 #15
0
            public static void Postfix(GameObject go)
            {
                AddGasGenerator(go);
                // remove the existing dispenser because it is messing up the CO2 output and it's no longer needed
                ConduitDispenser conduitDispenser = go.GetComponent <ConduitDispenser>();

                if (conduitDispenser != null)
                {
                    UnityEngine.Object.DestroyImmediate(conduitDispenser);
                }
            }
コード例 #16
0
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.IndustrialMachinery, false);

            Storage storage = go.AddOrGet <Storage>();

            storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
            storage.showInUI   = false;
            storage.capacityKg = 20f;

            go.AddOrGet <LoopingSounds>();
            go.AddOrGet <Quarry>();

            ElementConverter elementConverter1 = go.AddComponent <ElementConverter>();

            elementConverter1.consumedElements = new ElementConverter.ConsumedElement[] {
                new ElementConverter.ConsumedElement("Water", WATER_INPUT_RATE)
            };
            elementConverter1.outputElements = new ElementConverter.OutputElement[]
            {
                new ElementConverter.OutputElement(DIRTY_WATER_OUTPUT_RATE, SimHashes.DirtyWater,
                                                   minOutputTemperature: 0.0f,
                                                   useEntityTemperature: true,
                                                   storeOutput: true,
                                                   outputElementOffsetx: 0.0f,
                                                   outputElementOffsety: 0.5f,
                                                   0.75f, byte.MaxValue, 0),
                new ElementConverter.OutputElement(ORE_OUTPUT_RATE, SimHashes.IronOre,
                                                   minOutputTemperature: 0.0f,
                                                   useEntityTemperature: true,
                                                   storeOutput: false,
                                                   outputElementOffsetx: 0.0f,
                                                   outputElementOffsety: 0.5f,
                                                   1f, byte.MaxValue, 0)
            };

            ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>();

            conduitConsumer.conduitType          = ConduitType.Liquid;
            conduitConsumer.consumptionRate      = 10f;
            conduitConsumer.capacityKG           = 20f;
            conduitConsumer.capacityTag          = GameTags.Water;
            conduitConsumer.forceAlwaysSatisfied = true;
            conduitConsumer.wrongElementResult   = ConduitConsumer.WrongElementResult.Dump;

            ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

            conduitDispenser.conduitType   = ConduitType.Liquid;
            conduitDispenser.elementFilter = new SimHashes[1] {
                SimHashes.DirtyWater
            };
        }
コード例 #17
0
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            go.AddOrGet <LoopingSounds>();
            go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.IndustrialMachinery);

            Storage storage = BuildingTemplates.CreateDefaultStorage(go);

            storage.showInUI   = true;
            storage.capacityKg = 30000f;
            storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);

            go.AddOrGet <PipedDeodorizer>();

            ElementConverter elementConverter = go.AddOrGet <ElementConverter>();

            elementConverter.consumedElements = new ElementConverter.ConsumedElement[1]
            {
                new ElementConverter.ConsumedElement(SimHashes.ContaminatedOxygen.CreateTag(), AIR_INPUT_RATE),
            };
            elementConverter.outputElements = new ElementConverter.OutputElement[2]
            {
                new ElementConverter.OutputElement(AIR_OUTPUT_RATE, SimHashes.Oxygen, 0f, useEntityTemperature: false, storeOutput: true),
                new ElementConverter.OutputElement(DIRT_OUTPUT_RATE, SimHashes.ToxicSand, 0f, useEntityTemperature: false, storeOutput: true)
            };

            ElementDropper elementDropper = go.AddComponent <ElementDropper>();

            elementDropper.emitMass   = 10f;
            elementDropper.emitTag    = new Tag("ToxicSand");
            elementDropper.emitOffset = new Vector3(1f, 1f, 0f);

            ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>();

            conduitConsumer.conduitType          = ConduitType.Gas;
            conduitConsumer.consumptionRate      = AIR_INPUT_RATE;
            conduitConsumer.capacityKG           = 2 * AIR_INPUT_RATE;
            conduitConsumer.capacityTag          = GameTags.Breathable;   // ElementLoader.FindElementByHash(SimHashes.ContaminatedOxygen).tag;
            conduitConsumer.wrongElementResult   = ConduitConsumer.WrongElementResult.Dump;
            conduitConsumer.forceAlwaysSatisfied = true;

            ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

            conduitDispenser.conduitType         = ConduitType.Gas;
            conduitDispenser.alwaysDispense      = true;
            conduitDispenser.invertElementFilter = true;
            conduitDispenser.elementFilter       = new SimHashes[]
            {
                SimHashes.ContaminatedOxygen
            };

            go.AddOrGet <KBatchedAnimController>().randomiseLoopedOffset = true;
        }
コード例 #18
0
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        go.AddOrGet <DropAllWorkable>();
        go.AddOrGet <BuildingComplete>().isManuallyOperated = true;
        GlassForge glassForge = go.AddOrGet <GlassForge>();

        glassForge.sideScreenStyle = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid;
        go.AddOrGet <FabricatorIngredientStatusManager>();
        go.AddOrGet <CopyBuildingSettings>();
        ComplexFabricatorWorkable complexFabricatorWorkable = go.AddOrGet <ComplexFabricatorWorkable>();

        glassForge.duplicantOperated = true;
        BuildingTemplates.CreateComplexFabricatorStorage(go, glassForge);
        glassForge.outStorage.capacityKg = 2000f;
        glassForge.storeProduced         = true;
        glassForge.inStorage.SetDefaultStoredItemModifiers(RefineryStoredItemModifiers);
        glassForge.buildStorage.SetDefaultStoredItemModifiers(RefineryStoredItemModifiers);
        glassForge.outStorage.SetDefaultStoredItemModifiers(RefineryStoredItemModifiers);
        glassForge.outputOffset = new Vector3(1f, 0.5f);
        complexFabricatorWorkable.overrideAnims = new KAnimFile[1]
        {
            Assets.GetAnim("anim_interacts_metalrefinery_kanim")
        };
        glassForge.resultState = ComplexFabricator.ResultState.Melted;
        ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

        conduitDispenser.storage        = glassForge.outStorage;
        conduitDispenser.conduitType    = ConduitType.Liquid;
        conduitDispenser.elementFilter  = null;
        conduitDispenser.alwaysDispense = true;
        ComplexRecipe.RecipeElement[] array = new ComplexRecipe.RecipeElement[1]
        {
            new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Sand).tag, 100f)
        };
        ComplexRecipe.RecipeElement[] array2 = new ComplexRecipe.RecipeElement[1]
        {
            new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.MoltenGlass).tag, 25f)
        };
        string        obsolete_id   = ComplexRecipeManager.MakeObsoleteRecipeID("GlassForge", array[0].material);
        string        text          = ComplexRecipeManager.MakeRecipeID("GlassForge", array, array2);
        ComplexRecipe complexRecipe = new ComplexRecipe(text, array, array2);

        complexRecipe.time        = 40f;
        complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.Result;
        complexRecipe.description = string.Format(STRINGS.BUILDINGS.PREFABS.GLASSFORGE.RECIPE_DESCRIPTION, ElementLoader.GetElement(array2[0].material).name, ElementLoader.GetElement(array[0].material).name);
        complexRecipe.fabricators = new List <Tag>
        {
            TagManager.Create("GlassForge")
        };
        ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id, text);
        Prioritizable.AddRef(go);
    }
コード例 #19
0
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        go.AddOrGet <LoopingSounds>();
        go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.IndustrialMachinery, false);
        Storage storage = BuildingTemplates.CreateDefaultStorage(go, false);

        storage.showInUI   = true;
        storage.capacityKg = 30000f;
        storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
        AirFilter airFilter = go.AddOrGet <AirFilter>();

        airFilter.filterTag = GameTagExtensions.Create(SimHashes.Water);
        ElementConsumer elementConsumer = go.AddOrGet <PassiveElementConsumer>();

        elementConsumer.elementToConsume  = SimHashes.CarbonDioxide;
        elementConsumer.consumptionRate   = 0.6f;
        elementConsumer.capacityKG        = 0.6f;
        elementConsumer.consumptionRadius = 3;
        elementConsumer.showInStatusPanel = true;
        elementConsumer.sampleCellOffset  = new Vector3(0f, 0f, 0f);
        elementConsumer.isRequired        = false;
        elementConsumer.storeOnConsume    = true;
        elementConsumer.showDescriptor    = false;
        ElementConverter elementConverter = go.AddOrGet <ElementConverter>();

        elementConverter.consumedElements = new ElementConverter.ConsumedElement[2]
        {
            new ElementConverter.ConsumedElement(GameTagExtensions.Create(SimHashes.Water), 1f),
            new ElementConverter.ConsumedElement(GameTagExtensions.Create(SimHashes.CarbonDioxide), 0.3f)
        };
        elementConverter.outputElements = new ElementConverter.OutputElement[1]
        {
            new ElementConverter.OutputElement(1f, SimHashes.DirtyWater, 0f, false, true, 0f, 0.5f, 1f, byte.MaxValue, 0)
        };
        ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>();

        conduitConsumer.conduitType          = ConduitType.Liquid;
        conduitConsumer.consumptionRate      = 2f;
        conduitConsumer.capacityKG           = 2f;
        conduitConsumer.capacityTag          = ElementLoader.FindElementByHash(SimHashes.Water).tag;
        conduitConsumer.wrongElementResult   = ConduitConsumer.WrongElementResult.Store;
        conduitConsumer.forceAlwaysSatisfied = true;
        ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

        conduitDispenser.conduitType         = ConduitType.Liquid;
        conduitDispenser.invertElementFilter = true;
        conduitDispenser.elementFilter       = new SimHashes[1]
        {
            SimHashes.Water
        };
        go.AddOrGet <KBatchedAnimController>().randomiseLoopedOffset = true;
    }
コード例 #20
0
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.IndustrialMachinery, false);
            Storage storage = go.AddOrGet <Storage>();

            storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
            storage.showInUI       = true;
            storage.capacityKg     = 600 * SALT_INPUT_RATE + 20f;
            storage.storageFilters = new List <Tag> {
                GameTags.BuildableRaw, GameTags.Plastic, GameTags.Metal, GameTags.Edible
            };
            go.AddOrGet <LoopingSounds>();
            go.AddOrGet <Mineralizer>();
            ElementConverter elementConverter1 = go.AddComponent <ElementConverter>();

            elementConverter1.consumedElements = new ElementConverter.ConsumedElement[2]
            {
                new ElementConverter.ConsumedElement("Salt", SALT_INPUT_RATE),
                new ElementConverter.ConsumedElement("Water", WATER_WITH_SALT_INPUT_RATE)
            };
            elementConverter1.outputElements = new ElementConverter.OutputElement[1]
            {
                new ElementConverter.OutputElement(OUTPUT_RATE, SimHashes.SaltWater, 0.0f, false, true, 0.0f, 0.5f, 0.75f, byte.MaxValue, 0),
            };

            ManualDeliveryKG manualDeliveryKg = go.AddOrGet <ManualDeliveryKG>();

            manualDeliveryKg.SetStorage(storage);
            manualDeliveryKg.requestedItemTag = new Tag("Salt");
            manualDeliveryKg.capacity         = 600 * SALT_INPUT_RATE;
            manualDeliveryKg.refillMass       = 100 * SALT_INPUT_RATE;
            manualDeliveryKg.choreTypeIDHash  = Db.Get().ChoreTypes.MachineFetch.IdHash;

            ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>();

            conduitConsumer.conduitType          = ConduitType.Liquid;
            conduitConsumer.consumptionRate      = 10f;
            conduitConsumer.capacityKG           = 20f;
            conduitConsumer.capacityTag          = GameTags.Water;
            conduitConsumer.forceAlwaysSatisfied = true;
            conduitConsumer.wrongElementResult   = ConduitConsumer.WrongElementResult.Dump;

            ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

            conduitDispenser.conduitType   = ConduitType.Liquid;
            conduitDispenser.elementFilter = new SimHashes[1] {
                SimHashes.SaltWater
            };
            Prioritizable.AddRef(go);
        }
コード例 #21
0
        static public void Postfix(GameObject go)
        {
            PrimaryElement firstPrimaryElement = this.GetFirstPrimaryElement();

            if ((UnityEngine.Object)firstPrimaryElement == (UnityEngine.Object)null)
            {
                return;
            }
            Storage component = this.GetComponent <Storage>();
            float   num       = Mathf.Min(firstPrimaryElement.Mass, this.master.emptyRate * dt);

            if ((double)num <= 0.0)
            {
                return;
            }
            Tag prefabTag = firstPrimaryElement.GetComponent <KPrefabID>().PrefabTag;

            SimUtil.DiseaseInfo disease_info;
            float aggregate_temperature;

            component.ConsumeAndGetDisease(prefabTag, num, out disease_info, out aggregate_temperature);
            Vector3 position = this.transform.GetPosition();

            position.y += 1.8f;
            bool flag = this.GetComponent <Rotatable>().GetOrientation() == Orientation.FlipH;

            position.x += !flag ? 0.2f : -0.2f;
            int index = Grid.PosToCell(position) + (!flag ? 1 : -1);

            if (Grid.Solid[index])
            {
                index += !flag ? -1 : 1;
            }
            Element element = firstPrimaryElement.Element;
            byte    idx     = element.idx;

            ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

            if (!conduitDispenser.IsConnected)
            {
                if (element.IsLiquid)
                {
                    FallingWater.instance.AddParticle(index, idx, num, aggregate_temperature, disease_info.idx, disease_info.count, true, false, false, false);
                }
                else
                {
                    SimMessages.ModifyCell(index, (int)idx, aggregate_temperature, num, disease_info.idx, disease_info.count, SimMessages.ReplaceType.None, false, -1);
                }
            }
        }
コード例 #22
0
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        go.AddOrGet <LoopingSounds>();
        go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.Toilet, false);
        go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.FlushToilet, false);
        FlushToilet flushToilet = go.AddOrGet <FlushToilet>();

        flushToilet.massConsumedPerUse    = 5f;
        flushToilet.massEmittedPerUse     = 11.7f;
        flushToilet.newPeeTemperature     = 310.15f;
        flushToilet.diseaseId             = "FoodPoisoning";
        flushToilet.diseasePerFlush       = 100000;
        flushToilet.diseaseOnDupePerFlush = 5000;
        KAnimFile[] overrideAnims = new KAnimFile[1]
        {
            Assets.GetAnim("anim_interacts_toiletflush_kanim")
        };
        ToiletWorkableUse toiletWorkableUse = go.AddOrGet <ToiletWorkableUse>();

        toiletWorkableUse.overrideAnims       = overrideAnims;
        toiletWorkableUse.workLayer           = Grid.SceneLayer.BuildingFront;
        toiletWorkableUse.resetProgressOnStop = true;
        ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>();

        conduitConsumer.conduitType        = ConduitType.Liquid;
        conduitConsumer.capacityTag        = ElementLoader.FindElementByHash(SimHashes.Water).tag;
        conduitConsumer.capacityKG         = 5f;
        conduitConsumer.wrongElementResult = ConduitConsumer.WrongElementResult.Store;
        ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

        conduitDispenser.conduitType         = ConduitType.Liquid;
        conduitDispenser.invertElementFilter = true;
        conduitDispenser.elementFilter       = new SimHashes[1]
        {
            SimHashes.Water
        };
        Storage storage = go.AddOrGet <Storage>();

        storage.capacityKg        = 25f;
        storage.doDiseaseTransfer = false;
        storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
        Ownable ownable = go.AddOrGet <Ownable>();

        ownable.slotID      = Db.Get().AssignableSlots.Toilet.Id;
        ownable.canBePublic = true;
        RequireOutputs requireOutputs = go.AddOrGet <RequireOutputs>();

        requireOutputs.ignoreFullPipe = true;
    }
コード例 #23
0
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        go.AddOrGet <LoopingSounds>();
        go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.WashStation, false);
        go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.AdvancedWashStation, false);
        Shower shower = go.AddOrGet <Shower>();

        shower.overrideAnims = new KAnimFile[1]
        {
            Assets.GetAnim("anim_interacts_shower_kanim")
        };
        shower.workTime                 = 15f;
        shower.outputTargetElement      = SimHashes.DirtyWater;
        shower.fractionalDiseaseRemoval = 0.95f;
        shower.absoluteDiseaseRemoval   = -2000;
        shower.workLayer                = Grid.SceneLayer.BuildingFront;
        shower.trackUses                = true;
        ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>();

        conduitConsumer.conduitType        = ConduitType.Liquid;
        conduitConsumer.capacityTag        = ElementLoader.FindElementByHash(SimHashes.Water).tag;
        conduitConsumer.wrongElementResult = ConduitConsumer.WrongElementResult.Store;
        conduitConsumer.capacityKG         = 5f;
        ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

        conduitDispenser.conduitType         = ConduitType.Liquid;
        conduitDispenser.invertElementFilter = true;
        conduitDispenser.elementFilter       = new SimHashes[1]
        {
            SimHashes.Water
        };
        ElementConverter elementConverter = go.AddOrGet <ElementConverter>();

        elementConverter.consumedElements = new ElementConverter.ConsumedElement[1]
        {
            new ElementConverter.ConsumedElement(new Tag("Water"), 1f)
        };
        elementConverter.outputElements = new ElementConverter.OutputElement[1]
        {
            new ElementConverter.OutputElement(1f, SimHashes.DirtyWater, 0f, false, true, 0f, 0.5f, 1f, byte.MaxValue, 0)
        };
        Storage storage = go.AddOrGet <Storage>();

        storage.capacityKg = 10f;
        storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
        RequireOutputs requireOutputs = go.AddOrGet <RequireOutputs>();

        requireOutputs.ignoreFullPipe = true;
    }
コード例 #24
0
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            Prioritizable.AddRef(go);
            Storage storage = go.AddOrGet <Storage>();

            storage.storageFilters = STORAGEFILTERS.LIQUIDS;
            storage.showInUI       = true;
            storage.showDescriptor = true;
            storage.capacityKg     = 300f;
            go.AddOrGet <TreeFilterable>();
            go.AddOrGet <LiquidBottleEmptier>();
            ConduitDispenser dispenser = go.AddOrGet <ConduitDispenser>();

            dispenser.conduitType   = ConduitType.Liquid;
            dispenser.elementFilter = LiquidBottlerConfig.enabledElements;
        }
コード例 #25
0
    public override void DoPostConfigureComplete(GameObject go)
    {
        CargoBay cargoBay = go.AddOrGet <CargoBay>();

        cargoBay.storage            = go.AddOrGet <Storage>();
        cargoBay.storageType        = CargoBay.CargoType.liquids;
        cargoBay.storage.capacityKg = 1000f;
        cargoBay.storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
        RocketModule rocketModule = go.AddOrGet <RocketModule>();

        rocketModule.SetBGKAnim(Assets.GetAnim("rocket_storage_liquid_bg_kanim"));
        ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

        conduitDispenser.conduitType = ConduitType.Liquid;
        conduitDispenser.storage     = cargoBay.storage;
    }
コード例 #26
0
    public override void DoPostConfigureComplete(GameObject go)
    {
        CargoBay cargoBay = go.AddOrGet <CargoBay>();

        cargoBay.storage            = go.AddOrGet <Storage>();
        cargoBay.storageType        = CargoBay.CargoType.gasses;
        cargoBay.storage.capacityKg = 1000f;
        cargoBay.storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
        ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

        conduitDispenser.conduitType = ConduitType.Gas;
        conduitDispenser.storage     = cargoBay.storage;
        RocketModule rocketModule = go.AddOrGet <RocketModule>();

        rocketModule.SetBGKAnim(Assets.GetAnim("rocket_storage_gas_bg_kanim"));
        EntityTemplates.ExtendBuildingToRocketModule(go);
    }
コード例 #27
0
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.IndustrialMachinery, false);
            Storage storage = go.AddOrGet <Storage>();

            storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
            storage.showInUI   = true;
            storage.capacityKg = 600 * MINERAL_INPUT_RATE;
            go.AddOrGet <LoopingSounds>();
            go.AddOrGet <Mineralizer>();
            Prioritizable.AddRef(go);
            ElementConverter elementConverter1 = go.AddComponent <ElementConverter>();

            elementConverter1.consumedElements = new ElementConverter.ConsumedElement[2]
            {
                new ElementConverter.ConsumedElement("Crystal", MINERAL_INPUT_RATE),
                new ElementConverter.ConsumedElement("Water", WATER_WITH_MINERAL_INPUT_RATE)
            };
            elementConverter1.outputElements = new ElementConverter.OutputElement[1]
            {
                new ElementConverter.OutputElement(OUTPUT_RATE, Elements.MineralWaterElement.SimHash, 0.0f, false, true, 0.0f, 0.5f, 0.75f, byte.MaxValue, 0),
            };

            ManualDeliveryKG manualDeliveryKg = go.AddOrGet <ManualDeliveryKG>();

            manualDeliveryKg.SetStorage(storage);
            manualDeliveryKg.requestedItemTag = new Tag("Crystal");
            manualDeliveryKg.capacity         = storage.capacityKg;
            manualDeliveryKg.refillMass       = 100 * MINERAL_INPUT_RATE;
            manualDeliveryKg.choreTypeIDHash  = Db.Get().ChoreTypes.MachineFetch.IdHash;

            ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>();

            conduitConsumer.conduitType        = ConduitType.Liquid;
            conduitConsumer.consumptionRate    = 10f;
            conduitConsumer.capacityKG         = 4 * WATER_WITH_MINERAL_INPUT_RATE;
            conduitConsumer.capacityTag        = ElementLoader.FindElementByHash(SimHashes.Water).tag;
            conduitConsumer.wrongElementResult = ConduitConsumer.WrongElementResult.Dump;

            ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

            conduitDispenser.conduitType   = ConduitType.Liquid;
            conduitDispenser.elementFilter = new SimHashes[1] {
                Elements.MineralWaterElement.SimHash
            };
        }
コード例 #28
0
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            Tag tag = SimHashes.CarbonDioxide.CreateTag();

            go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.IndustrialMachinery, false);
            CoalComp oxyliteRefinery = go.AddOrGet <CoalComp>();

            oxyliteRefinery.emitTag    = SimHashes.Carbon.CreateTag();
            oxyliteRefinery.emitMass   = 10f;
            oxyliteRefinery.dropOffset = new Vector3(0f, 1f);
            ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>();

            conduitConsumer.conduitType          = ConduitType.Gas;
            conduitConsumer.consumptionRate      = 1.2f;
            conduitConsumer.capacityTag          = tag;
            conduitConsumer.capacityKG           = 6f;
            conduitConsumer.forceAlwaysSatisfied = true;
            conduitConsumer.wrongElementResult   = ConduitConsumer.WrongElementResult.Dump;
            ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

            conduitDispenser.conduitType   = ConduitType.Gas;
            conduitDispenser.elementFilter = new SimHashes[]
            {
                SimHashes.Oxygen
            };
            Storage storage = go.AddOrGet <Storage>();

            storage.capacityKg = 23.2f;
            storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
            storage.showInUI = true;
            ElementConverter elementConverter = go.AddOrGet <ElementConverter>();

            elementConverter.consumedElements = new ElementConverter.ConsumedElement[]
            {
                new ElementConverter.ConsumedElement(tag, 1f)
            };
            elementConverter.outputElements = new ElementConverter.OutputElement[]
            {
                new ElementConverter.OutputElement(.25f, SimHashes.Carbon, 0f, false, true, 0f, 0.5f, 0.25f, 255, 0),
                new ElementConverter.OutputElement(.75f, SimHashes.Oxygen, 0f, false, true, 0f, 0f, 0.75f, 255, 0)
            };


            Prioritizable.AddRef(go);
        }
コード例 #29
0
        //required by IBuildingConfig
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            Prioritizable.AddRef(go);
            Storage storage = go.AddOrGet <Storage>();

            storage.storageFilters   = STORAGEFILTERS.LIQUIDS;
            storage.showInUI         = true;
            storage.showDescriptor   = true;
            storage.capacityKg       = 200f;
            storage.allowItemRemoval = false;
            go.AddOrGet <TreeFilterable>();
            ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

            conduitDispenser.conduitType    = ConduitType.Liquid;
            conduitDispenser.alwaysDispense = true;

            go.AddOrGet <DazBottleEmptier>();
        }
コード例 #30
0
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            Prioritizable.AddRef(go);
            Storage storage = go.AddOrGet <Storage>();

            storage.showInUI          = true;
            storage.allowItemRemoval  = false;
            storage.showDescriptor    = true;
            storage.storageFilters    = STORAGEFILTERS.LIQUIDS;
            storage.storageFullMargin = STORAGE.STORAGE_LOCKER_FILLED_MARGIN;
            ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

            conduitDispenser.conduitType    = ConduitType.Liquid;
            conduitDispenser.alwaysDispense = true;
            storage.capacityKg = BuildingGenerationPatches.Options.BottleVolume;             //200 kg default
            go.AddOrGet <TreeFilterable>();
            go.AddOrGet <VesselInserter>();
        }