// public override bool Autoload() => CataclysmMod.Instance.Calamity != null;

        public override void ModifyRecipes()
        {
            if (CalamityChangesConfig.Instance.throwingBrickRecipeChange)
            {
                RecipeFinder finder = new RecipeFinder();
                finder.AddIngredient(ItemID.RedBrick, 5);
                finder.AddTile(TileID.Anvils);
                finder.SetResult(ModContent.ItemType <ThrowingBrick>(), 15);

                if (finder.TryFindExactRecipe(out RecipeEditor throwingBrick))
                {
                    throwingBrick.DeleteTile(TileID.Anvils);
                    throwingBrick.AddTile(TileID.WorkBenches);
                }
            }

            if (CalamityChangesConfig.Instance.halleysInfernoRecipeChange)
            {
                RecipeFinder finder = new RecipeFinder();
                finder.AddIngredient(ModContent.ItemType <Lumenite>(), 6);
                finder.AddIngredient(ModContent.ItemType <RuinousSoul>(), 4);
                finder.AddIngredient(ModContent.ItemType <ExodiumClusterOre>(), 12);
                finder.AddIngredient(ItemID.SniperScope);
                finder.AddTile(TileID.LunarCraftingStation);
                finder.SetResult(ModContent.ItemType <HalleysInferno>());

                if (finder.TryFindExactRecipe(out RecipeEditor halleysInferno))
                {
                    halleysInferno.DeleteIngredient(ItemID.SniperScope);
                    halleysInferno.AddIngredient(ItemID.RifleScope);
                }
            }
        }
Beispiel #2
0
        public static void RecipeEditing(Mod mod)
        {
            RecipeFinder finder = new RecipeFinder();

            finder.AddIngredient(ItemID.MechanicalGlove, 1);
            finder.AddIngredient(ItemID.MagmaStone, 1);
            finder.SetResult(ItemID.FireGauntlet, 1);
            //.AddTile(TileID.Workshop);

            foreach (Recipe recipe in finder.SearchRecipes())

            {
                RecipeEditor editor = new RecipeEditor(recipe);
                editor.AddIngredient(2766, 15);
            }

            RecipeFinder finder2 = new RecipeFinder();

            finder2.AddIngredient(2431, 14);
            finder2.AddTile(TileID.Anvils);
            finder2.SetResult(ItemID.HornetStaff);
            Recipe exactRecipe2 = finder2.FindExactRecipe();

            bool isFound2 = exactRecipe2 != null;

            if (isFound2)
            {
                RecipeEditor editor2 = new RecipeEditor(exactRecipe2);
                editor2.DeleteIngredient(2431);
                editor2.AddIngredient(1134, 1);
                editor2.AddIngredient(1124, 20);
                editor2.AddIngredient(209, 15);
                editor2.SetResult(ItemID.HornetStaff);
            }
        }
Beispiel #3
0
        // Showcase RecipeFinder and RecipeEditor
        // With these classes, you can find and edit recipes
        public static void ExampleRecipeEditing(Mod mod)
        {
            // In the following example, we find recipes that uses a chain as ingredient and then we remove that ingredient from the recipe.
            RecipeFinder finder = new RecipeFinder();           // make a new RecipeFinder

            finder.AddIngredient(ItemID.Chain);                 // add Chain (with a stack of 1) to the finder

            foreach (Recipe recipe in finder.SearchRecipes())   // loop every recipe found by the finder
            {
                RecipeEditor editor = new RecipeEditor(recipe); // for the currently looped recipe, make a new RecipeEditor
                editor.DeleteIngredient(ItemID.Chain);          // delete the Chain ingredient.
            }

            // The following is a more precise example, finding an exact recipe and deleting it if possible.
            finder = new RecipeFinder();                             // make a new RecipeFinder
            finder.AddRecipeGroup("IronBar");                        // add a new recipe group, in this case the vanilla one for iron or lead bars.
            finder.AddTile(TileID.Anvils);                           // add a required tile, any anvil
            finder.SetResult(ItemID.Chain, 10);                      // set the result to be 10 chains
            Recipe exactRecipe = finder.FindExactRecipe();           // try to find the exact recipe matching our criteria

            bool isRecipeFound = exactRecipe != null;                // if our recipe is not null, it means we found the exact recipe

            if (isRecipeFound)                                       // since our recipe is found, we can continue
            {
                RecipeEditor editor = new RecipeEditor(exactRecipe); // for our recipe, make a new RecipeEditor
                editor.DeleteRecipe();                               // delete the recipe
            }
        }
