Exemplo n.º 1
0
        public static void RegisterGateLever()
        {
            var rivets      = new InventoryItem(BuiltinBlocks.IronRivet, 6);
            var iron        = new InventoryItem(BuiltinBlocks.IronWrought, 2);
            var copperParts = new InventoryItem(BuiltinBlocks.CopperParts, 6);
            var copperNails = new InventoryItem(BuiltinBlocks.CopperNails, 6);
            var tools       = new InventoryItem(BuiltinBlocks.CopperTools, 1);
            var planks      = new InventoryItem(BuiltinBlocks.Planks, 4);

            var recipe = new Recipe(Item.name,
                                    new List <InventoryItem>()
            {
                planks, iron, rivets, copperParts, copperNails, tools, planks
            },
                                    new InventoryItem(Item.ItemIndex),
                                    5);

            RecipeStorage.AddOptionalLimitTypeRecipe(Jobs.AdvancedCrafterRegister.JOB_NAME, recipe);

            var gate = new Recipe(GateItem.name,
                                  new List <InventoryItem>()
            {
                iron, rivets, tools
            },
                                  new InventoryItem(GateItem.ItemIndex),
                                  24);

            RecipeStorage.AddOptionalLimitTypeRecipe(Jobs.AdvancedCrafterRegister.JOB_NAME, gate);
        }
Exemplo n.º 2
0
        public static void RegisterMiner()
        {
            var rivets      = new InventoryItem(BuiltinBlocks.IronRivet, 6);
            var iron        = new InventoryItem(BuiltinBlocks.IronWrought, 2);
            var copperParts = new InventoryItem(BuiltinBlocks.CopperParts, 6);
            var copperNails = new InventoryItem(BuiltinBlocks.CopperNails, 6);
            var tools       = new InventoryItem(BuiltinBlocks.CopperTools, 1);
            var planks      = new InventoryItem(BuiltinBlocks.Planks, 4);
            var pickaxe     = new InventoryItem(BuiltinBlocks.BronzePickaxe, 2);

            var recipe = new Recipe(Item.name,
                                    new List <InventoryItem>
            {
                planks,
                iron,
                rivets,
                copperParts,
                copperNails,
                tools,
                planks,
                pickaxe
            },
                                    new InventoryItem(Item.ItemIndex),
                                    5);

            RecipeStorage.AddOptionalLimitTypeRecipe(AdvancedCrafterRegister.JOB_NAME, recipe);
        }
Exemplo n.º 3
0
        public static void AfterWorldLoad()
        {
            var iron = new InventoryItem(BuiltinBlocks.BronzeIngot, 2);
            var tools = new InventoryItem(BuiltinBlocks.CopperTools, 1);
            var planks = new InventoryItem(BuiltinBlocks.Planks, 4);

            var recipe = new Recipe(JOB_RECIPE,
                    new List<InventoryItem>() { iron, tools, planks },
                    new InventoryItem(JOB_ITEM_KEY, 1), 2);

            RecipePlayer.AddOptionalRecipe(recipe);
            RecipeStorage.AddOptionalLimitTypeRecipe(Items.ItemFactory.JOB_CRAFTER, recipe);
        }
Exemplo n.º 4
0
        public static void RegisterPatrolTool()
        {
            var planks = new InventoryItem(BuiltinBlocks.Planks, 2);
            var carpet = new InventoryItem(BuiltinBlocks.CarpetRed, 2);

            var recipe = new Recipe(PatrolFlag.name,
                                    new List <InventoryItem> {
                planks, carpet
            },
                                    new InventoryItem(PatrolFlag.ItemIndex, 2),
                                    5);

            RecipeStorage.AddOptionalLimitTypeRecipe(ItemFactory.JOB_CRAFTER, recipe);
        }
Exemplo n.º 5
0
        public static void Register()
        {
            var aether = new InventoryItem(Elementium.Item.ItemIndex, 2);
            var torch  = new InventoryItem(Mana.Item.ItemIndex, 1);

            var recipe = new Recipe(Item.name,
                                    new List <InventoryItem> {
                aether, torch
            },
                                    new InventoryItem(Item.ItemIndex, 1),
                                    6);

            RecipeStorage.AddOptionalLimitTypeRecipe(ApothecaryRegister.JOB_NAME, recipe);
        }
Exemplo n.º 6
0
        public static void Register()
        {
            var bandage     = new InventoryItem(Bandage.Item.ItemIndex, 1);
            var antibiotics = new InventoryItem(Anitbiotic.Item.ItemIndex, 1);

            var recipe = new Recipe(Item.name,
                                    new List <InventoryItem> {
                antibiotics, bandage
            },
                                    new InventoryItem(Item.ItemIndex, 1),
                                    50);

            RecipeStorage.AddOptionalLimitTypeRecipe(ApothecaryRegister.JOB_NAME, recipe);
        }
