示例#1
0
 public ItemMod(ItemType itemType, string attribute, Stat parent = null)
 {
     IsLocal = DetermineLocal(itemType, attribute);
     Attribute = attribute;
     Parent = parent;
     Value = new List<float>();
     ValueColor = new List<ValueColoring>();
 }
示例#2
0
        private void BaseSelection_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (BaseSelection.SelectedItem == null)
            {
                Item = null;
                return;
            }

            var d = _monitor.Enter();
            msp1.Affixes = msp2.Affixes = msp3.Affixes = mss1.Affixes = mss1.Affixes = mss2.Affixes = mss3.Affixes = null;

            var ibase = (ItemBase)BaseSelection.SelectedItem;
            Item = ibase.CreateItem();

            if (ibase.ImplicitMods.Any())
            {
                msImplicitMods.Affixes = new List<Affix>
                {
                    new Affix(ibase.ImplicitMods.Select(s => s.Name).ToArray(), new[] { new ItemModTier(ibase.ImplicitMods) })
                };
                Item.ImplicitMods = msImplicitMods.GetExactMods().ToList();
                ApplyLocals();
            }
            else
            {
                msImplicitMods.Affixes = null;
            }
            if (ibase.CanHaveQuality)
            {
                var qualityStat = new Stat(QualityModName, new Range<float>(0, 20), Item.ItemType, null);
                var qualityAffix = new Affix(new[] {QualityModName}, new[] {new ItemModTier(new[] {qualityStat})});
                MsQuality.Affixes = new List<Affix>(new[] {qualityAffix});
            }
            else
            {
                MsQuality.Affixes = null;
            }

            var aaff = _equipmentData.AffixesPerItemType[Item.ItemType].ToArray();

            _prefixes = aaff.Where(a => a.ModType == ModType.Prefix).ToList();
            _suffixes = aaff.Where(a => a.ModType == ModType.Suffix).ToList();

            msp1.Affixes = msp2.Affixes = msp3.Affixes = _prefixes;
            mss1.Affixes = mss2.Affixes = mss3.Affixes = _suffixes;
            msp3.Visibility = Item.ItemGroup == ItemGroup.Jewel ? Visibility.Hidden : Visibility.Visible;
            mss3.Visibility = Item.ItemGroup == ItemGroup.Jewel ? Visibility.Hidden : Visibility.Visible;

            d.Dispose();
        }