예제 #1
0
    public GameObject CreatePrefab()
    {
        GameObject gameObject = EntityTemplates.CreateLooseEntity("IntermediateCure", ITEMS.PILLS.INTERMEDIATECURE.NAME, ITEMS.PILLS.INTERMEDIATECURE.DESC, 1f, true, Assets.GetAnim("iv_slimelung_kanim"), "object", Grid.SceneLayer.Front, EntityTemplates.CollisionShape.RECTANGLE, 0.8f, 0.4f, true, 0, SimHashes.Creature, null);
        KPrefabID  component  = gameObject.GetComponent <KPrefabID>();

        component.AddTag(GameTags.MedicalSupplies, false);
        ComplexRecipe.RecipeElement[] array = new ComplexRecipe.RecipeElement[2]
        {
            new ComplexRecipe.RecipeElement(SwampLilyFlowerConfig.ID, 1f),
            new ComplexRecipe.RecipeElement(SimHashes.Phosphorite.CreateTag(), 1f)
        };
        ComplexRecipe.RecipeElement[] array2 = new ComplexRecipe.RecipeElement[1]
        {
            new ComplexRecipe.RecipeElement("IntermediateCure", 1f)
        };
        string        id            = ComplexRecipeManager.MakeRecipeID("Apothecary", array, array2);
        ComplexRecipe complexRecipe = new ComplexRecipe(id, array, array2);

        complexRecipe.time        = 100f;
        complexRecipe.description = ITEMS.PILLS.INTERMEDIATECURE.RECIPEDESC;
        complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.Result;
        complexRecipe.fabricators = new List <Tag>
        {
            "Apothecary"
        };
        complexRecipe.sortOrder    = 10;
        complexRecipe.requiredTech = "MedicineII";
        recipe = complexRecipe;
        return(gameObject);
    }
예제 #2
0
    public GameObject CreatePrefab()
    {
        GameObject gameObject = EntityTemplates.CreateLooseEntity("BasicBooster", ITEMS.PILLS.BASICBOOSTER.NAME, ITEMS.PILLS.BASICBOOSTER.DESC, 1f, true, Assets.GetAnim("pill_2_kanim"), "object", Grid.SceneLayer.Front, EntityTemplates.CollisionShape.RECTANGLE, 0.8f, 0.4f, true, 0, SimHashes.Creature, null);

        EntityTemplates.ExtendEntityToMedicine(gameObject, MEDICINE.BASICBOOSTER);
        ComplexRecipe.RecipeElement[] array = new ComplexRecipe.RecipeElement[1]
        {
            new ComplexRecipe.RecipeElement("Carbon", 1f)
        };
        ComplexRecipe.RecipeElement[] array2 = new ComplexRecipe.RecipeElement[1]
        {
            new ComplexRecipe.RecipeElement("BasicBooster".ToTag(), 1f)
        };
        string        id            = ComplexRecipeManager.MakeRecipeID("Apothecary", array, array2);
        ComplexRecipe complexRecipe = new ComplexRecipe(id, array, array2);

        complexRecipe.time        = 50f;
        complexRecipe.description = ITEMS.PILLS.BASICBOOSTER.RECIPEDESC;
        complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.Result;
        complexRecipe.fabricators = new List <Tag>
        {
            "Apothecary"
        };
        complexRecipe.sortOrder = 1;
        recipe = complexRecipe;
        return(gameObject);
    }
        public GameObject CreatePrefab()
        {
            GameObject looseEntity = EntityTemplates.CreateLooseEntity(ID, Name, Description, 1f, true, Assets.GetAnim((HashedString)"floral_antihistamine_kanim"),
                                                                       "object", Grid.SceneLayer.Front, EntityTemplates.CollisionShape.RECTANGLE, 0.8f, 0.4f, true, 0, SimHashes.Creature, (List <Tag>)null);
            MedicineInfo medicine_info = new MedicineInfo(ID.ToLower(), Effect_, MedicineInfo.MedicineType.CureSpecific, (string)null, new string[1]
            {
                "Allergies"
            });

            EntityTemplates.ExtendEntityToMedicine(looseEntity, medicine_info);
            looseEntity.GetComponent <KPrefabID>().AddTag(GameTags.MedicalSupplies, false);
            ComplexRecipe.RecipeElement[] ingredients = new ComplexRecipe.RecipeElement[2]
            {
                new ComplexRecipe.RecipeElement(SimHashes.Copper.CreateTag(), 100f),
                new ComplexRecipe.RecipeElement((Tag)FilamentsConfig.Id, 50f)
            };
            ComplexRecipe.RecipeElement[] results = new ComplexRecipe.RecipeElement[1]
            {
                new ComplexRecipe.RecipeElement((Tag)ID, 1f)
            };

            FloralAntihistamineConfig.recipe = new ComplexRecipe(ComplexRecipeManager.MakeRecipeID("Apothecary", (IList <ComplexRecipe.RecipeElement>)ingredients, (IList <ComplexRecipe.RecipeElement>)results), ingredients, results, 0)
            {
                time        = 200f,
                description = (string)Description,
                nameDisplay = ComplexRecipe.RecipeNameDisplay.Result,
                fabricators = new List <Tag>()
                {
                    (Tag)"Apothecary"
                },
                sortOrder    = 20,
                requiredTech = AdvancedCureConfig.recipe.requiredTech// "MedicineIV"
            };
            return(looseEntity);
        }
