少年修仙传客户端代码仓库
client_Wu Xijin
2018-08-20 396aec28d436a55673011f09f7282a9fda91f84b
System/KnapSack/Logic/PackModelInterface.cs
@@ -7,7 +7,7 @@
namespace Snxxz.UI
{
    public class PackModelInterface : Model, IBeforePlayerDataInitialize
    public class PackModelInterface : Model, IBeforePlayerDataInitialize,IPlayerLoginOk
    {
        private ItemConfig tagChinModel;
        private FuncConfigConfig _equipGSFormula;
@@ -88,6 +88,12 @@
            itemEffectCDDict.Clear();
            itemEffectTimelist.Clear();
        }
        public void OnPlayerLoginOk()
        {
        }
        public override void UnInit()
        {
@@ -736,6 +742,39 @@
                RefreshPickItemEvent(type,guid);
            }
        }
        Dictionary<int, ItemModel> RealmBetterDict = new Dictionary<int, ItemModel>();
        public Dictionary<int, ItemModel> CheckBetterEquipByRealm()
        {
            RealmBetterDict.Clear();
            SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
            if (singlePack == null) return RealmBetterDict;
            int realmLv = PlayerDatas.Instance.baseData.realmLevel;
            Dictionary<int,ItemModel> pairs = singlePack.GetPackModelIndexDict();
            foreach(var model in pairs.Values)
            {
                if(model.chinItemModel.EquipPlace > 0
                    && model.chinItemModel.EquipPlace != (int)RoleEquipType.retSpiritAnimal
                    && model.chinItemModel.RealmLimit <= realmLv
                    && !IsOverdue(model.itemInfo.ItemGUID,model.itemId,model.useDataDict)
                    && IsFightUp(model.itemId,model.equipScore) == 1)
                {
                    if(!RealmBetterDict.ContainsKey(model.EquipPlace))
                    {
                        RealmBetterDict.Add(model.EquipPlace,model);
                    }
                    else
                    {
                        if(model.equipScore > RealmBetterDict[model.EquipPlace].equipScore)
                        {
                            RealmBetterDict[model.EquipPlace] = model;
                        }
                    }
                }
            }
            return RealmBetterDict;
        }
        #endregion
        #region 解锁格子