public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            SoundEventVolumeCache.instance.AddVolume("storagelocker_kanim", "StorageLocker_Hit_metallic_low", NOISE_POLLUTION.NOISY.TIER1);
            Prioritizable.AddRef(go);
            Storage storage = go.AddOrGet <Storage>();

            storage.showInUI          = true;
            storage.allowItemRemoval  = true;
            storage.showDescriptor    = true;
            storage.storageFilters    = STORAGEFILTERS.NOT_EDIBLE_SOLIDS;
            storage.storageFullMargin = 1500f;
            storage.fetchCategory     = Storage.FetchCategory.GeneralStorage;
            CopyBuildingSettings copyBuildingSettings = go.AddOrGet <CopyBuildingSettings>();

            copyBuildingSettings.copyGroupTag = GameTags.StorageLocker;
            go.AddOrGet <StorageLocker>();
        }
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        Storage       storage       = go.AddOrGet <Storage>();
        PlantablePlot plantablePlot = go.AddOrGet <PlantablePlot>();

        plantablePlot.AddDepositTag(GameTags.CropSeed);
        plantablePlot.SetFertilizationFlags(true, false);
        CopyBuildingSettings copyBuildingSettings = go.AddOrGet <CopyBuildingSettings>();

        copyBuildingSettings.copyGroupTag = GameTags.Farm;
        BuildingTemplates.CreateDefaultStorage(go, false);
        storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
        go.AddOrGet <DropAllWorkable>();
        go.AddOrGet <PlanterBox>();
        go.AddOrGet <AnimTileable>();
        Prioritizable.AddRef(go);
    }
Beispiel #3
0
        public override void ConfigureBuildingTemplate(UnityEngine.GameObject go, Tag prefab_tag)
        {
            var storage = go.AddOrGet <global::Storage>();

            storage.showInUI          = true;
            storage.showDescriptor    = true;
            storage.storageFilters    = STORAGE_TAG;
            storage.allowItemRemoval  = true;
            storage.capacityKg       *= 6;
            storage.storageFullMargin = STORAGE.STORAGE_LOCKER_FILLED_MARGIN;
            storage.fetchCategory     = global::Storage.FetchCategory.GeneralStorage;
            go.AddOrGet <CopyBuildingSettings>().copyGroupTag = TAG;
            go.AddOrGet <StorageLocker>();
            go.AddOrGet <DropAllWorkable>();

            Prioritizable.AddRef(go);
        }
Beispiel #4
0
        public override void DoPostConfigureComplete(GameObject go)
        {
            GeneratedBuildings.RegisterLogicPorts(go, OUTPUT_PORT);
            Storage storage = go.AddOrGet <Storage>();

            storage.capacityKg       = 2500f; // 100 artifacts @ 25f each
            storage.showInUI         = true;
            storage.showDescriptor   = true;
            storage.allowItemRemoval = true;
            storage.fetchCategory    = Storage.FetchCategory.GeneralStorage;
            storage.storageFilters   = ArtifactCabinet.ArtifactsFilterTagList;
            go.AddOrGet <UncategorizedFilterable>();
            go.AddOrGet <ArtifactCabinet>();
            Prioritizable.AddRef(go);
            go.AddOrGet <DropAllWorkable>();
            go.AddOrGetDef <StorageController.Def>();
        }
 protected override void OnSpawn()
 {
     base.OnSpawn();
     DebugUtil.Assert(choreTypeIDHash.IsValid, "ManualDeliveryKG Must have a valid chore type specified!", base.name);
     Subscribe(493375141, OnRefreshUserMenuDelegate);
     Subscribe(-111137758, OnRefreshUserMenuDelegate);
     Subscribe(-592767678, OnOperationalChangedDelegate);
     if ((UnityEngine.Object)storage != (UnityEngine.Object)null)
     {
         SetStorage(storage);
     }
     Prioritizable.AddRef(base.gameObject);
     if (userPaused && allowPause)
     {
         OnPause();
     }
 }
Beispiel #6
0
 private void OnMenuToggle()
 {
     if (!Toggleable.IsToggleQueued(ToggleIdx))
     {
         if (IsEnabled)
         {
             Trigger(2108245096, "BuildingDisabled");
         }
         Prioritizable.AddRef(base.gameObject);
     }
     else
     {
         Prioritizable.RemoveRef(base.gameObject);
     }
     Toggleable.Toggle(ToggleIdx);
     Game.Instance.userMenu.Refresh(base.gameObject);
 }
