コード例 #1
0
        public ItemAttributesFromLevel(Follower follower, HeroClass heroClass)
        {
            switch (heroClass)
            {
                case HeroClass.ScoundrelFollower:
                    dexterityItem = new ItemValueRange(8 + 3 * follower.Level);
                    intelligenceItem = new ItemValueRange(8 + 1 * follower.Level);
                    strengthItem = new ItemValueRange(9 + 1 * follower.Level);
                    vitalityItem = new ItemValueRange(7 + 2 * follower.Level);
                    break;
                case HeroClass.EnchantressFollower:
                    dexterityItem = new ItemValueRange(9 + 1 * follower.Level);
                    intelligenceItem = new ItemValueRange(5 + 3 * follower.Level);
                    strengthItem = new ItemValueRange(9 + 1 * follower.Level);
                    vitalityItem = new ItemValueRange(7 + 2 * follower.Level);
                    break;
                case HeroClass.TemplarFollower:
                    dexterityItem = new ItemValueRange(8 + 1 * follower.Level);
                    intelligenceItem = new ItemValueRange(10 + 1 * follower.Level);
                    strengthItem = new ItemValueRange(7 + 3 * follower.Level);
                    vitalityItem = new ItemValueRange(9 + 2 * follower.Level);
                    break;
            }

            critDamagePercent = new ItemValueRange(0.5);
        }
コード例 #2
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();
        }
コード例 #3
0
        private Follower GetEditedFollower()
        {
            var follower = new Follower();

            if (String.IsNullOrEmpty(guiHeroLevel.Text))
            {
                follower.level = 60;
            }
            else
            {
                follower.level = Int32.Parse(guiHeroLevel.Text);
            }

            return follower;
        }
コード例 #4
0
        public D3CalculatorForm(Follower follower, HeroClass heroClass)
            : this()
        {
            Item offHand;
            Item mainHand;
            Text += " [ " + follower.slug + " ]";

            guiHeroClass.SelectedItem = heroClass.ToString();
            guiHeroLevel.Text = follower.level.ToString();
            guiHeroParagonLevel.Text = "0";

            if (follower.items.special != null)
            {
                special = follower.items.special.GetFullItem();
            }
            if (follower.items.leftFinger != null)
            {
                leftFinger = follower.items.leftFinger.GetFullItem();
            }
            if (follower.items.neck != null)
            {
                neck = follower.items.neck.GetFullItem();
            }
            if (follower.items.rightFinger != null)
            {
                rightFinger = follower.items.rightFinger.GetFullItem();
            }

            // If no weapon is set in mainHand, use "naked hand" weapon
            if (follower.items.mainHand != null)
            {
                mainHand = follower.items.mainHand.GetFullItem();
            }
            else
            {
                mainHand = D3Calculator.NakedHandWeapon;
            }

            // If no item is set in offHand, use a blank item
            if (follower.items.offHand != null)
            {
                offHand = follower.items.offHand.GetFullItem();
            }
            else
            {
                offHand = D3Calculator.BlankWeapon;
            }

            var allRawItems = new List<Item> { special, leftFinger, neck, rightFinger, mainHand, offHand };

            guiSpecialEditor.SetEditedItem(special);
            guiMainHandEditor.SetEditedItem(mainHand);
            guiOffHandEditor.SetEditedItem(offHand);
            guiLeftFingerEditor.SetEditedItem(leftFinger);
            guiNeckEditor.SetEditedItem(neck);
            guiRightFingerEditor.SetEditedItem(rightFinger);

            guiSetBonusEditor.SetEditedItem(new Item(allRawItems.Where(i => i != null).ToList().GetActivatedSetBonus()));

            //populatePassiveSkills();
            //populateActiveSkills();
        }
コード例 #5
0
 private void InsertContextMenu(TreeNode node, Follower d3Object)
 {
     node.Tag = d3Object;
     node.ContextMenuStrip = guiFollowerContextMenu;
     node.NodeFont = defaultNodeFont;
 }
コード例 #6
0
        public D3CalculatorForm(Follower follower, HeroClass heroClass)
            : this()
        {
            Item offHand;
            Item mainHand;
            Text += " [ " + follower.Slug + " ]";

            guiHeroClass.SelectedItem = heroClass.ToString();
            guiHeroLevel.Text = follower.Level.ToString();
            guiHeroParagonLevel.Text = "0";

            if (follower.Items.Special != null)
            {
                special = follower.Items.Special.GetFullItem();
            }
            if (follower.Items.LeftFinger != null)
            {
                leftFinger = follower.Items.LeftFinger.GetFullItem();
            }
            if (follower.Items.Neck != null)
            {
                neck = follower.Items.Neck.GetFullItem();
            }
            if (follower.Items.RightFinger != null)
            {
                rightFinger = follower.Items.RightFinger.GetFullItem();
            }

            // If no weapon is set in mainHand, use "naked hand" weapon
            if (follower.Items.MainHand != null)
            {
                mainHand = follower.Items.MainHand.GetFullItem();
            }
            else
            {
                mainHand = Constants.NakedHandWeapon;
            }

            // If no item is set in offHand, use a blank item
            if (follower.Items.OffHand != null)
            {
                offHand = follower.Items.OffHand.GetFullItem();
            }
            else
            {
                offHand = Constants.BlankWeapon;
            }

            var allRawItems = new List<Item> { special, leftFinger, neck, rightFinger, mainHand, offHand };

            guiItemChoiceSpecial.Tag = special;
            guiItemChoiceMainHand.Tag = mainHand;
            guiItemChoiceOffHand.Tag = offHand;
            guiItemChoiceLeftFinger.Tag = leftFinger;
            guiItemChoiceNeck.Tag = neck;
            guiItemChoiceRightFinger.Tag = rightFinger;

            guiSetBonusEditor.SetEditedItem(new Item(allRawItems.Where(i => i != null).ToList().GetActivatedSetBonus()));

            // Main hand item selected by default
            guiItemChoices_Click(guiItemChoiceMainHand, null);

            // Run initial calculations
            DoCalculations();
            DoActionOnCalculatedControls(UpdateResultControlColor);
        }