Beispiel #4
0
        public static void EditVanillaRecipes()
        {
            if (Config.MolotovCraft > 0)
            {
                var recipe = new ModRecipe(VanillaTweaks.Instance);
                recipe.AddIngredient(ItemID.Ale, 5);
                recipe.AddIngredient(ItemID.Torch, 1);
                recipe.AddIngredient(ItemID.Silk, 1);
                recipe.AddIngredient(ItemID.Gel, Config.MolotovCraft);
                recipe.SetResult(ItemID.MolotovCocktail, 5);
                recipe.AddRecipe();
            }
            if (Config.BoneBlockFix)
            {
                var finder = new RecipeFinder();
                finder.AddIngredient(ItemID.BoneBlockWall, 4);
                finder.AddTile(TileID.BoneWelder);
                finder.SetResult(ItemID.BoneBlock, 1);
                var recipe = finder.FindExactRecipe();
                if (recipe != null)
                {
                    recipe.createItem.SetDefaults(ItemID.Bone);
                }
            }
            var foundRecipes = new List <Recipe>();

            if (Config.JestersArrowCraft == 0)
            {
                foreach (var recipe in Main.recipe)
                {
                    if (recipe != null && recipe.createItem != null && recipe.createItem.type == ItemID.JestersArrow)
                    {
                        foundRecipes.Add(recipe);
                    }
                }

                foreach (var recipe in foundRecipes)
                {
                    var editor = new RecipeEditor(recipe);
                    editor.DeleteRecipe();
                }
                foundRecipes.Clear();
            }
            else
            {
                foreach (var recipe in Main.recipe)
                {
                    if (recipe != null && recipe.createItem != null && recipe.createItem.type == ItemID.JestersArrow)
                    {
                        var editor = new RecipeEditor(recipe);
                        editor.SetIngredientStack(ItemID.WoodenArrow, Config.JestersArrowCraft);
                        editor.SetResult(ItemID.JestersArrow, Config.JestersArrowCraft);
                    }
                }
            }
        }
Beispiel #5
0
        public override void ModifyTooltips(Item item, List <TooltipLine> tooltips)
        {
            if (item.modItem != null)
            {
                if (item.owner > -1 && Main.netMode != 1)
                {
                    SGAPlayer sgaply = (Main.player[item.owner].GetModPlayer <SGAPlayer>());
                    pboostertextboost = "\nCurrent boost: " + sgaply.SpaceDiverWings;
                    pboostertext      = pboostertextbase2 + pboostertextboost;
                }
                var    myType    = (item.modItem).GetType();
                var    n         = myType.Namespace;
                string asastring = (string)n;
                //int ishavocitem = (asastring.Split('.').Length - 1);
                int ishavocitem = asastring.Length - asastring.Replace("HavocGear.", "").Length;
                if (ishavocitem > 0)
                {
                    Color c = Main.hslToRgb(0.9f, 0.5f, 0.35f);
                    tooltips.Add(new TooltipLine(mod, "Havoc Item", Idglib.ColorText(c, "Former Havoc mod item")));
                }
                if (SGAmod.UsesPlasma.ContainsKey(item.type))
                {
                    Color c = Main.hslToRgb(0.7f, 0.15f, 0.7f);
                    tooltips.Add(new TooltipLine(mod, "Plasma Item", Idglib.ColorText(c, "This weapon uses plasma cells for recharging")));
                }

                if (SGAmod.UsesClips.ContainsKey(item.type))
                {
                    Color c = Main.hslToRgb(0.7f, 0.15f, 0.7f);
                    tooltips.Add(new TooltipLine(mod, "Clip Item", Idglib.ColorText(c, "This weapon has a clip and requires manual reloading")));
                }
            }

            if (SGAWorld.downedWraiths < 1)
            {
                RecipeFinder finder = new RecipeFinder();
                finder.AddTile(TileID.Furnaces);
                List <Recipe> reclist = finder.SearchRecipes();

                Recipe foundone = reclist.Find(rec => rec.createItem.type == item.type);

                if (foundone != null)
                {
                    Color c = Main.hslToRgb(0.5f, 0.10f, 0.1f);
                    tooltips.Add(new TooltipLine(mod, "Wraithclue", Idglib.ColorText(c, "Crafting this will anger something...")));
                }
            }
            if (item.type == ItemID.LunarBar)
            {
                if (SGAWorld.downedWraiths < 4)
                {
                    Color c = Main.hslToRgb(0.5f, 0.20f, 0.7f);
                    tooltips.Add(new TooltipLine(mod, "Wraithclue", Idglib.ColorText(c, "A very strong being has locked it away from your possession, talk to the guide")));
                }
            }
        }
Beispiel #6
0
 public static bool AttemptDelete(DeletionRecipe recipe, bool exact)
 {
     Finder = new RecipeFinder();
     Finder.SetResult(recipe.Result.Type, recipe.Result.Stack);
     foreach (DeletionItem ingredient in recipe.Ingredients)
     {
         Finder.AddIngredient(ingredient.Type, ingredient.Stack);
     }
     foreach (short tile in recipe.RequiredTiles)
     {
         Finder.AddTile(tile);
     }
     return(exact
                             ? DeleteExact()
                             : DeleteAlike());
 }
