コード例 #1
0
 public RunicHammer(CraftResource resource, int uses) : base(resource, uses, 0x13E3)
 {
     Weight = 8.0;
     Layer  = Layer.OneHanded;
     Hue    = CraftResources.GetHue(resource);
 }
コード例 #2
0
 public RunicDovetailSaw(CraftResource resource, int uses) : base(resource, uses, 0x1028)
 {
     Weight = 2.0;
     Hue    = CraftResources.GetHue(resource);
 }
コード例 #3
0
        public BaseGlovesOfMining(int bonus, int itemID) : base(itemID)
        {
            m_Bonus = bonus;

            this.Hue = CraftResources.GetHue((CraftResource)Utility.RandomMinMax((int)CraftResource.DullCopper, (int)CraftResource.Valorite));
        }
コード例 #4
0
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            Type resourceType = typeRes;

            if (resourceType == null)
            {
                resourceType = craftItem.Resources.GetAt(0).ItemType;
            }

            Resource = CraftResources.GetFromType(resourceType);

            CraftContext context = craftSystem.GetContext(from);

            if (context != null && context.DoNotColor)
            {
                Hue = 0;
            }

            if (1 < craftItem.Resources.Count)
            {
                resourceType = craftItem.Resources.GetAt(1).ItemType;

                if (resourceType == typeof(StarSapphire))
                {
                    GemType = GemType.StarSapphire;
                }
                else if (resourceType == typeof(Emerald))
                {
                    GemType = GemType.Emerald;
                }
                else if (resourceType == typeof(Sapphire))
                {
                    GemType = GemType.Sapphire;
                }
                else if (resourceType == typeof(Ruby))
                {
                    GemType = GemType.Ruby;
                }
                else if (resourceType == typeof(Citrine))
                {
                    GemType = GemType.Citrine;
                }
                else if (resourceType == typeof(Amethyst))
                {
                    GemType = GemType.Amethyst;
                }
                else if (resourceType == typeof(Tourmaline))
                {
                    GemType = GemType.Tourmaline;
                }
                else if (resourceType == typeof(Amber))
                {
                    GemType = GemType.Amber;
                }
                else if (resourceType == typeof(Diamond))
                {
                    GemType = GemType.Diamond;
                }
            }

            return(1);
        }
コード例 #5
0
 public ColoredAnvil() : this(CraftResources.GetHue((CraftResource)Utility.RandomMinMax((int)CraftResource.DullCopper, (int)CraftResource.Valorite)))
 {
 }
コード例 #6
0
        private bool Resmelt(Mobile from, Item item, CraftResource resource)
        {
            try
            {
                if (CraftResources.GetType(resource) != CraftResourceType.Metal)
                {
                    return(false);
                }

                CraftResourceInfo info = CraftResources.GetInfo(resource);

                if (info == null || info.ResourceTypes.Length == 0)
                {
                    return(false);
                }

                CraftItem craftItem = DefBlacksmithy.CraftSystem.CraftItems.SearchFor(item.GetType());

                if (craftItem == null || craftItem.Resources.Count == 0)
                {
                    return(false);
                }

                CraftRes craftResource = craftItem.Resources.GetAt(0);

                if (craftResource.Amount < 2)
                {
                    return(false); // Not enough metal to resmelt
                }
                double difficulty = 0.0;

                switch (resource)
                {
                case CraftResource.DullCopper: difficulty = 65.0; break;

                case CraftResource.ShadowIron: difficulty = 70.0; break;

                case CraftResource.Copper: difficulty = 75.0; break;

                case CraftResource.Bronze: difficulty = 80.0; break;

                case CraftResource.Gold: difficulty = 85.0; break;

                case CraftResource.Agapite: difficulty = 90.0; break;

                case CraftResource.Verite: difficulty = 95.0; break;

                case CraftResource.Valorite: difficulty = 99.0; break;
                }

                Type resourceType = info.ResourceTypes[0];
                Item ingot        = (Item)Activator.CreateInstance(resourceType);

                if (item is DragonBardingDeed || (item is BaseArmor && ((BaseArmor)item).PlayerConstructed) || (item is BaseWeapon && ((BaseWeapon)item).PlayerConstructed) || (item is BaseClothing && ((BaseClothing)item).PlayerConstructed))
                {
                    double mining = from.Skills[SkillName.Mining].Value;
                    if (mining > 100.0)
                    {
                        mining = 100.0;
                    }
                    double amount = (((4 + mining) * craftResource.Amount - 4) * 0.0068);
                    if (amount < 2)
                    {
                        ingot.Amount = 2;
                    }
                    else
                    {
                        ingot.Amount = (int)amount;
                    }
                }
                else
                {
                    ingot.Amount = 2;
                }

                if (difficulty > from.Skills[SkillName.Mining].Value)
                {
                    m_Failure = true;
                    ingot.Delete();
                }
                else
                {
                    item.Delete();
                }

                from.AddToBackpack(ingot);

                from.PlaySound(0x2A);
                from.PlaySound(0x240);

                return(true);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }

            return(false);
        }
コード例 #7
0
 public RunicFletcherTool(CraftResource resource, int uses) : base(resource, uses, 0x1022)
 {
     Weight = 2.0;
     Hue    = CraftResources.GetHue(resource);
 }
コード例 #8
0
 public RunicSewingKit(CraftResource resource, int uses) : base(resource, uses, 0xF9D)
 {
     Weight = 2.0;
     Hue    = CraftResources.GetHue(resource);
 }