Esempio n. 1
0
        public ItemBase(ItemImageService itemImageService, XmlItemBase xmlBase)
        {
            Level                = xmlBase.Level;
            RequiredStrength     = xmlBase.Strength;
            RequiredDexterity    = xmlBase.Dexterity;
            RequiredIntelligence = xmlBase.Intelligence;
            DropDisabled         = xmlBase.DropDisabled;
            InventoryHeight      = xmlBase.InventoryHeight;
            InventoryWidth       = xmlBase.InventoryWidth;

            Name       = xmlBase.Name;
            ItemType   = xmlBase.ItemType;
            ItemGroup  = ItemType.Group();
            MetadataId = xmlBase.MetadataId;

            ImplicitMods   = xmlBase.Implicit.Select(i => new Stat(i, ItemType)).ToList();
            _properties    = xmlBase.Properties.Select(p => new Stat(p, ItemType)).ToList();
            CanHaveQuality = ItemGroup == ItemGroup.OneHandedWeapon || ItemGroup == ItemGroup.TwoHandedWeapon ||
                             ItemGroup == ItemGroup.BodyArmour || ItemGroup == ItemGroup.Boots ||
                             ItemGroup == ItemGroup.Gloves || ItemGroup == ItemGroup.Helmet ||
                             ItemGroup == ItemGroup.Shield;

            Image = new ItemImage(itemImageService, Name, ItemGroup);

            MaximumNumberOfSockets = GetMaximumNumberOfSockets();
        }
Esempio n. 2
0
        public ItemBase(Options options, XmlItemBase xmlBase)
        {
            Level                = xmlBase.Level;
            RequiredStrength     = xmlBase.Strength;
            RequiredDexterity    = xmlBase.Dexterity;
            RequiredIntelligence = xmlBase.Intelligence;

            Name         = xmlBase.Name;
            ItemType     = xmlBase.ItemType;
            ItemGroup    = ItemType.Group();
            ImplicitMods = xmlBase.Implicit != null
                ? xmlBase.Implicit.Select(i => new Stat(i, ItemType)).ToList()
                : new List <Stat>();

            Properties = xmlBase.Properties != null
                ? xmlBase.Properties.Select(p => new Stat(p, ItemType)).ToList()
                : new List <Stat>();

            CanHaveQuality = ItemGroup == ItemGroup.OneHandedWeapon || ItemGroup == ItemGroup.TwoHandedWeapon ||
                             ItemGroup == ItemGroup.BodyArmour || ItemGroup == ItemGroup.Boots ||
                             ItemGroup == ItemGroup.Gloves || ItemGroup == ItemGroup.Helmet ||
                             ItemGroup == ItemGroup.Shield;

            Image = new ItemImage(options, Name, ItemGroup);
        }
Esempio n. 3
0
        public ItemBase(ItemImageService itemImageService, ModDatabase modDatabase, XmlItemBase xmlBase)
        {
            Level                = xmlBase.Level;
            RequiredStrength     = xmlBase.Strength;
            RequiredDexterity    = xmlBase.Dexterity;
            RequiredIntelligence = xmlBase.Intelligence;
            DropDisabled         = xmlBase.DropDisabled;
            InventoryHeight      = xmlBase.InventoryHeight;
            InventoryWidth       = xmlBase.InventoryWidth;

            Name       = xmlBase.Name;
            ItemClass  = xmlBase.ItemClass;
            Tags       = xmlBase.Tags;
            MetadataId = xmlBase.MetadataId;

            ImplicitMods   = xmlBase.Implicit.Select(id => modDatabase.Mods[id]).ToList();
            _properties    = xmlBase.Properties;
            CanHaveQuality = Tags.HasFlag(Tags.Weapon) || Tags.HasFlag(Tags.Armour);

            Image = new ItemImage(itemImageService, Name, ItemClass);

            MaximumNumberOfSockets = GetMaximumNumberOfSockets();
        }
Esempio n. 4
0
        public ItemBase(Options options, XmlItemBase xmlBase)
        {
            Level = xmlBase.Level;
            RequiredStrength = xmlBase.Strength;
            RequiredDexterity = xmlBase.Dexterity;
            RequiredIntelligence = xmlBase.Intelligence;

            Name = xmlBase.Name;
            ItemType = xmlBase.ItemType;
            ItemGroup = ItemType.Group();
            ImplicitMods = xmlBase.Implicit != null
                ? xmlBase.Implicit.Select(i => new Stat(i, ItemType)).ToList()
                : new List<Stat>();
            Properties = xmlBase.Properties != null
                ? xmlBase.Properties.Select(p => new Stat(p, ItemType)).ToList()
                : new List<Stat>();
            CanHaveQuality = ItemGroup == ItemGroup.OneHandedWeapon || ItemGroup == ItemGroup.TwoHandedWeapon
                             || ItemGroup == ItemGroup.BodyArmour || ItemGroup == ItemGroup.Boots
                             || ItemGroup == ItemGroup.Gloves || ItemGroup == ItemGroup.Helmet
                             || ItemGroup == ItemGroup.Shield;

            Image = new ItemImage(options, Name, ItemGroup);
        }