Beispiel #7
0
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        Door door = go.AddOrGet <Door>();

        door.hasComplexUserControls    = true;
        door.unpoweredAnimSpeed        = 1f;
        door.doorClosingSoundEventName = "ManualPressureDoor_gear_LP";
        door.doorOpeningSoundEventName = "ManualPressureDoor_gear_LP";
        door.doorType = Door.DoorType.ManualPressure;
        go.AddOrGet <ZoneTile>();
        go.AddOrGet <AccessControl>();
        go.AddOrGet <KBoxCollider2D>();
        Prioritizable.AddRef(go);
        go.AddOrGet <CopyBuildingSettings>().copyGroupTag = GameTags.Door;
        go.AddOrGet <Workable>().workTime = 5f;
        Object.DestroyImmediate((Object)go.GetComponent <BuildingEnabledButton>());
    }
Beispiel #8
0
 protected override void OnSpawn()
 {
     if (string.IsNullOrEmpty(currentStage))
     {
         currentStage = "Default";
     }
     SetStage(currentStage, true);
     shouldShowSkillPerkStatusItem = false;
     if (currentStage == "Default")
     {
         shouldShowSkillPerkStatusItem = true;
         Prioritizable.AddRef(base.gameObject);
         chore = new WorkChore <Artable>(Db.Get().ChoreTypes.Art, this, null, true, null, null, null, true, null, false, true, null, false, true, true, PriorityScreen.PriorityClass.basic, 5, false, true);
         chore.AddPrecondition(ChorePreconditions.instance.HasSkillPerk, requiredSkillPerk);
     }
     base.OnSpawn();
 }
        public override void DoPostConfigureComplete(GameObject go)
        {
            Door door = go.AddOrGet <Door>();

            door.unpoweredAnimSpeed        = 1.2f;
            door.doorType                  = Door.DoorType.Internal;
            door.doorOpeningSoundEventName = "Open_DoorInternal";
            door.doorClosingSoundEventName = "Close_DoorInternal";
            go.AddOrGet <AccessControl>().controlEnabled      = true;
            go.AddOrGet <CopyBuildingSettings>().copyGroupTag = GameTags.Door;
            go.AddOrGet <Workable>().workTime = 3f;
            go.GetComponent <KBatchedAnimController>().initialAnim = "closed";
            go.AddOrGet <ZoneTile>();
            go.AddOrGet <KBoxCollider2D>();
            Prioritizable.AddRef(go);
            Object.DestroyImmediate((Object)go.GetComponent <BuildingEnabledButton>());
        }
 protected override void OnPrefabInit()
 {
     base.OnPrefabInit();
     workerStatusItem            = Db.Get().DuplicantStatusItems.Digging;
     readyForSkillWorkStatusItem = Db.Get().BuildingStatusItems.DigRequiresSkillPerk;
     faceTargetWhenWorking       = true;
     Subscribe(-1432940121, OnReachableChangedDelegate);
     attributeConverter            = Db.Get().AttributeConverters.DiggingSpeed;
     attributeExperienceMultiplier = DUPLICANTSTATS.ATTRIBUTE_LEVELING.MOST_DAY_EXPERIENCE;
     skillExperienceSkillGroup     = Db.Get().SkillGroups.Mining.Id;
     skillExperienceMultiplier     = SKILLS.MOST_DAY_EXPERIENCE;
     multitoolContext      = "dig";
     multitoolHitEffectTag = "fx_dig_splash";
     workingPstComplete    = HashedString.Invalid;
     workingPstFailed      = HashedString.Invalid;
     Prioritizable.AddRef(base.gameObject);
 }
        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
            };
        }
