From 958a3925462bfd78b91727f8a98021c5e5805c81 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 13 十一月 2023 14:50:13 +0800
Subject: [PATCH] 9895 子 【BT0.1】【主干】坐骑、灵宠、称号升星 / 【BT0.1】坐骑、灵宠、称号升星 - 坐骑升星, 并删除了很古老的坐骑升级消耗表

---
 System/Mount/MountModel.cs |  187 +++++++++++++++++++---------------------------
 1 files changed, 77 insertions(+), 110 deletions(-)

diff --git a/System/Mount/MountModel.cs b/System/Mount/MountModel.cs
index 966727e..283c666 100644
--- a/System/Mount/MountModel.cs
+++ b/System/Mount/MountModel.cs
@@ -81,6 +81,7 @@
     Dictionary<SkillEffectGroup, List<int>> integrationHorseSkills = new Dictionary<SkillEffectGroup, List<int>>();
     Dictionary<int, SkillEffectGroup> horseSkillEffectValues = new Dictionary<int, SkillEffectGroup>();
     Dictionary<int, int> horseSkills = new Dictionary<int, int>();
+    public Dictionary<int, int> horseStarDict = new Dictionary<int, int>(); //鍧愰獞骞诲寲鍗囨槦
 
     Dictionary<int, int> unLockSkinItems = new Dictionary<int, int>();
 
@@ -184,6 +185,7 @@
         HorseRidingBool = false;
         Wait = true;
         MountHA301MorePack = false;
+        horseStarDict.Clear();
     }
 
     public void OnPlayerLoginOk()
@@ -227,7 +229,6 @@
     }
 
     List<HorseConfig> Hconfigs = new List<HorseConfig>();
-    List<HorseUpConfig> Uconfigs = new List<HorseUpConfig>();
 
     public int RedPoint_HuaxingID = MainRedDot.RedPoint_MountPackKey * 10; //鍖栧舰绾㈢偣
     int RedPoint_DanID = MainRedDot.RedPoint_MountPackKey * 10 + 1; //鍙敤鍧愰獞涓圭孩鐐�
@@ -247,73 +248,7 @@
         }
 
     }
-    private void MountChangeRedPoint()//鍧愰獞婵�娲荤孩鐐�
-    {
-        return;
-        //foreach (var key in DeblockingRedPoint.Keys)
-        //{
-        //    DeblockingRedPoint[key].state = RedPointState.None;
-        //}
-        //if (!FuncOpen.Instance.IsFuncOpen(8))
-        //{
-        //    return;
-        //}
-        //if (Hconfigs.Count <= 0)
-        //{
-        //    Hconfigs = HorseConfig.GetValues();
-        //}
-        ////  var configs = HorseConfig.GetValues();
-        //foreach (var config in Hconfigs)
-        //{
-        //    int unlockItemID = config.UnlockItemID;
-        //    int itemCount = playerPack.GetItemCountByID(PackType.Item, unlockItemID);
-        //    int unlockItemCnt = config.UnlockItemCnt;
-        //    if (itemCount >= unlockItemCnt && !_DicHorse.ContainsKey(config.HorseID))
-        //    {
-        //        DeblockingRedPoint[config.HorseID].state = RedPointState.Simple;
-        //    }
-        //}
-    }
 
-    //void MountSkillAndItem()//鑾峰彇鍧愰獞鎶�鑳�
-    //{
-    //    if (GetMountSkillAndItem.Count != 0)
-    //        return;
-    //    if (Uconfigs.Count <= 0)
-    //    {
-    //        Uconfigs = HorseUpConfig.GetValues();
-    //    }
-    //    //var configs = HorseUpConfig.GetValues();
-    //    foreach (var config in Uconfigs)
-    //    {
-    //        if (!HorseConfig.Has(config.HorseID))
-    //        {
-    //            continue;
-    //        }
-
-    //        for (int i = 0; i < config.SkillID.Length; i++)
-    //        {
-    //            int skillID = config.SkillID[i];
-    //            if (skillID != 0 && !GetMountSkillAndItem.ContainsKey(skillID))
-    //            {
-    //                SkillConfig _skillModel = SkillConfig.Get(skillID);
-    //                if (_skillModel == null)
-    //                {
-    //                    Debug.Log(skillID);
-    //                }
-
-    //                HorseSkillClass horseSkillClass = new HorseSkillClass();
-    //                horseSkillClass.SkillID = skillID;
-    //                horseSkillClass.SkillItem = _skillModel.ExAttr4;
-    //                horseSkillClass.HorseID = config.HorseID;
-    //                horseSkillClass.HorseLV = config.LV;
-    //                GetMountSkillAndItem.Add(skillID, horseSkillClass);
-    //            }
-    //        }
-    //    }
-    //}
-    //private const int Redpoint_key1 = 1050101;
-    //public Redpoint redPointStre1 = new Redpoint(MainRedDot.RedPoint_MountPackKey, Redpoint_key1);//鍧愰獞澶栬
     private const int Redpoint_key2 = MainRedDot.RedPoint_MountPackKey * 10 + 2;
     public Redpoint redPointStre2 = new Redpoint(MainRedDot.RedPoint_MountPackKey, Redpoint_key2);//鍧愰獞鍏介瓊
 
@@ -344,6 +279,11 @@
                 {
                     DeblockingRedPoint[activeID].state = RedPointState.Simple;
                 }
