Pārlūkot izejas kodu

卡牌升级限制提示

zhaoyang 2 gadi atpakaļ
vecāks
revīzija
99f765eb38

+ 11 - 6
GameClient/Assets/Game/HotUpdate/Views/Card/CardFosterView.cs

@@ -342,7 +342,7 @@ namespace GFGGame
             _consumeSelectIndex = type;
             if (type == 1)
             {
-                if (IsUpLvLimit()) return;
+                if (IsUpLvLimit(itemId)) return;
 
                 if (ItemDataManager.GetItemNum(itemId) == 0)
                 {
@@ -371,7 +371,9 @@ namespace GFGGame
                 }
                 else
                 {
-                    if (!CommonUtil.Instance.CheckPointIsOnComponent(_consumeSelectItem, CommonUtil.Instance.GetMouseV2Point()) || IsUpLvLimit())
+                    int index = (int)_consumeSelectItem.data;
+                    int itemId = upgradeCardItemsArr[index];
+                    if (!CommonUtil.Instance.CheckPointIsOnComponent(_consumeSelectItem, CommonUtil.Instance.GetMouseV2Point()) || IsUpLvLimit(itemId))
                     {
                         Timers.inst.Remove(OnTimedEvent);
                         return;
@@ -421,7 +423,7 @@ namespace GFGGame
                 }
                 return false;
             }
-            if (IsUpLvLimit(false)) return false;
+            if (IsUpLvLimit(itemId, false)) return false;
             itemsCount[index] = itemsCount[index] + 1;
             listItem.m_txtUseCount.text = itemsCount[index].ToString();
             this.UpdatePreView();
@@ -471,7 +473,7 @@ namespace GFGGame
         {
             for (int i = 0; i < itemsCount.Count; i++)
             {
-                if (IsUpLvLimit()) break;
+                // if (IsUpLvLimit()) break;
                 long itemNum = ItemDataManager.GetItemNum(upgradeCardItemsArr[i]);
                 for (long j = 0; j < itemNum; j++)
                 {
@@ -546,10 +548,13 @@ namespace GFGGame
             }
         }
 
-        private bool IsUpLvLimit(bool showTips = true)
+        private bool IsUpLvLimit(int itemId, bool showTips = true)
         {
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
             int lvLimit = RoleLevelCfgArray.Instance.GetCfg(RoleDataManager.lvl).cardLeverLimit;
-            if (_showLv > lvLimit)
+            int needExp = CardLvlCfgArray.Instance.GetCfgByrarityAndcardLvl(_cardData.itemCfg.rarity, lvLimit).needExp;
+
+            if (_showLv > lvLimit || _showLv == lvLimit && _comFosterBottom.m_barLv.value + itemCfg.cardUpLvExp > needExp)
             {
                 if (!showTips) return true;