Exemple #1
0
 public static void AfterItemTypesDefined()
 {
     buildtoolRecipe = new Recipe(new List <InventoryItem>()
     {
         new InventoryItem("ironingot", 1), new InventoryItem("planks", 1)
     }, new InventoryItem(JOB_ITEM_KEY, 1));
     RecipeManager.AddRecipes("pipliz.crafter", new List <Recipe>()
     {
         buildtoolRecipe
     });
 }
Exemple #2
0
        public static void AfterItemTypesDefined()
        {
            List <InventoryItem> requirements = new List <InventoryItem>()
            {
                new InventoryItem("planks", 1)
            };
            List <Recipe> architectRecipes = new List <Recipe>();

            foreach (string blueprintTypename in ManagerBlueprints.blueprints.Keys)
            {
                Recipe architectBlueprintRecipe = new Recipe(requirements, new InventoryItem(blueprintTypename, 1));
                architectRecipes.Add(architectBlueprintRecipe);
            }
            RecipeManager.AddRecipes(JOB_NAME, architectRecipes);
        }
Exemple #3
0
        public static void AfterItemTypesDefined()
        {
            anvilRecipe  = new Recipe(new InventoryItem("ironingot", 4), new InventoryItem(JOB_ITEM_KEY, 1));
            sledgeRecipe = new Recipe(new InventoryItem("ironingot", 1), new InventoryItem(JOB_TOOL_KEY, 1));
            RecipeManager.AddRecipes("pipliz.crafter", new List <Recipe> ()
            {
                anvilRecipe, sledgeRecipe
            });
            List <Recipe> blacksmithRecipes = new List <Recipe> ();

            Recipe[] crafterRecipes;
            if (RecipeManager.RecipeStorage.TryGetValue("pipliz.crafter", out crafterRecipes))
            {
                ushort ironingotType = ItemTypes.IndexLookup.GetIndex("ironingot");
                foreach (Recipe recipe in crafterRecipes)
                {
                    int ironNeeded = 0;
                    foreach (InventoryItem ingredient in recipe.Requirements)
                    {
                        if (ingredient.Type == ironingotType)
                        {
                            ironNeeded++;
                        }
                        else
                        {
                            ironNeeded--;
                        }
                    }
                    if (ironNeeded >= 0)
                    {
                        blacksmithRecipes.Add(recipe);
                    }
                }
            }
            else
            {
                Pipliz.Log.WriteError("Could not find any crafter recipes for blacksmiths");
            }
            RecipeManager.AddRecipes("scarabol.blacksmith", blacksmithRecipes);
        }
 public override void AddRecipes() => RecipeManager.AddRecipes();