Exemplo n.º 7
0
        public static void Register()
        {
            var mana     = new InventoryItem(Mana.Item.ItemIndex, 2);
            var cryastal = new InventoryItem(BuiltinBlocks.Crystal, 10);

            var recipe = new Recipe(Item.name,
                                    new List <InventoryItem> {
                mana, cryastal
            },
                                    new InventoryItem(Item.ItemIndex, 1),
                                    20);

            RecipeStorage.AddOptionalLimitTypeRecipe(ApothecaryRegister.JOB_NAME, recipe);
        }
Exemplo n.º 8
0
        public static void Register()
        {
            var aether = new InventoryItem(Elementium.Item.ItemIndex, 2);
            var torch  = new InventoryItem(BuiltinBlocks.BronzeArrow, 20);

            var recipe = new Recipe(Item.name,
                                    new List <InventoryItem> {
                aether, torch
            },
                                    new InventoryItem(Item.ItemIndex, 1),
                                    6);

            //ItemTypesServer.LoadSortOrder(Item.name, GameLoader.GetNextItemSortIndex());
            RecipeStorage.AddOptionalLimitTypeRecipe(ApothecaryRegister.JOB_NAME, recipe);
        }
Exemplo n.º 9
0
        public static void Register()
        {
            var herbs  = new InventoryItem(BuiltinBlocks.Hollyhock, 10);
            var herbs2 = new InventoryItem(BuiltinBlocks.Alkanet, 10);
            var oil    = new InventoryItem(BuiltinBlocks.LinseedOil, 10);
            var herbs3 = new InventoryItem(BuiltinBlocks.Wolfsbane, 10);

            var recipe = new Recipe(Item.name,
                                    new List <InventoryItem> {
                herbs3, oil, herbs, herbs2
            },
                                    new InventoryItem(Item.ItemIndex, 1),
                                    50);

            RecipeStorage.AddOptionalLimitTypeRecipe(ApothecaryRegister.JOB_NAME, recipe);
        }
Exemplo n.º 10
0
        public static void Register()
        {
            var herbs = new InventoryItem(Jobs.HerbalistRegister.HerbItem.ItemIndex, 3);
            var oil   = new InventoryItem(BuiltinBlocks.LinseedOil, 1);
            var flour = new InventoryItem(BuiltinBlocks.Flour, 2);

            var recipe = new Recipe(Item.name,
                                    new List <InventoryItem>()
            {
                flour, oil, herbs
            },
                                    new InventoryItem(Item.ItemIndex, 1),
                                    50);

            RecipeStorage.AddOptionalLimitTypeRecipe(Jobs.ApothecaryRegister.JOB_NAME, recipe);
        }
Exemplo n.º 11
0
        public static void AfterWorldLoad()
        {
            var gold  = new InventoryItem(BuiltinBlocks.BronzeIngot, 2);
            var iron  = new InventoryItem(BuiltinBlocks.IronWrought, 2);
            var tools = new InventoryItem(BuiltinBlocks.CopperTools, 1);
            var stone = new InventoryItem(BuiltinBlocks.StoneBricks, 4);

            var recipe = new Recipe(JOB_RECIPE,
                                    new List <InventoryItem> {
                gold, tools, stone, iron
            },
                                    new InventoryItem(JOB_ITEM_KEY, 1), 2);

            RecipePlayer.AddOptionalRecipe(recipe);
            RecipeStorage.AddOptionalLimitTypeRecipe(ItemFactory.JOB_CRAFTER, recipe);
        }
Exemplo n.º 12
0
        public static void AfterWorldLoad()
        {
            var iron   = new InventoryItem(BuiltinBlocks.BronzeIngot, 2);
            var tools  = new InventoryItem(BuiltinBlocks.CopperTools, 1);
            var planks = new InventoryItem(BuiltinBlocks.Planks, 4);

            var recipe = new Recipe(JOB_RECIPE,
                                    new List <InventoryItem> {
                iron, tools, planks
            },
                                    new InventoryItem(JOB_ITEM_KEY, 1), 2);

            //ItemTypesServer.LoadSortOrder(JOB_ITEM_KEY, GameLoader.GetNextItemSortIndex());
            RecipePlayer.AddOptionalRecipe(recipe);
            RecipeStorage.AddOptionalLimitTypeRecipe(ItemFactory.JOB_CRAFTER, recipe);
        }
Exemplo n.º 13
0
        public static void Register()
        {
            var elementium = new InventoryItem(Elementium.Item.ItemIndex, 1);
            var steel      = new InventoryItem(BuiltinBlocks.SteelIngot, 1);
            var gold       = new InventoryItem(BuiltinBlocks.GoldIngot, 1);
            var silver     = new InventoryItem(BuiltinBlocks.SilverIngot, 1);
            var aether     = new InventoryItem(Aether.Item.ItemIndex, 4);

            var recipe = new Recipe(Item.name,
                                    new List <InventoryItem> {
                elementium, aether, steel, gold, silver
            },
                                    new InventoryItem(Item.ItemIndex, 1),
                                    5);

            RecipeStorage.AddOptionalLimitTypeRecipe(ApothecaryRegister.JOB_NAME, recipe);
        }