예제 #4
0
        private void ConfigureRecipes()
        {
            float inputAmount  = 200.0f;
            float outputAmount = 100.0f;

            ComplexRecipe.RecipeElement[] ingredients1 = new ComplexRecipe.RecipeElement[1]
            {
                new ComplexRecipe.RecipeElement(
                    ElementLoader.FindElementByHash(SimHashes.Sand).tag,
                    inputAmount)
            };
            ComplexRecipe.RecipeElement[] results1 = new ComplexRecipe.RecipeElement[1]
            {
                new ComplexRecipe.RecipeElement(
                    ElementLoader.FindElementByHash(SimHashes.Salt).tag,
                    outputAmount)
            };
            string str1 = ComplexRecipeManager.MakeRecipeID(Id,
                                                            ingredients1, results1);
            string desc1 = $"Polishes sand into salt.";

            new ComplexRecipe(str1, ingredients1, results1)
            {
                time        = BUILDINGS.FABRICATION_TIME_SECONDS.SHORT,
                nameDisplay = ComplexRecipe.RecipeNameDisplay.Result,
                description = desc1
            }.fabricators = new List <Tag>()
            {
                TagManager.Create(Id)
            };
        }
예제 #5
0
        private static void Postfix(Game __instance, GameObject go)
        {
            if (CustomizeBuildingsState.StateManager.State.NewRecipeRockCrusher)
            {
                string workstation = "RockCrusher"; // "Kiln"

                Tag   ingredient1 = SimHashes.Regolith.CreateTag();
                float amountIn1   = 100f;
                Tag   result1     = SimHashes.Sand.CreateTag();
                float amountOut1  = 99f;

                ComplexRecipe.RecipeElement[] ingredients1 = new ComplexRecipe.RecipeElement[] { new ComplexRecipe.RecipeElement(ingredient1, amountIn1) };
                ComplexRecipe.RecipeElement[] results1     = new ComplexRecipe.RecipeElement[] { new ComplexRecipe.RecipeElement(result1, amountOut1) };

                string        obsolete_id1   = ComplexRecipeManager.MakeObsoleteRecipeID(workstation, result1);
                string        str1           = ComplexRecipeManager.MakeRecipeID(workstation, (IList <ComplexRecipe.RecipeElement>)ingredients1, (IList <ComplexRecipe.RecipeElement>)results1);
                ComplexRecipe complexRecipe1 = new ComplexRecipe(str1, ingredients1, results1)
                {
                    time        = 40f,
                    description = "Turns Regolith into Sand and Dirt.",
                    fabricators = new List <Tag>()
                    {
                        TagManager.Create(workstation)
                    },
                    nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult
                };
                ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id1, str1);
            }
        }