Beispiel #12
0
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.IndustrialMachinery, false);
        RustDeoxidizer rustDeoxidizer = go.AddOrGet <RustDeoxidizer>();

        rustDeoxidizer.maxMass = 1.8f;
        Storage storage = go.AddOrGet <Storage>();

        storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
        storage.showInUI = true;
        ManualDeliveryKG manualDeliveryKG = go.AddOrGet <ManualDeliveryKG>();

        manualDeliveryKG.SetStorage(storage);
        manualDeliveryKG.requestedItemTag = new Tag("Rust");
        manualDeliveryKG.capacity         = 585f;
        manualDeliveryKG.refillMass       = 193.05f;
        manualDeliveryKG.choreTypeIDHash  = Db.Get().ChoreTypes.FetchCritical.IdHash;
        ManualDeliveryKG manualDeliveryKG2 = go.AddComponent <ManualDeliveryKG>();

        manualDeliveryKG2.SetStorage(storage);
        manualDeliveryKG2.requestedItemTag = new Tag("Salt");
        manualDeliveryKG2.capacity         = 195f;
        manualDeliveryKG2.refillMass       = 64.3500061f;
        manualDeliveryKG2.allowPause       = true;
        manualDeliveryKG2.choreTypeIDHash  = Db.Get().ChoreTypes.FetchCritical.IdHash;
        ElementConverter elementConverter = go.AddOrGet <ElementConverter>();

        elementConverter.consumedElements = new ElementConverter.ConsumedElement[2]
        {
            new ElementConverter.ConsumedElement(new Tag("Rust"), 0.75f),
            new ElementConverter.ConsumedElement(new Tag("Salt"), 0.25f)
        };
        elementConverter.outputElements = new ElementConverter.OutputElement[3]
        {
            new ElementConverter.OutputElement(0.57f, SimHashes.Oxygen, 348.15f, false, false, 0f, 1f, 1f, byte.MaxValue, 0),
            new ElementConverter.OutputElement(0.0300000012f, SimHashes.ChlorineGas, 348.15f, false, false, 0f, 1f, 1f, byte.MaxValue, 0),
            new ElementConverter.OutputElement(0.4f, SimHashes.IronOre, 348.15f, false, true, 0f, 1f, 1f, byte.MaxValue, 0)
        };
        ElementDropper elementDropper = go.AddComponent <ElementDropper>();

        elementDropper.emitMass   = 24f;
        elementDropper.emitTag    = SimHashes.IronOre.CreateTag();
        elementDropper.emitOffset = new Vector3(0f, 1f, 0f);
        Prioritizable.AddRef(go);
    }
Beispiel #13
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);
        }
Beispiel #14
0
    public override void DoPostConfigureComplete(GameObject go)
    {
        GeneratedBuildings.RegisterLogicPorts(go, OUTPUT_PORT);
        Storage storage = go.AddOrGet <Storage>();

        storage.showInUI          = true;
        storage.showDescriptor    = true;
        storage.storageFilters    = STORAGEFILTERS.FOOD;
        storage.allowItemRemoval  = true;
        storage.capacityKg        = 100f;
        storage.storageFullMargin = STORAGE.STORAGE_LOCKER_FILLED_MARGIN;
        storage.fetchCategory     = Storage.FetchCategory.GeneralStorage;
        Prioritizable.AddRef(go);
        go.AddOrGet <TreeFilterable>();
        go.AddOrGet <Refrigerator>();
        go.AddOrGet <DropAllWorkable>();
        go.AddOrGetDef <StorageController.Def>();
    }
 private void QueueDeconstruction()
 {
     if (chore == null)
     {
         if (DebugHandler.InstantBuildMode)
         {
             OnCompleteWork(null);
         }
         else
         {
             Prioritizable.AddRef(base.gameObject);
             chore = new WorkChore <Deconstructable>(Db.Get().ChoreTypes.Deconstruct, this, null, true, null, null, null, true, null, false, false, null, true, true, true, PriorityScreen.PriorityClass.basic, 5, true, true);
             GetComponent <KSelectable>().AddStatusItem(Db.Get().BuildingStatusItems.PendingDeconstruction, this);
             isMarkedForDeconstruction = true;
             Trigger(2108245096, "Deconstruct");
         }
     }
 }
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        Prioritizable.AddRef(go);
        BuildingTemplates.CreateDefaultStorage(go, false).SetDefaultStoredItemModifiers(EggIncubatorConfig.IncubatorStorage); //do not change

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

        storage.showInUI          = true;
        storage.allowItemRemoval  = true;
        storage.showDescriptor    = true;
        storage.storageFilters    = IncubatorXConfig.EGGS; //new List<Tag>() { GameTags.Egg };
        storage.storageFullMargin = STORAGE.STORAGE_LOCKER_FILLED_MARGIN;
        storage.fetchCategory     = Storage.FetchCategory.GeneralStorage;
        storage.capacityKg        = 20f;

        go.AddOrGet <CopyBuildingSettings>().copyGroupTag = GameTags.StorageLocker;
        go.AddOrGet <IncubatorX>();
    }
        protected override void OnSpawn()
        {
            base.OnSpawn();
            DebugUtil.Assert(this.choreTypeIDHash.IsValid, "ManualDeliveryKG Must have a valid chore type specified!", base.name);
            this.Subscribe(GameHashes.RefreshUserMenu, new Action <object>(this.OnRefreshUserMenu));
            this.Subscribe(GameHashes.StatusChange, new Action <object>(this.OnRefreshUserMenu));
            this.Subscribe(GameHashes.OperationalChanged, new Action <object>(this.OnOperationalChanged));

            if (this.storage != null)
            {
                this.SetStorage(this.storage);
            }
            Prioritizable.AddRef(base.gameObject);
            if (this.userPaused && this.allowPause)
            {
                this.OnPause();
            }
        }
