소스 검색

分解界面数量显示算法修改

huangxiaoyue 2 년 전
부모
커밋
e2e80abffb

+ 21 - 0
GameClient/Assets/Game/HotUpdate/Data/DecomposeDataManager.cs

@@ -28,6 +28,27 @@ namespace GFGGame
             {
                 _decomposeData[rarity].Add(itemId);
             }
+
+            //套装拥有的时候需要让材料重新加进列表
+            int[][] syntheticMateriarsArr = ItemDataManager.GetItemSyntheticSuitArr(itemId);
+            if (syntheticMateriarsArr.Length > 0) {
+                foreach (int[] materiars in syntheticMateriarsArr)
+                {
+                    int materialId = materiars[0];
+                    int materialItemType = ItemDataManager.GetItemType(materialId);
+                    if (materialItemType == ConstItemType.DRESS_UP) { 
+                        long materiarsCount = ItemCanDecomposeCount(materialId);
+                        if (materiarsCount> 0 && (materiarsCount + materiars[1] - DeductSynthesisNeedNum(materialId)) > 0)
+                        {
+                            rarity = ItemDataManager.GetItemRarity(materialId);
+                            if (_decomposeData[rarity].IndexOf(materialId) < 0)
+                            {
+                                _decomposeData[rarity].Add(materialId);
+                            }
+                        }
+                    }
+                }
+            }
         }
 
         public void Remove(int itemId)

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Data/ItemDataManager.cs

@@ -150,6 +150,17 @@ namespace GFGGame
             return itemCfg.itemType;
         }
 
+        public static int[][] GetItemSyntheticSuitArr(int itemId)
+        {
+            _dataDic.TryGetValue(itemId, out var value);
+            if (value != null && value.syntheticMateriarsArr != null && value.syntheticMateriarsArr.Length > 0)
+            {
+                return value.syntheticMateriarsArr;
+            }
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
+            return itemCfg.syntheticMateriarsArr;
+        }
+
         public static int GetItemSubType(int itemId)
         {
             _dataDic.TryGetValue(itemId, out var value);

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Data/VO/ItemData.cs

@@ -10,6 +10,7 @@ namespace GFGGame
         public int itemType;
         public int subType;
         public int rarity;
+        public int[][] syntheticMateriarsArr;
 
         private Dictionary<int, int> AttributesDic = new Dictionary<int, int>();