Browse Source

服装分解技能书接入协议

huangxiaoyue 2 years ago
parent
commit
e40e8503cb

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Data/DecomposeDataManager.cs

@@ -177,7 +177,7 @@ namespace GFGGame
 
             for (int i = 0; i < materialDataKey.Count; i++)
             {
-                for (int k = 0; k < _decomposeMaterialData[materialDataKey[i]].Count; k++)
+                for (int k = _decomposeMaterialData[materialDataKey[i]].Count-1; k >= 0; k--)
                 {
                     int itemId = _decomposeMaterialData[materialDataKey[i]][k];
                     if (ItemCanDecomposeMaterialCount(itemId) <= 0) {
@@ -185,6 +185,7 @@ namespace GFGGame
                     }
                 }
             }
+
             return _decomposeMaterialData[rarity];
         }
 

+ 15 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/ClothingDecomposeSProxy.cs

@@ -21,5 +21,20 @@ namespace GFGGame
             }
             return false;
         }
+
+        public static async ETTask<bool> SkillBookDecompose(List<int> itemIds, List<long> itemNums)
+        {
+            M2C_SkillBookDecompose response = null;
+            response = (M2C_SkillBookDecompose)await MessageHelper.SendToServer(new C2M_SkillBookDecompose() { itemIds = itemIds, itemNums = itemNums });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(response.bonusList));
+                    return true;
+                }
+            }
+            return false;
+        }
     }
 }

+ 16 - 4
GameClient/Assets/Game/HotUpdate/Views/ClothingDecompose/ClothingDecomposeView.cs

@@ -353,11 +353,23 @@ namespace GFGGame
 
             List<int> itemIds = _decomposeData.Keys.ToList<int>();
             List<long> itemNums = _decomposeData.Values.ToList<long>();
-            bool result = await ClothingDecomposeSProxy.ClothingDecompose(itemIds, itemNums);
-            if (result)
+            if (_ui.m_c1.selectedIndex == 0)
+            {
+                bool result = await ClothingDecomposeSProxy.ClothingDecompose(itemIds, itemNums);
+                if (result)
+                {
+                    OnClickBtnRarity(_curRarity);
+                    LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.FU_ZHUANG_FEN_JIE, 2);
+                }
+            }
+            else
             {
-                OnClickBtnRarity(_curRarity);
-                LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.FU_ZHUANG_FEN_JIE, 2);
+                bool result = await ClothingDecomposeSProxy.SkillBookDecompose(itemIds, itemNums);
+                if (result)
+                {
+                    OnClickBtnRarity(_curRarity);
+                    LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.FU_ZHUANG_FEN_JIE, 2);
+                }
             }
         }