public static void GetItems_Exchange(Com.Game.Module.ItemType _type, string _id, bool _writeInModel = true) { MobaMessageManagerTools.SendClientMsg(ClientV2V.GetExchange, new object[] { _type, _id, _writeInModel }, false); }
public static Com.Game.Module.ItemType AnalyzeDropItemById(this ToolsFacade facade, string _dropItemId, out int id, out int count) { SysDropItemsVo dataById = BaseDataMgr.instance.GetDataById <SysDropItemsVo>(_dropItemId); Com.Game.Module.ItemType result = Com.Game.Module.ItemType.None; id = 0; count = 0; if (dataById == null) { Debug.LogError("Tools_Rewards: 不可处理的空掉落物品" + _dropItemId); return(result); } return(facade.AnalyzeDropItem(dataById.rewards, out id, out count)); }
public static string GetDropItemTypeName(this ToolsFacade facade, Com.Game.Module.ItemType targetType) { switch (targetType) { case Com.Game.Module.ItemType.Rune: return(LanguageManager.Instance.GetStringById("BattleSettlement_Runes")); case Com.Game.Module.ItemType.Diamond: return(LanguageManager.Instance.GetStringById("Currency_Diamond")); case Com.Game.Module.ItemType.Cap: return(LanguageManager.Instance.GetStringById("Currency_MagicBottle")); case Com.Game.Module.ItemType.HeadPortrait: return(LanguageManager.Instance.GetStringById("BattleSettlement_HeadAvatar")); case Com.Game.Module.ItemType.Hero: return(LanguageManager.Instance.GetStringById("BattleSettlement_Hero")); case Com.Game.Module.ItemType.HeroSkin: return(LanguageManager.Instance.GetStringById("BattleSettlement_Skin")); case Com.Game.Module.ItemType.Coin: return(LanguageManager.Instance.GetStringById("Currency_Gold")); case Com.Game.Module.ItemType.Bottle: return(LanguageManager.Instance.GetStringById("GameItems_Name_7777")); case Com.Game.Module.ItemType.Exp: return("经验值"); case Com.Game.Module.ItemType.NormalGameItem: return(LanguageManager.Instance.GetStringById("Currency_Items")); case Com.Game.Module.ItemType.Coupon: return("打折卡"); case Com.Game.Module.ItemType.PortraitFrame: return(LanguageManager.Instance.GetStringById("Currency_PictureFrame")); case Com.Game.Module.ItemType.GameBuff: return("召唤师增益卡"); case Com.Game.Module.ItemType.Speaker: return(LanguageManager.Instance.GetStringById("Currency_Horn")); } return(string.Empty); }
public static Com.Game.Module.ItemType AnalyzeDropItem(this ToolsFacade facade, string _dropItemStr, out int id, out int count) { Com.Game.Module.ItemType result = Com.Game.Module.ItemType.None; id = 0; count = 0; if (string.IsNullOrEmpty(_dropItemStr)) { Debug.LogError("Tools_Rewards: 不可处理的空字符串"); return(result); } string[] array = _dropItemStr.Split(new char[] { '|' }); if (array == null || array.Length != 3) { Debug.LogError("Tools_Rewards: 不合规则的错字符串" + _dropItemStr); return(result); } int num = int.Parse(array[0]); int num2 = int.Parse(array[1]); int num3 = int.Parse(array[2]); switch (num) { case 1: id = num2; count = num3; if (num2 == 1) { result = Com.Game.Module.ItemType.Coin; } else if (num2 == 2) { result = Com.Game.Module.ItemType.Diamond; } else if (num2 == 9) { result = Com.Game.Module.ItemType.Cap; } else if (num2 == 11) { result = Com.Game.Module.ItemType.Speaker; } break; case 2: { SysGameItemsVo dataById = BaseDataMgr.instance.GetDataById <SysGameItemsVo>(id.ToString()); id = num2; count = num3; if (id == 7777) { result = Com.Game.Module.ItemType.Bottle; } else if (dataById != null && dataById.type == 4) { result = Com.Game.Module.ItemType.Rune; } else { result = Com.Game.Module.ItemType.NormalGameItem; } break; } case 3: count = 1; id = num3; if (num2 == 1) { result = Com.Game.Module.ItemType.Hero; } else if (num2 == 2) { result = Com.Game.Module.ItemType.HeroSkin; } else if (num2 == 3) { result = Com.Game.Module.ItemType.HeadPortrait; } else if (num2 == 4) { result = Com.Game.Module.ItemType.PortraitFrame; } else if (num2 == 5) { result = Com.Game.Module.ItemType.Coupon; } break; case 4: count = num3; id = 0; if (num2 == 1) { result = Com.Game.Module.ItemType.Exp; } break; case 6: count = 1; id = num2; result = Com.Game.Module.ItemType.GameBuff; break; } return(result); }
private void OnGetMsg_UserDataCode(OperationResponse operationResponse) { string arg = operationResponse[10] as string; string arg2 = operationResponse[59] as string; byte[] buffer = operationResponse[246] as byte[]; List <DropItemData> list = SerializeHelper.Deserialize <List <DropItemData> >(buffer); if (list == null || list.Count < 1) { return; } foreach (DropItemData current in list) { Com.Game.Module.ItemType dropItemType = ToolsFacade.Instance.GetDropItemType(current); string text = ToolsFacade.Instance.GetDropItemTypeName(dropItemType); Com.Game.Module.ItemType itemType = dropItemType; if (itemType != Com.Game.Module.ItemType.HeroSkin) { if (itemType == Com.Game.Module.ItemType.NormalGameItem) { SysGameItemsVo dataById = BaseDataMgr.instance.GetDataById <SysGameItemsVo>(current.itemId.ToString()); SysCustomizationVo dataById2 = BaseDataMgr.instance.GetDataById <SysCustomizationVo>(current.itemId.ToString()); if (dataById2 != null && dataById2.customization_type != 1 && dataById.quality < 5) { break; } string text2; switch (dataById.quality) { case 3: text2 = "[C138F9]史诗级"; break; case 4: text2 = "[ECC16F]传说级"; break; case 5: text2 = "[f81841]典藏级"; break; default: text2 = string.Empty; break; } text = string.Concat(new string[] { text2, text, "【", LanguageManager.Instance.GetStringById(dataById.name), "】" }); } } else { SysHeroSkinVo dataById3 = BaseDataMgr.instance.GetDataById <SysHeroSkinVo>(current.itemCount.ToString()); text = string.Concat(new string[] { (dataById3.quality != 5) ? "[ECC16F]传说级" : "[f81841]典藏级", text, "【", LanguageManager.Instance.GetStringById(dataById3.name), "】" }); } this.data.otherMsgQueue.Enqueue(string.Format("天降鸿运!恭喜[e3905b]{0}[-]在{1}中获得{2}", arg2, arg, text)); } }