少年修仙传客户端代码仓库
client_Hale
2019-04-15 c79dbe6647429b864d15a21b3baa77ffa8d48768
System/KnapSack/Logic/ItemLogicUtility.cs
@@ -134,17 +134,17 @@
                }
                foreach (var item in keyValues)
                {
                    Add(item.Key, item.Value);
                {
                    Add(item.Key, item.Value);
                }
            }
            public void AddBaseProperties(int itemId, List<int> reference)
            {
                var config = ItemConfig.Get(itemId);
                if (config == null)
                {
                    return;
                if (config == null)
                {
                    return;
                }
                if (config.Effect1 != 0 && reference.Contains(config.Effect1))
                {
@@ -184,9 +184,9 @@
                AddRange(config.OutOfPrintAttr, config.OutOfPrintAttrValue);
            }
            public bool ContainsKey(int id)
            {
                return properties.ContainsKey(id);
            public bool ContainsKey(int id)
            {
                return properties.ContainsKey(id);
            }
        }
@@ -207,22 +207,22 @@
            if (isPreview)
            {
                switch ((RoleEquipType)config.EquipPlace)
                {
                    case RoleEquipType.Weapon:
                    case RoleEquipType.Weapon2:
                    case RoleEquipType.Hat:
                    case RoleEquipType.Clothes:
                    case RoleEquipType.Belt:
                    case RoleEquipType.Trousers:
                    case RoleEquipType.Shoes:
                    case RoleEquipType.Glove:
                    case RoleEquipType.Neck:
                    case RoleEquipType.FairyCan1:
                    case RoleEquipType.FairyCan2:
                {
                    case RoleEquipType.Weapon:
                    case RoleEquipType.Weapon2:
                    case RoleEquipType.Hat:
                    case RoleEquipType.Clothes:
                    case RoleEquipType.Belt:
                    case RoleEquipType.Trousers:
                    case RoleEquipType.Shoes:
                    case RoleEquipType.Glove:
                    case RoleEquipType.Neck:
                    case RoleEquipType.FairyCan1:
                    case RoleEquipType.FairyCan2:
                    case RoleEquipType.Jade:
                        properties.AddRange(GetEquipLegendProperties(itemId));
                        break;
                    case RoleEquipType.Wing:
                        break;
                    case RoleEquipType.Wing:
                        properties.AddRange(GetWingsLegendProperties(itemId));
                        break;
                }
@@ -248,15 +248,15 @@
        private Dictionary<int, int> GetEquipLegendProperties(int itemId)
        {
            var legendProperties = LegendPropertyUtility.GetEquipProperties(itemId);
            var properties = new Dictionary<int, int>();
            if (legendProperties != null)
            {
                foreach (var item in legendProperties)
                {
                    properties[item.x] = item.y;
                }
            }
            var legendProperties = LegendPropertyUtility.GetEquipProperties(itemId);
            var properties = new Dictionary<int, int>();
            if (legendProperties != null)
            {
                foreach (var item in legendProperties)
                {
                    properties[item.x] = item.y;
                }
            }
            return properties;
        }
@@ -278,8 +278,8 @@
            }
            return properties;
        }
        }
        public bool IsCustomItem(int itemId)
        {
            if (!ItemConfig.Has(itemId))
@@ -305,10 +305,10 @@
            }
            var minAttack = properties.ContainsKey((int)PropertyType.MinAtk) ? properties[(int)PropertyType.MinAtk] : 0;
            var maxAttack = properties.ContainsKey((int)PropertyType.MaxAtk) ? properties[(int)PropertyType.MaxAtk] : 0;
            var attack = properties.ContainsKey((int)PropertyType.ATK) ? properties[(int)PropertyType.ATK] : 0;
            properties[(int)PropertyType.MinAtk] = minAttack + attack;
            var maxAttack = properties.ContainsKey((int)PropertyType.MaxAtk) ? properties[(int)PropertyType.MaxAtk] : 0;
            var attack = properties.ContainsKey((int)PropertyType.ATK) ? properties[(int)PropertyType.ATK] : 0;
            properties[(int)PropertyType.MinAtk] = minAttack + attack;
            properties[(int)PropertyType.MaxAtk] = maxAttack + attack;
            Equation.Instance.Clear();
@@ -322,11 +322,11 @@
                {
                    case PropertyType.ATKSPEED:
                    case PropertyType.OnlyFinalHurt:
                    case PropertyType.PVPAtkBackHP:
                    case PropertyType.MinAtk:
                    case PropertyType.PVPAtkBackHP:
                    case PropertyType.MinAtk:
                    case PropertyType.MaxAtk:
                        curEquipAttrDict.Add(attrType, properties[key]);
                        break;
                        break;
                    default:
                        if (GSProValueDict != null && GSProValueDict.ContainsKey(attrType))
                        {
@@ -377,9 +377,9 @@
                return;
            }
            if (item.isAuction)
            {
                return;
            if (item.isAuction)
            {
                return;
            }
            if (item.config.UseLV > PlayerDatas.Instance.baseData.LV)
@@ -587,7 +587,7 @@
                return false;
            }
            var putModel = packModel.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Wing);
            var putModel = packModel.GetItemByIndex(PackType.Equip, SpiritWeaponModel.WING_EQUIPINDEX);
            var singlePack = packModel.GetSinglePack(PackType.Item);
            if (singlePack == null)
            {
@@ -623,11 +623,11 @@
                return false;
            }
            var itemModels = packModel.GetItems(PackType.Item, new SinglePack.FilterParams()
            {
                itemTypes = new List<int>() { (int)ItemType.Equip_Wing }
            });
            var itemModels = packModel.GetItems(PackType.Item, new SinglePack.FilterParams()
            {
                itemTypes = new List<int>() { (int)ItemType.Equip_Wing }
            });
            if (itemModels != null)
            {
                for (int i = 0; i < itemModels.Count; i++)
@@ -719,11 +719,11 @@
        private void SetGetBetterEquipEvent(ItemModel model)
        {
            if (model.isAuction)
            {
                return;
            }
            if (model.isAuction)
            {
                return;
            }
            var itemEffectTime = model.GetUseData((int)ItemUseDataKey.createTime);
            if (!itemEffectTime.IsNullOrEmpty() && itemEffectTime.Count > 0)
            {
@@ -741,22 +741,22 @@
                        return;
                    }
                }
            }
            if (!equipModel.IsLevelUnLocked(model.config.LV))
            {
                return;
            }
            int isFightUp = IsFightUp(model.itemId, model.score);
            if (isFightUp != 1)
            {
                return;
            }
            if (GetBetterEquipEvent != null)
            {
                GetBetterEquipEvent(model.guid);
            if (!equipModel.IsLevelUnLocked(model.config.LV))
            {
                return;
            }
            int isFightUp = IsFightUp(model.itemId, model.score);
            if (isFightUp != 1)
            {
                return;
            }
            if (GetBetterEquipEvent != null)
            {
                GetBetterEquipEvent(model.guid);
            }
        }
@@ -870,8 +870,8 @@
        private int playerLv;
        private Dictionary<int, List<ItemModel>> _lifePotionDict = new Dictionary<int, List<ItemModel>>(); //key 药水等级
        private List<int> _sellItemScorelist = new List<int>();
        private Dictionary<int, Dictionary<int, List<ItemModel>>> _sameIndexEquipDict = new Dictionary<int, Dictionary<int, List<ItemModel>>>();  //存储相同装备位的装备
                                                                                                                                                  // private  _sameEquipScoreDict = new Dictionary<int, List<ItemModel>>(); //存储相同ID中相同装备评分的装备
        private Dictionary<int, Dictionary<int, List<ItemModel>>> _sameIndexEquipDict = new Dictionary<int, Dictionary<int, List<ItemModel>>>();  //存储相同装备位的装备
                                                                                                                                                  // private  _sameEquipScoreDict = new Dictionary<int, List<ItemModel>>(); //存储相同ID中相同装备评分的装备
        private Dictionary<int, ItemModel> _packModelDict;
        private List<ItemModel> _sellItemlist = new List<ItemModel>();
@@ -1352,18 +1352,18 @@
        public bool IsOverdue(string guid)
        {
            var item = packModel.GetItemByGuid(guid);
            if (item == null)
            {
                return false;
            if (item == null)
            {
                return false;
            }
            if (item.isAuction)
            {
                return item.auctionSurplusTime < 0;
            }
            else
            {
                return item.overdueSurplusTime < 0;
            if (item.isAuction)
            {
                return item.auctionSurplusTime < 0;
            }
            else
            {
                return item.overdueSurplusTime < 0;
            }
        }
@@ -1375,36 +1375,36 @@
            return config != null && (config.JobLimit == 0 || config.JobLimit == PlayerDatas.Instance.baseData.Job);
        }
        public bool IsEquip(int itemId)
        {
            if (!ItemConfig.Has(itemId))
            {
                return false;
            }
            var config = ItemConfig.Get(itemId);
            return config.Type >= 101 && config.Type <= 112;
        public bool IsEquip(int itemId)
        {
            if (!ItemConfig.Has(itemId))
            {
                return false;
            }
            var config = ItemConfig.Get(itemId);
            return config.Type >= 101 && config.Type <= 112;
        }
        public bool IsWing(int itemId)
        {
            if (!ItemConfig.Has(itemId))
            {
                return false;
            }
            var config = ItemConfig.Get(itemId);
            return config.Type == 113 || config.Type == 39 || config.Type == 52;
        public bool IsWing(int itemId)
        {
            if (!ItemConfig.Has(itemId))
            {
                return false;
            }
            var config = ItemConfig.Get(itemId);
            return config.Type == 113 || config.Type == 39 || config.Type == 52;
        }
        public bool IsDogzEquip(int itemId)
        {
            if (!ItemConfig.Has(itemId))
            {
                return false;
            }
            var config = ItemConfig.Get(itemId);
            return config.Type >= 119 && config.Type <= 124;
        public bool IsDogzEquip(int itemId)
        {
            if (!ItemConfig.Has(itemId))
            {
                return false;
            }
            var config = ItemConfig.Get(itemId);
            return config.Type >= 119 && config.Type <= 124;
        }
    }