From fa4bb5491df435bcbb19aba25cd643911e62cf5f Mon Sep 17 00:00:00 2001
From: Client_PangDeRong <593317293@qq.com>
Date: 星期五, 12 十月 2018 17:57:01 +0800
Subject: [PATCH] 4144 【前端】人物粉色品质防具装备的合成与拆解

---
 Core/NetworkPackage/ClientPack/ClientToMapServer/CA3_Item/CA313_tagCMItemDecompound.cs      |   18 +++++++++
 System/KnapSack/Logic/PackSendQuestMgr.cs                                                   |    9 ++++
 Utility/EnumHelper.cs                                                                       |    2 +
 System/KnapSack/Logic/ItemTipsModel.cs                                                      |   35 +++++++++++++++++
 Core/NetworkPackage/ClientPack/ClientToMapServer/CA3_Item/CA313_tagCMItemDecompound.cs.meta |   12 ++++++
 5 files changed, 76 insertions(+), 0 deletions(-)

diff --git a/Core/NetworkPackage/ClientPack/ClientToMapServer/CA3_Item/CA313_tagCMItemDecompound.cs b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA3_Item/CA313_tagCMItemDecompound.cs
new file mode 100644
index 0000000..bd9fde3
--- /dev/null
+++ b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA3_Item/CA313_tagCMItemDecompound.cs
@@ -0,0 +1,18 @@
+using UnityEngine;
+using System.Collections;
+
+// A3 13 物品拆解 #tagCMItemDecompound

+

+public class CA313_tagCMItemDecompound : GameNetPackBasic {

+    public byte Index;    // 拆解物品所在背包索引

+

+    public CA313_tagCMItemDecompound () {

+        combineCmd = (ushort)0x03FE;

+        _cmd = (ushort)0xA313;

+    }

+

+    public override void WriteToBytes () {

+        WriteBytes (Index, NetDataType.BYTE);

+    }

+

+}

diff --git a/Core/NetworkPackage/ClientPack/ClientToMapServer/CA3_Item/CA313_tagCMItemDecompound.cs.meta b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA3_Item/CA313_tagCMItemDecompound.cs.meta
new file mode 100644
index 0000000..afc0d86
--- /dev/null
+++ b/Core/NetworkPackage/ClientPack/ClientToMapServer/CA3_Item/CA313_tagCMItemDecompound.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 77eef483c79a1a244b31335edb236af7
+timeCreated: 1539335657
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/System/KnapSack/Logic/ItemTipsModel.cs b/System/KnapSack/Logic/ItemTipsModel.cs
index fcf71dc..f03284e 100644
--- a/System/KnapSack/Logic/ItemTipsModel.cs
+++ b/System/KnapSack/Logic/ItemTipsModel.cs
@@ -710,6 +710,41 @@
                 attrData.SetTipsFuncBtn(ItemWinBtnType.sell, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendSellQuest(ItemWinBtnType.sell,attrData); });
             }
 
+            List<int> dismantleReturnlist = attrData.GetUseDataModel((int)ItemUseDataKey.Def_IudetItemDecompound);
+            if (dismantleReturnlist != null && dismantleReturnlist.Count > 0)
+            {
+                int needGridCnt = 0;
+                for(int i = 0; i < dismantleReturnlist.Count; i++)
+                {
+                    if(i == 0)
+                    {
+                       if(dismantleReturnlist[i] != 0)
+                        {
+                            needGridCnt += 1;
+                        }
+                    }
+                    else
+                    {
+                        if((i-1) % 3 == 0)
+                        {
+                            if (dismantleReturnlist[i] != 0)
+                            {
+                                needGridCnt += 1;
+                            }
+                        }
+                    }
+                }
+
+                if(needGridCnt > playerPack.GetReaminGridCount(PackType.rptItem))
+                {
+                    SysNotifyMgr.Instance.ShowTip("BagFull102",attrData.itemConfig.ItemName,needGridCnt);
+                }
+                else
+                {
+                    attrData.SetTipsFuncBtn(ItemWinBtnType.dismantle, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendDismantleQuest(ItemWinBtnType.dismantle, attrData); });
+                }
+            }
+
             if (!isOverdue)
             {
                 if(attrData.itemConfig.JumpComposeCondi != null && attrData.itemConfig.JumpComposeCondi.Length > 0)
diff --git a/System/KnapSack/Logic/PackSendQuestMgr.cs b/System/KnapSack/Logic/PackSendQuestMgr.cs
index 353732b..3b3fc9c 100644
--- a/System/KnapSack/Logic/PackSendQuestMgr.cs
+++ b/System/KnapSack/Logic/PackSendQuestMgr.cs
@@ -1083,6 +1083,15 @@
         }
         #endregion
 
+        #region 鍙戦�佹媶瑙h姹�
+        public void SendDismantleQuest(ItemWinBtnType btnType, ItemAttrData attrData)
+        {
+            CA313_tagCMItemDecompound decompound = new CA313_tagCMItemDecompound();
+            decompound.Index = (byte)attrData.index;
+            GameNetSystem.Instance.SendInfo(decompound);
+        }
+        #endregion
+
         #region 鍙戦�佺画璐硅姹� 
         public void SendRenewalQuest(ItemWinBtnType btnType,int index)
         {
diff --git a/Utility/EnumHelper.cs b/Utility/EnumHelper.cs
index 2791376..0f6254e 100644
--- a/Utility/EnumHelper.cs
+++ b/Utility/EnumHelper.cs
@@ -1487,6 +1487,7 @@
     Def_IudetSuiteLV = 30,  //濂楄绛夌骇
     Def_IudetDogzEquipPlus = 31,  // 绁炲吔瑁呭寮哄寲淇℃伅鍒楄〃 [寮哄寲绛夌骇, 寮哄寲鐔熺粌搴
     Def_IudetHasOpenCnt = 32,  // 鐗╁搧绱Н寮�鍚鏁�
+    Def_IudetItemDecompound = 33,  //鍚堟垚鐗╁搧鎷嗚В杩旇繕鐗╁搧鍒楄〃 [瑁呭ID,鏉愭枡1ID,涓暟,鏄惁缁戝畾,鏉愭枡2ID,涓暟,鏄惁缁戝畾,...]
     Def_IudetCreateItemLoginDay = 34,  //鍒涘缓鐗╁搧鏃剁殑鐧诲綍澶╂暟
     Def_IudetLastOpenItemLoginDay = 36,  //涓婁竴娆″紑鍚墿鍝佹椂鐨勭櫥褰曞ぉ鏁�
     Def_IudetRuneLV = 38,  // 绗﹀嵃绛夌骇
@@ -1507,6 +1508,7 @@
 {
     makeUse, //浣跨敤
     putOn, //绌夸笂
+    dismantle, //鎷嗚В鍚堟垚瑁呭
     split, //鎷嗗垎
     putAway,//涓婃灦
     inlay, //闀跺祵

--
Gitblit v1.8.0