예제 #6
0
        public GameObject CreatePrefab()
        {
            Db.Get().effects.Add(CreateEffect());

            GameObject gameObject = EntityTemplates.CreateLooseEntity("Stimulant", "Stimulant", "Temporarily increases physical ability at the cost of increased metabolism.", 1f, unitMass: true, Assets.GetAnim("pill_2_kanim"), "object", Grid.SceneLayer.Front, EntityTemplates.CollisionShape.RECTANGLE, 0.8f, 0.4f, isPickupable: true);

            EntityTemplates.ExtendEntityToMedicine(gameObject, medicineInfo);
            ComplexRecipe.RecipeElement[] inputs = new ComplexRecipe.RecipeElement[3]
            {
                new ComplexRecipe.RecipeElement(SimHashes.RefinedCarbon.CreateTag(), 10f),
                new ComplexRecipe.RecipeElement(SpiceNutConfig.ID, 1f),
                new ComplexRecipe.RecipeElement("LightBugEgg", 1f)
            };
            ComplexRecipe.RecipeElement[] outputs = new ComplexRecipe.RecipeElement[1]
            {
                new ComplexRecipe.RecipeElement("Stimulant", 10f)
            };
            string id = ComplexRecipeManager.MakeRecipeID("Apothecary", inputs, outputs);

            recipe = new ComplexRecipe(id, inputs, outputs)
            {
                time        = 75f,
                description = "Temporarily increases physical ability at the cost of increased metabolism.",
                nameDisplay = ComplexRecipe.RecipeNameDisplay.Result,
                fabricators = new List <Tag> {
                    "Apothecary"
                },
                sortOrder = 1
            };
            return(gameObject);
        }
예제 #7
0
    public static void Postfix()
    {
        float num1 = 0.01f;

        ComplexRecipe.RecipeElement[] ingredients2 = new ComplexRecipe.RecipeElement[2]
        {
            new ComplexRecipe.RecipeElement(SimHashes.SolidMercury.CreateTag(), 50f),
            new ComplexRecipe.RecipeElement(SimHashes.TempConductorSolid.CreateTag(), 50f)
        };
        ComplexRecipe.RecipeElement[] results2 = new ComplexRecipe.RecipeElement[1]
        {
            new ComplexRecipe.RecipeElement(SimHashes.Radium.CreateTag(), 100f)
        };
        ComplexRecipe complexRecipe3 = new ComplexRecipe(ComplexRecipeManager.MakeRecipeID("SupermaterialRefinery", (IList <ComplexRecipe.RecipeElement>)ingredients2, (IList <ComplexRecipe.RecipeElement>)results2), ingredients2, results2);

        complexRecipe3.time                   = 80f;
        complexRecipe3.description            = (string)STRINGS.BUILDINGS.PREFABS.SUPERMATERIALREFINERY.SUPERCOOLANT_RECIPE_DESCRIPTION;
        complexRecipe3.useResultAsDescription = true;
        ComplexRecipe complexRecipe4 = complexRecipe3;
        List <Tag>    tagList3       = new List <Tag>();

        tagList3.Add(TagManager.Create("SupermaterialRefinery"));
        List <Tag> tagList4 = tagList3;

        complexRecipe4.fabricators = tagList4;

        /*
         *      ComplexRecipe.RecipeElement[] ingredients = new ComplexRecipe.RecipeElement[3]
         * {
         *      new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Steel).tag, 25f),
         *      new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Glass).tag, 25f),
         *      new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.SolidNaphtha).tag, 100f)
         * };
         *      ComplexRecipe.RecipeElement[] results = new ComplexRecipe.RecipeElement[1]
         *      {
         * new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.LiquidPropane).tag, 100f)
         *      };
         *      string obsolete_id = ComplexRecipeManager.MakeObsoleteRecipeID("GlassForge", ingredients[0].material);
         *      string str = ComplexRecipeManager.MakeRecipeID("GlassForge", (IList<ComplexRecipe.RecipeElement>)ingredients, (IList<ComplexRecipe.RecipeElement>)results);
         *      new ComplexRecipe(str, ingredients, results)
         *      {
         *              time = 40f,
         *              useResultAsDescription = true,
         *              description = string.Format((string)STRINGS.BUILDINGS.PREFABS.GLASSFORGE.RECIPE_DESCRIPTION, (object)ElementLoader.GetElement(results[0].material).name, (object)ElementLoader.GetElement(ingredients[0].material).name)
         *
         *      }.fabricators = new List<Tag>()
         * {
         * TagManager.Create("GlassForge")
         * };
         *      ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id, str);*/
    }