| File was renamed from System/KnapSack/Logic/PackSendQuestMgr.cs |
| | |
| | | FairyModel fairyModel { get { return ModelCenter.Instance.GetModel<FairyModel>(); } }
|
| | | BoxGetItemModel BoxModel { get { return ModelCenter.Instance.GetModel<BoxGetItemModel>(); } }
|
| | | VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } }
|
| | | PlayerSuitModel SuitModel { get { return ModelCenter.Instance.GetModel<PlayerSuitModel>(); } }
|
| | | PlayerSuitModel suitModel { get { return ModelCenter.Instance.GetModel<PlayerSuitModel>(); } } |
| | | RolePointModel rolePointModel { get { return ModelCenter.Instance.GetModel<RolePointModel>(); } }
|
| | | DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } }
|
| | |
|
| | | #region 发送穿戴装备的请求
|
| | | |
| | | public ItemModel selectedItem { get; private set; } |
| | | ItemConfig sendItemConfig = null;
|
| | | public ItemModel sendItemModel = null;
|
| | | int itemIndex = -1;
|
| | | public void PutOnItem(ItemWinBtnType btnType, string guid)
|
| | | public void PutOnItem(ItemOperateType btnType, string guid) |
| | | {
|
| | | sendItemModel = playerPack.GetItemModelByGUID(guid);
|
| | | if (sendItemModel == null)
|
| | | selectedItem = playerPack.GetItemModelByGUID(guid); |
| | | if (selectedItem == null) |
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | var itemId = sendItemModel.itemInfo.ItemID;
|
| | | sendItemConfig = ItemConfig.Get(sendItemModel.itemInfo.ItemID);
|
| | | var itemId = selectedItem.itemInfo.ItemID; |
| | | sendItemConfig = ItemConfig.Get(selectedItem.itemInfo.ItemID); |
| | | if (sendItemConfig.JobLimit != 0 && sendItemConfig.JobLimit / 100 != PlayerDatas.Instance.baseData.Job)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GeRen_lhs_31379");
|
| | | return;
|
| | | }
|
| | |
|
| | | itemIndex = sendItemModel.itemInfo.ItemPlace;
|
| | | var putOnLimits = sendItemModel.GetUseDataModel((int)ItemUseDataKey.cancelUseLimit);
|
| | | itemIndex = selectedItem.itemInfo.ItemPlace; |
| | | var putOnLimits = selectedItem.GetUseDataModel((int)ItemUseDataKey.cancelUseLimit); |
| | | if (putOnLimits != null)
|
| | | {
|
| | | if (putOnLimits[0] == 1)
|
| | |
| | | }
|
| | | break;
|
| | | case 1:
|
| | | wearable = CheckPutOnRealm(config);
|
| | | wearable = CheckPutOnRealm(itemId); |
| | | break;
|
| | | case 2:
|
| | | wearable = CheckPutOnNeed();
|
| | | wearable = CheckPutOnNeed(itemId); |
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | private Dictionary<AttrEnum, int> sumNeedlist = new Dictionary<AttrEnum, int>();
|
| | | private float sumOffsetPoint = 0;
|
| | | private int sumNeedPoint = 0;
|
| | | private bool CheckPutOnNeed()
|
| | | |
| | | private bool CheckPutOnNeed(int itemId) |
| | | {
|
| | | var config = ItemConfig.Get(itemId); |
| | | int playerJob = PlayerDatas.Instance.baseData.Job;
|
| | | if (playerJob != Math.Floor((double)sendItemConfig.JobLimit / 100) && sendItemConfig.JobLimit != 0)
|
| | | if (playerJob != Math.Floor((double)config.JobLimit / 100) && config.JobLimit != 0) |
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GeRen_lhs_31379");
|
| | | return false;
|
| | | }
|
| | |
|
| | | int jobRank = sendItemConfig.JobLimit % 10;
|
| | | int jobRank = config.JobLimit % 10; |
| | | offsetConditionStr.Length = 0;
|
| | | sumOffsetlist.Clear();
|
| | | sumNeedlist.Clear();
|
| | |
| | | needConditionStr.Length = 0;
|
| | | upgradConditionStr.Length = 0;
|
| | | float offset = 0;
|
| | | if (sendItemConfig.LimitSTR != 0)
|
| | | if (config.LimitSTR != 0) |
| | | {
|
| | | offset = sendItemConfig.LimitSTR - UIHelper.GetPropertyMapPlayerData(AttrEnum.POWER);
|
| | | offset = config.LimitSTR - UIHelper.GetPropertyMapPlayerData(AttrEnum.POWER); |
| | | if (offset > 0)
|
| | | {
|
| | | if (offsetConditionStr.Length > 0)
|
| | |
| | |
|
| | | if (upgradConditionStr.Length > 0)
|
| | | {
|
| | | upgradConditionStr.Append("\n" + Language.Get("KnapS141", Language.Get("KnapS136", sendItemConfig.LimitSTR), offset));
|
| | | upgradConditionStr.Append("\n" + Language.Get("KnapS141", Language.Get("KnapS136", config.LimitSTR), offset)); |
| | | }
|
| | | else
|
| | | {
|
| | | upgradConditionStr.Append(Language.Get("KnapS141", Language.Get("KnapS136", sendItemConfig.LimitSTR), offset));
|
| | | upgradConditionStr.Append(Language.Get("KnapS141", Language.Get("KnapS136", config.LimitSTR), offset)); |
| | | }
|
| | |
|
| | | sumOffsetPoint += offset;
|
| | | sumNeedPoint += sendItemConfig.LimitSTR;
|
| | | sumNeedPoint += config.LimitSTR; |
| | | sumOffsetlist.Add(AttrEnum.POWER, offset);
|
| | | }
|
| | | sumNeedlist.Add(AttrEnum.POWER, sendItemConfig.LimitSTR);
|
| | | sumNeedlist.Add(AttrEnum.POWER, config.LimitSTR); |
| | | if (needConditionStr.Length > 0)
|
| | | {
|
| | | needConditionStr.Append("\n" + Language.Get("KnapS136", sendItemConfig.LimitSTR));
|
| | | needConditionStr.Append("\n" + Language.Get("KnapS136", config.LimitSTR)); |
| | | }
|
| | | else
|
| | | {
|
| | | needConditionStr.Append(Language.Get("KnapS136", sendItemConfig.LimitSTR));
|
| | | needConditionStr.Append(Language.Get("KnapS136", config.LimitSTR)); |
| | | } |
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | if (sendItemConfig.LimitPHY != 0)
|
| | | if (config.LimitPHY != 0) |
| | | {
|
| | | offset = sendItemConfig.LimitPHY - UIHelper.GetPropertyMapPlayerData(AttrEnum.AGILITY);
|
| | | offset = config.LimitPHY - UIHelper.GetPropertyMapPlayerData(AttrEnum.AGILITY); |
| | | if (offset > 0)
|
| | | {
|
| | | if (offsetConditionStr.Length > 0)
|
| | |
| | |
|
| | | if (upgradConditionStr.Length > 0)
|
| | | {
|
| | | upgradConditionStr.Append("\n" + Language.Get("KnapS141", Language.Get("KnapS135", sendItemConfig.LimitPHY), offset));
|
| | | upgradConditionStr.Append("\n" + Language.Get("KnapS141", Language.Get("KnapS135", config.LimitPHY), offset)); |
| | | }
|
| | | else
|
| | | {
|
| | | upgradConditionStr.Append(Language.Get("KnapS141", Language.Get("KnapS135", sendItemConfig.LimitPHY), offset));
|
| | | upgradConditionStr.Append(Language.Get("KnapS141", Language.Get("KnapS135", config.LimitPHY), offset)); |
| | | }
|
| | |
|
| | | sumOffsetPoint += offset;
|
| | | sumNeedPoint += sendItemConfig.LimitPHY;
|
| | | sumNeedPoint += config.LimitPHY; |
| | | sumOffsetlist.Add(AttrEnum.AGILITY, offset);
|
| | | }
|
| | | sumNeedlist.Add(AttrEnum.AGILITY, sendItemConfig.LimitPHY);
|
| | | sumNeedlist.Add(AttrEnum.AGILITY, config.LimitPHY); |
| | | if (needConditionStr.Length > 0)
|
| | | {
|
| | | needConditionStr.Append("\n" + Language.Get("KnapS135", sendItemConfig.LimitPHY));
|
| | | needConditionStr.Append("\n" + Language.Get("KnapS135", config.LimitPHY)); |
| | | }
|
| | | else
|
| | | {
|
| | | needConditionStr.Append(Language.Get("KnapS135", sendItemConfig.LimitPHY));
|
| | | needConditionStr.Append(Language.Get("KnapS135", config.LimitPHY)); |
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | if (sendItemConfig.LimitPNE != 0)
|
| | | if (config.LimitPNE != 0) |
| | | {
|
| | | offset = sendItemConfig.LimitPNE - UIHelper.GetPropertyMapPlayerData(AttrEnum.MENTALITY);
|
| | | offset = config.LimitPNE - UIHelper.GetPropertyMapPlayerData(AttrEnum.MENTALITY); |
| | | if (offset > 0)
|
| | | {
|
| | | if (offsetConditionStr.Length > 0)
|
| | |
| | |
|
| | | if (upgradConditionStr.Length > 0)
|
| | | {
|
| | | upgradConditionStr.Append("\n" + Language.Get("KnapS141", Language.Get("KnapS137", sendItemConfig.LimitPNE), offset));
|
| | | upgradConditionStr.Append("\n" + Language.Get("KnapS141", Language.Get("KnapS137", config.LimitPNE), offset)); |
| | | }
|
| | | else
|
| | | {
|
| | | upgradConditionStr.Append(Language.Get("KnapS141", Language.Get("KnapS137", sendItemConfig.LimitPNE), offset));
|
| | | upgradConditionStr.Append(Language.Get("KnapS141", Language.Get("KnapS137", config.LimitPNE), offset)); |
| | | }
|
| | |
|
| | | sumOffsetPoint += offset;
|
| | | sumOffsetlist.Add(AttrEnum.MENTALITY, offset);
|
| | | sumNeedPoint += sendItemConfig.LimitPNE;
|
| | | sumNeedPoint += config.LimitPNE; |
| | | }
|
| | | sumNeedlist.Add(AttrEnum.MENTALITY, sendItemConfig.LimitPNE);
|
| | | sumNeedlist.Add(AttrEnum.MENTALITY, config.LimitPNE); |
| | |
|
| | | if (needConditionStr.Length > 0)
|
| | | {
|
| | | needConditionStr.Append("\n" + Language.Get("KnapS137", sendItemConfig.LimitPNE));
|
| | | needConditionStr.Append("\n" + Language.Get("KnapS137", config.LimitPNE)); |
| | | }
|
| | | else
|
| | | {
|
| | | needConditionStr.Append(Language.Get("KnapS137", sendItemConfig.LimitPNE));
|
| | | needConditionStr.Append(Language.Get("KnapS137", config.LimitPNE)); |
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | private StringBuilder curRealmImgStr = new StringBuilder();
|
| | | private StringBuilder needRealmImgStr = new StringBuilder();
|
| | | private bool CheckPutOnRealm(ItemConfig config)
|
| | | private bool CheckPutOnRealm(int itemId) |
| | | {
|
| | | var config = ItemConfig.Get(itemId); |
| | | curRealmImgStr.Length = 0;
|
| | | needRealmImgStr.Length = 0;
|
| | | var _realmLv = config.RealmLimit;
|
| | |
| | | bool isSameEquip = false;
|
| | | switch ((RoleEquipType)sendItemConfig.EquipPlace)
|
| | | {
|
| | | case RoleEquipType.retFairyCan:
|
| | | case RoleEquipType.FairyCan: |
| | | isSameEquip = true;
|
| | | putOnModel1 = playerPack.GetItemModelByIndex(PackType.Equip, sendItemConfig.EquipPlace);
|
| | | putOnModel2 = playerPack.GetItemModelByIndex(PackType.Equip, (int)RoleEquipType.retFairyCan2);
|
| | | putOnModel2 = playerPack.GetItemModelByIndex(PackType.Equip, (int)RoleEquipType.FairyCan2); |
| | | break;
|
| | | case RoleEquipType.JadeDynasty_Glove1:
|
| | | isSameEquip = true;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | CheckSuitReplaceInfo(sendItemConfig.EquipPlace, sendItemModel);
|
| | | CheckSuitReplaceInfo(sendItemConfig.EquipPlace, selectedItem); |
| | | }
|
| | |
|
| | | public void CheckSuitReplaceInfo(int equipPlace, ItemModel item)
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | var replaceDic = SuitModel.SetReplaceSuitModel(item.itemId, equipPlace);
|
| | | if (replaceDic[SuitType.LowSuit].isNoEffect && !replaceDic[SuitType.HighSuit].isNoEffect)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("ReplaceSuitPrompt102", UIHelper.GetEquipAreaName(equipPlace), Language.Get("EquipSuitNormal2")),
|
| | | (bool isOK) =>
|
| | | {
|
| | | if (isOK)
|
| | | {
|
| | | PutOnEquip(equipPlace, itemIndex, item);
|
| | | }
|
| | | }
|
| | | );
|
| | | return;
|
| | | }
|
| | | else if (replaceDic[SuitType.LowSuit].isPerfect && replaceDic[SuitType.HighSuit].isNoEffect)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("ReplaceSuitPrompt102", UIHelper.GetEquipAreaName(equipPlace), Language.Get("EquipSuitHigh")),
|
| | | (bool isOK) =>
|
| | | {
|
| | | if (isOK)
|
| | | {
|
| | | PutOnEquip(equipPlace, itemIndex, item);
|
| | | }
|
| | | }
|
| | | );
|
| | | return;
|
| | | }
|
| | | else if (replaceDic[SuitType.LowSuit].isNoEffect && replaceDic[SuitType.HighSuit].isNoEffect)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("ReplaceSuitPrompt104", UIHelper.GetEquipAreaName(equipPlace)),
|
| | | (bool isOK) =>
|
| | | {
|
| | | if (isOK)
|
| | | {
|
| | | PutOnEquip(equipPlace, itemIndex, item);
|
| | | }
|
| | | }
|
| | | );
|
| | | return;
|
| | | }
|
| | | else if (replaceDic[SuitType.LowSuit].effectLv > 0 && replaceDic[SuitType.HighSuit].effectLv <= 0
|
| | | && !replaceDic[SuitType.HighSuit].isNoEffect)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("ReplaceSuitPrompt101", UIHelper.GetEquipAreaName(equipPlace), Language.Get("EquipSuitNormal2"), replaceDic[SuitType.LowSuit].effectLv),
|
| | | (bool isOK) =>
|
| | | {
|
| | | if (isOK)
|
| | | {
|
| | | PutOnEquip(equipPlace, itemIndex, item);
|
| | | }
|
| | | }
|
| | | );
|
| | | return;
|
| | | }
|
| | | else if (replaceDic[SuitType.HighSuit].effectLv > 0 && replaceDic[SuitType.LowSuit].effectLv <= 0)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("ReplaceSuitPrompt101", UIHelper.GetEquipAreaName(equipPlace), Language.Get("EquipSuitHigh"), replaceDic[SuitType.LowSuit].effectLv),
|
| | | (bool isOK) =>
|
| | | {
|
| | | if (isOK)
|
| | | {
|
| | | PutOnEquip(equipPlace, itemIndex, item);
|
| | | }
|
| | | }
|
| | | );
|
| | | return;
|
| | | }
|
| | | else if (replaceDic[SuitType.HighSuit].isNoEffect && replaceDic[SuitType.LowSuit].effectLv > 0)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("ReplaceSuitPrompt103", UIHelper.GetEquipAreaName(equipPlace), replaceDic[SuitType.LowSuit].effectLv),
|
| | | (bool isOK) =>
|
| | | {
|
| | | if (isOK)
|
| | | {
|
| | | PutOnEquip(equipPlace, itemIndex, item);
|
| | | }
|
| | | }
|
| | | );
|
| | | return;
|
| | | }
|
| | | else if (replaceDic[SuitType.LowSuit].effectLv > 0 && replaceDic[SuitType.HighSuit].effectLv > 0)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),
|
| | | Language.Get("ReplaceSuitPrompt105", UIHelper.GetEquipAreaName(equipPlace), replaceDic[SuitType.HighSuit].effectLv, replaceDic[SuitType.LowSuit].effectLv),
|
| | | (bool isOK) =>
|
| | | {
|
| | | if (isOK)
|
| | | {
|
| | | PutOnEquip(equipPlace, itemIndex, item);
|
| | | }
|
| | | }
|
| | | );
|
| | | return;
|
| | | }
|
| | |
|
| | | if (item.packType == PackType.JadeDynastyItem)
|
| | | {
|
| | | if (equipPlace >= (int)RoleEquipType.JadeDynasty_Cloak
|
| | | && equipPlace <= (int)RoleEquipType.JadeDynasty_Sword4)
|
| | | if (equipPlace >= (int)RoleEquipType.JadeDynasty_Cloak && equipPlace <= (int)RoleEquipType.JadeDynasty_Sword4) |
| | | {
|
| | | var jadeDynastyModel = ModelCenter.Instance.GetModel<JadeDynastyEquipModel>();
|
| | | bool islock = jadeDynastyModel.IsLockEquipPlace(equipPlace);
|
| | |
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | if (item != null && item.config.BindType == 1)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("JadeDynastyEquip5"), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | PutOnEquip(equipPlace, itemIndex, item);
|
| | | }
|
| | | });
|
| | | |
| | | var replaceDic = suitModel.SetReplaceSuitModel(item.itemId, equipPlace); |
| | | var replaceTip = string.Empty; |
| | | var isReplace = false; |
| | | var equipPlaceName = UIHelper.GetEquipPlaceName(equipPlace); |
| | | var lowSuitResult = replaceDic[SuitType.LowSuit]; |
| | | var highSuitResult = replaceDic[SuitType.HighSuit]; |
| | | |
| | | if (lowSuitResult.isNoEffect && !highSuitResult.isNoEffect) |
| | | { |
| | | replaceTip = Language.Get("ReplaceSuitPrompt102", equipPlaceName, Language.Get("EquipSuitNormal2")); |
| | | isReplace = true; |
| | | } |
| | | else if (lowSuitResult.isPerfect && highSuitResult.isNoEffect) |
| | | { |
| | | replaceTip = Language.Get("ReplaceSuitPrompt102", equipPlaceName, Language.Get("EquipSuitHigh")); |
| | | isReplace = true; |
| | | return;
|
| | | }
|
| | | else if (lowSuitResult.isNoEffect && highSuitResult.isNoEffect) |
| | | { |
| | | replaceTip = Language.Get("ReplaceSuitPrompt104", equipPlaceName); |
| | | isReplace = true; |
| | | } |
| | | else if (lowSuitResult.effectLv > 0 && highSuitResult.effectLv <= 0 |
| | | && !highSuitResult.isNoEffect) |
| | | { |
| | | replaceTip = Language.Get("ReplaceSuitPrompt101", equipPlaceName, Language.Get("EquipSuitNormal2"), lowSuitResult.effectLv); |
| | | isReplace = true; |
| | | } |
| | | else if (highSuitResult.effectLv > 0 && lowSuitResult.effectLv <= 0) |
| | | { |
| | | replaceTip = Language.Get("ReplaceSuitPrompt101", equipPlaceName, Language.Get("EquipSuitHigh"), lowSuitResult.effectLv); |
| | | isReplace = true; |
| | | } |
| | | else if (highSuitResult.isNoEffect && lowSuitResult.effectLv > 0) |
| | | { |
| | | replaceTip = Language.Get("ReplaceSuitPrompt103", equipPlaceName, lowSuitResult.effectLv); |
| | | isReplace = true; |
| | | } |
| | | else if (lowSuitResult.effectLv > 0 && highSuitResult.effectLv > 0) |
| | | { |
| | | replaceTip = Language.Get("ReplaceSuitPrompt105", equipPlaceName, highSuitResult.effectLv, lowSuitResult.effectLv); |
| | | isReplace = true; |
| | | }
|
| | |
|
| | | if (item.packType == PackType.JadeDynastyItem) |
| | | { |
| | | if (item != null && item.config.BindType == 1) |
| | | { |
| | | replaceTip = Language.Get("JadeDynastyEquip5"); |
| | | isReplace = true; |
| | | } |
| | | } |
| | | |
| | | if (isReplace) |
| | | { |
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), replaceTip, |
| | | (bool ok) => |
| | | { |
| | | if (ok) |
| | | { |
| | | PutOnEquip(equipPlace, itemIndex, item);
|
| | | } |
| | | } |
| | | ); |
| | | } |
| | | else |
| | | { |
| | | PutOnEquip(equipPlace, itemIndex, item); |
| | | } |
| | | }
|
| | |
|
| | | public void PutOnEquip(int equipPlace, int itemIndex, ItemModel oldItem)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | if (SuitModel.IsPerfectGetSuitLv(sendItemConfig.ID, equipPlace))
|
| | | if (suitModel.IsPerfectGetSuitLv(sendItemConfig.ID, equipPlace)) |
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("SwitchEquip_SuitPanel");
|
| | | }
|
| | |
| | | #endregion
|
| | |
|
| | | #region 发送脱下装备的请求
|
| | | public void PutOffEquip(ItemWinBtnType btnType, string guid)
|
| | | public void PutOffEquip(ItemOperateType btnType, string guid) |
| | | {
|
| | | var item = playerPack.GetItemModelByGUID(guid);
|
| | | if (item == null)
|
| | |
| | | #endregion
|
| | |
|
| | | #region 发送放入仓库请求
|
| | | public void PutInWareHouse(ItemWinBtnType btnType, string guid)
|
| | | public void PutInWareHouse(ItemOperateType btnType, string guid) |
| | | {
|
| | | var itemModel = playerPack.GetItemModelByGUID(guid);
|
| | | if (itemModel == null)
|
| | |
| | | #endregion
|
| | |
|
| | | #region 发送从仓库取出请求
|
| | | public void TakeOutFromWarehouse(ItemWinBtnType btnType, string guid)
|
| | | public void TakeOutFromWarehouse(ItemOperateType btnType, string guid) |
| | | {
|
| | | var itemModel = playerPack.GetItemModelByGUID(guid);
|
| | | if (itemModel == null)
|
| | |
| | | #region 发送使用物品请求
|
| | |
|
| | | public ItemModel useItemModel { get; set; }
|
| | | public void UseItem(ItemWinBtnType btnType, int itemIndex)
|
| | | public void UseItem(ItemOperateType btnType, int itemIndex) |
| | | {
|
| | | var singlePack = playerPack.GetSinglePackModel(PackType.Item);
|
| | | if (singlePack == null)
|
| | |
| | | }
|
| | | if (playerPack.CheckIsDrugById(useItemModel.itemInfo.ItemID))
|
| | | {
|
| | | if (CheckItemUselimit(useItemModel.config))
|
| | | if (CheckItemUselimit(useItemModel.itemId)) |
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.MakeDrug);
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public bool CheckItemUselimit(ItemConfig config)
|
| | | public bool CheckItemUselimit(int itemId) |
| | | {
|
| | | var config = ItemConfig.Get(itemId); |
| | | int[] uselimits = config.UseCondiType;
|
| | | if (uselimits == null) return true;
|
| | |
|
| | |
| | | }
|
| | | break;
|
| | | case 1:
|
| | | return CheckPutOnRealm(config);
|
| | | return CheckPutOnRealm(itemId); |
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | public bool CheckUseCondition(ItemModel itemModel)
|
| | | {
|
| | | if (!CheckItemUselimit(itemModel.config))
|
| | | if (!CheckItemUselimit(itemModel.itemId)) |
| | | {
|
| | | return false;
|
| | | }
|
| | |
| | | #endregion
|
| | |
|
| | | #region 发送拆分请求
|
| | | public void OnClickSplitBtn(ItemWinBtnType btnType, string guid)
|
| | | public void OnClickSplitBtn(ItemOperateType btnType, string guid) |
| | | {
|
| | | WindowCenter.Instance.Open<SplitWin>();
|
| | | }
|
| | |
| | | #endregion
|
| | |
|
| | | #region 发送上架请求
|
| | | public void PutAwayItem(ItemWinBtnType btnType, string guid)
|
| | | public void PutAwayItem(ItemOperateType btnType, string guid) |
| | | {
|
| | | var itemModel = playerPack.GetItemModelByGUID(guid);
|
| | | if (itemModel == null || itemModel.packType != PackType.Item)
|
| | |
| | | #endregion
|
| | |
|
| | | #region 点击镶嵌按钮
|
| | | public void GotoInlayItem(ItemWinBtnType btnType, string guid)
|
| | | public void GotoInlayItem(ItemOperateType btnType, string guid) |
| | | {
|
| | | var model = playerPack.GetItemModelByGUID(guid);
|
| | | var packType = GeneralDefine.GetPackTypeByItemType(model.config.Type);
|
| | |
| | | #endregion
|
| | |
|
| | | #region 点击合成按钮
|
| | | public void GotoComposeItem(ItemWinBtnType btnType, int jumpId)
|
| | | public void GotoComposeItem(ItemOperateType btnType, int jumpId) |
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)jumpId);
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 发送出售请求
|
| | | public void SellItem(ItemWinBtnType btnType, ItemAttrData attrData)
|
| | | public void SellItem(ItemOperateType btnType, ItemAttrData attrData) |
| | | {
|
| | | if (attrData.itemConfig.EquipPlace > 0 && attrData.itemConfig.EquipPlace <= (int)RoleEquipType.retSpiritAnimal)
|
| | | if (attrData.itemConfig.EquipPlace > 0 && attrData.itemConfig.EquipPlace <= (int)RoleEquipType.SpiritAnimal) |
| | | {
|
| | | bool isOverdue = modelInterface.IsOverdue(attrData.guid, attrData.itemConfig.ID, attrData.useDataDict);
|
| | | bool isLimit = Math.Floor((double)attrData.itemConfig.JobLimit / 100) == PlayerDatas.Instance.baseData.Job
|
| | | || attrData.itemConfig.JobLimit == 0 ? true : false;
|
| | | ItemModel putModel = playerPack.GetItemModelByIndex(PackType.Equip, attrData.itemConfig.EquipPlace);
|
| | | if (attrData.itemConfig.EquipPlace == (int)RoleEquipType.retFairyCan)
|
| | | if (attrData.itemConfig.EquipPlace == (int)RoleEquipType.FairyCan) |
| | | {
|
| | | ItemModel fairy2Model = playerPack.GetItemModelByIndex(PackType.Equip, (int)RoleEquipType.retFairyCan2);
|
| | | ItemModel fairy2Model = playerPack.GetItemModelByIndex(PackType.Equip, (int)RoleEquipType.FairyCan2); |
| | | if (fairy2Model == null || putModel == null)
|
| | | {
|
| | | putModel = null;
|
| | |
| | | {
|
| | | if (putModel == null)
|
| | | {
|
| | | SetSellItemPrompt(attrData, "KnapS147", UIHelper.GetEquipAreaName(attrData.itemConfig.EquipPlace));
|
| | | SetSellItemPrompt(attrData, "KnapS147", UIHelper.GetEquipPlaceName(attrData.itemConfig.EquipPlace)); |
| | | }
|
| | | else
|
| | | {
|
| | |
| | | #endregion
|
| | |
|
| | | #region 发送拆解请求
|
| | | public void DismantleItem(ItemWinBtnType btnType, ItemAttrData attrData)
|
| | | public void DismantleItem(ItemOperateType btnType, ItemAttrData attrData) |
| | | {
|
| | | List<int> dismantleReturnlist = attrData.GetUseDataModel((int)ItemUseDataKey.itemDecompound);
|
| | | int needGridCnt = 0;
|
| | |
| | | #endregion
|
| | |
|
| | | #region 发送续费请求
|
| | | public void RenewalItem(ItemWinBtnType btnType, string guid)
|
| | | public void RenewalItem(ItemOperateType btnType, string guid) |
| | | {
|
| | | GuardOverdueWin.guid = guid;
|
| | | WindowCenter.Instance.Open<GuardOverdueWin>();
|
| | |
| | | #endregion
|
| | |
|
| | | #region 解锁背包格子数据
|
| | | public int OpenCount {
|
| | | public int OpenCount |
| | | { |
| | | get; private set;
|
| | | }
|
| | |
|
| | | public PackType packType {
|
| | | public PackType packType |
| | | { |
| | | get; private set;
|
| | | }
|
| | |
|
| | | public int Index {
|
| | | public int Index |
| | | { |
| | | get; private set;
|
| | | }
|
| | |
|