private static void CreateGroup(string name, int minTier, int maxTier, GroupRecipe recipeMethod, bool hasRarity = true) { string[] TierPrefix = { "", "Beginner's", "Novice's", "Journeyman's", "Adept's", "Expert's", "Master's", "Grandmaster's", "Elder's" }; for (int tier = minTier; tier <= maxTier; tier++) { for (int rarity = 1; rarity <= 4; rarity++) { if ((tier >= 4 && hasRarity) || rarity == 1) { var itemname = TierPrefix[tier] + " " + name; var item = new Item(itemname, tier, rarity); var recipe = new Recipe(item); recipeMethod(tier, rarity, recipe); Items.Add(item); } } } }
private static void CreateGroup(string name, int minTier, GroupRecipe recipeMethod, bool hasRarity = true) { CreateGroup(name, minTier, 8, recipeMethod, hasRarity); }
private static void FillList() { #region recipes #region bar GroupRecipe bar4plank4 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Bar, tier, rarity), 4); recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Plank, tier, rarity), 4); }; GroupRecipe bar8 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Bar, tier, rarity), 8); }; GroupRecipe bar12leather12 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Bar, tier, rarity), 12); recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Leather, tier, rarity), 12); }; GroupRecipe bar16 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Bar, tier, rarity), 16); }; GroupRecipe bar16leather8 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Bar, tier, rarity), 16); recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Leather, tier, rarity), 8); }; GroupRecipe bar16cloth8 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Bar, tier, rarity), 16); recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Cloth, tier, rarity), 8); }; GroupRecipe bar16plank8 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Bar, tier, rarity), 16); recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Plank, tier, rarity), 8); }; GroupRecipe bar16leather16 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Bar, tier, rarity), 16); recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Leather, tier, rarity), 16); }; GroupRecipe bar20cloth12 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Bar, tier, rarity), 20); recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Cloth, tier, rarity), 12); }; GroupRecipe bar20leather12 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Bar, tier, rarity), 20); recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Leather, tier, rarity), 12); }; GroupRecipe bar20plank12 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Bar, tier, rarity), 20); recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Plank, tier, rarity), 12); }; GroupRecipe bar24 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Bar, tier, rarity), 24); }; #endregion bar #region cloth GroupRecipe cloth4leather4 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Cloth, tier, rarity), 4); recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Leather, tier, rarity), 4); }; GroupRecipe cloth4plank4 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Cloth, tier, rarity), 4); recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Plank, tier, rarity), 4); }; GroupRecipe cloth8 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Cloth, tier, rarity), 8); }; GroupRecipe cloth8leather8 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Cloth, tier, rarity), 8); recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Leather, tier, rarity), 8); }; GroupRecipe cloth16 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Cloth, tier, rarity), 16); }; #endregion #region leather GroupRecipe leather8 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Leather, tier, rarity), 8); }; GroupRecipe leather16 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Leather, tier, rarity), 16); }; GroupRecipe leather20bar12 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Leather, tier, rarity), 20); recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Bar, tier, rarity), 12); }; #endregion #region plank GroupRecipe plank6bar2 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Plank, tier, rarity), 6); recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Bar, tier, rarity), 2); }; GroupRecipe plank8block8 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Plank, tier, rarity), 8); recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Block, tier, rarity), 8); }; GroupRecipe plank16bar8 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Plank, tier, rarity), 16); recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Bar, tier, rarity), 8); }; GroupRecipe plank16cloth8 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Plank, tier, rarity), 16); recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Cloth, tier, rarity), 8); }; GroupRecipe plank32 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Plank, tier, rarity), 32); }; GroupRecipe plank20bar12 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Plank, tier, rarity), 20); recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Bar, tier, rarity), 12); }; GroupRecipe plank20cloth12 = (tier, rarity, recipe) => { recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Plank, tier, rarity), 20); recipe.AddComponent(Helpers.GetResourceByTier(ResourceType.Cloth, tier, rarity), 12); }; #endregion #endregion #region Warrior CreateGroup("Soldier Boots", 2, bar8); CreateGroup("Knight Boots", 4, bar8); CreateGroup("Guardian Boots", 4, bar8); CreateGroup("Soldier Armor", 2, bar16); CreateGroup("Knight Armor", 4, bar16); CreateGroup("Guardian Armor", 4, bar16); CreateGroup("Soldier Helmet", 2, bar8); CreateGroup("Knight Helmet", 4, bar8); CreateGroup("Guardian Helmet", 4, bar8); CreateGroup("Claymore", 4, bar20leather12); CreateGroup("Dual Swords", 4, bar20leather12); CreateGroup("Broadsword", 2, bar16leather8); CreateGroup("Greataxe", 4, bar20plank12); CreateGroup("Halberd", 4, plank20bar12); CreateGroup("Battleaxe", 3, bar16plank8); CreateGroup("Flail", 4, bar20cloth12); CreateGroup("Heavy Mace", 4, bar20cloth12); CreateGroup("Mace", 3, bar16cloth8); CreateGroup("Great Hammer", 4, bar20cloth12); CreateGroup("Polehammer", 4, bar20cloth12); CreateGroup("Hammer", 4, bar24); CreateGroup("Crossbow", 4, plank20bar12); CreateGroup("Heavy Crossbow", 4, plank20bar12); CreateGroup("Light Crossbow", 4, plank16bar8); CreateGroup("Shield", 2, bar4plank4); #endregion Blacksmith #region Hunter CreateGroup("Mercenary Shoes", 2, leather8); CreateGroup("Hunter Shoes", 4, leather8); CreateGroup("Assassin Shoes", 4, leather8); CreateGroup("Mercenary Jacket", 2, leather16); CreateGroup("Hunter Jacket", 4, leather16); CreateGroup("Assassin Jacket", 4, leather16); CreateGroup("Mercenary Hood", 2, leather8); CreateGroup("Hunter Hood", 4, leather8); CreateGroup("Assassin Hood", 4, leather8); CreateGroup("Bow", 2, plank32); CreateGroup("Longbow", 4, plank32); CreateGroup("Warbow", 4, plank32); CreateGroup("Glaive", 4, bar20plank12); CreateGroup("Pike", 4, plank20bar12); CreateGroup("Spear", 3, plank16bar8); CreateGroup("Great Nature Staff", 4, plank20cloth12); CreateGroup("Wild Staff", 4, plank20cloth12); CreateGroup("Nature Staff", 3, plank16cloth8); CreateGroup("Claws", 4, leather20bar12); CreateGroup("Dagger Pair", 4, bar16leather16); CreateGroup("Dagger", 4, bar12leather12); CreateGroup("Double Bladed Staff", 4, leather20bar12); CreateGroup("Iron-Clad Staff", 4, leather20bar12); CreateGroup("Quarterstaff", 4, leather20bar12); CreateGroup("Torch", 3, cloth4plank4); #endregion #region Mage CreateGroup("Scholar Sandals", 2, cloth8); CreateGroup("Cleric Sandals", 4, cloth8); CreateGroup("Mage Sandals", 4, cloth8); CreateGroup("Scholar Robe", 2, cloth16); CreateGroup("Cleric Robe", 4, cloth16); CreateGroup("Mage Robe", 4, cloth16); CreateGroup("Scholar Cowl", 2, cloth8); CreateGroup("Cleric Cowl", 4, cloth8); CreateGroup("Mage Cowl", 4, cloth8); CreateGroup("Great Fire Staff", 4, plank20bar12); CreateGroup("Infernal Staff", 4, plank20bar12); CreateGroup("Fire Staff", 2, plank16bar8); CreateGroup("Divine Staff", 4, plank20cloth12); CreateGroup("Great Holy Staff", 4, plank20cloth12); CreateGroup("Holy Staff", 3, plank16cloth8); CreateGroup("Great Arcane Staff", 4, plank20bar12); CreateGroup("Enigmatic Staff", 4, plank20bar12); CreateGroup("Arcane Staff", 3, plank16bar8); CreateGroup("Great Frost Staff", 4, plank20bar12); CreateGroup("Glacial Staff", 4, plank20bar12); CreateGroup("Frost Staff", 4, plank16bar8); CreateGroup("Great Cursed Staff", 4, plank20bar12); CreateGroup("Demonic Staff", 4, plank20bar12); CreateGroup("Cursed Staff", 4, plank16bar8); CreateGroup("Tome of Spells", 2, cloth4leather4); #endregion #region Toolsmith CreateGroup("Bag", 2, cloth8leather8); CreateGroup("Cape", 2, cloth4leather4); CreateGroup("Axe", 2, plank6bar2, false); CreateGroup("Stone Hammer", 2, plank6bar2, false); CreateGroup("Pickaxe", 2, plank6bar2, false); CreateGroup("Skinning Knife", 2, plank6bar2, false); CreateGroup("Sickle", 2, plank6bar2, false); CreateGroup("Demolition Hammer", 2, plank8block8, false); #endregion Toolsmith }