public void clayToSlime() { Tag clay = SimHashes.Clay.CreateTag(); Tag dirt = SimHashes.ToxicSand.CreateTag(); Tag slime = SimHashes.SlimeMold.CreateTag(); string desc = "Mixes {0} with {1} to create {2}"; ComplexRecipe.RecipeElement[] input = new ComplexRecipe.RecipeElement[] { new ComplexRecipe.RecipeElement(clay, 200), new ComplexRecipe.RecipeElement(dirt, 200) }; ComplexRecipe.RecipeElement[] output = new ComplexRecipe.RecipeElement[] { new ComplexRecipe.RecipeElement(slime, 400) }; ComplexRecipe recipe = new ComplexRecipe(ComplexRecipeManager.MakeRecipeID("RockCrusher", input, output), input, output); recipe.time = 100f; recipe.description = string.Format(desc, clay, dirt, slime); recipe.fabricators = new List <Tag> { TagManager.Create("RockCrusher") }; recipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult; recipesIDs.Add(recipe.id); }
public void burnCloth() { Dictionary <string, string> vests = new Dictionary <string, string> { { "Cool_Vest", EQUIPMENT.PREFABS.COOL_VEST.NAME }, { "Funky_Vest", EQUIPMENT.PREFABS.FUNKY_VEST.NAME }, { "Warm_Vest", EQUIPMENT.PREFABS.WARM_VEST.NAME } }; Tag coal = SimHashes.Carbon.CreateTag(); string descBurn = "Burn old {0}"; foreach (KeyValuePair <string, string> vest in vests) { ComplexRecipe.RecipeElement[] input = new ComplexRecipe.RecipeElement[] { new ComplexRecipe.RecipeElement(vest.Key, 1) }; ComplexRecipe.RecipeElement[] output = new ComplexRecipe.RecipeElement[] { new ComplexRecipe.RecipeElement(coal, 3) }; ComplexRecipe recipe = new ComplexRecipe(ComplexRecipeManager.MakeRecipeID("Kiln", input, output), input, output); recipe.time = 55f; recipe.description = string.Format(descBurn, vest.Value); recipe.fabricators = new List <Tag> { TagManager.Create("Kiln") }; recipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult; recipesIDs.Add(recipe.id); } }
public void fossilCrushing() { Tag fossil = SimHashes.Fossil.CreateTag(); Tag lime = SimHashes.Lime.CreateTag(); Tag sand = SimHashes.Sand.CreateTag(); string desc = "Crushes {0} into {1} and {2}"; ComplexRecipe.RecipeElement[] input = new ComplexRecipe.RecipeElement[] { new ComplexRecipe.RecipeElement(fossil, 100) }; ComplexRecipe.RecipeElement[] output = new ComplexRecipe.RecipeElement[] { new ComplexRecipe.RecipeElement(lime, 5), new ComplexRecipe.RecipeElement(sand, 95) }; ComplexRecipe recipe = new ComplexRecipe(ComplexRecipeManager.MakeRecipeID("RockCrusher", input, output), input, output); recipe.time = 40f; recipe.description = string.Format(desc, fossil, lime, sand); recipe.fabricators = new List <Tag> { TagManager.Create("RockCrusher") }; recipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult; recipesIDs.Add(recipe.id); }
public void saltCrushing() { Tag salt = SimHashes.Salt.CreateTag(); Tag tableSalt = TableSaltConfig.ID.ToTag(); Tag sand = SimHashes.Sand.CreateTag(); float num = 5E-05f; string desc = "Crushes {0} into {1} and some {2}"; ComplexRecipe.RecipeElement[] input = new ComplexRecipe.RecipeElement[] { new ComplexRecipe.RecipeElement(salt, 100) }; ComplexRecipe.RecipeElement[] output = new ComplexRecipe.RecipeElement[] { new ComplexRecipe.RecipeElement(tableSalt, 100 * num), new ComplexRecipe.RecipeElement(sand, 100 * (1 - num)) }; ComplexRecipe recipe = new ComplexRecipe(ComplexRecipeManager.MakeRecipeID("RockCrusher", input, output), input, output); recipe.time = 120f; recipe.description = string.Format(desc, salt, tableSalt, sand); recipe.fabricators = new List <Tag> { TagManager.Create("RockCrusher") }; recipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult; recipesIDs.Add(recipe.id); }
public static void Postfix() { Element pyrite = ElementLoader.FindElementByHash(SimHashes.FoolsGold); pyrite.thermalConductivity = ElementLoader.FindElementByHash(SimHashes.Ceramic).thermalConductivity; ComplexRecipe.RecipeElement recipeElement3 = new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.IronOre).tag, 50f); ComplexRecipe.RecipeElement recipeElement4 = new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Gold).tag, 20f); ComplexRecipe.RecipeElement recipeElement6 = new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.FoolsGold).tag, 50f); ComplexRecipe.RecipeElement[] ingredients1 = new ComplexRecipe.RecipeElement[2] { recipeElement3, recipeElement4 }; ComplexRecipe.RecipeElement[] results1 = new ComplexRecipe.RecipeElement[1] { recipeElement6 }; string str1 = ComplexRecipeManager.MakeRecipeID("MetalRefinery", (IList <ComplexRecipe.RecipeElement>)results1, (IList <ComplexRecipe.RecipeElement>)ingredients1); new ComplexRecipe(str1, ingredients1, results1) { time = 1000f, useResultAsDescription = true, description = string.Format((string)STRINGS.BUILDINGS.PREFABS.METALREFINERY.RECIPE_DESCRIPTION, (object)ElementLoader.GetElement(recipeElement3.material).name, (object)ElementLoader.GetElement(recipeElement6.material).name) }.fabricators = new List <Tag>() { TagManager.Create("MetalRefinery") }; }
public void add_recipe_Dirt() { ComplexRecipe.RecipeElement[] ingredients = new ComplexRecipe.RecipeElement[4] { new ComplexRecipe.RecipeElement(SimHashes.Granite.CreateTag(), 1000f), new ComplexRecipe.RecipeElement(SimHashes.Water.CreateTag(), 1000f), new ComplexRecipe.RecipeElement(SimHashes.DirtyWater.CreateTag(), 1000f), new ComplexRecipe.RecipeElement(SimHashes.Obsidian.CreateTag(), 1000f), }; ComplexRecipe.RecipeElement[] results = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement(SimHashes.Dirt.CreateTag(), 4000f) }; var r = new ComplexRecipe(ComplexRecipeManager.MakeRecipeID(ID, (IList <ComplexRecipe.RecipeElement>)ingredients, (IList <ComplexRecipe.RecipeElement>)results), ingredients, results) { time = 80f / 8, description = "Pulverize minerals until an organic paste is made", nameDisplay = ComplexRecipe.RecipeNameDisplay.Result }; r.fabricators = new List <Tag>() { TagManager.Create(SupermaterialRefineryConfig.ID) }; }
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); }
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); }
private static void Postfix() { var ingredients = new[] { new ComplexRecipe.RecipeElement(TagManager.Create("BasicSingleHarvestPlantSeed"), 10f), new ComplexRecipe.RecipeElement(BasicFabricConfig.ID.ToTag(), 10f) }; var result = new[] { new ComplexRecipe.RecipeElement(TagManager.Create(PalmeraTreeConfig.SeedId), 1f) }; new ComplexRecipe(ComplexRecipeManager.MakeRecipeID(MolecularForgeId, ingredients, result), ingredients, result) { time = 50f, description = "What will happen if you mash some organic mass together?", useResultAsDescription = true } .fabricators = new List <Tag>() { TagManager.Create(MolecularForgeId) }; }
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); }
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) }; }
public void limeCrushing() { Dictionary <string[], float[]> organics = new Dictionary <string[], float[]> { { new string[] { "EggShell", MISC.TAGS.EGGSHELL }, new float[] { 5, 5 } }, { new string[] { "BabyCrabShell", ITEMS.INDUSTRIAL_PRODUCTS.CRAB_SHELL.NAME }, new float[] { 1, 5 } }, { new string[] { "CrabShell", ITEMS.INDUSTRIAL_PRODUCTS.CRAB_SHELL.NAME }, new float[] { 1, 10 } } }; Tag lime = SimHashes.Lime.CreateTag(); string desc = "Crushes {0} into {1}"; foreach (KeyValuePair <string[], float[]> organic in organics) { ComplexRecipe.RecipeElement[] input = new ComplexRecipe.RecipeElement[] { new ComplexRecipe.RecipeElement(organic.Key[0], organic.Value[0]), }; ComplexRecipe.RecipeElement[] output = new ComplexRecipe.RecipeElement[] { new ComplexRecipe.RecipeElement(lime, organic.Value[1]) }; ComplexRecipe recipe = new ComplexRecipe(ComplexRecipeManager.MakeRecipeID("RockCrusher", input, output), input, output); recipe.time = 40f; recipe.description = string.Format(desc, organic.Key[1], lime); recipe.fabricators = new List <Tag> { TagManager.Create("RockCrusher") }; recipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult; recipesIDs.Add(recipe.id); } }
public static void RemoveInsulator() { float num3 = 0.15f; float num4 = 0.05f; float num5 = 1f - num4 - num3; ComplexRecipe.RecipeElement[] ingredients2 = new ComplexRecipe.RecipeElement[3] { new ComplexRecipe.RecipeElement(SimHashes.Isoresin.CreateTag(), 100f * num3), new ComplexRecipe.RecipeElement(SimHashes.Katairite.CreateTag(), 100f * num5), new ComplexRecipe.RecipeElement(BasicFabricConfig.ID.ToTag(), 100f * num4) }; ComplexRecipe.RecipeElement[] results2 = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement(SimHashes.SuperInsulator.CreateTag(), 100f) }; string recipeId = ComplexRecipeManager.MakeRecipeID(Id, ingredients2, results2); ComplexRecipe recipe = ComplexRecipeManager.Get().GetRecipe(recipeId); if (recipe != null) { ComplexRecipeManager.Get().recipes.Remove(recipe); } else { Debug.Log(nameof(ComplexRecipeManager) + " failed to add the new recipe."); } }
public static void Postfix() { 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); }
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); }
public static void Postfix() { ElementLoader.FindElementByHash(SimHashes.SolidMercury).highTemp = 1000f; ElementLoader.FindElementByHash(SimHashes.Mercury).lowTemp = 50f; ElementLoader.FindElementByHash(SimHashes.Mercury).highTemp = 1200f; ElementLoader.FindElementByHash(SimHashes.Granite).highTempTransitionTarget = SimHashes.Mercury; ComplexRecipe.RecipeElement[] ingredients = new ComplexRecipe.RecipeElement[3] { new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Tungsten).tag, 50f), new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.MaficRock).tag, 50f), new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Obsidian).tag, 100f) }; ComplexRecipe.RecipeElement[] results = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Mercury).tag, 200f) }; 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); }
public GameObject CreatePrefab() { GameObject looseEntity = EntityTemplates.CreateLooseEntity(ID, Name, Description, 1f, true, Assets.GetAnim((HashedString)"mending_serum_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.Booster, "AdvancedDoctorStation", (string[])null); EntityTemplates.ExtendEntityToMedicine(looseEntity, medicine_info); looseEntity.GetComponent <KPrefabID>().AddTag(GameTags.MedicalSupplies, false); ComplexRecipe.RecipeElement[] ingredients = new ComplexRecipe.RecipeElement[3] { new ComplexRecipe.RecipeElement((Tag)RawEggConfig.ID, 3f), new ComplexRecipe.RecipeElement((Tag)NectarConfig.Id, 10f), new ComplexRecipe.RecipeElement((Tag)SwampLilyFlowerConfig.ID, 1f) }; ComplexRecipe.RecipeElement[] results = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement((Tag)ID, 1f) }; MendingSerumConfig.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); }
public static void Postfix() { ComplexRecipe.RecipeElement[] ingredients2 = new ComplexRecipe.RecipeElement[4] { new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Tungsten).tag, 50f), new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.MaficRock).tag, 50f), new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Obsidian).tag, 100f), new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.SuperCoolant).tag, 50f), }; ComplexRecipe.RecipeElement[] results2 = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement(SimHashes.SolidMercury.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; }
public static void Postfix() { ComplexRecipe.RecipeElement[] ingredients2 = new ComplexRecipe.RecipeElement[3] { new ComplexRecipe.RecipeElement(SimHashes.MaficRock.CreateTag(), 70f), new ComplexRecipe.RecipeElement(SimHashes.Sulfur.CreateTag(), 10f), new ComplexRecipe.RecipeElement(SimHashes.IgneousRock.CreateTag(), 20f) }; ComplexRecipe.RecipeElement[] results2 = new ComplexRecipe.RecipeElement[2] { new ComplexRecipe.RecipeElement(SimHashes.Wolframite.CreateTag(), 50f), new ComplexRecipe.RecipeElement(SimHashes.Sand.CreateTag(), 50f) }; 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; }
public static void Postfix() { float num1 = 0.01f; ComplexRecipe.RecipeElement[] ingredients2 = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement(SimHashes.Steel.CreateTag(), 100f) }; ComplexRecipe.RecipeElement[] results2 = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement(SimHashes.Lime.CreateTag(), 20f) }; 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; }
public GameObject CreatePrefab() { GameObject gameObject = EntityTemplates.CreateLooseEntity("AdvancedCure", ITEMS.PILLS.ADVANCEDCURE.NAME, ITEMS.PILLS.ADVANCEDCURE.DESC, 1f, true, Assets.GetAnim("vial_spore_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(SimHashes.Steel.CreateTag(), 1f), new ComplexRecipe.RecipeElement("LightBugOrangeEgg", 1f) }; ComplexRecipe.RecipeElement[] array2 = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement("AdvancedCure", 1f) }; string id = ComplexRecipeManager.MakeRecipeID("Apothecary", array, array2); ComplexRecipe complexRecipe = new ComplexRecipe(id, array, array2); complexRecipe.time = 200f; complexRecipe.description = ITEMS.PILLS.ADVANCEDCURE.RECIPEDESC; complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.Result; complexRecipe.fabricators = new List <Tag> { "Apothecary" }; complexRecipe.sortOrder = 20; complexRecipe.requiredTech = "MedicineIV"; recipe = complexRecipe; return(gameObject); }
public ComplexRecipe(string id, RecipeElement[] ingredients, RecipeElement[] results) { this.id = id; this.ingredients = ingredients; this.results = results; ComplexRecipeManager.Get().Add(this); }
public static void Postfix(ref GameObject go) { ComplexRecipe.RecipeElement[] ingredients = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Katairite).tag, 100f) }; ComplexRecipe.RecipeElement[] results = new ComplexRecipe.RecipeElement[2] { new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.AluminumOre).tag, 50f), new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Sand).tag, 50f) }; new ComplexRecipe( ComplexRecipeManager.MakeRecipeID( "RockCrusher" , (IList <ComplexRecipe.RecipeElement>)ingredients , (IList <ComplexRecipe.RecipeElement>)results) , ingredients, results ) { time = 40f, description = string.Format((string)STRINGS.BUILDINGS.PREFABS.ROCKCRUSHER.LIME_FROM_LIMESTONE_RECIPE_DESCRIPTION, (object)SimHashes.Katairite.CreateTag().ProperName(), (object)SimHashes.Wolframite.CreateTag().ProperName(), (object)SimHashes.Sand.CreateTag().ProperName()), nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult }.fabricators = new List <Tag>() { TagManager.Create("RockCrusher") }; }
public GameObject CreatePrefab() { GameObject gameObject = EntityTemplates.CreateLooseEntity("Antihistamine", ITEMS.PILLS.ANTIHISTAMINE.NAME, ITEMS.PILLS.ANTIHISTAMINE.DESC, 1f, true, Assets.GetAnim("pill_allergies_kanim"), "object", Grid.SceneLayer.Front, EntityTemplates.CollisionShape.RECTANGLE, 0.8f, 0.4f, true, 0, SimHashes.Creature, null); EntityTemplates.ExtendEntityToMedicine(gameObject, MEDICINE.ANTIHISTAMINE); ComplexRecipe.RecipeElement[] array = new ComplexRecipe.RecipeElement[2] { new ComplexRecipe.RecipeElement("PrickleFlowerSeed", 1f), new ComplexRecipe.RecipeElement(SimHashes.Dirt.CreateTag(), 1f) }; ComplexRecipe.RecipeElement[] array2 = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement("Antihistamine", 10f) }; string id = ComplexRecipeManager.MakeRecipeID("Apothecary", array, array2); ComplexRecipe complexRecipe = new ComplexRecipe(id, array, array2); complexRecipe.time = 100f; complexRecipe.description = ITEMS.PILLS.ANTIHISTAMINE.RECIPEDESC; complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.Result; complexRecipe.fabricators = new List <Tag> { "Apothecary" }; complexRecipe.sortOrder = 10; recipe = complexRecipe; return(gameObject); }
public static void ConfigureRecipes(string fabricator) { var inputs = new ComplexRecipe.RecipeElement[] { new ComplexRecipe.RecipeElement("BasicFabric".ToTag(),3f), }; var outputs = new ComplexRecipe.RecipeElement[] { new ComplexRecipe.RecipeElement(ID.ToTag(),1f), }; var id = ComplexRecipeManager.MakeRecipeID(fabricator,inputs,outputs); recipe = new ComplexRecipe(id,inputs,outputs) { time = FABTIME, description = RECIPE_DESC, nameDisplay = ComplexRecipe.RecipeNameDisplay.Result, fabricators = new List <Tag> { fabricator }, sortOrder = 1, requiredTech = Db.Get().TechItems.suitsOverlay.parentTech.Id }; }
public static void Postfix() { var ingredients = new[] { new ComplexRecipe.RecipeElement(SimHashes.Diamond.CreateTag(), 50f), new ComplexRecipe.RecipeElement(BasicFabricConfig.ID.ToTag(), 10f) }; var result = new[] { new ComplexRecipe.RecipeElement(TagManager.Create(FervineConfig.SeedId), 1f) }; new ComplexRecipe(ComplexRecipeManager.MakeRecipeID(MolecularForgeId, ingredients, result), ingredients, result) { time = 50f, description = "Plant + shiny = ?", useResultAsDescription = true } .fabricators = new List <Tag>() { TagManager.Create(MolecularForgeId) }; }
public GameObject CreatePrefab() { ComplexRecipe.RecipeElement[] ingredients = new ComplexRecipe.RecipeElement[4] { new ComplexRecipe.RecipeElement((Tag)PuftConfig.EGG_ID, 2f), new ComplexRecipe.RecipeElement((Tag)PuftBleachstoneConfig.EGG_ID, 1f), new ComplexRecipe.RecipeElement((Tag)PuftOxyliteConfig.EGG_ID, 1f), new ComplexRecipe.RecipeElement(SimHashes.SourGas.CreateTag(), 10f), }; ComplexRecipe.RecipeElement[] results = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement((Tag)DevilPuftConfig.EGG_ID, 1f) }; var r = new ComplexRecipe(ComplexRecipeManager.MakeRecipeID(ID, (IList <ComplexRecipe.RecipeElement>)ingredients, (IList <ComplexRecipe.RecipeElement>)results), ingredients, results, 0) { time = 80f / 8, description = BabyDescription, nameDisplay = ComplexRecipe.RecipeNameDisplay.Result }; r.fabricators = new List <Tag>() { TagManager.Create(SupermaterialRefineryConfig.ID) }; return(EntityTemplates.ExtendEntityToFertileCreature(DevilPuftConfig.CreatePuft(ID, Name, Description, "devil_puft_adult_kanim", false), EGG_ID, EggName, Description, "devil_puft_egg_kanim", PuftTuning.EGG_MASS, BABY_ID, 45f, 15f, EggChances, DevilPuftConfig.EGG_SORT_ORDER, true, false, true, 1f)); }
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); } }
/// <summary> /// Recursively iterates the recipe list looking for foods that can be made with this /// item. /// </summary> /// <param name="item">The item to search.</param> /// <param name="found">The foods found so far.</param> /// <param name="seen">The items already seen, to prevent recipe loops from crashing.</param> /// <param name="quantity">The quantity of the base item.</param> private void SearchForRecipe(Tag item, IList <FoodResult> found, ICollection <Tag> seen, float quantity) { var prefab = Assets.GetPrefab(item); if (prefab != null && quantity > 0.0f && !seen.Contains(item)) { var edible = prefab.GetComponent <Edible>(); float kcal; seen.Add(item); // Item itself is usable as food if (edible != null && (kcal = edible.FoodInfo.CaloriesPerUnit) > 0.0f) { found.Add(new FoodResult(kcal, quantity, item)); } // Search for recipes using this item foreach (var recipe in RecipeManager.Get().recipes) { float amount = 0.0f; foreach (var ingredient in recipe.Ingredients) { // Search for this item in the recipe if (ingredient.tag == item) { amount = ingredient.amount; break; } } if (amount > 0.0f) { SearchForRecipe(recipe.Result, found, seen, recipe.OutputUnits * quantity / amount); } } // And complex ones too foreach (var recipe in ComplexRecipeManager.Get().recipes) { float amount = 0.0f; foreach (var ingredient in recipe.ingredients) { // Search for this item in the recipe if (ingredient.material == item) { amount = ingredient.amount; break; } } if (amount > 0.0f) { // Check all results of the recipe foreach (var result in recipe.results) { SearchForRecipe(result.material, found, seen, result.amount * quantity / amount); } } } } }
public static ComplexRecipeManager Get() { if (_Instance == null) { _Instance = new ComplexRecipeManager(); } return(_Instance); }