Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
 public void InitializeStrings()
 {
     DisplayName       = StringLibrary.TransformDataString(DisplayName, Name);
     PluralDisplayName = StringLibrary.TransformDataString(PluralDisplayName, DisplayName + "s"); // Default to appending an s if the plural name is not specified.
     ShortDisplayName  = StringLibrary.TransformDataString(ShortDisplayName, DisplayName);
     Verb         = StringLibrary.TransformDataString(Verb, StringLibrary.GetString("build"));
     PastTeseVerb = StringLibrary.TransformDataString(PastTeseVerb, StringLibrary.GetString("built"));
     CurrentVerb  = StringLibrary.TransformDataString(CurrentVerb, StringLibrary.GetString("building"));
     Description  = StringLibrary.TransformDataString(Description, Description);
 }
Ejemplo n.º 3
0
 public IEnumerable <Act.Status> Cleanup(CreatureAI creature)
 {
     if (creature.Blackboard.GetData <bool>("NoPath", false))
     {
         if (creature.Faction == creature.World.PlayerFaction)
         {
             creature.World.MakeAnnouncement(
                 StringLibrary.GetString("cancelled-crafting-unreachable", creature.Stats.FullName, Item.ItemType.DisplayName));
             creature.World.Master.TaskManager.CancelTask(this);
         }
     }
     yield return(Act.Status.Success);
 }
Ejemplo n.º 4
0
        public CraftItemTask(CraftDesignation CraftDesignation)
        {
            Category              = TaskCategory.BuildObject;
            MaxAssignable         = 3;
            Name                  = StringLibrary.GetString("craft-at", CraftDesignation.Entity.GlobalID, CraftDesignation.ItemType.DisplayName, CraftDesignation.Location);
            Priority              = PriorityType.Medium;
            AutoRetry             = true;
            this.CraftDesignation = CraftDesignation;

            foreach (var tinter in CraftDesignation.Entity.EnumerateAll().OfType <Tinter>())
            {
                tinter.Stipple = true;
            }
            BoredomIncrease = GameSettings.Default.Boredom_NormalTask;
            if (CraftDesignation.ItemType.IsMagical)
            {
                Category = TaskCategory.Research;
            }

            if (CraftDesignation.ExistingResource != null)
            {
                MaxAssignable = 1;
            }
        }
Ejemplo n.º 5
0
 public virtual String GetDescriptionString()
 {
     return(StringLibrary.GetString("generic-room-description"));
 }