Beispiel #1
0
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            go.AddOrGet <LoreBearer>();
            go.AddOrGet <Telepad>();
            Light2D light2D = go.AddOrGet <Light2D>();

            light2D.Color         = LIGHT2D.HEADQUARTERS_COLOR;
            light2D.Range         = 5f;
            light2D.Offset        = LIGHT2D.HEADQUARTERS_OFFSET;
            light2D.overlayColour = LIGHT2D.HEADQUARTERS_OVERLAYCOLOR;
            light2D.shape         = LightShape.Circle;
            light2D.drawOverlay   = true;


            go.AddOrGet <DropAllWorkable>();
            Prioritizable.AddRef(go);
            go.AddOrGet <BuildingComplete>().isManuallyOperated = false;
            ComplexFabricator fabricator = go.AddOrGet <ComplexFabricator>();

            BuildingTemplates.CreateComplexFabricatorStorage(go, fabricator);


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

            storage.showInUI          = true;
            storage.allowItemRemoval  = false;
            storage.showDescriptor    = false;
            storage.storageFilters    = STORAGEFILTERS.NOT_EDIBLE_SOLIDS;
            storage.storageFullMargin = STORAGE.STORAGE_LOCKER_FILLED_MARGIN;
            storage.fetchCategory     = Storage.FetchCategory.GeneralStorage;
            // todo storage.Serialize
        }
Beispiel #2
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);
        }
Beispiel #3
0
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            go.AddOrGet <DropAllWorkable>();
            go.AddOrGet <BuildingComplete>().isManuallyOperated = true;

            ComplexFabricator complexFabricator = go.AddOrGet <ComplexFabricator>();

            complexFabricator.resultState       = ComplexFabricator.ResultState.Heated;
            complexFabricator.heatedTemperature = OUTPUT_TEMPERATURE;
            complexFabricator.sideScreenStyle   = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid;
            complexFabricator.duplicantOperated = true;

            go.AddOrGet <FabricatorIngredientStatusManager>();
            go.AddOrGet <CopyBuildingSettings>();

            ComplexFabricatorWorkable complexFabricatorWorkable = go.AddOrGet <ComplexFabricatorWorkable>();

            BuildingTemplates.CreateComplexFabricatorStorage(go, complexFabricator);
            complexFabricatorWorkable.overrideAnims = new KAnimFile[1] {
                Assets.GetAnim("anim_interacts_supermaterial_refinery_kanim")
            };

            Prioritizable.AddRef(go);

            AddRecipes();
        }
Beispiel #4
0
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        Prioritizable.AddRef(go);
        go.AddOrGet <DropAllWorkable>();
        go.AddOrGet <BuildingComplete>().isManuallyOperated = true;
        Apothecary fabricator = go.AddOrGet <Apothecary>();

        BuildingTemplates.CreateComplexFabricatorStorage(go, fabricator);
        go.AddOrGet <ComplexFabricatorWorkable>();
        go.AddOrGet <FabricatorIngredientStatusManager>();
        go.AddOrGet <CopyBuildingSettings>();
    }
    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);
    }
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.IndustrialMachinery, false);
            go.AddOrGet <DropAllWorkable>();
            go.AddOrGet <BuildingComplete>().isManuallyOperated = false;
            ComplexFabricator fabricator = go.AddOrGet <ComplexFabricator>();

            fabricator.sideScreenStyle   = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid;
            fabricator.duplicantOperated = false;
            go.AddOrGet <FabricatorIngredientStatusManager>();
            go.AddOrGet <CopyBuildingSettings>();
            BuildingTemplates.CreateComplexFabricatorStorage(go, fabricator);
            ConfigureRecipes();
            Prioritizable.AddRef(go);
        }