Beispiel #7
0
 private static void RemoveNightsEdgeRecipe()
 {
     RecipeFinder finder = new RecipeFinder();
     {
         finder.AddIngredient(ItemID.BloodButcherer, 1);
         finder.AddIngredient(ItemID.FieryGreatsword, 1);
         finder.AddIngredient(ItemID.BladeofGrass, 1);
         finder.AddIngredient(ItemID.Muramasa, 1);
         finder.AddTile(TileID.DemonAltar);
         finder.SetResult(ItemID.NightsEdge, 1);
         Recipe recipe2 = finder.FindExactRecipe();
         if (recipe2 != null)
         {
             RecipeEditor editor = new RecipeEditor(recipe2);
             editor.DeleteRecipe();
         }
     }
 }
Beispiel #8
0
        public static void SetAllFurnaceRecipeSystem()
        {
            RecipeFinder rf = new RecipeFinder();

            rf.AddTile(TileID.Furnaces);

            List <Recipe> list = rf.SearchRecipes();

            for (int i = 0; i < list.Count; i++)
            {
                Recipe r      = list[i];
                Recipe recipe = r;
                if (recipe.requiredItem.Length == 1)
                {
                    TUA.instance.AddFurnaceRecipe(recipe.requiredItem[0].type, recipe.createItem.type, 20);
                    _removedRecipes.Add(r);
                    RecipeEditor re = new RecipeEditor(r);
                    re.DeleteRecipe();
                }
            }
        }
Beispiel #9
0
        public static void ExactRecipeRemover2Ingredients(int Ingredient1, int Ingredient1Amount, int Ingredient2, int Ingredient2Amount, int CraftingStation, int RecipeResult)
        {
            //this method is for when there's an item whose recipe needs to be removed, but we can't use RecipeRemover
            //that usually means we're giving it a custom recipe somewhere else, since RecipeRemover runs on any recipe that results in that item
            //using exact recipes is thus required. not sure if we need to do this again, but if we do, now theres a method
            RecipeFinder finder = new RecipeFinder();

            finder.AddIngredient(Ingredient1, Ingredient1Amount);
            finder.AddIngredient(Ingredient2, Ingredient2Amount);
            finder.AddTile(CraftingStation);
            finder.SetResult(RecipeResult);
            Recipe locateRecipe = finder.FindExactRecipe();

            bool recipeFound = locateRecipe != null;

            if (recipeFound)
            {
                RecipeEditor editor = new RecipeEditor(locateRecipe);
                editor.DeleteRecipe();
            }
        }
Beispiel #10
0
        public override void AddRecipes()
        {
            ModRecipe newLeather = new ModRecipe(this);

            newLeather.AddRecipeGroup("ExtraGunGear:EvilChunk", 3);
            newLeather.AddTile(TileID.WorkBenches);
            newLeather.SetResult(ItemID.Leather);
            newLeather.AddRecipe();

            RecipeFinder finder = new RecipeFinder();

            finder.AddIngredient(ItemID.RottenChunk, 5);
            finder.AddTile(TileID.WorkBenches);
            finder.SetResult(ItemID.Leather);
            Recipe recipe2 = finder.FindExactRecipe();

            if (recipe2 != null)
            {
                RecipeEditor editor = new RecipeEditor(recipe2);
                editor.DeleteRecipe();
            }
        }
        public override void PostAddRecipes()
        {
            Mod tremor = ModLoader.GetMod("Tremor");

            if (tremor != null && Config.DommhammerjackhammerSettings == 2)
            {
                RecipeFinder finder = new RecipeFinder(); // make a new RecipeFinder
                finder.AddIngredient(ItemID.Pwnhammer);   // add a new recipe group, in this case the vanilla one for iron or lead bars.
                finder.AddIngredient(tremor.ItemType("DarkBulb"), 15);
                finder.AddIngredient(ItemID.Bone, 100);
                finder.AddTile(TileID.MythrilAnvil);                     // add a required tile, any anvil
                finder.SetResult(tremor.ItemType("Squasher"));           // set the result to be 10 chains
                Recipe exactRecipe = finder.FindExactRecipe();           // try to find the exact recipe matching our criteria

                bool isRecipeFound = exactRecipe != null;                // if our recipe is not null, it means we found the exact recipe
                if (isRecipeFound)                                       // since our recipe is found, we can continue
                {
                    RecipeEditor editor = new RecipeEditor(exactRecipe); // for our recipe, make a new RecipeEditor
                    editor.DeleteRecipe();                               // delete the recipe
                }
            }
        }
        public static void TestRecipeEditor(Mod mod)
        {
            RecipeFinder finder = new RecipeFinder();

            finder.AddIngredient(ItemID.Chain);
            foreach (Recipe recipe in finder.SearchRecipes())
            {
                RecipeEditor editor = new RecipeEditor(recipe);
                editor.DeleteIngredient(ItemID.Chain);
            }

            finder = new RecipeFinder();
            finder.AddRecipeGroup("IronBar");
            finder.AddTile(TileID.Anvils);
            finder.SetResult(ItemID.Chain, 10);
            Recipe recipe2 = finder.FindExactRecipe();

            if (recipe2 != null)
            {
                RecipeEditor editor = new RecipeEditor(recipe2);
                editor.DeleteRecipe();
            }
        }
