From d2f07e048e308a9ce166b3e842ea8a4615fa94ab Mon Sep 17 00:00:00 2001
From: client_Zxw <826696702@qq.com>
Date: 星期五, 04 一月 2019 10:40:55 +0800
Subject: [PATCH] 5555 子 【优化】【1.4】坐骑、灵宠红点优化 / 【前端】【1.4】坐骑、灵宠红点优化

---
 System/Pet/PlayerPetDatas.cs     |   53 ++++++++++++++++----------
 System/Mount/PlayerMountDatas.cs |   52 ++++++++++++++-----------
 2 files changed, 61 insertions(+), 44 deletions(-)

diff --git a/System/Mount/PlayerMountDatas.cs b/System/Mount/PlayerMountDatas.cs
index 2054295..a405961 100644
--- a/System/Mount/PlayerMountDatas.cs
+++ b/System/Mount/PlayerMountDatas.cs
@@ -332,7 +332,27 @@
         }
         int GetMinLV = 100;
         int GetMountID = 0;
-        for (int j = 0; j < SortMount.Count; j++)
+        for (int j = 0; j < SortMount.Count; j++)//閫夊彇鍑哄彲鍗囩骇鍧愰獞绛夌骇鏈�浣庝笖鏈夋湭婵�娲绘妧鑳界殑鍧愰獞
+        {
+            int Id = SortMount[j].HorseID;
+            int GetHorseMaxLv = GetMountSkillMaxLV(Id);
+            if (IntList.Contains(Id) && _DicHorse.ContainsKey(Id))
+            {
+                if (_DicHorse[Id].Lv < GetMinLV && _DicHorse[Id].Lv< GetHorseMaxLv)
+                {
+                    GetMinLV = _DicHorse[Id].Lv;
+                    GetMountID = Id;
+                }
+            }
+        }
+        if (GetMountID != 0 && ASingleFeedRedPoint.ContainsKey(GetMountID))
+        {
+            ASingleFeedRedPoint[GetMountID].state = RedPointState.Simple;
+            return;
+        }
+
+
+        for (int j = 0; j < SortMount.Count; j++)//閫夊彇鍑哄彲鍗囩骇鍧愰獞绛夌骇鏈�浣�
         {
             int Id = SortMount[j].HorseID;
             if (IntList.Contains(Id) && _DicHorse.ContainsKey(Id))
@@ -344,26 +364,10 @@
                 }
             }
         }
-        bool IsFullBool = true;
-        foreach (var key in _DicHorse.Keys)
+        if (GetMountID != 0 && ASingleFeedRedPoint.ContainsKey(GetMountID))
         {
-            if (_DicHorse[key].Lv < 20)
-            {
-                IsFullBool = false;
-            }
-        }
-        if (ASingleFeedRedPoint.ContainsKey(GetMountID))
-        {
-            if (_DicHorse[GetMountID].Lv < 20)
-            {
-                ASingleFeedRedPoint[GetMountID].state = RedPointState.Simple;
-                return;
-            }
-            else if (_DicHorse[GetMountID].Lv >= 20 && IsFullBool)
-            {
-                ASingleFeedRedPoint[GetMountID].state = RedPointState.Simple;
-                return;
-            }           
+            ASingleFeedRedPoint[GetMountID].state = RedPointState.Simple;
+            return;
         }
     }
 
@@ -378,9 +382,11 @@
         }
         int GetMountID = 0;
         int MountLV = 999;