Beispiel #7
0
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            go.AddOrGet <DropAllWorkable>();
            go.AddOrGet <BuildingComplete>().isManuallyOperated = true;
            ComplexFabricator fabricator = go.AddOrGet <ComplexFabricator>();

            fabricator.resultState       = ComplexFabricator.ResultState.Heated;
            fabricator.heatedTemperature = 313.15f;
            fabricator.sideScreenStyle   = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid;
            fabricator.duplicantOperated = true;
            go.AddOrGet <FabricatorIngredientStatusManager>();
            go.AddOrGet <CopyBuildingSettings>();
            ComplexFabricatorWorkable fabricatorWorkable = go.AddOrGet <ComplexFabricatorWorkable>();

            BuildingTemplates.CreateComplexFabricatorStorage(go, fabricator);
            fabricatorWorkable.overrideAnims = new KAnimFile[1]
            {
                //Assets.GetAnim((HashedString) "anim_interacts_supermaterial_refinery_kanim")
                Assets.GetAnim((HashedString)"anim_interacts_metalrefinery_kanim")
            };
            Prioritizable.AddRef(go);


            //float num7 = 0.35f;
            ComplexRecipe.RecipeElement[] ingredients4 = new ComplexRecipe.RecipeElement[2]
            {
                new ComplexRecipe.RecipeElement((Tag)HatchConfig.EGG_ID, 1f),
                new ComplexRecipe.RecipeElement((Tag)RawEggConfig.ID, (float)(40 / 8))
            };
            ComplexRecipe.RecipeElement[] results4 = new ComplexRecipe.RecipeElement[1]
            {
                new ComplexRecipe.RecipeElement((Tag)HatchConfig.EGG_ID, 1f)
            };
            var r = new ComplexRecipe(ComplexRecipeManager.MakeRecipeID(ID, (IList <ComplexRecipe.RecipeElement>)ingredients4,
                                                                        (IList <ComplexRecipe.RecipeElement>)results4), ingredients4, results4)
            {
                time        = 80f / 8,
                description = RECOMBINATION_RECIPE_DESCRIPTION,
                nameDisplay = ComplexRecipe.RecipeNameDisplay.Result
            };

            RECIPE_RECOMBINATION = r;
            r.fabricators        = new List <Tag>()
            {
                TagManager.Create(ID)
            };
        }
Beispiel #8
0
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        go.AddOrGet <DropAllWorkable>();
        Prioritizable.AddRef(go);
        go.AddOrGet <BuildingComplete>().isManuallyOperated = true;
        ComplexFabricator complexFabricator = go.AddOrGet <ComplexFabricator>();

        complexFabricator.sideScreenStyle = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid;
        go.AddOrGet <FabricatorIngredientStatusManager>();
        go.AddOrGet <CopyBuildingSettings>();
        go.AddOrGet <ComplexFabricatorWorkable>().overrideAnims = new KAnimFile[1]
        {
            Assets.GetAnim("anim_interacts_fabricator_generic_kanim")
        };
        go.AddOrGet <ComplexFabricatorWorkable>().AnimOffset = new Vector3(-1f, 0f, 0f);
        complexFabricator.fetchChoreTypeIdHash = Db.Get().ChoreTypes.FabricateFetch.IdHash;
        BuildingTemplates.CreateComplexFabricatorStorage(go, complexFabricator);
        go.AddOrGet <LoopingSounds>();
    }
Beispiel #9
0
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.IndustrialMachinery, false);
        go.AddOrGet <BuildingComplete>().isManuallyOperated = true;
        go.AddOrGet <DropAllWorkable>();
        Prioritizable.AddRef(go);
        ComplexFabricator complexFabricator = go.AddOrGet <ComplexFabricator>();

        go.AddOrGet <ComplexFabricatorWorkable>().overrideAnims = new KAnimFile[1]
        {
            Assets.GetAnim("anim_interacts_clothingfactory_kanim")
        };
        go.AddOrGet <ComplexFabricatorWorkable>().AnimOffset = new Vector3(-1f, 0f, 0f);
        complexFabricator.sideScreenStyle = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid;
        go.AddOrGet <FabricatorIngredientStatusManager>();
        go.AddOrGet <CopyBuildingSettings>();
        ConfigureRecipes();
        BuildingTemplates.CreateComplexFabricatorStorage(go, complexFabricator);
    }
        public override void ConfigureBuildingTemplate(GameObject go, Tag tag)
        {
            go.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.IndustrialMachinery, false);
            go.AddOrGet <DropAllWorkable>();
            go.AddOrGet <BuildingComplete>().isManuallyOperated = false;

            var fab = go.AddOrGet <ComplexFabricator>();

            fab.resultState       = ComplexFabricator.ResultState.Heated;
            fab.heatedTemperature = KilnConfig.OUTPUT_TEMP;
            fab.duplicantOperated = false;
            fab.sideScreenStyle   = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid;
            fab.storeProduced     = true;
            go.AddOrGet <FabricatorIngredientStatusManager>();
            go.AddOrGet <CopyBuildingSettings>().copyGroupTag = TAG;

            BuildingTemplates.CreateComplexFabricatorStorage(go, fab);
            ConfigureRecipes();
        }