Beispiel #18
0
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.IndustrialMachinery, false);
        go.AddTag(GameTags.NotRoomAssignable);
        go.AddOrGet <BuildingComplete>().isManuallyOperated = true;
        Prioritizable.AddRef(go);
        Ownable ownable = go.AddOrGet <Ownable>();

        ownable.slotID = Db.Get().AssignableSlots.ResetSkillsStation.Id;
        ResetSkillsStation resetSkillsStation = go.AddOrGet <ResetSkillsStation>();

        resetSkillsStation.workTime      = 180f;
        resetSkillsStation.overrideAnims = new KAnimFile[1]
        {
            Assets.GetAnim("anim_interacts_reSpeccer_kanim")
        };
        resetSkillsStation.workLayer = Grid.SceneLayer.BuildingFront;
    }
        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>();
        }
Beispiel #20
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>();
        }
Beispiel #21
0
        public override void DoPostConfigureComplete(GameObject go)
        {
            Door door = go.AddOrGet <Door>();

            door.hasComplexUserControls    = true;
            door.unpoweredAnimSpeed        = 0.65f;
            door.poweredAnimSpeed          = 5f;
            door.doorClosingSoundEventName = "MechanizedAirlock_closing";
            door.doorOpeningSoundEventName = "MechanizedAirlock_opening";
            go.AddOrGet <AccessControl>();
            go.AddOrGet <KBoxCollider2D>();
            Prioritizable.AddRef(go);
            go.AddOrGet <Workable>().workTime = 5f;
            GeneratedBuildings.RegisterLogicPorts(go, DoorConfig.INPUT_PORTS);
            UnityEngine.Object.DestroyImmediate((UnityEngine.Object)go.GetComponent <BuildingEnabledButton>());
            go.GetComponent <AccessControl>().controlEnabled       = true;
            go.GetComponent <KBatchedAnimController>().initialAnim = "closed";
        }
Beispiel #22
0
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            SoundEventVolumeCache.instance.AddVolume("storagelocker_kanim", "StorageLocker_Hit_metallic_low",
                                                     NOISE_POLLUTION.NOISY.TIER1);
            Prioritizable.AddRef(go);
            var storage = go.AddOrGet <Storage>();

            storage.showInUI          = true;
            storage.allowItemRemoval  = true;
            storage.showDescriptor    = true;
            storage.storageFilters    = STORAGEFILTERS.NOT_EDIBLE_SOLIDS;
            storage.storageFullMargin = STORAGE.STORAGE_LOCKER_FILLED_MARGIN;
            storage.fetchCategory     = Storage.FetchCategory.GeneralStorage;
            storage.allowSublimation  = false;
            go.AddOrGet <CopyBuildingSettings>().copyGroupTag = GameTags.StorageLocker;
            go.AddOrGet <StorageLocker>();
            go.GetComponent <Storage>().capacityKg = StoragePodOptions.Instance.podCapacity;
        }
