少年修仙传客户端代码仓库
client_linchunjie
2018-09-26 9ee6fe853c33f10db9cd17312618d454609dc024
System/KnapSack/Logic/PackModelInterface.cs
@@ -297,19 +297,31 @@
            curEquipAttrDict.Clear();
            itemEffectDict.Clear();
            _equipGSFormulaDict.Clear();
            try
            {
                if (tagChinModel.Effect1 != 0)
                    itemEffectDict.Add(tagChinModel.Effect1, tagChinModel.EffectValueA1);
                {
                    ConvertAttrId(tagChinModel.Effect1, tagChinModel.EffectValueA1, itemEffectDict);
                }
                if (tagChinModel.Effect2 != 0)
                    itemEffectDict.Add(tagChinModel.Effect2, tagChinModel.EffectValueA2);
                {
                    ConvertAttrId(tagChinModel.Effect2, tagChinModel.EffectValueA2, itemEffectDict);
                }
                if (tagChinModel.Effect3 != 0)
                    itemEffectDict.Add(tagChinModel.Effect3, tagChinModel.EffectValueA3);
                {
                    ConvertAttrId(tagChinModel.Effect3, tagChinModel.EffectValueA3, itemEffectDict);
                }
                if (tagChinModel.Effect4 != 0)
                    itemEffectDict.Add(tagChinModel.Effect4, tagChinModel.EffectValueA4);
                {
                    ConvertAttrId(tagChinModel.Effect4, tagChinModel.EffectValueA4, itemEffectDict);
                }
                if (tagChinModel.Effect5 != 0)
                    itemEffectDict.Add(tagChinModel.Effect5, tagChinModel.EffectValueA5);
                {
                    ConvertAttrId(tagChinModel.Effect5, tagChinModel.EffectValueA5, itemEffectDict);
                }
            }
            catch (Exception ex)
@@ -399,6 +411,42 @@
            }
            return 0;
        }
        private void ConvertAttrId(int attrId,int attrValue,Dictionary<int,int> keyValues)
        {
            switch((AttrEnum)attrId)
            {
                case AttrEnum.ATK:
                    if(!keyValues.ContainsKey((int)AttrEnum.MinAtk))
                    {
                        keyValues.Add(((int)AttrEnum.MinAtk),attrValue);
                    }
                    else
                    {
                        keyValues[(int)AttrEnum.MinAtk] += attrValue;
                    }
                    if (!keyValues.ContainsKey((int)AttrEnum.MaxAtk))
                    {
                        keyValues.Add(((int)AttrEnum.MaxAtk), attrValue);
                    }
                    else
                    {
                        keyValues[(int)AttrEnum.MaxAtk] += attrValue;
                    }
                    break;
                default:
                    if (!keyValues.ContainsKey(attrId))
                    {
                        keyValues.Add(attrId, attrValue);
                    }
                    else
                    {
                        keyValues[attrId] += attrValue;
                    }
                    break;
            }
        }
        #endregion
        #region 主界面物品弹框展示