Exemplo n.º 14
0
        public static void Register()
        {
            var aether = new InventoryItem(Aether.Item.ItemIndex, 1);
            var copper = new InventoryItem(BuiltinBlocks.Copper, 400);
            var iron   = new InventoryItem(BuiltinBlocks.IronOre, 200);
            var tin    = new InventoryItem(BuiltinBlocks.Tin, 400);
            var gold   = new InventoryItem(BuiltinBlocks.GoldOre, 100);
            var silver = new InventoryItem(BuiltinBlocks.GalenaSilver, 50);
            var lead   = new InventoryItem(BuiltinBlocks.GalenaLead, 50);

            var recipe = new Recipe(Item.name,
                                    new List <InventoryItem> {
                aether, copper, iron, tin, gold, silver, lead
            },
                                    new InventoryItem(Item.ItemIndex, 1),
                                    10);

            RecipeStorage.AddOptionalLimitTypeRecipe(ApothecaryRegister.JOB_NAME, recipe);
        }
Exemplo n.º 15
0
        public static void RegisterTeleportPad()
        {
            var rivets  = new InventoryItem(BuiltinBlocks.IronRivet, 6);
            var steel   = new InventoryItem(BuiltinBlocks.SteelIngot, 5);
            var sbb     = new InventoryItem(BuiltinBlocks.ScienceBagBasic, 20);
            var sbc     = new InventoryItem(BuiltinBlocks.ScienceBagColony, 20);
            var sba     = new InventoryItem(BuiltinBlocks.ScienceBagAdvanced, 20);
            var crystal = new InventoryItem(BuiltinBlocks.Crystal, 5);
            var stone   = new InventoryItem(BuiltinBlocks.StoneBricks, 50);
            var mana    = new InventoryItem(Mana.Item.ItemIndex, 100);

            var recipe = new Recipe(Item.name,
                                    new List <InventoryItem> {
                crystal, steel, rivets, sbb, sbc, sba, crystal, stone
            },
                                    new InventoryItem(Item.ItemIndex),
                                    6);

            RecipeStorage.AddOptionalLimitTypeRecipe(AdvancedCrafterRegister.JOB_NAME, recipe);
        }
Exemplo n.º 16
0
        public static void RegisterTurret()
        {
            var rivets      = new InventoryItem(BuiltinBlocks.IronRivet, 6);
            var iron        = new InventoryItem(BuiltinBlocks.IronWrought, 2);
            var copperParts = new InventoryItem(BuiltinBlocks.CopperParts, 6);
            var copperNails = new InventoryItem(BuiltinBlocks.CopperNails, 6);
            var tools       = new InventoryItem(BuiltinBlocks.CopperTools, 1);
            var planks      = new InventoryItem(BuiltinBlocks.Planks, 2);
            var stone       = new InventoryItem(BuiltinBlocks.StoneBricks, 4);
            var bronze      = new InventoryItem(BuiltinBlocks.BronzePlate, 2);
            var bronzeIngot = new InventoryItem(BuiltinBlocks.BronzeIngot, 3);
            var steelParts  = new InventoryItem(BuiltinBlocks.SteelParts, 6);
            var steelIngot  = new InventoryItem(BuiltinBlocks.SteelIngot, 2);

            var stoneAmmo = new InventoryItem(BuiltinBlocks.SlingBullet, 10);
            var sling     = new InventoryItem(BuiltinBlocks.Sling, 2);

            var arrow = new InventoryItem(BuiltinBlocks.BronzeArrow, 10);
            var bow   = new InventoryItem(BuiltinBlocks.Bow, 2);

            var bolt     = new InventoryItem(BuiltinBlocks.BronzeArrow, 10);
            var crossbow = new InventoryItem(BuiltinBlocks.Crossbow, 2);

            var bullet    = new InventoryItem(BuiltinBlocks.LeadBullet, 10);
            var gunpowder = new InventoryItem(BuiltinBlocks.GunpowderPouch, 3);
            var matchlock = new InventoryItem(BuiltinBlocks.MatchlockGun, 2);

            AddStoneTurretSettings();
            AddBronzeArrowTurretSettings();
            AddCrossBowTurretSettings();
            AddMatchlockTurretSettings();

            var stonerecipe = new Recipe(STONE_NAMESPACE,
                                         new List <InventoryItem>()
            {
                planks, copperParts, copperNails, tools, stone, sling, stoneAmmo
            },
                                         new InventoryItem(TurretSettings[STONE].TurretItem.ItemIndex),
                                         5);

            RecipeStorage.AddOptionalLimitTypeRecipe(Jobs.AdvancedCrafterRegister.JOB_NAME, stonerecipe);

            var bronzeArrowrecipe = new Recipe(BRONZEARROW_NAMESPACE,
                                               new List <InventoryItem>()
            {
                planks, bronze, bronzeIngot, copperNails, tools, stone, arrow, bow
            },
                                               new InventoryItem(TurretSettings[BRONZEARROW].TurretItem.ItemIndex),
                                               5);

            RecipeStorage.AddOptionalLimitTypeRecipe(Jobs.AdvancedCrafterRegister.JOB_NAME, bronzeArrowrecipe);

            var crossbowrecipe = new Recipe(CROSSBOW_NAMESPACE,
                                            new List <InventoryItem>()
            {
                planks, iron, rivets, copperNails, tools, stone, bolt, crossbow
            },
                                            new InventoryItem(TurretSettings[CROSSBOW].TurretItem.ItemIndex),
                                            5);

            RecipeStorage.AddOptionalLimitTypeRecipe(Jobs.AdvancedCrafterRegister.JOB_NAME, crossbowrecipe);

            var matchlockrecipe = new Recipe(MATCHLOCK_NAMESPACE,
                                             new List <InventoryItem>()
            {
                planks, steelParts, steelIngot, copperNails, tools, stone, bullet, gunpowder, matchlock
            },
                                             new InventoryItem(TurretSettings[MATCHLOCK].TurretItem.ItemIndex),
                                             5);

            RecipeStorage.AddOptionalLimitTypeRecipe(Jobs.AdvancedCrafterRegister.JOB_NAME, matchlockrecipe);

            foreach (var turret in TurretSettings)
            {
                MachineManager.RegisterMachineType(turret.Key, new MachineManager.MachineSettings(turret.Value.TurretItem.ItemIndex, Repair, MachineManager.Refuel, Reload, DoWork, turret.Value.RepairTime, turret.Value.RefuelTime, turret.Value.ReloadTime, turret.Value.WorkTime));
            }
        }
