From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../PTC/Process/Process_RpcC2G_UseItem.cs | 99 ++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/PTC/Process/Process_RpcC2G_UseItem.cs (limited to 'Client/Assets/Scripts/XMainClient/PTC/Process/Process_RpcC2G_UseItem.cs') diff --git a/Client/Assets/Scripts/XMainClient/PTC/Process/Process_RpcC2G_UseItem.cs b/Client/Assets/Scripts/XMainClient/PTC/Process/Process_RpcC2G_UseItem.cs new file mode 100644 index 00000000..3c07ed1d --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/PTC/Process/Process_RpcC2G_UseItem.cs @@ -0,0 +1,99 @@ +using System; +using System.Reflection; +using KKSG; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class Process_RpcC2G_UseItem + { + public static void OnReply(UseItemArg oArg, UseItemRes oRes) + { + bool flag = oRes.ErrorCode == ErrorCode.ERR_INVALID_REQUEST; + if (flag) + { + XEquipCreateDocument.Doc.IsCreating = false; + string fullName = MethodBase.GetCurrentMethod().ReflectedType.FullName; + XSingleton.singleton.OnGetInvalidRequest(fullName); + } + else + { + bool flag2 = oRes.ErrorCode == ErrorCode.ERR_SUCCESS; + if (flag2) + { + XSingleton.singleton.UseItem = true; + bool flag3 = oArg.OpType == 7u; + if (flag3) + { + bool flag4 = DlgBase.singleton.IsVisible(); + if (flag4) + { + DlgBase.singleton.PlayUseItemEffect(true); + } + ItemBuffTable.RowData itembuffDataByID = XHomeCookAndPartyDocument.Doc.GetItembuffDataByID(oArg.itemID); + bool flag5 = itembuffDataByID != null; + if (flag5) + { + BuffTable.RowData buffData = XSingleton.singleton.GetBuffData((int)itembuffDataByID.Buffs[0, 0], (int)itembuffDataByID.Buffs[0, 1]); + bool flag6 = buffData != null; + if (flag6) + { + double num = Math.Round((double)(buffData.BuffDuration / 3600f), 1); + string text = string.Format(XSingleton.singleton.GetString("FoodBuffTip"), itembuffDataByID.Name, buffData.BuffName, num); + XSingleton.singleton.ShowSystemTip(text, "fece00"); + } + } + } + else + { + bool flag7 = oArg.OpType == 12u; + if (flag7) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("FASHION_STORAGE_SUCCESS"), "fece00"); + } + else + { + bool flag8 = oArg.itemID > 0u; + if (flag8) + { + ItemList.RowData itemConf = XBagDocument.GetItemConf((int)oArg.itemID); + bool flag9 = (int)itemConf.ItemType == XFastEnumIntEqualityComparer.ToInt(ItemType.Tarja); + if (flag9) + { + XSingleton.singleton.ShowSystemTip(XStringDefineProxy.GetString("USE_ITEM_SUCCESS_TARJA"), "fece00"); + } + } + } + } + bool flag10 = oRes.expand != null; + if (flag10) + { + XBagDocument.BagDoc.SetBagExpandData(oRes.expand, true); + } + } + bool flag11 = ItemUseMgr.GetItemUseValue(ItemUse.Composite) == oArg.OpType; + if (flag11) + { + XEquipCreateDocument.Doc.OnReqCreateEquipSet(oArg, oRes); + } + else + { + XCharacterItemDocument specificDocument = XDocuments.GetSpecificDocument(XCharacterItemDocument.uuID); + specificDocument.OnUseItem(oArg, oRes); + ArtifactBagDocument.Doc.OnUseItem(oArg, oRes); + bool flag12 = oRes.ErrorCode > ErrorCode.ERR_SUCCESS; + if (flag12) + { + XSingleton.singleton.ShowSystemTip(oRes.ErrorCode, "fece00"); + } + } + } + } + + public static void OnTimeout(UseItemArg oArg) + { + } + } +} -- cgit v1.1-26-g67d0