Beispiel #13
0
        public override void AddRecipes()
        {
            RecipeFinder HBR = new RecipeFinder();

            HBR = new RecipeFinder();
            HBR.AddIngredient(ItemID.Hellstone, 3);
            HBR.AddIngredient(ItemID.Obsidian);
            HBR.AddTile(TileID.Hellforge);
            HBR.SetResult(ItemID.HellstoneBar);
            Recipe HBRR = HBR.FindExactRecipe();

            if (HBR != null)
            {
                RecipeEditor HBE = new RecipeEditor(HBRR);
                HBE.DeleteRecipe();
            }

            ModRecipe HSB = new ModRecipe(this);

            HSB.AddIngredient(ItemID.Hellstone, 5);
            HSB.AddTile(TileID.Hellforge);
            HSB.SetResult(ItemID.HellstoneBar);
            HSB.AddRecipe();
        }
Beispiel #14
0
        public override void AddRecipes()
        {
            RecipeFinder finder = new RecipeFinder();

            finder.AddIngredient(ItemID.Pumpkin, 20);
            finder.AddTile(TileID.WorkBenches);
            finder.SetResult(ItemID.PumpkinHelmet);
            Recipe recipe1 = finder.FindExactRecipe();

            if (recipe1 != null)
            {
                RecipeEditor editor = new RecipeEditor(recipe1);
                editor.DeleteRecipe();
            }

            finder = new RecipeFinder();
            finder.AddIngredient(ItemID.Pumpkin, 30);
            finder.AddTile(TileID.WorkBenches);
            finder.SetResult(ItemID.PumpkinBreastplate);
            Recipe recipe2 = finder.FindExactRecipe();

            if (recipe2 != null)
            {
                RecipeEditor editor = new RecipeEditor(recipe2);
                editor.DeleteRecipe();
            }

            finder = new RecipeFinder();
            finder.AddIngredient(ItemID.Pumpkin, 25);
            finder.AddTile(TileID.WorkBenches);
            finder.SetResult(ItemID.PumpkinLeggings);
            Recipe recipe3 = finder.FindExactRecipe();

            if (recipe3 != null)
            {
                RecipeEditor editor = new RecipeEditor(recipe3);
                editor.DeleteRecipe();
            }

            ModRecipe recipe = new ModRecipe(mod);

            recipe.AddIngredient(ItemID.Pumpkin, 20);
            recipe.AddRecipeGroup("EvilBar", 5);
            recipe.AddTile(TileID.Anvils);
            recipe.SetResult(ItemID.PumpkinHelmet);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Pumpkin, 30);
            recipe.AddRecipeGroup("EvilBar", 12);
            recipe.AddTile(TileID.Anvils);
            recipe.SetResult(ItemID.PumpkinBreastplate);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Pumpkin, 25);
            recipe.AddRecipeGroup("EvilBar", 8);
            recipe.AddTile(TileID.Anvils);
            recipe.SetResult(ItemID.PumpkinLeggings);
            recipe.AddRecipe();
        }
        public override void AddRecipes()
        {
            //-------------------------------------Existing Recipes-------------------------------------\\

            RecipeFinder finder = new RecipeFinder();

            finder.SetResult(151);              //Necro Helmet
            foreach (Recipe r in finder.SearchRecipes())
            {
                RecipeEditor editor = new RecipeEditor(r);
                editor.DeleteTile(18);          //Workbench
                editor.AddTile(300);            //Bone Welder
            }

            finder = new RecipeFinder();
            finder.SetResult(152);              //Necro Breastplate
            foreach (Recipe r in finder.SearchRecipes())
            {
                RecipeEditor editor = new RecipeEditor(r);
                editor.DeleteTile(18);          //Workbench
                editor.AddTile(300);            //Bone Welder
            }

            finder = new RecipeFinder();
            finder.SetResult(153);              //Necro Greaves
            foreach (Recipe r in finder.SearchRecipes())
            {
                RecipeEditor editor = new RecipeEditor(r);
                editor.DeleteTile(18);          //Workbench
                editor.AddTile(300);            //Bone Welder
            }

            finder = new RecipeFinder();
            finder.AddIngredient(795);          //Blood Butcherer
            finder.AddIngredient(155);          //Muramasa
            finder.AddIngredient(190);          //Blade of Grass
            finder.AddIngredient(121);          //Fiery Greatsword
            finder.AddTile(26);                 //Altar
            finder.SetResult(273);              //Night's Edge
            Recipe exactRecipe = finder.FindExactRecipe();

            bool isRecipeFound = exactRecipe != null;

            if (isRecipeFound)
            {
                RecipeEditor editor = new RecipeEditor(exactRecipe);
                editor.DeleteRecipe();
            }

            //-------------------------------------New Recipes-------------------------------------\\

            /*
             * recipe = new ModRecipe(this);
             * recipe.AddIngredient(000);
             * recipe.AddTile(114);                //Tinkerer's Workshop
             * recipe.SetResult(000);
             * recipe.AddRecipe();
             */

            ModRecipe recipe = new ModRecipe(this);

            recipe.AddIngredient(null, "TrueNightsEdgeB");
            recipe.AddIngredient(674);          //True Excalibur
            recipe.AddTile(134);                //Hardmode Anvil
            recipe.SetResult(757);              //Terra Blade
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(null, "Obfuscator");
            recipe.AddIngredient(null, "CursedNaginata");
            recipe.AddIngredient(null, "BoOfGrass");
            recipe.AddIngredient(null, "HellHalberd");
            recipe.AddTile(26);                 //Altar
            recipe.SetResult(274);              //Dark Lance
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(706, 3);       //Platinum Bar
            recipe.AddIngredient(381, 12);      //Cobalt Bar
            recipe.AddIngredient(327);          //Golden Key
            recipe.AddTile(114);                //Tinkerer's Workshop
            recipe.SetResult(156);              //Cobalt Shield
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(147, 10);      //Spike
            recipe.AddIngredient(259, 6);       //Leather
            recipe.AddIngredient(225, 2);       //Silk
            recipe.AddTile(114);                //Tinkerer's Workshop
            recipe.SetResult(953);              //Climbing Claws
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(147, 10);      //Spike
            recipe.AddIngredient(259, 6);       //Leather
            recipe.AddIngredient(225, 2);       //Silk
            recipe.AddTile(114);                //Tinkerer's Workshop
            recipe.SetResult(975);              //Shoe Spikes
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(765, 90);      //Rain Cloud
            recipe.AddIngredient(575, 5);       //Soul of Flight
            recipe.AddIngredient(19, 15);       //Gold Bar
            recipe.AddTile(114);                //Tinkerer's Workshop
            recipe.SetResult(158);              //Lucky Horseshoe
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(3756, 90);     //Snow Cloud
            recipe.AddIngredient(575, 5);       //Soul of Flight
            recipe.AddIngredient(3306);         //White String
            recipe.AddTile(114);                //Tinkerer's Workshop
            recipe.SetResult(159);              //Shiny Red Balloon
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(751, 90);      //Cloud Block
            recipe.AddIngredient(575, 5);       //Soul of Flight
            recipe.AddIngredient(31);           //Bottle
            recipe.AddTile(114);                //Tinkerer's Workshop
            recipe.SetResult(53);               //Cloud in a Bottle
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(169, 90);      //Sand Block
            recipe.AddIngredient(575, 5);       //Soul of Flight
            recipe.AddIngredient(31);           //Bottle
            recipe.AddTile(114);                //Tinkerer's Workshop
            recipe.SetResult(857);              //Sandstorm in a Bottle
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(593, 90);      //Snow Block
            recipe.AddIngredient(575, 5);       //Soul of Flight
            recipe.AddIngredient(31);           //Bottle
            recipe.AddTile(114);                //Tinkerer's Workshop
            recipe.SetResult(987);              //Blizzard in a Bottle
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(2435, 90);     //Coralstone Block
            recipe.AddIngredient(575, 5);       //Soul of Flight
            recipe.AddIngredient(31);           //Bottle
            recipe.AddTile(114);                //Tinkerer's Workshop
            recipe.SetResult(3201);             //Tsunami in a Bottle
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(318);          //Fireblossom
            recipe.AddIngredient(172, 100);     //Ash
            recipe.AddIngredient(173, 100);     //Obsidian
            recipe.AddIngredient(207, 3);       //Lava Bucket
            recipe.AddTile(114);                //Tinkerer's Workshop
            recipe.SetResult(1323);             //Obsidian Rose
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(275);          //Coral
            recipe.AddTile(18);                 //Workbench
            recipe.SetResult(2435);             //Coralstone Block
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(2435);         //Coralstone Block
            recipe.AddTile(18);                 //Workbench
            recipe.SetResult(275);              //Coral
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddRecipeGroup("AdvancedTinkering:AnimalSkin");
            recipe.AddTile(18);                 //Workbench
            recipe.SetResult(259, 12);          //Leather
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(225, 20);      //Silk
            recipe.AddIngredient(259, 20);      //Leather
            recipe.AddIngredient(254, 3);       //Black Thread
            recipe.AddTile(86);                 //Loom
            recipe.SetResult(410);              //Miner's Shirt
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(225, 15);      //Silk
            recipe.AddIngredient(259, 25);      //Leather
            recipe.AddIngredient(254, 3);       //Black Thread
            recipe.AddTile(86);                 //Loom
            recipe.SetResult(411);              //Miner's Pants
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(null, "RetinazerMask");
            recipe.AddIngredient(null, "SpazmatismMask");
            recipe.AddTile(18);                 //Workbench
            recipe.SetResult(2106);             //The Twins Mask
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(3111, 30);     //Pink Gel
            recipe.AddIngredient(23, 100);      //Gel
            recipe.AddIngredient(9, 7);         //Purity Wood
            recipe.AddTile(220);                //Solidifier
            recipe.SetResult(1309);             //Slime Staff
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(545, 999);     //Cursed Arrow
            recipe.AddIngredient(1334, 999);    //Ichor Arrow
            recipe.AddIngredient(47, 999);      //Unholy Arrow
            recipe.AddIngredient(516, 999);     //Holy Arrow
            recipe.AddIngredient(265, 999);     //Hellfire Arrow
            recipe.AddIngredient(3003, 999);    //Bone Arrow
            recipe.AddIngredient(259, 25);      //Leather
            recipe.AddTile(114);                //Tinkerer's Workshop
            recipe.SetResult(1321);             //Magic Quiver
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(210);          //Vine
            recipe.SetResult(2996, 6);          //Vine Rope
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddRecipeGroup("Wood", 3);
            recipe.AddTile(17);                 //Furnace
            recipe.SetResult(1922);             //Coal
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(2339);         //Tin Can
            recipe.AddTile(17);                 //Furnace
            recipe.SetResult(703);              //Tin Bar
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(766);          //Bone Block
            recipe.AddTile(300);                //Bone Welder
            recipe.SetResult(154);              //Bone
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(154, 5);       //Bone
            recipe.AddTile(300);                //Bone Welder
            recipe.SetResult(3003, 5);          //Bone Arrow
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(154);          //Bone
            recipe.AddIngredient(8, 3);         //Torch
            recipe.AddTile(300);                //Bone Welder
            recipe.SetResult(3004, 3);          //Bone Torch
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(19);           //Gold Bar
            recipe.SetResult(1348, 2);          //Gold Dust
            recipe.AddTile(247);                //Autohammer
            recipe.SetResult(327);              //Golden Key
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(1101, 8);      //Lihzahrd Brick
            recipe.AddRecipeGroup("IronBar", 2);
            recipe.AddTile(303);                //Lihzahrd Furnace
            recipe.SetResult(1142);             //Lihzahrd Chest
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(9, 8);         //Purity Wood
            recipe.AddRecipeGroup("IronBar", 2);
            recipe.AddTile(304);                //Living Loom
            recipe.SetResult(831);              //Living Wood Chest
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(824, 8);       //Sunplate Block
            recipe.AddRecipeGroup("IronBar", 2);
            recipe.AddTile(305);                //Sky Mill
            recipe.SetResult(838);              //Skyware Chest
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(3272);         //Hardened Sand Block
            recipe.AddTile(17);                 //Furnace
            recipe.SetResult(607, 2);           //Sandstone Brick
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(3271);         //Sandstone Block
            recipe.AddTile(17);                 //Furnace
            recipe.SetResult(607, 3);           //Sandstone Brick
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(586, 22);      //Candy Cane Block
            recipe.AddTile(17);                 //Furnace
            recipe.SetResult(1909);             //Candy Cane Sword
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(586, 24);      //Candy Cane Block
            recipe.AddTile(17);                 //Furnace
            recipe.SetResult(1917);             //Candy Cane Pickaxe
            recipe.AddRecipe();

            recipe = new ModRecipe(this);
            recipe.AddIngredient(586, 20);      //Candy Cane Block
            recipe.AddTile(17);                 //Furnace
            recipe.SetResult(1915);             //Candy Cane Hook
            recipe.AddRecipe();
        }
