From 82931aabaaa3e479bc04e11630a77cd9c9dd5fe3 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期五, 26 十月 2018 20:05:36 +0800
Subject: [PATCH] Merge branch 'master' into leonard

---
 System/KnapSack/Logic/PackModelInterface.cs |  120 +++++++++++++++++++----------------------------------------
 1 files changed, 39 insertions(+), 81 deletions(-)

diff --git a/System/KnapSack/Logic/PackModelInterface.cs b/System/KnapSack/Logic/PackModelInterface.cs
index e20d5e1..ce94d02 100644
--- a/System/KnapSack/Logic/PackModelInterface.cs
+++ b/System/KnapSack/Logic/PackModelInterface.cs
@@ -1364,6 +1364,36 @@
             return modellist;
         }
 
+        /// <summary>
+        /// 鑾峰彇瑁呭璇勫垎鏈�楂樺彲鎻愬崌鎴樺姏鐨勮澶�
+        /// </summary>
+        /// <param name="_places"></param>
+        /// <returns></returns>
+        public string GetHighestScoreEquipByPlace(int equipPlace)
+        {
+            var itemPackage = playerPack.GetSinglePackModel(PackType.rptItem);
+            var allItems = itemPackage.GetPackModelIndexDict();
+            ItemModel putModel = playerPack.GetItemModelByIndex(PackType.rptEquip,equipPlace);
+            equipPlace = (equipPlace == 9 || equipPlace == 10) ?  9 : equipPlace;
+            var guid = string.Empty;
+            var equips = new List<string>();
+            var score = putModel == null ? 0 : putModel.equipScore;
+            var job = PlayerDatas.Instance.baseData.Job;
+            foreach (var item in allItems.Values)
+            {
+                if(item.chinItemModel.EquipPlace == equipPlace)
+                {
+                    if (!IsOverdue(item.itemInfo.ItemGUID, item.itemId)
+                       && (item.chinItemModel.JobLimit == 0 || (item.chinItemModel.JobLimit / 100) == job) && item.equipScore > score)
+                    {
+                        guid = item.itemInfo.ItemGUID;
+                        score = item.equipScore;
+                    }
+                }
+            }
+
+            return guid;
+        }
         #endregion
 
         #region 鑳屽寘鏁寸悊鍚庡ソ鐨勫悓绫诲瀷鏈�濂界殑瑁呭
@@ -1375,44 +1405,20 @@
             if (!IsCanPutOn(itemModel)) return;
 
             int equipPlace = itemModel.chinItemModel.EquipPlace;
-            SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptEquip);
-            ItemModel putOnModel = null;
-            if (singlePack != null)
-            {
-                putOnModel = singlePack.GetItemModelByIndex(equipPlace);
-            }
             if (!itemModelDict.ContainsKey(equipPlace))
             {
                 Dictionary<int, ItemModel> dict = new Dictionary<int, ItemModel>();
-                if (putOnModel == null)
+                if (IsFightUp(itemModel.itemId,itemModel.equipScore) == 1)
                 {
                     dict.Add(itemModel.itemInfo.ItemPlace, itemModel);
                     itemModelDict.Add(equipPlace, dict);
                 }
-                else
-                {
-                    if (itemModel.equipScore > putOnModel.equipScore)
-                    {
-                        dict.Add(itemModel.itemInfo.ItemPlace, itemModel);
-                        itemModelDict.Add(equipPlace, dict);
-                    }
-                }
             }
             else
             {
-                if(putOnModel == null)
+                if (IsFightUp(itemModel.itemId, itemModel.equipScore) == 1)
                 {
-                    if (!itemModelDict[equipPlace].ContainsKey(itemModel.itemInfo.ItemPlace))
-                    {
-                        itemModelDict[equipPlace].Add(itemModel.itemInfo.ItemPlace, itemModel);
-                    }
-                }
-                else
-                {
-                    if (itemModel.equipScore > putOnModel.equipScore)
-                    {
-                        itemModelDict[equipPlace].Add(itemModel.itemInfo.ItemPlace, itemModel);
-                    }
+                    itemModelDict[equipPlace].Add(itemModel.itemInfo.ItemPlace, itemModel);
                 }
             }
 
@@ -1445,65 +1451,17 @@
                 }
             }
 
-            return CheckPutOnLimit(itemModel.itemId);
+            return CheckPutOnRealm(itemModel.chinItemModel);
         }
 
-        private bool CheckPutOnLimit(int itemId)
+        private bool CheckPutOnRealm(ItemConfig config)
         {
-            int playerLv = PlayerDatas.Instance.baseData.LV;
-            ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(itemId);
-            if (itemConfig == null) return false;
-
-            if (itemConfig.EquipPlace != (int)RoleEquipType.retWing)
+            var _realmLv = config.RealmLimit;
+            if (PlayerDatas.Instance.baseData.realmLevel < _realmLv)
             {
-                if (itemConfig.UseLV > playerLv) return false;
-                float sumOffsetPoint = 0;
-                float offset = 0;
-                if (itemConfig.LimitSTR != 0)
-                {
-                    offset = itemConfig.LimitSTR - UIHelper.GetPropertyMapPlayerData(AttrEnum.POWER);
-                    sumOffsetPoint += offset;
-                }
-
-                if (itemConfig.LimitPHY != 0)
-                {
-                    offset = itemConfig.LimitPHY - UIHelper.GetPropertyMapPlayerData(AttrEnum.AGILITY);
-                    sumOffsetPoint += offset;
-                }
-
-                if (itemConfig.LimitPNE != 0)
-                {
-                    offset = itemConfig.LimitPNE - UIHelper.GetPropertyMapPlayerData(AttrEnum.MENTALITY);
-                    sumOffsetPoint += offset;
-                }
-
-                if (sumOffsetPoint <= PlayerDatas.Instance.baseData.FreePoint)
-                {
-                    if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.AddPoint))
-                    {
-                        return true;
-                    }
-                }
-
                 return false;
             }
-
-            else
-            {
-                var _realmLv = 1;
-                GeneralDefine.wingEquipLimits.TryGetValue(itemId, out _realmLv);
-                var needRealmConfig = Config.Instance.Get<RealmConfig>(_realmLv);
-                var curRealmConfig = Config.Instance.Get<RealmConfig>(PlayerDatas.Instance.baseData.realmLevel);
-
-                if (PlayerDatas.Instance.baseData.realmLevel < _realmLv)
-                {
-                    return false;
-                }
-                else
-                {
-                    return true;
-                }
-            }
+            return true;
         }
         #endregion
 
@@ -1576,7 +1534,7 @@
             ItemConfig chinItemModel = Config.Instance.Get<ItemConfig>(_itemID);
             if (chinItemModel != null)
             {
-                if (chinItemModel.Type < 101 || chinItemModel.Type >= 110) return 0;
+                if (chinItemModel.EquipPlace < 1 || chinItemModel.EquipPlace > 12) return 0;
                 ItemModel model = playerPack.GetItemModelByIndex(PackType.rptEquip,chinItemModel.EquipPlace);
                 if (chinItemModel.EquipPlace == (int)RoleEquipType.retFairyCan)
                 {

--
Gitblit v1.8.0