Beispiel #11
0
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        go.AddOrGet <BuildingComplete>().isManuallyOperated = true;
        CookingStation cookingStation = go.AddOrGet <CookingStation>();

        cookingStation.resultState       = ComplexFabricator.ResultState.Heated;
        cookingStation.heatedTemperature = 368.15f;
        go.AddOrGet <FabricatorIngredientStatusManager>();
        go.AddOrGet <CopyBuildingSettings>();
        go.AddOrGet <ComplexFabricatorWorkable>().overrideAnims = new KAnimFile[1]
        {
            Assets.GetAnim("anim_interacts_cookstation_kanim")
        };
        cookingStation.sideScreenStyle = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid;
        Prioritizable.AddRef(go);
        go.AddOrGet <DropAllWorkable>();
        ConfigureRecipes();
        go.AddOrGetDef <PoweredController.Def>();
        BuildingTemplates.CreateComplexFabricatorStorage(go, cookingStation);
    }
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        go.AddOrGet <DropAllWorkable>();
        go.AddOrGet <BuildingComplete>().isManuallyOperated = true;
        GourmetCookingStation gourmetCookingStation = go.AddOrGet <GourmetCookingStation>();

        gourmetCookingStation.resultState       = ComplexFabricator.ResultState.Heated;
        gourmetCookingStation.heatedTemperature = 368.15f;
        gourmetCookingStation.duplicantOperated = true;
        gourmetCookingStation.sideScreenStyle   = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid;
        go.AddOrGet <FabricatorIngredientStatusManager>();
        go.AddOrGet <CopyBuildingSettings>();
        go.AddOrGet <ComplexFabricatorWorkable>();
        BuildingTemplates.CreateComplexFabricatorStorage(go, gourmetCookingStation);
        gourmetCookingStation.fuelTag = FUEL_TAG;
        gourmetCookingStation.outStorage.capacityKg = 10f;
        gourmetCookingStation.inStorage.SetDefaultStoredItemModifiers(GourmetCookingStationStoredItemModifiers);
        gourmetCookingStation.buildStorage.SetDefaultStoredItemModifiers(GourmetCookingStationStoredItemModifiers);
        gourmetCookingStation.outStorage.SetDefaultStoredItemModifiers(GourmetCookingStationStoredItemModifiers);
        ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>();

        conduitConsumer.capacityTag          = FUEL_TAG;
        conduitConsumer.capacityKG           = 10f;
        conduitConsumer.alwaysConsume        = true;
        conduitConsumer.storage              = gourmetCookingStation.inStorage;
        conduitConsumer.forceAlwaysSatisfied = true;
        ElementConverter elementConverter = go.AddOrGet <ElementConverter>();

        elementConverter.consumedElements = new ElementConverter.ConsumedElement[1]
        {
            new ElementConverter.ConsumedElement(FUEL_TAG, 0.1f)
        };
        elementConverter.outputElements = new ElementConverter.OutputElement[1]
        {
            new ElementConverter.OutputElement(0.025f, SimHashes.CarbonDioxide, 348.15f, false, false, 0f, 3f, 1f, byte.MaxValue, 0)
        };
        ConfigureRecipes();
        Prioritizable.AddRef(go);
    }
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        go.AddOrGet <DropAllWorkable>();
        Prioritizable.AddRef(go);
        go.AddOrGet <BuildingComplete>().isManuallyOperated = true;
        ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>();

        conduitConsumer.conduitType = ConduitType.Liquid;
        MicrobeMusher microbeMusher = go.AddOrGet <MicrobeMusher>();

        microbeMusher.mushbarSpawnOffset = new Vector3(1f, 0f, 0f);
        go.AddOrGet <FabricatorIngredientStatusManager>();
        go.AddOrGet <CopyBuildingSettings>();
        go.AddOrGet <ComplexFabricatorWorkable>().overrideAnims = new KAnimFile[1]
        {
            Assets.GetAnim("anim_interacts_musher_kanim")
        };
        microbeMusher.sideScreenStyle = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid;
        BuildingTemplates.CreateComplexFabricatorStorage(go, microbeMusher);
        ConfigureRecipes();
        go.AddOrGetDef <PoweredController.Def>();
    }
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        go.AddOrGet <DropAllWorkable>();
        go.AddOrGet <BuildingComplete>().isManuallyOperated = true;
        go.AddOrGet <KBatchedAnimController>().SetSymbolVisiblity("snapto_egg", false);
        ComplexFabricator complexFabricator = go.AddOrGet <ComplexFabricator>();

        complexFabricator.labelByResult     = false;
        complexFabricator.sideScreenStyle   = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid;
        complexFabricator.duplicantOperated = true;
        go.AddOrGet <FabricatorIngredientStatusManager>();
        go.AddOrGet <CopyBuildingSettings>();
        ComplexFabricatorWorkable complexFabricatorWorkable = go.AddOrGet <ComplexFabricatorWorkable>();

        BuildingTemplates.CreateComplexFabricatorStorage(go, complexFabricator);
        complexFabricatorWorkable.overrideAnims = new KAnimFile[1]
        {
            Assets.GetAnim("anim_interacts_egg_cracker_kanim")
        };
        complexFabricator.outputOffset = new Vector3(1f, 1f, 0f);
        Prioritizable.AddRef(go);
        go.AddOrGet <EggCracker>();
    }
