Exemple #1
0
        //刷新属性
        public void RefreshAttr(BookManager _this)
        {
            _this.attrs.Clear();
            _this.MonsterAttrs.Clear();
            //图鉴收集
            foreach (var book in _this.Books)
            {
                var tbbook = Table.GetHandBook(book.Key);
                if (tbbook == null)
                {
                    Logger.Fatal("null==Table.GetHandBook({0})", book.Key);
                    continue;
                }
                //----------人物属性
//                ItemEquip2.PushEquipAttr(_this.attrs, tbbook.AttrId, tbbook.AttrValue, _this.mCharacter.GetLevel(), _this.mCharacter.GetAttackType());
                //----------魔物属性
                int attrId     = book.Key * 100 + book.Value;
                var tbBookBase = Table.GetBookBase(attrId);
                if (tbBookBase != null)
                {
                    for (int i = 0; i < tbBookBase.AttrList.Length; i++)
                    {
                        _this.attrs.modifyValue(i + 1, tbBookBase.AttrList[i] * tbBookBase.AddAttr / 10000);
                        _this.MonsterAttrs.modifyValue(i + 1, tbBookBase.AttrList[i]);
                    }
                }
            }
            //组收集
            var groupOkCount = 0;

            foreach (var i in _this.Group)
            {
                var tbGroupBook = Table.GetBookGroup(i);
                if (tbGroupBook == null)
                {
                    Logger.Fatal("null==Table.GetBookGroup({0})", i);
                    continue;
                }
                groupOkCount++;
                for (var j = 0; j != tbGroupBook.GroupAttrId.Length; j++)
                {
                    if (tbGroupBook.GroupAttrId[j] > 0)
                    {
                        ItemEquip2.PushEquipAttr(_this.attrs, tbGroupBook.GroupAttrId[j],
                                                 tbGroupBook.GroupAttrValue[j], _this.mCharacter.GetLevel(),
                                                 _this.mCharacter.GetAttackType());
                    }
                }
            }
            var nowMaxCount = _this.mCharacter.GetExData((int)eExdataDefine.e347);

            if (groupOkCount > nowMaxCount)
            {
                _this.mCharacter.SetExData((int)eExdataDefine.e347, groupOkCount);
            }
        }
Exemple #2
0
        //属性计算
        public static void GetAttrList(Dictionary <int, int> AttrList,
                                       ItemBase wing,
                                       WingQualityRecord tbWing,
                                       int characterLevel,
                                       int attackType)
        {
            var Quality = tbWing.Segment;

            if (wing.mDbData.Exdata.Count < 11)
            {
                return;
            }
            //基础属性
            for (var i = 0; i != tbWing.AddPropID.Length; ++i)
            {
                var nAttrId = tbWing.AddPropID[i];
                if (nAttrId < 0)
                {
                    break;
                }
                var nValue = tbWing.AddPropValue[i];
                if (nValue > 0 && nAttrId != -1)
                {
                    ItemEquip2.PushEquipAttr(AttrList, nAttrId, nValue, characterLevel, attackType);
                }
            }
            //培养属性
            ////for (var i = 0; i != 5; ++i)
            ////{
            ////    var tbWingTrain = Table.GetWingTrain(wing.GetExdata(1 + i*2));
            ////    if (tbWingTrain == null)
            ////    {
            ////        continue;
            ////    }
            ////    //if (tbWingTrain.Condition > Quality)
            ////    //{
            ////    //    continue;
            ////    //}
            ////    for (var j = 0; j != tbWingTrain.AddPropID.Length; ++j)
            ////    {
            ////        var nAttrId = tbWingTrain.AddPropID[j];
            ////        var nValue = tbWingTrain.AddPropValue[j];
            ////        if (nAttrId < 0 || nValue <= 0)
            ////        {
            ////            break;
            ////        }
            ////        if (nValue > 0 && nAttrId != -1)
            ////        {
            ////            ItemEquip2.PushEquipAttr(AttrList, nAttrId, nValue, characterLevel, attackType);
            ////        }
            ////    }
            ////}
            var tbWingTrain = Table.GetWingTrain(wing.GetExdata(1));

            if (tbWingTrain != null)
            {
                for (var j = 0; j != tbWingTrain.AddPropID.Length; ++j)
                {
                    var nAttrId = tbWingTrain.AddPropID[j];
                    var nValue  = tbWingTrain.AddPropValue[j];
                    if (nAttrId < 0 || nValue <= 0)
                    {
                        break;
                    }
                    if (nValue > 0 && nAttrId != -1)
                    {
                        ItemEquip2.PushEquipAttr(AttrList, nAttrId, nValue, characterLevel, attackType);
                    }
                }
            }

            // 成长属性
            for (var i = (int)eWingExDefine.eGrowProperty; i < wing.mDbData.Exdata.Count; ++i)
            {
                var attrId = WingItem.GetGrowAttrId(wing.mDbData, i);
                if (attrId > 0)
                {
                    var value = wing.GetExdata(i + 1);
                    if (value > 0)
                    {
                        ItemEquip2.PushEquipAttr(AttrList, attrId, value, characterLevel, attackType);
                    }
                    ++i;
                }
            }
        }