From 6dbf827fa655caec79b030e497191c85eda28a07 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期五, 23 十一月 2018 16:35:16 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/Pet/PlayerPetDatas.cs     |   38 ++++++++++++-------
 System/Mount/PlayerMountDatas.cs |   50 +++++++++++++++----------
 2 files changed, 54 insertions(+), 34 deletions(-)

diff --git a/System/Mount/PlayerMountDatas.cs b/System/Mount/PlayerMountDatas.cs
index 5b37ca3..2c2e3d4 100644
--- a/System/Mount/PlayerMountDatas.cs
+++ b/System/Mount/PlayerMountDatas.cs
@@ -141,7 +141,7 @@
         if (mountRedpoint.Count != 0)
             return;
 
-       // var configs = Config.Instance.GetAllValues<HorseConfig>();
+        // var configs = Config.Instance.GetAllValues<HorseConfig>();
         if (Hconfigs.Count <= 0)
         {
             Hconfigs = Config.Instance.GetAllValues<HorseConfig>();
@@ -183,7 +183,7 @@
         {
             Hconfigs = Config.Instance.GetAllValues<HorseConfig>();
         }
-      //  var configs = Config.Instance.GetAllValues<HorseConfig>();
+        //  var configs = Config.Instance.GetAllValues<HorseConfig>();
         foreach (var config in Hconfigs)
         {
             int unlockItemID = config.UnlockItemID;
@@ -202,7 +202,7 @@
             return;
         if (Uconfigs.Count <= 0)
         {
-            Uconfigs= Config.Instance.GetAllValues<HorseUpConfig>();
+            Uconfigs = Config.Instance.GetAllValues<HorseUpConfig>();
         }
         //var configs = Config.Instance.GetAllValues<HorseUpConfig>();
         foreach (var config in Uconfigs)
@@ -295,30 +295,26 @@
         {
             return;
         }
-
-        int GetMountID = 0;
-        int GetMountLv = 0;
-        int NeedExp = 99999999;
-        int NeedNumber = 0;//鎵�闇�瑕佺殑缁忛獙涓�
+        List<int> IntList = new List<int>();
+        FuncConfigConfig _tagfun = Config.Instance.Get<FuncConfigConfig>("HorseUpItem");
+        ItemConfig _tagchine = Config.Instance.Get<ItemConfig>(int.Parse(_tagfun.Numerical1));
+        int number = playerPack.GetItemCountByID(PackType.rptItem, _tagchine.ID);
         for (int i = 0; i < SortMount.Count; i++)
         {
             int horseID = SortMount[i].HorseID;
-            if (_DicHorse.ContainsKey(horseID) && _DicHorse[horseID].Lv < Config.Instance.Get<HorseConfig>(horseID).MaxLV)
+            int MaxLv = Config.Instance.Get<HorseConfig>(horseID).MaxLV;
+            if (_DicHorse.ContainsKey(horseID) && _DicHorse[horseID].Lv < MaxLv)
             {
                 int _NeedExp = HorseUpConfig.GetHorseIDAndLV(horseID, (_DicHorse[horseID].Lv)).NeedExp;
-                if (_NeedExp - _DicHorse[horseID].Exp < NeedExp)
+                int NeedExp = _NeedExp - _DicHorse[horseID].Exp;
+                int NeedNumber = Mathf.CeilToInt((float)NeedExp / HorseDanExp);
+                if (number >= NeedNumber)
                 {
-                    NeedExp = _NeedExp - _DicHorse[horseID].Exp;
-                    GetMountID = horseID;
-                    GetMountLv = _DicHorse[horseID].Lv;
-                    NeedNumber = Mathf.CeilToInt((float)NeedExp / HorseDanExp);
+                    IntList.Add(horseID);
                 }
             }
         }
-        FuncConfigConfig _tagfun = Config.Instance.Get<FuncConfigConfig>("HorseUpItem");
-        ItemConfig _tagchine = Config.Instance.Get<ItemConfig>(int.Parse(_tagfun.Numerical1));
-        HorseConfig horsecon = Config.Instance.Get<HorseConfig>(GetMountID);
-        int number = playerPack.GetItemCountByID(PackType.rptItem, _tagchine.ID);
+
         foreach (var key in _DicHorse.Keys)//鍥犱负鏈夋垚灏变换鍔¢檺鍒舵墍鏈� 绗竴鍙潗楠戠孩鐐归�昏緫鐗规畩鍐�
         {
             if (DicDefaultMount.ContainsKey(key) && DicDefaultMount[key] > _DicHorse[key].Lv
@@ -328,7 +324,21 @@
                 return;
             }
         }
-        if (ASingleFeedRedPoint.ContainsKey(GetMountID) && number >= NeedNumber && GetMountLv < horsecon.MaxLV)
+        int GetMinLV = 100;
+        int GetMountID = 0;
+        for (int j = 0; j < SortMount.Count; j++)
+        {
+            int Id = SortMount[j].HorseID;
+            if (IntList.Contains(Id) && _DicHorse.ContainsKey(Id))
+            {
+                if (_DicHorse[Id].Lv < GetMinLV)
+                {
+                    GetMinLV = _DicHorse[Id].Lv;
+                    GetMountID = Id;
+                }
+            }
+        }
+        if (ASingleFeedRedPoint.ContainsKey(GetMountID))
         {
             ASingleFeedRedPoint[GetMountID].state = RedPointState.Simple;
             return;
@@ -382,7 +392,7 @@
             {
                 Hconfigs = Config.Instance.GetAllValues<HorseConfig>();
             }
-           // var configs = Config.Instance.GetAllValues<HorseConfig>();
+            // var configs = Config.Instance.GetAllValues<HorseConfig>();
             foreach (var config in Hconfigs)
             {
                 if (config.ItemID == info.itemInfo.ItemID)
diff --git a/System/Pet/PlayerPetDatas.cs b/System/Pet/PlayerPetDatas.cs
index f6a4828..e4f7ae6 100644
--- a/System/Pet/PlayerPetDatas.cs
+++ b/System/Pet/PlayerPetDatas.cs
@@ -244,7 +244,7 @@
         {
             allPetConfigs = Config.Instance.GetAllValues<PetInfoConfig>();
         }
-      //  var allPetConfigs = Config.Instance.GetAllValues<PetInfoConfig>();
+        //  var allPetConfigs = Config.Instance.GetAllValues<PetInfoConfig>();
         foreach (var config in allPetConfigs)
         {
             if (!DeblockingRedPoint.ContainsKey(config.ID))
@@ -275,7 +275,7 @@
         {
             return;
         }
-       // var configs = Config.Instance.GetAllValues<PetInfoConfig>();
+        // var configs = Config.Instance.GetAllValues<PetInfoConfig>();
         if (allPetConfigs.Count <= 0)
         {
             allPetConfigs = Config.Instance.GetAllValues<PetInfoConfig>();
@@ -328,25 +328,25 @@
             return;
         }
         int GetPetId = 0;
-        int petLv = 0;
-        int NeedExp = 99999999;
-        int NeedNumber = 0;//鎵�闇�瑕佺殑缁忛獙涓�
+        int petLv = 100;
+        int itemCount = playerPack.GetItemCountByID(PackType.rptItem, 4151);
+        List<int> ListInt = new List<int>();
         for (int i = 0; i < Sortpet.Count; i++)
         {
             int petID = Sortpet[i].ID;
-            if (_DicPetBack.ContainsKey(petID) && _DicPetBack[petID].PetClass < Config.Instance.Get<PetInfoConfig>(petID).MaxRank)
+            int MaxLv = Config.Instance.Get<PetInfoConfig>(petID).MaxRank;
+            if (_DicPetBack.ContainsKey(petID) && _DicPetBack[petID].PetClass < MaxLv)
             {
                 int _NeedExp = PetClassCostConfig.GetPetIdAndRank(petID, _DicPetBack[petID].PetClass).UpNeedExp;
-                if (_NeedExp - _DicPetBack[petID].petExp < NeedExp)
+                int NeedExp = _NeedExp - _DicPetBack[petID].petExp;
+                int NeedNumber = Mathf.CeilToInt((float)NeedExp / PetDanExp);
+                if (itemCount>= NeedNumber)
                 {
-                    NeedExp = _NeedExp - _DicPetBack[petID].petExp;
-                    petLv = _DicPetBack[petID].PetClass;
-                    GetPetId = petID;
-                    NeedNumber = Mathf.CeilToInt((float)NeedExp / PetDanExp);
+                    ListInt.Add(petID);
                 }
             }
         }
-        int itemCount = playerPack.GetItemCountByID(PackType.rptItem, 4151);
+
         foreach (var key in _DicPetBack.Keys)//鍥犱负鏈夋垚灏变换鍔¢檺鍒舵墍鏈� 绗竴鍙潗楠戠孩鐐归�昏緫鐗规畩鍐�
         {
             if (DicDefaultPet.ContainsKey(key) && DicDefaultPet[key] > _DicPetBack[key].PetClass
@@ -356,8 +356,18 @@
                 return;
             }
         }
-        PetInfoConfig petinfo = Config.Instance.Get<PetInfoConfig>(GetPetId);
-        if (CultivateRedPoint.ContainsKey(GetPetId) && itemCount >= NeedNumber && petinfo.MaxRank > petLv)
+        for (int i = 0; i < ListInt.Count; i++)
+        {
+            if (_DicPetBack.ContainsKey(ListInt[i]))
+            {
+                if (_DicPetBack[(ListInt[i])].PetClass < petLv)
+                {
+                    petLv = _DicPetBack[(ListInt[i])].PetClass;
+                    GetPetId = (ListInt[i]);
+                }
+            }
+        }
+        if (CultivateRedPoint.ContainsKey(GetPetId))
         {
             CultivateRedPoint[GetPetId].state = RedPointState.Simple;
             return;

--
Gitblit v1.8.0