Beispiel #15
0
        private static bool Prefix(RockCrusherConfig __instance, ref GameObject go)
        {
            Debug.Log("Refinement Plus - RockCrusherConfig Postfix: ");
            Prioritizable.AddRef(go);
            go.AddOrGet <DropAllWorkable>();
            go.AddOrGet <BuildingComplete>().isManuallyOperated = true;
            var fabricator = go.AddOrGet <ComplexFabricator>();

            fabricator.sideScreenStyle   = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid;
            fabricator.duplicantOperated = true;
            go.AddOrGet <FabricatorIngredientStatusManager>();
            go.AddOrGet <CopyBuildingSettings>();
            var fabricatorWorkable = go.AddOrGet <ComplexFabricatorWorkable>();

            BuildingTemplates.CreateComplexFabricatorStorage(go, fabricator);
            fabricatorWorkable.overrideAnims = new[]
            {
                Assets.GetAnim((HashedString)"anim_interacts_rockrefinery_kanim")
            };
            fabricatorWorkable.workingPstComplete = new[]
            {
                (HashedString)"working_pst_complete"
            };
            var methods = new Methods();

            methods.clayToSlime();
            methods.limeCrushing();
            methods.fossilCrushing();
            methods.maficToRegolith();
            methods.mineralsCrushing();
            methods.oresToRefined();
            methods.organicToFert();
            methods.refinedToOres();
            methods.saltCrushing();
            methods.snowCone();
            return(false);
        }
Beispiel #16
0
        private static bool Prefix(RockCrusherConfig __instance, ref GameObject go)
        {
            Debug.Log("Refinement Plus - RockCrusherConfig Postfix: ");

            Prioritizable.AddRef(go);
            go.AddOrGet <DropAllWorkable>();
            go.AddOrGet <BuildingComplete>().isManuallyOperated = true;
            ComplexFabricator complexFabricator = go.AddOrGet <ComplexFabricator>();

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

            BuildingTemplates.CreateComplexFabricatorStorage(go, complexFabricator);
            complexFabricatorWorkable.overrideAnims = new KAnimFile[]
            { Assets.GetAnim("anim_interacts_rockrefinery_kanim") };
            complexFabricatorWorkable.workingPstComplete = "working_pst_complete";

            Methods mtd = new Methods();

            /* Clay To Slime */ mtd.clayToSlime();
            //* Corpses To Meal And Lime */		mtd.corpseToMeal();
            /* Eggs To Lime */ mtd.limeCrushing();
            /* Fossils To Lime And Sand */ mtd.fossilCrushing();
            /* Mafic Rock To Regolith */ mtd.maficToRegolith();
            /* Minerals To Sand Overhaul */ mtd.mineralsCrushing();
            /* Ores To Refined */ mtd.oresToRefined();
            /* Organic To Fert */ mtd.organicToFert();
            /* Refined To Ores */ mtd.refinedToOres();
            /* Salt To Table Salt */ mtd.saltCrushing();
            /* Crush Ice */ mtd.snowCone();

            return(false);
        }