Beispiel #23
0
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        Storage storage = go.AddOrGet <Storage>();

        storage.SetDefaultStoredItemModifiers(new List <Storage.StoredItemModifier>(new Storage.StoredItemModifier[2]
        {
            Storage.StoredItemModifier.Seal,
            Storage.StoredItemModifier.Preserve
        }));
        Prioritizable.AddRef(go);
        SingleEntityReceptacle singleEntityReceptacle = go.AddOrGet <SingleEntityReceptacle>();

        singleEntityReceptacle.AddDepositTag(GameTags.PedestalDisplayable);
        singleEntityReceptacle.occupyingObjectRelativePosition = new Vector3(0f, 1.2f, -1f);
        go.AddOrGet <DecorProvider>();
        go.AddOrGet <ItemPedestal>();
        go.GetComponent <KPrefabID>().AddTag(GameTags.Decoration, false);
    }
Beispiel #24
0
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            var tag1 = SimHashes.ChlorineGas.CreateTag();
            var tag2 = SimHashes.Copper.CreateTag();

            go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.IndustrialMachinery);
            var oxyliteRefinery = go.AddOrGet <OxyliteRefinery>();

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

            conduitConsumer.conduitType          = ConduitType.Gas;
            conduitConsumer.consumptionRate      = 1.2f;
            conduitConsumer.capacityTag          = tag1;
            conduitConsumer.capacityKG           = 6f;
            conduitConsumer.forceAlwaysSatisfied = true;
            conduitConsumer.wrongElementResult   = ConduitConsumer.WrongElementResult.Dump;
            var storage = go.AddOrGet <Storage>();

            storage.capacityKg = 23.2f;
            storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
            storage.showInUI = true;
            var manualDeliveryKg = go.AddOrGet <ManualDeliveryKG>();

            manualDeliveryKg.SetStorage(storage);
            manualDeliveryKg.requestedItemTag = tag2;
            manualDeliveryKg.refillMass       = 1.8f;
            manualDeliveryKg.capacity         = 7.2f;
            manualDeliveryKg.choreTypeIDHash  = Db.Get().ChoreTypes.MachineFetch.IdHash;
            var elementConverter = go.AddOrGet <ElementConverter>();

            elementConverter.consumedElements = new ElementConverter.ConsumedElement[2]
            {
                new ElementConverter.ConsumedElement(tag1, 0.6f),
                new ElementConverter.ConsumedElement(tag2, 3f / 1000f)
            };
            elementConverter.outputElements = new ElementConverter.OutputElement[1]
            {
                new ElementConverter.OutputElement(0.6f, SimHashes.BleachStone, 303.15f, false, true)
            };
            Prioritizable.AddRef(go);
        }