Exemplo n.º 17
0
        public static void RegisterRecipes()
        {
            var coppertools = new InventoryItem(BuiltinBlocks.CopperTools, 1);
            var planks      = new InventoryItem(BuiltinBlocks.Planks, 1);

            var copperParts = new InventoryItem(BuiltinBlocks.CopperParts, 5);
            var copper      = new InventoryItem(BuiltinBlocks.Copper, 5);

            var bronzePlate = new InventoryItem(BuiltinBlocks.BronzePlate, 5);
            var bronze      = new InventoryItem(BuiltinBlocks.BronzeIngot, 5);

            var ironRivet = new InventoryItem(BuiltinBlocks.IronRivet, 5);
            var iron      = new InventoryItem(BuiltinBlocks.IronWrought, 5);

            var steelParts = new InventoryItem(BuiltinBlocks.SteelParts, 5);
            var steel      = new InventoryItem(BuiltinBlocks.SteelIngot, 5);


            List <InventoryItem> items;

            foreach (var a in ItemFactory.WeaponLookup)
            {
                items = new List <InventoryItem>();

                // ----------------------------------------
                // Copper
                // ----------------------------------------

                if (a.Value.Metal == MetalType.Copper && a.Value.WeaponType == WeaponType.Sword)
                {
                    copperParts = new InventoryItem(BuiltinBlocks.CopperParts, 3);
                    copper      = new InventoryItem(BuiltinBlocks.Copper, 2);
                    items.AddRange(new[] { copper, copperParts, coppertools, planks });
                }

                // ----------------------------------------
                // Bronze
                // ----------------------------------------

                if (a.Value.Metal == MetalType.Bronze && a.Value.WeaponType == WeaponType.Sword)
                {
                    bronzePlate = new InventoryItem(BuiltinBlocks.BronzePlate, 3);
                    bronze      = new InventoryItem(BuiltinBlocks.BronzeIngot, 2);
                    items.AddRange(new[] { bronze, bronzePlate, coppertools, planks });
                }

                // ----------------------------------------
                // Iron
                // ----------------------------------------

                if (a.Value.Metal == MetalType.Iron && a.Value.WeaponType == WeaponType.Sword)
                {
                    ironRivet = new InventoryItem(BuiltinBlocks.IronRivet, 3);
                    iron      = new InventoryItem(BuiltinBlocks.IronIngot, 2);
                    items.AddRange(new[] { iron, ironRivet, coppertools, planks });
                }

                // ----------------------------------------
                // Steel
                // ----------------------------------------

                if (a.Value.Metal == MetalType.Steel && a.Value.WeaponType == WeaponType.Sword)
                {
                    steelParts = new InventoryItem(BuiltinBlocks.SteelParts, 3);
                    steel      = new InventoryItem(BuiltinBlocks.SteelIngot, 2);
                    items.AddRange(new[] { steel, steelParts, coppertools, planks });
                }

                var invItem = new InventoryItem(a.Value.ItemType.ItemIndex);
                var recipe  = new Recipe(a.Value.ItemType.name, items, invItem, 5);

                RecipeStorage.AddOptionalLimitTypeRecipe(Armor.JOB_METALSMITH, recipe);
            }

            ItemFactory.RefreshGuardSettings();
        }