Beispiel #16
0
        public void CheckRecipesForItem(int type)
        {
            ((ResearchFrom14)mod).ui.recipes.changedToList = true;
            if (ModContent.GetInstance <Config>().researchRecipes)
            {
                Item itm = new Item();
                itm.SetDefaults(type);

                if (itm.createTile >= 0)
                {
                    List <int> tiles = AdjTiles(itm.createTile);
                    foreach (int t in tiles)
                    {
                        RecipeFinder rf = new RecipeFinder();
                        rf.AddTile(t);
                        List <Recipe> res = rf.SearchRecipes();
                        // Main.NewText("Found " + res.Count + "recipes with tile.");
                        foreach (Recipe r in res)
                        {
                            validateAndResearchRecipe(r);
                        }
                    }
                }
                RecipeFinder rf2 = new RecipeFinder();
                rf2.AddIngredient(itm.type);
                List <Recipe> res2 = rf2.SearchRecipes();
                // Main.NewText("Found " + res2.Count + "recipes with item.");
                foreach (Recipe r in res2)
                {
                    validateAndResearchRecipe(r);
                }
            }
            Mod rare = ModLoader.GetMod("ARareItemSwapJPANs");

            if (rare != null && ModContent.GetInstance <Config>().PartsCompat)
            {
                List <string> parts = rare.Call("GetPartList") as List <string>;
                if (parts == null)
                {
                    return;
                }
                parts.RemoveAll((x) => !IsResearched(x));
                if (parts.Count > 0)
                {
                    bool allPartsResearched = true;
                    foreach (string part in parts)
                    {
                        allPartsResearched = allPartsResearched && researchedParts.Contains(part);
                    }
                    if (!allPartsResearched)
                    {
                        List <Item> results = rare.Call("GetMaxPurchasesAvailable", parts) as List <Item>;

                        if (results == null)
                        {
                            return;
                        }
                        foreach (string part in parts)
                        {
                            if (!researchedParts.Contains(part))
                            {
                                researchedParts.Add(part);
                            }
                        }
                        foreach (Item result in results)
                        {
                            if (!IsResearched(result))
                            {
                                AddResearchedAmount(result.type, Int32.MaxValue - 1000);
                                researchedCache.Add(result.type);
                                CheckRecipesForItem(result.type);
                            }
                        }
                    }
                }
            }
        }
