Exemplo n.º 1
0
        public D3ItemControl(Item item)
            : this()
        {
            Item = item;

            InitializeControl();

            HookMouseEventOfChildren(guiDescriptionPanel);
        }
Exemplo n.º 2
0
        public void Constructor2()
        {
            var mainHand = new Item(new ItemAttributes { attacksPerSecondItem = new ItemValueRange(1.4) });
            var item = new StatsItem(mainHand, null, new List<Item>());

            item.Update();

            Assert.AreEqual(mainHand, item.MainHand);
            Assert.IsFalse(item.IsAmbidexterity());
            Assert.AreEqual(1.4, item.GetWeaponAttackPerSecond().Min);
        }
Exemplo n.º 3
0
        public void Constructor3()
        {
            var mainHand = new Item(new ItemAttributes { attacksPerSecondItem = new ItemValueRange(1.4) });
            var offHand = new Item(new ItemAttributes { attacksPerSecondItem = new ItemValueRange(1.2) });
            var item = new StatsItem(mainHand, offHand, new List<Item>());

            item.Update();

            Assert.AreEqual(mainHand, item.MainHand);
            Assert.IsTrue(item.IsAmbidexterity());
            Assert.AreEqual(1.15 * 2 * 1 / (1 / 1.4 + 1 / 1.2), item.GetWeaponAttackPerSecond().Min);
        }
Exemplo n.º 4
0
        public D3Calculator(Hero hero, Item mainHand, Item offHand, IEnumerable<Item> items)
        {
            HeroClass = hero.heroClass;
            HeroLevel = hero.level;

            // Build unique item equivalent to items worn
            HeroStatsItem = new StatsItem(mainHand, offHand, items);

            levelAttributes = new ItemAttributesFromLevel(hero);
            paragonLevelAttributes = new ItemAttributesFromParagonLevel(hero);

            Update();
        }
Exemplo n.º 5
0
        private void UpdateItemInfo(Item item)
        {
            guiItemName.Text = item.Name;
            guiItemName.ForeColor = GetDisplayColor(item.DisplayColor);

            if (item.MinDamage != null && item.MaxDamage != null)
            {
                guiDescriptionPanel.Controls.Add(new D3ItemDamageLabelControl(item));
            }

            if (item.Armor != null)
            {
                guiDescriptionPanel.Controls.Add(new D3ItemArmorLabelControl(item));
            }

            if (item.Attributes.Primary != null && item.Attributes.Primary.Any())
            {
                guiDescriptionPanel.Controls.Add(new D3ItemPrimaryLabelControl(item));
            }

            if (item.Attributes.Secondary != null && item.Attributes.Secondary.Any())
            {
                guiDescriptionPanel.Controls.Add(new D3ItemSecondaryLabelControl(item));
            }

            if (item.Attributes.Passive != null && item.Attributes.Passive.Any())
            {
                guiDescriptionPanel.Controls.Add(new D3ItemPassiveLabelControl(item));
            }

            if (item.Gems != null && item.Gems.Any())
            {
                foreach (var gem in item.Gems)
                {
                    if (gem.IsJewel)
                    {
                        guiDescriptionPanel.Controls.Add(new D3ItemJewelLabelControl(gem));
                    }
                    else
                    {
                        guiDescriptionPanel.Controls.Add(new D3ItemGemLabelControl(gem));
                    }
                }
            }
        }
Exemplo n.º 6
0
        public D3Calculator(Follower follower, HeroClass heroClass, Item mainHand, Item offHand, IEnumerable<Item> items)
        {
            HeroClass = heroClass;
            HeroLevel = follower.level;

            foreach (var item in items.Union(new[] { mainHand, offHand }))
            {
                ApplyFollowersBonusMalusOnItemAttributes(item.AttributesRaw, heroClass);
                if (item.Gems != null)
                {
                    foreach (var gem in item.Gems)
                    {
                        ApplyFollowersBonusMalusOnItemAttributes(gem.AttributesRaw, heroClass);
                    }
                }
            }

            // Build unique item equivalent to items worn
            HeroStatsItem = new StatsItem(mainHand, offHand, items);

            levelAttributes = new Followers.ItemAttributesFromLevel(follower, heroClass);

            Update();
        }
Exemplo n.º 7
0
 public SocketedGem(Item item)
 {
     Item = item;
     Attributes = item.Attributes;
     AttributesRaw = item.AttributesRaw;
 }
Exemplo n.º 8
0
 public List<Item> GetGemsForItem(Item item)
 {
     return GetGemsForItemTypeId(item.Type.Id, item.Slots);
 }