+                else
+                {
+                    RefreshStarRedpoint(id);
+                }
+
             }
             ForsterHorseRed(id);
 
@@ -368,10 +308,43 @@
                 {
                     DeblockingRedPoint[activeID].state = RedPointState.Simple;
                 }
+                else
+                {
+                    RefreshStarRedpoint(id);
+                }
             }
             ForsterHorseRed(id);
 
         }
+    }
+
+    //鍗囨槦鍜岃В閿佸叡鐢ㄧ孩鐐�
+    void RefreshStarRedpoint(int itemID)
+    {
+        int activeID = unLockSkinItems[itemID];
+        int horseID = HorseConfig.GetItemUnLockHorse(itemID);
+        if (!HorseStarUpConfig.horseIDToIDs.ContainsKey(horseID))
+            return;
+        if (!isMountSkinActive(horseID))
+            return;
+
+        DeblockingRedPoint[activeID].state = RedPointState.None;
+
+        int star = 0;
+        horseStarDict.TryGetValue(horseID, out star);
+        //婊℃槦
+        if (star == HorseStarUpConfig.horseIDToIDs[horseID].Count)
+            return;
+
+        var id = HorseStarUpConfig.horseIDToIDs[horseID][star];
+        var nextStarConfig = HorseStarUpConfig.Get(id);
+        List<int[]> awards = nextStarConfig.StarUpNeedItemList;
+        for (int i = 0; i < awards.Count; i++)
+        {
+            if (playerPack.GetItemCountByID(PackType.Item, awards[i][0]) < awards[i][1])
+                return;
+        }
+        DeblockingRedPoint[activeID].state = RedPointState.Simple;
     }
 
     //private void OnFuncStateChangeEvent(int funcId)
@@ -418,7 +391,7 @@
         }
         
     }
-    private void MountStoneRed()//鍧愰獞榄傜煶绾㈢偣
+    public void MountStoneRed()//鍧愰獞榄傜煶绾㈢偣
     {
         redPointStre2.state = RedPointState.None;
         if (!FuncOpen.Instance.IsFuncOpen(8))
@@ -458,39 +431,6 @@
 
     }
 
-
-    private int GetRedPointMountID(List<int> MountList)
-    {
-        int GetSkillMinLv = 999;
-        for (int i = 0; i < MountList.Count; i++)
-        {
-            int SkillminLv = GetSkillLvDis(MountList[i]);
-            if (SkillminLv < GetSkillMinLv && SkillminLv != 0)
-            {
-                GetSkillMinLv = SkillminLv;
-            }
-        }
-
-        int mountId = 0;
-        int ExpNumber = 999999999;
-        for (int i = 0; i < MountList.Count; i++)
-        {
-            int SkillLv = GetSkillLvDis(MountList[i]);
-            if (SkillLv > GetSkillMinLv || SkillLv == 0)
-            {
-                continue;
-            }
-            var Hor1 = HorseUpConfig.GetHorseIDAndLV(MountList[i], SkillLv);
-            var Hor2 = HorseUpConfig.GetHorseIDAndLV(MountList[i], _DicHorse[(MountList[i])].Lv);
-            int Exp = Hor1.NeedExpTotal - Hor2.NeedExpTotal - _DicHorse[(MountList[i])].Exp;
-            if (Exp < ExpNumber)
-            {
-                ExpNumber = Exp;
-                mountId = MountList[i];
-            }
-        }
-        return mountId;
-    }
 
     private int GetSkillLvDis(int MountId)//鑾峰彇绂诲崌绾ф渶杩戠殑鎶�鑳界瓑绾�
     {
@@ -670,15 +610,7 @@
         else
         {
             int _AttT = 0;//鏀诲嚮
-            foreach (int key in _DicHorse.Keys)
-            {
-                HorseUpConfig tagMode = HorseUpConfig.GetHorseIDAndLV(key, _DicHorse[key].Lv);
-                int[] intAttrValue = tagMode.AttrValue;
-                if (intAttrValue.Length != 0)
-                {
-                    _AttT += intAttrValue[1];
-                }
-            }
+
             return _AttT + dicStone[7];
         }
     }
@@ -1113,4 +1045,39 @@
             RankHorseIDList.Add(horseConfig.HorseID);
         }
     }
+
+    //鍧愰獞骞诲寲鍗囨槦
+    public void UpdateHorseStarInfo(HA3CD_tagMCHorseStarInfo netPack)
+    {
+        for (int i = 0; i < netPack.HorseStarList.Length; i++)
+        {
+            horseStarDict[(int)netPack.HorseStarList[i].HorseID] = netPack.HorseStarList[i].Star;
+        }
+        onMountSkinActive?.Invoke();
+
+        foreach (var id in unLockSkinItems.Keys)
+        {
+            RefreshStarRedpoint(id);
+        }
+    }
+
+    //鍧愰獞骞诲寲鐗╁搧鏄惁鍙敤浜庤閱�
+    public bool IsHorseSkinCanAwake(int horseID)
+    {
+        if (!isMountSkinActive(horseID))
+        {
+            return false;
+        }
+
+        if (!HorseStarUpConfig.horseIDToIDs.ContainsKey(horseID))
+            return true;
+
+        int star = 0;
+        horseStarDict.TryGetValue(horseID, out star);
+        //婊℃槦
+        if (star != HorseStarUpConfig.horseIDToIDs[horseID].Count)
+            return false;
+
+        return true;
+    }
 }

--
Gitblit v1.8.0