Beispiel #17
0
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        go.AddOrGet <DropAllWorkable>();
        go.AddOrGet <BuildingComplete>().isManuallyOperated = true;
        ComplexFabricator complexFabricator = go.AddOrGet <ComplexFabricator>();

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

        BuildingTemplates.CreateComplexFabricatorStorage(go, complexFabricator);
        complexFabricatorWorkable.overrideAnims = new KAnimFile[1]
        {
            Assets.GetAnim("anim_interacts_rockrefinery_kanim")
        };
        complexFabricatorWorkable.workingPstComplete = "working_pst_complete";
        Tag            tag  = SimHashes.Sand.CreateTag();
        List <Element> list = ElementLoader.elements.FindAll((Element e) => e.HasTag(GameTags.Crushable));
        ComplexRecipe  complexRecipe;

        foreach (Element item in list)
        {
            ComplexRecipe.RecipeElement[] array = new ComplexRecipe.RecipeElement[1]
            {
                new ComplexRecipe.RecipeElement(item.tag, 100f)
            };
            ComplexRecipe.RecipeElement[] array2 = new ComplexRecipe.RecipeElement[1]
            {
                new ComplexRecipe.RecipeElement(tag, 100f)
            };
            string obsolete_id = ComplexRecipeManager.MakeObsoleteRecipeID("RockCrusher", item.tag);
            string text        = ComplexRecipeManager.MakeRecipeID("RockCrusher", array, array2);
            complexRecipe             = new ComplexRecipe(text, array, array2);
            complexRecipe.time        = 40f;
            complexRecipe.description = string.Format(STRINGS.BUILDINGS.PREFABS.ROCKCRUSHER.RECIPE_DESCRIPTION, item.name, tag.ProperName());
            complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult;
            complexRecipe.fabricators = new List <Tag>
            {
                TagManager.Create("RockCrusher")
            };
            ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id, text);
        }
        List <Element> list2 = ElementLoader.elements.FindAll((Element e) => e.IsSolid && e.HasTag(GameTags.Metal));

        foreach (Element item2 in list2)
        {
            Element highTempTransition = item2.highTempTransition;
            Element lowTempTransition  = highTempTransition.lowTempTransition;
            if (lowTempTransition != item2)
            {
                ComplexRecipe.RecipeElement[] array3 = new ComplexRecipe.RecipeElement[1]
                {
                    new ComplexRecipe.RecipeElement(item2.tag, 100f)
                };
                ComplexRecipe.RecipeElement[] array4 = new ComplexRecipe.RecipeElement[2]
                {
                    new ComplexRecipe.RecipeElement(lowTempTransition.tag, 50f),
                    new ComplexRecipe.RecipeElement(tag, 50f)
                };
                string obsolete_id2 = ComplexRecipeManager.MakeObsoleteRecipeID("RockCrusher", lowTempTransition.tag);
                string text2        = ComplexRecipeManager.MakeRecipeID("RockCrusher", array3, array4);
                complexRecipe             = new ComplexRecipe(text2, array3, array4);
                complexRecipe.time        = 40f;
                complexRecipe.description = string.Format(STRINGS.BUILDINGS.PREFABS.ROCKCRUSHER.METAL_RECIPE_DESCRIPTION, lowTempTransition.name, item2.name);
                complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult;
                complexRecipe.fabricators = new List <Tag>
                {
                    TagManager.Create("RockCrusher")
                };
                ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id2, text2);
            }
        }
        Element element = ElementLoader.FindElementByHash(SimHashes.Lime);

        ComplexRecipe.RecipeElement[] array5 = new ComplexRecipe.RecipeElement[1]
        {
            new ComplexRecipe.RecipeElement("EggShell", 5f)
        };
        ComplexRecipe.RecipeElement[] array6 = new ComplexRecipe.RecipeElement[1]
        {
            new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Lime).tag, 5f)
        };
        string obsolete_id3 = ComplexRecipeManager.MakeObsoleteRecipeID("RockCrusher", element.tag);
        string text3        = ComplexRecipeManager.MakeRecipeID("RockCrusher", array5, array6);

        complexRecipe             = new ComplexRecipe(text3, array5, array6);
        complexRecipe.time        = 40f;
        complexRecipe.description = string.Format(STRINGS.BUILDINGS.PREFABS.ROCKCRUSHER.LIME_RECIPE_DESCRIPTION, SimHashes.Lime.CreateTag().ProperName(), MISC.TAGS.EGGSHELL);
        complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult;
        complexRecipe.fabricators = new List <Tag>
        {
            TagManager.Create("RockCrusher")
        };
        ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id3, text3);
        Element element2 = ElementLoader.FindElementByHash(SimHashes.Lime);

        ComplexRecipe.RecipeElement[] array7 = new ComplexRecipe.RecipeElement[1]
        {
            new ComplexRecipe.RecipeElement("BabyCrabShell", 1f)
        };
        ComplexRecipe.RecipeElement[] array8 = new ComplexRecipe.RecipeElement[1]
        {
            new ComplexRecipe.RecipeElement(element2.tag, 5f)
        };
        string id = ComplexRecipeManager.MakeRecipeID("RockCrusher", array7, array8);

        complexRecipe             = new ComplexRecipe(id, array7, array8);
        complexRecipe.time        = 40f;
        complexRecipe.description = string.Format(STRINGS.BUILDINGS.PREFABS.ROCKCRUSHER.LIME_RECIPE_DESCRIPTION, SimHashes.Lime.CreateTag().ProperName(), ITEMS.INDUSTRIAL_PRODUCTS.CRAB_SHELL.NAME);
        complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult;
        complexRecipe.fabricators = new List <Tag>
        {
            TagManager.Create("RockCrusher")
        };
        Element element3 = ElementLoader.FindElementByHash(SimHashes.Lime);

        ComplexRecipe.RecipeElement[] array9 = new ComplexRecipe.RecipeElement[1]
        {
            new ComplexRecipe.RecipeElement("CrabShell", 1f)
        };
        ComplexRecipe.RecipeElement[] array10 = new ComplexRecipe.RecipeElement[1]
        {
            new ComplexRecipe.RecipeElement(element3.tag, 10f)
        };
        string id2 = ComplexRecipeManager.MakeRecipeID("RockCrusher", array9, array10);

        complexRecipe             = new ComplexRecipe(id2, array9, array10);
        complexRecipe.time        = 40f;
        complexRecipe.description = string.Format(STRINGS.BUILDINGS.PREFABS.ROCKCRUSHER.LIME_RECIPE_DESCRIPTION, SimHashes.Lime.CreateTag().ProperName(), ITEMS.INDUSTRIAL_PRODUCTS.CRAB_SHELL.NAME);
        complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult;
        complexRecipe.fabricators = new List <Tag>
        {
            TagManager.Create("RockCrusher")
        };
        ComplexRecipe.RecipeElement[] array11 = new ComplexRecipe.RecipeElement[1]
        {
            new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Fossil).tag, 100f)
        };
        ComplexRecipe.RecipeElement[] array12 = new ComplexRecipe.RecipeElement[2]
        {
            new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Lime).tag, 5f),
            new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.SedimentaryRock).tag, 95f)
        };
        string id3 = ComplexRecipeManager.MakeRecipeID("RockCrusher", array11, array12);

        complexRecipe             = new ComplexRecipe(id3, array11, array12);
        complexRecipe.time        = 40f;
        complexRecipe.description = string.Format(STRINGS.BUILDINGS.PREFABS.ROCKCRUSHER.LIME_FROM_LIMESTONE_RECIPE_DESCRIPTION, SimHashes.Fossil.CreateTag().ProperName(), SimHashes.SedimentaryRock.CreateTag().ProperName(), SimHashes.Lime.CreateTag().ProperName());
        complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult;
        complexRecipe.fabricators = new List <Tag>
        {
            TagManager.Create("RockCrusher")
        };
        float num = 5E-05f;

        ComplexRecipe.RecipeElement[] array13 = new ComplexRecipe.RecipeElement[1]
        {
            new ComplexRecipe.RecipeElement(SimHashes.Salt.CreateTag(), 100f)
        };
        ComplexRecipe.RecipeElement[] array14 = new ComplexRecipe.RecipeElement[2]
        {
            new ComplexRecipe.RecipeElement(TableSaltConfig.ID.ToTag(), 100f * num),
            new ComplexRecipe.RecipeElement(SimHashes.Sand.CreateTag(), 100f * (1f - num))
        };
        string id4 = ComplexRecipeManager.MakeRecipeID("RockCrusher", array13, array14);

        complexRecipe             = new ComplexRecipe(id4, array13, array14);
        complexRecipe.time        = 40f;
        complexRecipe.description = string.Format(STRINGS.BUILDINGS.PREFABS.ROCKCRUSHER.RECIPE_DESCRIPTION, SimHashes.Salt.CreateTag().ProperName(), ITEMS.INDUSTRIAL_PRODUCTS.TABLE_SALT.NAME);
        complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult;
        complexRecipe.fabricators = new List <Tag>
        {
            TagManager.Create("RockCrusher")
        };
        Prioritizable.AddRef(go);
    }
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        go.AddOrGet <DropAllWorkable>();
        go.AddOrGet <BuildingComplete>().isManuallyOperated = true;
        LiquidCooledRefinery liquidCooledRefinery = go.AddOrGet <LiquidCooledRefinery>();

        liquidCooledRefinery.duplicantOperated = true;
        liquidCooledRefinery.sideScreenStyle   = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid;
        liquidCooledRefinery.keepExcessLiquids = true;
        go.AddOrGet <FabricatorIngredientStatusManager>();
        go.AddOrGet <CopyBuildingSettings>();
        ComplexFabricatorWorkable complexFabricatorWorkable = go.AddOrGet <ComplexFabricatorWorkable>();

        BuildingTemplates.CreateComplexFabricatorStorage(go, liquidCooledRefinery);
        liquidCooledRefinery.coolantTag            = COOLANT_TAG;
        liquidCooledRefinery.minCoolantMass        = 400f;
        liquidCooledRefinery.outStorage.capacityKg = 2000f;
        liquidCooledRefinery.thermalFudge          = 0.8f;
        liquidCooledRefinery.inStorage.SetDefaultStoredItemModifiers(RefineryStoredItemModifiers);
        liquidCooledRefinery.buildStorage.SetDefaultStoredItemModifiers(RefineryStoredItemModifiers);
        liquidCooledRefinery.outStorage.SetDefaultStoredItemModifiers(RefineryStoredItemModifiers);
        liquidCooledRefinery.outputOffset       = new Vector3(1f, 0.5f);
        complexFabricatorWorkable.overrideAnims = new KAnimFile[1]
        {
            Assets.GetAnim("anim_interacts_metalrefinery_kanim")
        };
        RequireOutputs requireOutputs = go.AddOrGet <RequireOutputs>();

        requireOutputs.ignoreFullPipe = true;
        ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>();

        conduitConsumer.capacityTag          = GameTags.Liquid;
        conduitConsumer.capacityKG           = 800f;
        conduitConsumer.storage              = liquidCooledRefinery.inStorage;
        conduitConsumer.alwaysConsume        = true;
        conduitConsumer.forceAlwaysSatisfied = true;
        ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>();

        conduitDispenser.storage        = liquidCooledRefinery.outStorage;
        conduitDispenser.conduitType    = ConduitType.Liquid;
        conduitDispenser.elementFilter  = null;
        conduitDispenser.alwaysDispense = true;
        List <Element> list = ElementLoader.elements.FindAll((Element e) => e.IsSolid && e.HasTag(GameTags.Metal));
        ComplexRecipe  complexRecipe;

        foreach (Element item in list)
        {
            Element highTempTransition = item.highTempTransition;
            Element lowTempTransition  = highTempTransition.lowTempTransition;
            if (lowTempTransition != item)
            {
                ComplexRecipe.RecipeElement[] array = new ComplexRecipe.RecipeElement[1]
                {
                    new ComplexRecipe.RecipeElement(item.tag, 100f)
                };
                ComplexRecipe.RecipeElement[] array2 = new ComplexRecipe.RecipeElement[1]
                {
                    new ComplexRecipe.RecipeElement(lowTempTransition.tag, 100f)
                };
                string obsolete_id = ComplexRecipeManager.MakeObsoleteRecipeID("MetalRefinery", item.tag);
                string text        = ComplexRecipeManager.MakeRecipeID("MetalRefinery", array, array2);
                complexRecipe             = new ComplexRecipe(text, array, array2);
                complexRecipe.time        = 40f;
                complexRecipe.description = string.Format(STRINGS.BUILDINGS.PREFABS.METALREFINERY.RECIPE_DESCRIPTION, lowTempTransition.name, item.name);
                complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult;
                complexRecipe.fabricators = new List <Tag>
                {
                    TagManager.Create("MetalRefinery")
                };
                ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id, text);
            }
        }
        Element element = ElementLoader.FindElementByHash(SimHashes.Steel);

        ComplexRecipe.RecipeElement[] array3 = new ComplexRecipe.RecipeElement[3]
        {
            new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Iron).tag, 70f),
            new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.RefinedCarbon).tag, 20f),
            new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Lime).tag, 10f)
        };
        ComplexRecipe.RecipeElement[] array4 = new ComplexRecipe.RecipeElement[1]
        {
            new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Steel).tag, 100f)
        };
        string obsolete_id2 = ComplexRecipeManager.MakeObsoleteRecipeID("MetalRefinery", element.tag);
        string text2        = ComplexRecipeManager.MakeRecipeID("MetalRefinery", array3, array4);

        complexRecipe             = new ComplexRecipe(text2, array3, array4);
        complexRecipe.time        = 40f;
        complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult;
        complexRecipe.description = string.Format(STRINGS.BUILDINGS.PREFABS.METALREFINERY.RECIPE_DESCRIPTION, ElementLoader.FindElementByHash(SimHashes.Steel).name, ElementLoader.FindElementByHash(SimHashes.Iron).name);
        complexRecipe.fabricators = new List <Tag>
        {
            TagManager.Create("MetalRefinery")
        };
        ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id2, text2);
        Prioritizable.AddRef(go);
    }