-        foreach (var key in _DicHorse.Keys)//鏃犵孩鐐规椂璺宠浆閫変腑鏈�浣庨樁鏁�
+        
+        foreach (var key in _DicHorse.Keys)//鏃犵孩鐐规椂璺宠浆閫変腑鏈�浣庨樁鏁颁笖鏈弧绾�
         {
-            if (_DicHorse[key].Lv < MountLV)
+            var mountConfig = Config.Instance.Get<HorseConfig>(key);
+            if (_DicHorse[key].Lv < MountLV && _DicHorse[key].Lv< mountConfig.MaxLV)
             {
                 GetMountID = key;
                 MountLV = _DicHorse[key].Lv;
@@ -389,7 +395,7 @@
         return GetMountID;
     }
 
-    public int GetMountSkillMaxLV(int MountId)//鑾峰彇鐏靛疇鏈�澶ф妧鑳界瓑绾�
+    public int GetMountSkillMaxLV(int MountId)//鑾峰彇鍧愰獞鏈�澶ф妧鑳界瓑绾�
     {
         int SkillLv = 0;
         foreach (var key in GetMountSkillAndItem.Keys)
diff --git a/System/Pet/PlayerPetDatas.cs b/System/Pet/PlayerPetDatas.cs
index c04f273..37775a4 100644
--- a/System/Pet/PlayerPetDatas.cs
+++ b/System/Pet/PlayerPetDatas.cs
@@ -356,7 +356,32 @@
                 return;
             }
         }
-        for (int i = 0; i < ListInt.Count; i++)
+        for (int i = 0; i < ListInt.Count; i++)//閫夋嫨鍑哄崌绾х伒瀹犵瓑绾ф渶浣庝笖鏈夋妧鑳芥湭瑙i攣鐨�
+        {
+            if (_DicPetBack.ContainsKey(ListInt[i]))
+            {
+                var PetConfig = Config.Instance.Get<PetInfoConfig>(ListInt[i]);
+                if (PetConfig == null)
+                {
+                    return;
+                }
+                int[] SkillUnLockInt = PetConfig.SkillUnLock;
+                int SkillLvMax = SkillUnLockInt[(SkillUnLockInt.Length-1)];
+                if (_DicPetBack[(ListInt[i])].PetClass < petLv && _DicPetBack[(ListInt[i])].PetClass<SkillLvMax)
+                {
+                    petLv = _DicPetBack[(ListInt[i])].PetClass;
+                    GetPetId = (ListInt[i]);
+                }
+            }
+        }
+        if (GetPetId != 0 && CultivateRedPoint.ContainsKey(GetPetId))
+        {
+            CultivateRedPoint[GetPetId].state = RedPointState.Simple;
+            return;
+        }
+
+
+        for (int i = 0; i < ListInt.Count; i++)//閫夋嫨鍑虹瓑绾ф渶浣庣殑鐏靛疇
         {
             if (_DicPetBack.ContainsKey(ListInt[i]))
             {
@@ -367,26 +392,10 @@
                 }
             }
         }
-        bool IsFullBool = true;
-        foreach (var key in _DicPetBack.Keys)
+        if (GetPetId != 0 && CultivateRedPoint.ContainsKey(GetPetId))
         {
-            if (_DicPetBack[key].PetClass < 20)
-            {
-                IsFullBool = false;
-            }
-        }
-        if (CultivateRedPoint.ContainsKey(GetPetId))
-        {
-            if (_DicPetBack[GetPetId].PetClass < 20)
-            {
-                CultivateRedPoint[GetPetId].state = RedPointState.Simple;
-                return;
-            }
-            else if (_DicPetBack[GetPetId].PetClass >= 20 && IsFullBool)
-            {
-                CultivateRedPoint[GetPetId].state = RedPointState.Simple;
-                return;
-            }
+            CultivateRedPoint[GetPetId].state = RedPointState.Simple;
+            return;
         }
     }
 
@@ -401,9 +410,11 @@
         }
         int GetPetId = 0;
         int GetPetLv = 999;
+        
         foreach (var key in _DicPetBack.Keys)//鏃犵孩鐐规椂璺宠浆閫変腑绛夌骇鏈�浣庣殑
         {
-            if (_DicPetBack[key].PetClass < GetPetLv)
+            var config = Config.Instance.Get<PetInfoConfig>(key);
+            if (_DicPetBack[key].PetClass < GetPetLv && _DicPetBack[key].PetClass < config.MaxRank)
             {
                 GetPetId = key;
                 GetPetLv = _DicPetBack[key].PetClass;

--
Gitblit v1.8.0