Exemplo n.º 18
0
        /// <summary>
        /// Does all the work of adding this recipe to the server's database. Should be called in the AfterItemTypesDefined callback.
        /// </summary>
        public void addRecipeToLimitType()
        {
            if (enabled)
            {
                try
                {
                    // First remove any recipes we are replacing.
                    foreach (string deleteMe in Replaces)
                    {
                        Pipliz.Log.Write("{0}: Recipe {1} is marked as replacing {2}, attempting to comply.", NAMESPACE == null ? "" : NAMESPACE, this.Name, deleteMe);
                        RecipeHelper.tryRemoveRecipe(deleteMe);
                    }

                    // Convert shell references into actual InventoryItem objects.
                    foreach (ItemShell I in Results)
                    {
                        if (Variables.itemsMaster == null)
                        {
                            Pipliz.Log.WriteError("{0}.SimpleRecipe.addRecipeToLimitType() has reached a critical error: 'Variables.itemsMaster' is not yet available. Recipe: {1}", NAMESPACE == null ? "" : NAMESPACE, this.Name);
                        }
                        else
                        {
                            string useKey = I.asSimpleItem == null ? I.strItemkey : I.asSimpleItem.ID;
                            if (Variables.itemsMaster.ContainsKey(useKey))
                            {
                                realResults.Add(new InventoryItem(useKey, I.intAmount));
                            }
                            else
                            {
                                Pipliz.Log.WriteError("{0}: A problem occurred adding recipe RESULT {1} to recipe {2}, the item key was not found.", NAMESPACE == null ? "" : NAMESPACE, I.strItemkey, this.Name);
                            }
                        }
                    }
                    foreach (ItemShell I in Requirements)
                    {
                        if (Variables.itemsMaster == null)
                        {
                            Pipliz.Log.WriteError("{0}.SimpleRecipe.addRecipeToLimitType() has reached a critical error: 'Variables.itemsMaster' is not yet available. Recipe: {1}", NAMESPACE == null ? "" : NAMESPACE, this.Name);
                        }
                        else
                        {
                            string useKey = I.asSimpleItem == null ? I.strItemkey : I.asSimpleItem.ID;
                            if (Variables.itemsMaster.ContainsKey(useKey))
                            {
                                realRequirements.Add(new InventoryItem(useKey, I.intAmount));
                            }
                            else
                            {
                                Pipliz.Log.WriteError("{0}: A problem occurred adding recipe REQUIREMENT {1} to recipe {2}, the item key was not found.", NAMESPACE == null ? "" : NAMESPACE, I.strItemkey, this.Name);
                            }
                        }
                    }

                    // Build actual Recipe object.
                    Recipe thisRecipe = new Recipe(this.fullName, this.realRequirements, this.realResults, this.defaultLimit, this.isOptional, this.defaultPriority);

                    // Commence registering it.
                    Pipliz.Log.Write("{0}: Attempting to register recipe {1}", NAMESPACE == null ? "" : NAMESPACE, thisRecipe.Name);
                    if (this.limitType != null)
                    {
                        if (isOptional)
                        {
                            Pipliz.Log.Write("{0}: Attempting to register optional limit type recipe {1}", NAMESPACE == null ? "" : NAMESPACE, thisRecipe.Name);
                            RecipeStorage.AddOptionalLimitTypeRecipe(limitType, thisRecipe);
                        }
                        else
                        {
                            Pipliz.Log.Write("{0}: Attempting to register default limit type recipe {1}", NAMESPACE == null ? "" : NAMESPACE, thisRecipe.Name);
                            RecipeStorage.AddDefaultLimitTypeRecipe(limitType, thisRecipe);
                        }
                    }

                    if (userCraftable)
                    {
                        Recipe playerRecipe = new Recipe("player." + this.Name, this.realRequirements, this.realResults, this.defaultLimit, this.isOptional);
                        Pipliz.Log.Write("{0}: Attempting to register default player type recipe {1}", NAMESPACE == null ? "" : NAMESPACE, playerRecipe.Name);
                        RecipePlayer.AddDefaultRecipe(playerRecipe);
                    }
                }
                catch (Exception ex)
                {
                    Pipliz.Log.WriteError("{0}: Error adding recipe: {1}", NAMESPACE == null ? "" : NAMESPACE, ex.Message);
                }
            }
            else
            {
                Pipliz.Log.Write("{0}: Recipe {1} has been disabled and will NOT be registered.", NAMESPACE == null ? "" : NAMESPACE, this.Name);
            }
        }
