예제 #1
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);
        }
예제 #2
0
            static void Postfix(GlassForgeConfig __instance, ref GameObject go)
            {
                bool       GlassDupeWork = DynamicBuildingsState.StateManager.State.GlassDupe;
                GlassForge glassForge    = go.AddOrGet <GlassForge>();

                glassForge.duplicantOperated = GlassDupeWork;
            }
    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);
    }