Beispiel #17
0
        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);

            recipe.AddRecipeGroup("Wood", 5);
            recipe.AddRecipeGroup("TenebraeMod:GoldBar", 3);
            recipe.AddRecipeGroup("IronBar", 2);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(ItemID.GoldChest);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddRecipeGroup("TenebraeMod:DemoniteBrick", 8);
            recipe.AddRecipeGroup("IronBar", 2);
            recipe.AddTile(TileID.Anvils);
            recipe.SetResult(ItemID.ShadowChest);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddRecipeGroup("Wood", 5);
            recipe.AddIngredient(ItemID.JungleSpores, 2);
            recipe.AddRecipeGroup("IronBar", 2);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(ItemID.IvyChest);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Coral, 8);
            recipe.AddRecipeGroup("IronBar", 2);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(ItemID.WaterChest);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Chest);
            recipe.AddIngredient(ItemID.Cobweb, 8);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(ItemID.WebCoveredChest);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Chest, 5);
            recipe.AddIngredient(ItemID.SnowBlock, 25);
            recipe.AddIngredient(ItemID.IceBlock, 25);
            recipe.AddIngredient(ItemID.TempleKey);
            recipe.AddTile(TileID.MythrilAnvil);
            recipe.SetResult(ItemID.FrozenChest, 5);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Chest, 5);
            recipe.AddIngredient(ItemID.MudBlock, 25);
            recipe.AddIngredient(ItemID.JungleGrassSeeds, 25);
            recipe.AddIngredient(ItemID.TempleKey);
            recipe.AddTile(TileID.MythrilAnvil);
            recipe.SetResult(ItemID.JungleChest, 5);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Chest, 5);
            recipe.AddIngredient(ItemID.PearlstoneBlock, 50);
            recipe.AddIngredient(ItemID.TempleKey);
            recipe.AddTile(TileID.MythrilAnvil);
            recipe.SetResult(ItemID.HallowedChest, 5);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Chest, 5);
            recipe.AddIngredient(ItemID.EbonstoneBlock, 50);
            recipe.AddIngredient(ItemID.TempleKey);
            recipe.AddTile(TileID.MythrilAnvil);
            recipe.SetResult(ItemID.CorruptionChest, 5);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Chest, 5);
            recipe.AddIngredient(ItemID.CrimstoneBlock, 50);
            recipe.AddIngredient(ItemID.TempleKey);
            recipe.AddTile(TileID.MythrilAnvil);
            recipe.SetResult(ItemID.CrimsonChest, 5);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Frog, 5);
            recipe.AddTile(TileID.Sawmill);
            recipe.SetResult(ItemID.FrogLeg);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Cloud, 50);
            recipe.AddIngredient(ItemID.Bottle);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(ItemID.CloudinaBottle);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Cloud, 25);
            recipe.AddIngredient(ItemID.SnowBlock, 25);
            recipe.AddIngredient(ItemID.Bottle);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(ItemID.BlizzardinaBottle);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Cloud, 25);
            recipe.AddIngredient(ItemID.SandBlock, 25);
            recipe.AddIngredient(ItemID.Bottle);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(ItemID.SandstorminaBottle);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Cloud, 20);
            recipe.AddIngredient(ItemID.WhiteString, 2);
            recipe.AddIngredient(ItemID.Feather, 10);
            recipe.AddTile(TileID.SkyMill);
            recipe.SetResult(ItemID.ShinyRedBalloon);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.OldShoe);
            recipe.AddIngredient(ItemID.Silk, 5);
            recipe.AddIngredient(ItemID.Feather, 10);
            recipe.AddTile(TileID.Loom);
            recipe.SetResult(ItemID.HermesBoots);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.OldShoe);
            recipe.AddIngredient(ItemID.Coral, 5);
            recipe.AddIngredient(ItemID.WaterWalkingPotion, 5);
            recipe.AddTile(TileID.Loom);
            recipe.SetResult(ItemID.WaterWalkingBoots);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.OldShoe);
            recipe.AddIngredient(ItemID.IceBlock, 25);
            recipe.AddRecipeGroup("IronBar", 2);
            recipe.AddTile(TileID.Loom);
            recipe.SetResult(ItemID.IceSkates);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Silk, 3);
            recipe.AddRecipeGroup("IronBar", 2);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(ItemID.Aglet);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(null, "TatteredBand");
            recipe.AddIngredient(ItemID.JungleSpores, 10);
            recipe.AddIngredient(ItemID.Cloud, 5);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(ItemID.AnkletoftheWind);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Leather, 5);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(ItemID.OldShoe);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(null, "TatteredBand");
            recipe.AddIngredient(ItemID.RegenerationPotion, 3);
            recipe.AddIngredient(ItemID.LifeCrystal, 1);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(ItemID.BandofRegeneration);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(null, "TatteredBand");
            recipe.AddIngredient(ItemID.ManaRegenerationPotion, 3);
            recipe.AddIngredient(ItemID.ManaCrystal, 1);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(ItemID.BandofStarpower);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Vine, 10);
            recipe.AddIngredient(ItemID.Leather, 5);
            recipe.AddTile(TileID.Loom);
            recipe.SetResult(ItemID.FeralClaws);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.FeralClaws);
            recipe.AddIngredient(ItemID.Spike, 10);
            recipe.AddTile(TileID.Anvils);
            recipe.SetResult(ItemID.ClimbingClaws);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.OldShoe);
            recipe.AddIngredient(ItemID.Spike, 10);
            recipe.AddTile(TileID.Anvils);
            recipe.SetResult(ItemID.ShoeSpikes);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.OldShoe);
            recipe.AddIngredient(ItemID.DayBloomPlanterBox, 25);
            recipe.AddIngredient(ItemID.JungleGrassSeeds, 10);
            recipe.AddTile(TileID.Loom);
            recipe.SetResult(ItemID.FlowerBoots);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddRecipeGroup("TenebraeMod:GoldBar", 3);
            recipe.AddIngredient(ItemID.Cloud, 50);
            recipe.AddIngredient(ItemID.Feather, 5);
            recipe.AddTile(TileID.SkyMill);
            recipe.SetResult(ItemID.LuckyHorseshoe);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(null, "Paper", 3);
            recipe.AddIngredient(ItemID.Leather);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(ItemID.Book, 3);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.SpellTome);
            recipe.AddIngredient(ItemID.WaterCandle, 3);
            recipe.AddIngredient(ItemID.Bone, 20);
            recipe.AddTile(TileID.Bookcases);
            recipe.SetResult(ItemID.WaterBolt);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.SpellTome);
            recipe.AddIngredient(ItemID.LivingDemonFireBlock, 20);
            recipe.AddIngredient(ItemID.SoulofNight, 15);
            recipe.AddTile(TileID.Bookcases);
            recipe.SetResult(ItemID.DemonScythe);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.SpellTome);
            recipe.AddIngredient(ItemID.CelestialMagnet);
            recipe.AddIngredient(ItemID.Ectoplasm, 15);
            recipe.AddTile(TileID.Bookcases);
            recipe.SetResult(ItemID.MagnetSphere);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(null, "WornCloth", 15);
            recipe.AddIngredient(ItemID.SoulofNight, 6);
            recipe.AddIngredient(ItemID.DarkShard, 2);
            recipe.AddTile(TileID.MythrilAnvil);
            recipe.SetResult(ItemID.Blindfold);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(null, "WornCloth", 10);
            recipe.AddIngredient(ItemID.SandBlock, 50);
            recipe.AddIngredient(ItemID.Sandstone, 25);
            recipe.AddTile(TileID.Loom);
            recipe.SetResult(ItemID.FlyingCarpet);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(null, "TatteredBand", 1);
            recipe.AddIngredient(ItemID.LavaBucket, 3);
            recipe.AddIngredient(ItemID.AshBlock, 25);
            recipe.AddTile(TileID.Hellforge);
            recipe.SetResult(ItemID.LavaCharm);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.ArmorBracing);
            recipe.AddIngredient(ItemID.MedicatedBandage);
            recipe.AddIngredient(ItemID.ThePlan);
            recipe.AddIngredient(ItemID.CountercurseMantra);
            recipe.AddIngredient(ItemID.Blindfold);
            recipe.AddIngredient(null, "ReflectiveGlove");
            recipe.AddTile(TileID.TinkerersWorkbench);
            recipe.SetResult(ItemID.AnkhCharm);
            recipe.AddRecipe();

            recipe = new ModRecipe(mod);
            recipe.AddIngredient(null, "MoldyHerosTome");
            recipe.AddTile(TileID.DemonAltar);
            recipe.SetResult(ItemID.BrokenHeroSword);
            recipe.AddRecipe();


            finder = new RecipeFinder();
            finder.AddIngredient(ItemID.Blindfold);
            finder.AddIngredient(ItemID.ArmorBracing);
            finder.AddIngredient(ItemID.MedicatedBandage);
            finder.AddIngredient(ItemID.ThePlan);
            finder.AddIngredient(ItemID.CountercurseMantra);
            finder.AddTile(TileID.TinkerersWorkbench);
            finder.SetResult(ItemID.AnkhCharm);
            Recipe recipe2 = finder.FindExactRecipe();

            if (recipe2 != null)
            {
                RecipeEditor editor = new RecipeEditor(recipe2);
                editor.DeleteRecipe();
            }
        }