Exemplo n.º 19
0
        public static void RegisterTurret()
        {
            var planks     = new InventoryItem(BuiltinBlocks.Planks, 50);
            var stone      = new InventoryItem(BuiltinBlocks.StoneBricks, 100);
            var tools      = new InventoryItem(BuiltinBlocks.CopperTools, 20);
            var mana       = new InventoryItem(Mana.Item.ItemIndex, 4);
            var elemen     = new InventoryItem(Elementium.Item.ItemIndex, 2);
            var esper      = new InventoryItem(Esper.Item.ItemIndex, 1);
            var esperMax   = new InventoryItem(Esper.Item.ItemIndex, 10);
            var airStone   = new InventoryItem(AirStone.Item.ItemIndex, 2);
            var fireStone  = new InventoryItem(FireStone.Item.ItemIndex, 2);
            var waterStone = new InventoryItem(WaterStone.Item.ItemIndex, 2);
            var earthStone = new InventoryItem(EarthStone.Item.ItemIndex, 2);
            var voidStone  = new InventoryItem(Void.Item.ItemIndex, 1);

            AddAirTurretTurretSettings();
            AddEarthTurretTurretSettings();
            AddWaterTurretTurretSettings();
            AddFireTurretTurretSettings();
            AddVoidTurretTurretSettings();

            var airRecipe = new Recipe(AIRTURRET_NAMESPACE,
                                       new List <InventoryItem> {
                planks, elemen, mana, tools, stone, airStone, esper
            },
                                       new InventoryItem(Turret.TurretSettings[AIRTURRET].TurretItem.ItemIndex),
                                       5);

            RecipeStorage.AddOptionalLimitTypeRecipe(AdvancedCrafterRegister.JOB_NAME, airRecipe);

            var earthRecipe = new Recipe(EARTHTURRET_NAMESPACE,
                                         new List <InventoryItem>
            {
                planks,
                elemen,
                mana,
                tools,
                stone,
                earthStone,
                esper
            },
                                         new InventoryItem(Turret.TurretSettings[EARTHTURRET].TurretItem.ItemIndex),
                                         5, true);

            RecipeStorage.AddOptionalLimitTypeRecipe(AdvancedCrafterRegister.JOB_NAME, earthRecipe);

            var fireRecipe = new Recipe(FIRETURRET_NAMESPACE,
                                        new List <InventoryItem> {
                planks, elemen, mana, tools, stone, fireStone, esper
            },
                                        new InventoryItem(Turret.TurretSettings[FIRETURRET].TurretItem.ItemIndex),
                                        5, true);

            RecipeStorage.AddOptionalLimitTypeRecipe(AdvancedCrafterRegister.JOB_NAME, fireRecipe);

            var waterRecipe = new Recipe(WATERTURRET_NAMESPACE,
                                         new List <InventoryItem>
            {
                planks,
                elemen,
                mana,
                tools,
                stone,
                waterStone,
                esper
            },
                                         new InventoryItem(Turret.TurretSettings[WATERTURRET].TurretItem.ItemIndex),
                                         5, true);

            RecipeStorage.AddOptionalLimitTypeRecipe(AdvancedCrafterRegister.JOB_NAME, waterRecipe);

            var voidRecipe = new Recipe(VOIDTURRET_NAMESPACE,
                                        new List <InventoryItem>
            {
                planks,
                elemen,
                mana,
                tools,
                stone,
                voidStone,
                esperMax
            },
                                        new InventoryItem(Turret.TurretSettings[VOIDTURRET].TurretItem.ItemIndex),
                                        5, true);

            RecipeStorage.AddOptionalLimitTypeRecipe(AdvancedCrafterRegister.JOB_NAME, voidRecipe);
        }