Beispiel #25
0
 /// <summary>
 /// Performs the post-configure complete steps that this building object can do.
 /// Not exhaustive! Other components must likely be added.
 ///
 /// This method does NOT add the logic ports. Use CreateLogicPorts to do so,
 /// <b>after</b> this method has been invoked.
 /// </summary>
 /// <param name="go">The game object to configure.</param>
 public void DoPostConfigureComplete(GameObject go)
 {
     if (InputConduits.Count == 1)
     {
         var conduitConsumer = go.AddOrGet <ConduitConsumer>();
         foreach (var conduit in InputConduits)
         {
             conduitConsumer.alwaysConsume      = true;
             conduitConsumer.conduitType        = conduit.Type;
             conduitConsumer.wrongElementResult = ConduitConsumer.WrongElementResult.
                                                  Store;
         }
     }
     if (OutputConduits.Count == 1)
     {
         var conduitDispenser = go.AddOrGet <ConduitDispenser>();
         foreach (var conduit in OutputConduits)
         {
             conduitDispenser.alwaysDispense = true;
             conduitDispenser.conduitType    = conduit.Type;
             conduitDispenser.elementFilter  = null;
         }
     }
     if (IndustrialMachine)
     {
         go.GetComponent <KPrefabID>()?.AddTag(RoomConstraints.ConstraintTags.
                                               IndustrialMachinery, false);
     }
     if (PowerInput != null)
     {
         go.AddOrGet <EnergyConsumer>();
     }
     if (PowerOutput != null)
     {
         go.AddOrGet <EnergyGenerator>();
     }
     // Set a default priority
     if (DefaultPriority != null)
     {
         Prioritizable.AddRef(go);
         go.GetComponent <Prioritizable>().SetMasterPriority(new PrioritySetting(
                                                                 PriorityScreen.PriorityClass.basic, DefaultPriority ?? 5));
     }
 }
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.IndustrialMachinery, false);
            PipedElectrolyzer electrolyzer = go.AddOrGet <PipedElectrolyzer>();

            electrolyzer.maxMass  = 1.8f;
            electrolyzer.hasMeter = true;

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

            conduitConsumer.conduitType        = ConduitType.Liquid;
            conduitConsumer.consumptionRate    = 1f;
            conduitConsumer.capacityTag        = ElementLoader.FindElementByHash(SimHashes.Water).tag;
            conduitConsumer.wrongElementResult = ConduitConsumer.WrongElementResult.Dump;

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

            storage.capacityKg = 2f;
            storage.showInUI   = true;

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

            dispenser.conduitType         = ConduitType.Gas;
            dispenser.invertElementFilter = false;
            dispenser.elementFilter       = new SimHashes[1]
            {
                SimHashes.Oxygen
            };

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

            elementConverter.consumedElements = new ElementConverter.ConsumedElement[1]
            {
                new ElementConverter.ConsumedElement(new Tag("Water"), 1f)
            };

            elementConverter.outputElements = new ElementConverter.OutputElement[2]
            {
                new ElementConverter.OutputElement(WATER2OXYGEN_RATIO, SimHashes.Oxygen, OXYGEN_TEMPERATURE, false, true, 0f, 1f, 1f, byte.MaxValue, 0),
                new ElementConverter.OutputElement(1 - WATER2OXYGEN_RATIO, SimHashes.Hydrogen, OXYGEN_TEMPERATURE, false, false, 0f, 1f, 1f, byte.MaxValue, 0)
            };

            Prioritizable.AddRef(go);
        }
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        Storage storage  = go.AddComponent <Storage>();
        Storage storage2 = go.AddComponent <Storage>();

        storage2.capacityKg = 100f;
        go.AddOrGet <BuildingComplete>().isManuallyOperated = true;
        go.AddOrGet <LoopingSounds>();
        Prioritizable.AddRef(go);
        float           num             = 2426.72f;
        float           num2            = 0.01f;
        LiquidCooledFan liquidCooledFan = go.AddOrGet <LiquidCooledFan>();

        liquidCooledFan.gasStorage           = storage;
        liquidCooledFan.liquidStorage        = storage2;
        liquidCooledFan.waterKGConsumedPerKJ = 1f / (num * num2);
        liquidCooledFan.coolingKilowatts     = 80f;
        liquidCooledFan.minCooledTemperature = 290f;
        liquidCooledFan.minEnvironmentMass   = 0.25f;
        liquidCooledFan.minCoolingRange      = new Vector2I(-2, 0);
        liquidCooledFan.maxCoolingRange      = new Vector2I(2, 4);
        ManualDeliveryKG manualDeliveryKG = go.AddComponent <ManualDeliveryKG>();

        manualDeliveryKG.requestedItemTag = new Tag("Water");
        manualDeliveryKG.capacity         = 500f;
        manualDeliveryKG.refillMass       = 50f;
        manualDeliveryKG.choreTypeIDHash  = Db.Get().ChoreTypes.MachineFetch.IdHash;
        ElementConsumer elementConsumer = go.AddOrGet <ElementConsumer>();

        elementConsumer.storeOnConsume    = true;
        elementConsumer.storage           = storage;
        elementConsumer.configuration     = ElementConsumer.Configuration.AllGas;
        elementConsumer.consumptionRadius = 8;
        elementConsumer.EnableConsumption(true);
        elementConsumer.sampleCellOffset = new Vector3(0f, 0f);
        elementConsumer.showDescriptor   = false;
        LiquidCooledFanWorkable liquidCooledFanWorkable = go.AddOrGet <LiquidCooledFanWorkable>();

        liquidCooledFanWorkable.SetWorkTime(20f);
        liquidCooledFanWorkable.overrideAnims = new KAnimFile[1]
        {
            Assets.GetAnim("anim_interacts_liquidfan_kanim")
        };
    }
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            Tag tag  = SimHashes.ChlorineGas.CreateTag();
            Tag tag2 = ElementLoader.FindElementByHash(SimHashes.Sand).tag;

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

            oxyliteRefinery.emitTag    = SimHashes.BleachStone.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;
            Storage storage = go.AddOrGet <Storage>();

            storage.capacityKg = 232f;
            storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
            storage.showInUI = true;
            ManualDeliveryKG manualDeliveryKG = go.AddOrGet <ManualDeliveryKG>();

            manualDeliveryKG.SetStorage(storage);
            manualDeliveryKG.requestedItemTag = tag2;
            manualDeliveryKG.refillMass       = 1.8000001f;
            manualDeliveryKG.capacity         = 72.00003f;
            manualDeliveryKG.choreTypeIDHash  = Db.Get().ChoreTypes.MachineFetch.IdHash;
            ElementConverter elementConverter = go.AddOrGet <ElementConverter>();

            elementConverter.consumedElements = new ElementConverter.ConsumedElement[]
            {
                new ElementConverter.ConsumedElement(tag, 0.6f),
                new ElementConverter.ConsumedElement(tag2, 0.03f)
            };
            elementConverter.outputElements = new ElementConverter.OutputElement[]
            {
                new ElementConverter.OutputElement(0.6f, SimHashes.BleachStone, 303.15f, false, true, 0f, 0.5f, 1f, byte.MaxValue, 0)
            };
            Prioritizable.AddRef(go);
        }