Beispiel #19
0
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            go.AddOrGet <DropAllWorkable>();
            go.AddOrGet <BuildingComplete>().isManuallyOperated = true;
            go.AddOrGet <FabricatorIngredientStatusManager>();
            go.AddOrGet <CopyBuildingSettings>();

            var lcfr = go.AddOrGet <LiquidCooledFueledRefinery>();

            lcfr.duplicantOperated = true;
            lcfr.sideScreenStyle   = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid;
            lcfr.keepExcessLiquids = true;
            BuildingTemplates.CreateComplexFabricatorStorage(go, lcfr);
            lcfr.coolantTag            = COOLANT_TAG;
            lcfr.minCoolantMass        = COOLANT_MASS;
            lcfr.maxCoolantMass        = COOLANT_MASS * 3;
            lcfr.outStorage.capacityKg = 2000f;
            lcfr.thermalFudge          = LIQUID_COOLED_HEAT_PORTION;
            lcfr.fuelTag = FUEL_TAG;
            lcfr.inStorage.SetDefaultStoredItemModifiers(RefineryStoredItemModifiers);
            lcfr.buildStorage.SetDefaultStoredItemModifiers(RefineryStoredItemModifiers);
            lcfr.outStorage.SetDefaultStoredItemModifiers(RefineryStoredItemModifiers);
            lcfr.outputOffset = new Vector3(0.8f, 0.5f);

            var manualDeliveryKG = go.AddOrGet <ManualDeliveryKG>();

            manualDeliveryKG.SetStorage(lcfr.outStorage);
            manualDeliveryKG.requestedItemTag       = FUEL_TAG;
            manualDeliveryKG.capacity               = FUEL_STORE_CAPACITY;
            manualDeliveryKG.refillMass             = FUEL_STORE_CAPACITY / 2;
            manualDeliveryKG.choreTypeIDHash        = Db.Get().ChoreTypes.MachineFetch.IdHash;
            manualDeliveryKG.operationalRequirement = FetchOrder2.OperationalRequirement.Functional;

            var workable = go.AddOrGet <SmelterWorkable>();

            workable.overrideAnims = new KAnimFile[] { Assets.GetAnim("anim_interacts_smelter_kanim") };
            workable.AnimOffset    = Vector3.left;

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

            conduitConsumer.capacityTag          = GameTags.Liquid;
            conduitConsumer.capacityKG           = COOLANT_MASS * 2;
            conduitConsumer.storage              = lcfr.inStorage;
            conduitConsumer.alwaysConsume        = true;
            conduitConsumer.forceAlwaysSatisfied = true;

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

            elementConverter.consumedElements = new ElementConverter.ConsumedElement[]
            {
                new ElementConverter.ConsumedElement(FUEL_TAG, FUEL_CONSUME_RATE)
            };
            elementConverter.outputElements = new ElementConverter.OutputElement[]
            {
                new ElementConverter.OutputElement(CO2_EMIT_RATE, SimHashes.CarbonDioxide, CO2_OUTPUT_TEMPERATURE, false, false, 1f, 2f)
            };

            var smelterWorkableEmpty = go.AddOrGet <SmelterWorkableEmpty>();

            smelterWorkableEmpty.workTime  = BUILDINGS.WORK_TIME_SECONDS.SHORT_WORK_TIME;
            smelterWorkableEmpty.workLayer = Grid.SceneLayer.BuildingFront;

            Prioritizable.AddRef(go);
        }