/// <summary> /// 刷新属性信息,以及对比信息 /// </summary> protected void RefreshProperty() { if (curEquipInfo == null) { return; } if (itemGS != null) { // 装备基础战力 + //装备基础战力 * 强化加成比例+装备基础战力*加星加成比例 + //附加属性战力*加星加成比例 + itemGS.text = curEquipInfo.GS.ToString(); } // if (itemLev != null) // itemLev.text = curEquipInfo.ItemStrColor + (curEquipInfo.UpgradeLv > 0?curEquipInfo.UpgradeLv.ToString():""); if (itemProf != null) { PlayerConfig playerConfig = ConfigMng.Instance.GetPlayerConfig(curEquipInfo.NeedProf); bool selfEquip = curEquipInfo.CheckClass(GameCenter.mainPlayerMng.MainPlayerInfo.Prof); string colorStr = selfEquip?"[00ff00]{0}[-]":"[ff0000]{0}[-]"; itemProf.text = playerConfig == null?string.Format(colorStr, ConfigMng.Instance.GetUItext(194)) : string.Format(colorStr, playerConfig.name); } if (itemSlot != null) { itemSlot.text = curEquipInfo.SlotName; } }
protected void RefreshBetter() { if (lowerFlag != null) { if (equipmentInfo == null || equipmentInfo.Family != EquipmentFamily.COSMETIC) { lowerFlag.gameObject.SetActive(false); return; } if (equipmentInfo.CheckClass(GameCenter.curMainPlayer.Prof) && equipmentInfo.BelongTo != EquipmentBelongTo.EQUIP) { lowerFlag.gameObject.SetActive(equipmentInfo.Slot != EquipSlot.None && GameCenter.inventoryMng.EquipDictionary.ContainsKey(equipmentInfo.Slot) && equipmentInfo.IsLower(GameCenter.inventoryMng.EquipDictionary[equipmentInfo.Slot])); } else { lowerFlag.gameObject.SetActive(false); } } }
public static void TryToUseAll(this EquipmentInfo _eq) { if (!_eq.IsEquip && !_eq.CanUse) { GameCenter.messageMng.AddClientMsg(428); return; } if (_eq.UseReqLevel > GameCenter.mainPlayerMng.MainPlayerInfo.CurLevel) { if (_eq.IsEquip) { GameCenter.messageMng.AddClientMsg(247); } else { GameCenter.messageMng.AddClientMsg(13); } return; } if (_eq.IsEquip) { if (!_eq.CheckClass(GameCenter.mainPlayerMng.MainPlayerInfo.Prof)) { GameCenter.messageMng.AddClientMsg(246); return; } GameCenter.inventoryMng.C2S_ReplaceItem(_eq); } else { if (_eq.ActionType == EquipActionType.open_ui) { if (GameCenter.inventoryMng != null) { GameCenter.inventoryMng.SkipWndById(_eq.OpenUiType); } else { Debug.Log(" inventoryMng 为null, 不能使用跳转界面功能"); } } else if (_eq.ActionType == EquipActionType.activate_title)//激活并使用该称号 { GameCenter.inventoryMng.C2S_UseItem(_eq); GameCenter.fashionMng.OpenFinshionTitleWnd(); } else { if (_eq.ActionType == EquipActionType.add_lucky)//使用祝福油跳转到祝福界面 { EquipmentInfo info = null; foreach (EquipmentInfo data in GameCenter.inventoryMng.GetPlayerEquipDic().Values) { if (data.Slot == EquipSlot.weapon) { info = data; } } if (info != null) { GameCenter.inventoryMng.curEquWeapon = info; GameCenter.uIMng.GenGUI(GUIType.BLESSWND, true); } else { GameCenter.messageMng.AddClientMsg(438); } return; } if (_eq.ActionType == EquipActionType.activate_illusion)//使用幻化物品跳到幻化界面 { if (GameCenter.mainPlayerMng.FunctionIsOpen(FunctionType.UNREAL)) { GameCenter.newMountMng.ShowMountSkinModel(_eq); } else { GameCenter.messageMng.AddClientMsg(389); return; } } if (_eq.Family == EquipmentFamily.POTION) { if (!GameCenter.mainPlayerMng.MainPlayerInfo.IsCanUseDrug) { GameCenter.messageMng.AddClientMsg(469); return; } } if (_eq.ActionType == EquipActionType.rename)//改名卡 { GameCenter.inventoryMng.InstanceID = _eq.InstanceID; GameCenter.uIMng.GenGUI(GUIType.RENAMECARD, true); return; } if (_eq.CanUseBatch && _eq.StackCurCount > 1)//批量使用所有物品 { GameCenter.inventoryMng.CurSelectInventory = _eq; GameCenter.inventoryMng.C2S_UseItems(_eq, _eq.StackCurCount); return; } GameCenter.inventoryMng.C2S_UseItem(_eq); } } }
public static void TryToUse(this EquipmentInfo _eq) { if (!_eq.IsEquip && !_eq.CanUse) { GameCenter.messageMng.AddClientMsg(428); return; } if (_eq.UseReqLevel > GameCenter.mainPlayerMng.MainPlayerInfo.CurLevel) { if (_eq.IsEquip) { GameCenter.messageMng.AddClientMsg(247); } else { GameCenter.messageMng.AddClientMsg(13); } return; } if (_eq.IsEquip) { if (!_eq.CheckClass(GameCenter.mainPlayerMng.MainPlayerInfo.Prof)) { GameCenter.messageMng.AddClientMsg(246); return; } EquipmentInfo info = GameCenter.inventoryMng.GetEquipFromEquipDicBySlot(_eq.Slot); bool isOpenExtend = GameCenter.mainPlayerMng.FunctionIsOpen(FunctionType.INHERITANCE); if (isOpenExtend && info != null && (info.EquipmentGs < _eq.EquipmentGs) && info.CanExtend && (info.UpgradeLv > _eq.UpgradeLv || info.LuckyLv > _eq.LuckyLv || info.EquOne > 0)) { MessageST mst = new MessageST(); mst.messID = 554; mst.delYes = (x) => { GameCenter.uIMng.SwitchToSubUI(SubGUIType.EQUIPMENTEXTEND); GameCenter.equipmentTrainingMng.CurSelectEquipmentInfo = info; GameCenter.equipmentTrainingMng.CurViceEquipmentInfo = _eq; }; mst.delNo = (y) => { GameCenter.inventoryMng.C2S_ReplaceItem(_eq); }; GameCenter.messageMng.AddClientMsg(mst); } else { GameCenter.inventoryMng.C2S_ReplaceItem(_eq); } } else { if (_eq.ActionType == EquipActionType.open_ui) { if (GameCenter.inventoryMng != null) { GameCenter.inventoryMng.SkipWndById(_eq.OpenUiType); } else { Debug.Log(" inventoryMng 为null, 不能使用跳转界面功能"); } //string[] uiType = _eq.OpenUiType.Split(','); //Debug.Log("_eq.OpenUiType:"+_eq.OpenUiType); //if(uiType.Length == 2) //{ // if(uiType[0].Equals("2")) // GameCenter.uIMng.SwitchToSubUI((SubGUIType)System.Enum.Parse(typeof(SubGUIType),uiType[1])); // else // GameCenter.uIMng.SwitchToUI((GUIType)System.Enum.Parse(typeof(GUIType),uiType[1])); //}else //{ // GameCenter.messageMng.AddClientMsg("open_ui参数配置错误!"); //} } else if (_eq.ActionType == EquipActionType.activate_title)//激活并使用该称号 { //GameCenter.titleMng.C2S_UseTitle(_eq.EID, 2); GameCenter.inventoryMng.C2S_UseItem(_eq); GameCenter.fashionMng.OpenFinshionTitleWnd(); } else { if (_eq.ActionType == EquipActionType.add_lucky)//使用祝福油跳转到祝福界面 { EquipmentInfo info = null; foreach (EquipmentInfo data in GameCenter.inventoryMng.GetPlayerEquipDic().Values) { if (data.Slot == EquipSlot.weapon) { info = data; } } if (info != null) { GameCenter.inventoryMng.curEquWeapon = info; GameCenter.uIMng.GenGUI(GUIType.BLESSWND, true); } else { GameCenter.messageMng.AddClientMsg(438); } return; } if (_eq.CanUseBatch && _eq.StackCurCount > 1)//可批量开启的物品使用 { //GameCenter.inventoryMng.OpenBatchUseWnd(_eq); GameCenter.inventoryMng.CurSelectInventory = _eq; GameCenter.uIMng.GenGUI(GUIType.IMMEDIATEUSE, true); return; } if (_eq.ActionType == EquipActionType.activate_illusion)//使用幻化物品跳到幻化界面 { if (GameCenter.mainPlayerMng.FunctionIsOpen(FunctionType.UNREAL)) { GameCenter.newMountMng.ShowMountSkinModel(_eq); } else { GameCenter.messageMng.AddClientMsg(389); return; } //GameCenter.uIMng.SwitchToSubUI(SubGUIType.ILLUSION); } if (_eq.Family == EquipmentFamily.POTION) { if (!GameCenter.mainPlayerMng.MainPlayerInfo.IsCanUseDrug) { GameCenter.messageMng.AddClientMsg(469); return; } } if (_eq.ActionType == EquipActionType.rename)//改名卡 { GameCenter.inventoryMng.InstanceID = _eq.InstanceID; GameCenter.uIMng.GenGUI(GUIType.RENAMECARD, true); return; } GameCenter.inventoryMng.C2S_UseItem(_eq); } } }