Beispiel #29
0
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            go.AddOrGet <LoopingSounds>();
            Prioritizable.AddRef(go);
            Storage storage = BuildingTemplates.CreateDefaultStorage(go, false);

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

            ElementConsumer elementConsumer = go.AddOrGet <ElementConsumer>();

            elementConsumer.elementToConsume  = SimHashes.CarbonDioxide;
            elementConsumer.consumptionRate   = 0.3f;
            elementConsumer.consumptionRadius = 3;
            elementConsumer.showInStatusPanel = true;
            elementConsumer.sampleCellOffset  = new Vector3(0f, 0f, 0f);
            elementConsumer.isRequired        = false;
            elementConsumer.storeOnConsume    = true;
            elementConsumer.showDescriptor    = false;

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

            elementDropper.emitMass   = 10f;
            elementDropper.emitTag    = new Tag("Carbon");
            elementDropper.emitOffset = new Vector3(0f, 0f, 0f);
            ElementConverter elementConverter = go.AddOrGet <ElementConverter>();

            elementConverter.consumedElements = new ElementConverter.ConsumedElement[]
            {
                //new ElementConverter.ConsumedElement(new Tag("Filter"), 0.13333334f),
                new ElementConverter.ConsumedElement(new Tag("CarbonDioxide"), 0.25f)
            };
            elementConverter.outputElements = new ElementConverter.OutputElement[]
            {
                new ElementConverter.OutputElement(0.0833333f, SimHashes.Carbon, 0f, false, true, 0f, 0.5f, 0.25f, 255, 0),
                new ElementConverter.OutputElement(0.1666667f, SimHashes.Oxygen, 0f, false, false, 0f, 0f, 0.75f, 255, 0)
            };
            CoalSynth airFilter = go.AddOrGet <CoalSynth>();

            airFilter.filterTag = new Tag("CarbonDioxide");
            go.AddOrGet <KBatchedAnimController>().randomiseLoopedOffset = true;
        }
Beispiel #30
0
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        Door door = go.AddOrGet <Door>();

        door.hasComplexUserControls = false;
        door.unpoweredAnimSpeed     = 1f;
        door.doorType = Door.DoorType.Sealed;
        go.AddOrGet <ZoneTile>();
        go.AddOrGet <AccessControl>();
        go.AddOrGet <Unsealable>();
        go.AddOrGet <KBoxCollider2D>();
        Prioritizable.AddRef(go);
        Workable workable = go.AddOrGet <Workable>();

        workable.workTime = 5f;
        KBatchedAnimController kBatchedAnimController = go.AddOrGet <KBatchedAnimController>();

        kBatchedAnimController.fgLayer = Grid.SceneLayer.BuildingFront;
    }