public static void Initialize() { foreach (var potion in Potions) { Resource resource = new Resource(); { resource.Name = potion.Key; resource.PotionType = potion.Key; resource.CraftPrerequisites = potion.Value.Ingredients; resource.CraftInfo = new Resource.CraftItemInfo() { CraftItemType = potion.Key }; resource.CanCraft = true; resource.MoneyValue = 100; resource.Description = potion.Value.Description; resource.ShortName = potion.Key; resource.Tags = new List <Resource.ResourceTags>() { Resource.ResourceTags.Potion }; resource.GuiLayers = new List <Gui.TileReference>() { new Gui.TileReference("resources", potion.Value.Icon) }; resource.CompositeLayers = new List <Resource.CompositeLayer>() { new Resource.CompositeLayer() { Asset = ContentPaths.Entities.Resources.resources, Frame = new Microsoft.Xna.Framework.Point(potion.Value.Icon % 8, potion.Value.Icon / 8), FrameSize = new Microsoft.Xna.Framework.Point(32, 32) } }; resource.Tint = Microsoft.Xna.Framework.Color.White; }; ResourceLibrary.Add(resource); CraftItem craftItem = new CraftItem() { CraftLocation = "Apothecary", Icon = new Gui.TileReference("resources", potion.Value.Icon), Category = "Potions", Name = potion.Key, DisplayName = potion.Key, AllowHeterogenous = true, IsMagical = true, Type = CraftItem.CraftType.Resource, Verb = StringLibrary.GetString("brew"), PastTeseVerb = StringLibrary.GetString("brewed"), CurrentVerb = StringLibrary.GetString("brewing"), ResourceCreated = potion.Key, Description = potion.Value.Description, RequiredResources = potion.Value.Ingredients, BaseCraftTime = 10.0f, }; CraftLibrary.Add(craftItem); } }
public CraftItem ObjectAsCraftableResource() { string resourceName = Name + "..."; CraftItem toReturn = CraftLibrary.GetCraftable(resourceName); if (toReturn == null) { toReturn = this.MemberwiseClone() as CraftItem; toReturn.Name = resourceName; toReturn.Type = CraftType.Resource; toReturn.CraftActBehavior = CraftActBehaviors.Object; toReturn.ResourceCreated = "Object"; toReturn.CraftLocation = String.IsNullOrEmpty(CraftLocation) ? "Anvil" : CraftLocation; toReturn.ObjectName = Name; toReturn.AllowUserCrafting = false; CraftLibrary.Add(toReturn); } return(toReturn); }