Exemplo n.º 20
0
        public static void RegisterRecipes()
        {
            var coppertools = new InventoryItem(BuiltinBlocks.CopperTools, 1);
            var clothing    = new InventoryItem(BuiltinBlocks.Clothing, 1);

            var copperParts = new InventoryItem(BuiltinBlocks.CopperParts, 5);
            var copper      = new InventoryItem(BuiltinBlocks.Copper, 5);

            var bronzePlate = new InventoryItem(BuiltinBlocks.BronzePlate, 5);
            var bronze      = new InventoryItem(BuiltinBlocks.BronzeIngot, 5);

            var ironRivet = new InventoryItem(BuiltinBlocks.IronRivet, 5);
            var iron      = new InventoryItem(BuiltinBlocks.IronWrought, 5);

            var steelParts = new InventoryItem(BuiltinBlocks.SteelParts, 5);
            var steel      = new InventoryItem(BuiltinBlocks.SteelIngot, 5);

            List <InventoryItem> items;

            foreach (var a in ArmorLookup)
            {
                items = new List <InventoryItem>();

                // ----------------------------------------
                // Copper
                // ----------------------------------------

                if (a.Value.Metal == MetalType.Copper && a.Value.Slot == ArmorSlot.Helm)
                {
                    copperParts = new InventoryItem(BuiltinBlocks.CopperParts, 3);
                    copper      = new InventoryItem(BuiltinBlocks.Copper, 2);
                    items.AddRange(new[] { copper, copperParts, coppertools, clothing });
                }

                if (a.Value.Metal == MetalType.Copper && a.Value.Slot == ArmorSlot.Chest)
                {
                    copperParts = new InventoryItem(BuiltinBlocks.CopperParts, 5);
                    copper      = new InventoryItem(BuiltinBlocks.Copper, 5);
                    items.AddRange(new[] { copper, copperParts, coppertools, clothing });
                }

                if (a.Value.Metal == MetalType.Copper && a.Value.Slot == ArmorSlot.Gloves)
                {
                    copperParts = new InventoryItem(BuiltinBlocks.CopperParts, 2);
                    copper      = new InventoryItem(BuiltinBlocks.Copper, 2);
                    items.AddRange(new[] { copper, copperParts, coppertools, clothing });
                }

                if (a.Value.Metal == MetalType.Copper && a.Value.Slot == ArmorSlot.Legs)
                {
                    copperParts = new InventoryItem(BuiltinBlocks.CopperParts, 3);
                    copper      = new InventoryItem(BuiltinBlocks.Copper, 3);
                    items.AddRange(new[] { copper, copperParts, coppertools, clothing });
                }

                if (a.Value.Metal == MetalType.Copper && a.Value.Slot == ArmorSlot.Boots)
                {
                    copperParts = new InventoryItem(BuiltinBlocks.CopperParts, 2);
                    copper      = new InventoryItem(BuiltinBlocks.Copper, 2);
                    items.AddRange(new[] { copper, copperParts, coppertools, clothing });
                }

                if (a.Value.Metal == MetalType.Copper && a.Value.Slot == ArmorSlot.Shield)
                {
                    copperParts = new InventoryItem(BuiltinBlocks.CopperParts, 2);
                    copper      = new InventoryItem(BuiltinBlocks.Copper, 2);
                    items.AddRange(new[] { copper, copperParts, coppertools, clothing });
                }

                // ----------------------------------------
                // Bronze
                // ----------------------------------------

                if (a.Value.Metal == MetalType.Bronze && a.Value.Slot == ArmorSlot.Helm)
                {
                    bronzePlate = new InventoryItem(BuiltinBlocks.BronzePlate, 3);
                    bronze      = new InventoryItem(BuiltinBlocks.BronzeIngot, 2);
                    items.AddRange(new[] { bronze, bronzePlate, coppertools, clothing });
                }

                if (a.Value.Metal == MetalType.Bronze && a.Value.Slot == ArmorSlot.Chest)
                {
                    bronzePlate = new InventoryItem(BuiltinBlocks.BronzePlate, 5);
                    bronze      = new InventoryItem(BuiltinBlocks.BronzeIngot, 5);
                    items.AddRange(new[] { bronze, bronzePlate, coppertools, clothing });
                }

                if (a.Value.Metal == MetalType.Bronze && a.Value.Slot == ArmorSlot.Gloves)
                {
                    bronzePlate = new InventoryItem(BuiltinBlocks.BronzePlate, 2);
                    bronze      = new InventoryItem(BuiltinBlocks.BronzeIngot, 2);
                    items.AddRange(new[] { bronze, bronzePlate, coppertools, clothing });
                }

                if (a.Value.Metal == MetalType.Bronze && a.Value.Slot == ArmorSlot.Legs)
                {
                    bronzePlate = new InventoryItem(BuiltinBlocks.BronzePlate, 3);
                    bronze      = new InventoryItem(BuiltinBlocks.BronzeIngot, 3);
                    items.AddRange(new[] { bronze, bronzePlate, coppertools, clothing });
                }

                if (a.Value.Metal == MetalType.Bronze && a.Value.Slot == ArmorSlot.Boots)
                {
                    bronzePlate = new InventoryItem(BuiltinBlocks.BronzePlate, 2);
                    bronze      = new InventoryItem(BuiltinBlocks.BronzeIngot, 2);
                    items.AddRange(new[] { bronze, bronzePlate, coppertools, clothing });
                }

                if (a.Value.Metal == MetalType.Bronze && a.Value.Slot == ArmorSlot.Shield)
                {
                    bronzePlate = new InventoryItem(BuiltinBlocks.BronzePlate, 2);
                    bronze      = new InventoryItem(BuiltinBlocks.BronzeIngot, 2);
                    items.AddRange(new[] { bronze, bronzePlate, coppertools, clothing });
                }

                // ----------------------------------------
                // Iron
                // ----------------------------------------

                if (a.Value.Metal == MetalType.Iron && a.Value.Slot == ArmorSlot.Helm)
                {
                    ironRivet = new InventoryItem(BuiltinBlocks.IronRivet, 3);
                    iron      = new InventoryItem(BuiltinBlocks.IronIngot, 2);
                    items.AddRange(new[] { iron, ironRivet, coppertools, clothing });
                }

                if (a.Value.Metal == MetalType.Iron && a.Value.Slot == ArmorSlot.Chest)
                {
                    ironRivet = new InventoryItem(BuiltinBlocks.IronRivet, 5);
                    iron      = new InventoryItem(BuiltinBlocks.IronIngot, 5);
                    items.AddRange(new[] { iron, ironRivet, coppertools, clothing });
                }

                if (a.Value.Metal == MetalType.Iron && a.Value.Slot == ArmorSlot.Gloves)
                {
                    ironRivet = new InventoryItem(BuiltinBlocks.IronRivet, 2);
                    iron      = new InventoryItem(BuiltinBlocks.IronIngot, 2);
                    items.AddRange(new[] { iron, ironRivet, coppertools, clothing });
                }

                if (a.Value.Metal == MetalType.Iron && a.Value.Slot == ArmorSlot.Legs)
                {
                    ironRivet = new InventoryItem(BuiltinBlocks.IronRivet, 3);
                    iron      = new InventoryItem(BuiltinBlocks.IronIngot, 3);
                    items.AddRange(new[] { iron, ironRivet, coppertools, clothing });
                }

                if (a.Value.Metal == MetalType.Iron && a.Value.Slot == ArmorSlot.Boots)
                {
                    ironRivet = new InventoryItem(BuiltinBlocks.IronRivet, 2);
                    iron      = new InventoryItem(BuiltinBlocks.IronIngot, 2);
                    items.AddRange(new[] { iron, ironRivet, coppertools, clothing });
                }

                if (a.Value.Metal == MetalType.Iron && a.Value.Slot == ArmorSlot.Shield)
                {
                    ironRivet = new InventoryItem(BuiltinBlocks.IronRivet, 2);
                    iron      = new InventoryItem(BuiltinBlocks.IronIngot, 2);
                    items.AddRange(new[] { iron, ironRivet, coppertools, clothing });
                }

                // ----------------------------------------
                // Steel
                // ----------------------------------------

                if (a.Value.Metal == MetalType.Steel && a.Value.Slot == ArmorSlot.Helm)
                {
                    steelParts = new InventoryItem(BuiltinBlocks.SteelParts, 3);
                    steel      = new InventoryItem(BuiltinBlocks.SteelIngot, 2);
                    items.AddRange(new[] { steel, steelParts, coppertools, clothing });
                }

                if (a.Value.Metal == MetalType.Steel && a.Value.Slot == ArmorSlot.Chest)
                {
                    steelParts = new InventoryItem(BuiltinBlocks.SteelParts, 5);
                    steel      = new InventoryItem(BuiltinBlocks.SteelIngot, 5);
                    items.AddRange(new[] { steel, steelParts, coppertools, clothing });
                }

                if (a.Value.Metal == MetalType.Steel && a.Value.Slot == ArmorSlot.Gloves)
                {
                    steelParts = new InventoryItem(BuiltinBlocks.SteelParts, 2);
                    steel      = new InventoryItem(BuiltinBlocks.SteelIngot, 2);
                    items.AddRange(new[] { steel, steelParts, coppertools, clothing });
                }

                if (a.Value.Metal == MetalType.Steel && a.Value.Slot == ArmorSlot.Legs)
                {
                    steelParts = new InventoryItem(BuiltinBlocks.SteelParts, 3);
                    steel      = new InventoryItem(BuiltinBlocks.SteelIngot, 3);
                    items.AddRange(new[] { steel, steelParts, coppertools, clothing });
                }

                if (a.Value.Metal == MetalType.Steel && a.Value.Slot == ArmorSlot.Boots)
                {
                    steelParts = new InventoryItem(BuiltinBlocks.SteelParts, 2);
                    steel      = new InventoryItem(BuiltinBlocks.SteelIngot, 2);
                    items.AddRange(new[] { steel, steelParts, coppertools, clothing });
                }

                if (a.Value.Metal == MetalType.Steel && a.Value.Slot == ArmorSlot.Shield)
                {
                    steelParts = new InventoryItem(BuiltinBlocks.SteelParts, 2);
                    steel      = new InventoryItem(BuiltinBlocks.SteelIngot, 2);
                    items.AddRange(new[] { steel, steelParts, coppertools, clothing });
                }

                var invItem = new InventoryItem(a.Value.ItemType.ItemIndex);
                var recipe  = new Recipe(a.Value.ItemType.name, items, invItem, 5, false, -100);

                RecipeStorage.AddOptionalLimitTypeRecipe(JOB_METALSMITH, recipe);
            }
        }