using Snxxz.UI;
|
using System.Collections.Generic;
|
using System.Text;
|
using UnityEngine;
|
using System;
|
|
namespace Snxxz.UI
|
{
|
[XLua.LuaCallCSharp]
|
public class ItemLogicUtility : Singleton<ItemLogicUtility>
|
{
|
PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
ItemTipsModel itemTipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
PlayerStrengthengDatas strengthModel { get { return ModelCenter.Instance.GetModel<PlayerStrengthengDatas>(); } }
|
EquipWashModel equipWashModel { get { return ModelCenter.Instance.GetModel<EquipWashModel>(); } }
|
PackModelInterface modelInterface { get { return ModelCenter.Instance.GetModel<PackModelInterface>(); } }
|
PlayerBuffDatas Buffmodel { get { return ModelCenter.Instance.GetModel<PlayerBuffDatas>(); } }
|
ItemOverdueModel itemOverdue { get { return ModelCenter.Instance.GetModel<ItemOverdueModel>(); } }
|
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>(); } }
|
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;
|
int itemIndex = -1;
|
public void PutOnItem(ItemOperateType btnType, string guid)
|
{
|
selectedItem = playerPack.GetItemModelByGUID(guid);
|
if (selectedItem == null)
|
{
|
return;
|
}
|
|
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 = selectedItem.itemInfo.ItemPlace;
|
var putOnLimits = selectedItem.GetUseDataModel((int)ItemUseDataKey.cancelUseLimit);
|
if (putOnLimits != null)
|
{
|
if (putOnLimits[0] == 1)
|
{
|
CheckPutOnPlace();
|
}
|
else
|
{
|
CheckEquipUseLimit(itemId);
|
}
|
}
|
else
|
{
|
CheckEquipUseLimit(itemId);
|
}
|
}
|
|
bool CheckEquipUseLimit(int itemId)
|
{
|
var config = ItemConfig.Get(itemId);
|
int[] uselimits = config.UseCondiType;
|
if (uselimits == null || uselimits.Length < 1)
|
{
|
CheckPutOnPlace();
|
return true;
|
}
|
|
bool wearable = true;
|
for (int i = 0; i < uselimits.Length; i++)
|
{
|
switch (uselimits[i])
|
{
|
case 0:
|
var level = PlayerDatas.Instance.baseData.LV;
|
if (level < config.UseLV)
|
{
|
wearable = false;
|
ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),
|
Language.Get("EquipWinLevelLimit", config.UseLV, config.UseLV - level));
|
}
|
break;
|
case 1:
|
wearable = CheckPutOnRealm(itemId);
|
break;
|
case 2:
|
wearable = CheckPutOnNeed(itemId);
|
break;
|
}
|
}
|
|
if (wearable)
|
{
|
CheckPutOnPlace();
|
}
|
|
return wearable;
|
}
|
|
/// <summary>
|
/// 检测穿戴装备所需要的条件
|
/// </summary>
|
private StringBuilder offsetConditionStr = new StringBuilder();
|
private StringBuilder upgradConditionStr = new StringBuilder();
|
private StringBuilder needConditionStr = new StringBuilder();
|
private Dictionary<AttrEnum, float> sumOffsetlist = new Dictionary<AttrEnum, float>();
|
private Dictionary<AttrEnum, int> sumNeedlist = new Dictionary<AttrEnum, int>();
|
private float sumOffsetPoint = 0;
|
private int sumNeedPoint = 0;
|
|
private bool CheckPutOnNeed(int itemId)
|
{
|
var config = ItemConfig.Get(itemId);
|
int playerJob = PlayerDatas.Instance.baseData.Job;
|
if (playerJob != Math.Floor((double)config.JobLimit / 100) && config.JobLimit != 0)
|
{
|
SysNotifyMgr.Instance.ShowTip("GeRen_lhs_31379");
|
return false;
|
}
|
|
int jobRank = config.JobLimit % 10;
|
offsetConditionStr.Length = 0;
|
sumOffsetlist.Clear();
|
sumNeedlist.Clear();
|
sumOffsetPoint = 0;
|
sumNeedPoint = 0;
|
needConditionStr.Length = 0;
|
upgradConditionStr.Length = 0;
|
float offset = 0;
|
if (config.LimitSTR != 0)
|
{
|
offset = config.LimitSTR - UIHelper.GetPropertyMapPlayerData(AttrEnum.POWER);
|
if (offset > 0)
|
{
|
if (offsetConditionStr.Length > 0)
|
{
|
offsetConditionStr.Append("\n" + Language.Get("KnapS136", offset));
|
}
|
else
|
{
|
offsetConditionStr.Append(Language.Get("KnapS136", offset));
|
}
|
|
if (upgradConditionStr.Length > 0)
|
{
|
upgradConditionStr.Append("\n" + Language.Get("KnapS141", Language.Get("KnapS136", config.LimitSTR), offset));
|
}
|
else
|
{
|
upgradConditionStr.Append(Language.Get("KnapS141", Language.Get("KnapS136", config.LimitSTR), offset));
|
}
|
|
sumOffsetPoint += offset;
|
sumNeedPoint += config.LimitSTR;
|
sumOffsetlist.Add(AttrEnum.POWER, offset);
|
}
|
sumNeedlist.Add(AttrEnum.POWER, config.LimitSTR);
|
if (needConditionStr.Length > 0)
|
{
|
needConditionStr.Append("\n" + Language.Get("KnapS136", config.LimitSTR));
|
}
|
else
|
{
|
needConditionStr.Append(Language.Get("KnapS136", config.LimitSTR));
|
}
|
}
|
|
if (config.LimitPHY != 0)
|
{
|
offset = config.LimitPHY - UIHelper.GetPropertyMapPlayerData(AttrEnum.AGILITY);
|
if (offset > 0)
|
{
|
if (offsetConditionStr.Length > 0)
|
{
|
offsetConditionStr.Append("\n" + Language.Get("KnapS135", offset));
|
}
|
else
|
{
|
offsetConditionStr.Append(Language.Get("KnapS135", offset));
|
}
|
|
if (upgradConditionStr.Length > 0)
|
{
|
upgradConditionStr.Append("\n" + Language.Get("KnapS141", Language.Get("KnapS135", config.LimitPHY), offset));
|
}
|
else
|
{
|
upgradConditionStr.Append(Language.Get("KnapS141", Language.Get("KnapS135", config.LimitPHY), offset));
|
}
|
|
sumOffsetPoint += offset;
|
sumNeedPoint += config.LimitPHY;
|
sumOffsetlist.Add(AttrEnum.AGILITY, offset);
|
}
|
sumNeedlist.Add(AttrEnum.AGILITY, config.LimitPHY);
|
if (needConditionStr.Length > 0)
|
{
|
needConditionStr.Append("\n" + Language.Get("KnapS135", config.LimitPHY));
|
}
|
else
|
{
|
needConditionStr.Append(Language.Get("KnapS135", config.LimitPHY));
|
}
|
|
}
|
|
if (config.LimitPNE != 0)
|
{
|
offset = config.LimitPNE - UIHelper.GetPropertyMapPlayerData(AttrEnum.MENTALITY);
|
if (offset > 0)
|
{
|
if (offsetConditionStr.Length > 0)
|
{
|
offsetConditionStr.Append("\n" + Language.Get("KnapS137", offset));
|
}
|
else
|
{
|
offsetConditionStr.Append(Language.Get("KnapS137", offset));
|
}
|
|
if (upgradConditionStr.Length > 0)
|
{
|
upgradConditionStr.Append("\n" + Language.Get("KnapS141", Language.Get("KnapS137", config.LimitPNE), offset));
|
}
|
else
|
{
|
upgradConditionStr.Append(Language.Get("KnapS141", Language.Get("KnapS137", config.LimitPNE), offset));
|
}
|
|
sumOffsetPoint += offset;
|
sumOffsetlist.Add(AttrEnum.MENTALITY, offset);
|
sumNeedPoint += config.LimitPNE;
|
}
|
sumNeedlist.Add(AttrEnum.MENTALITY, config.LimitPNE);
|
|
if (needConditionStr.Length > 0)
|
{
|
needConditionStr.Append("\n" + Language.Get("KnapS137", config.LimitPNE));
|
}
|
else
|
{
|
needConditionStr.Append(Language.Get("KnapS137", config.LimitPNE));
|
}
|
|
}
|
|
if (offsetConditionStr.Length > 0)
|
{
|
if (sumOffsetPoint <= PlayerDatas.Instance.baseData.FreePoint)
|
{
|
ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("KnapS132", offsetConditionStr.ToString()), (bool isOk) =>
|
{
|
|
if (isOk)
|
{
|
if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.AddPoint))
|
{
|
foreach (var key in sumOffsetlist.Keys)
|
{
|
PlayerDatas.Instance.PlayerDataRefreshInfoEvent += RefreshFreePoint;
|
rolePointModel.SendAddPoint((int)key, (int)sumOffsetlist[key]);
|
}
|
}
|
else
|
{
|
FuncOpen.Instance.ProcessorFuncErrorTip((int)FuncOpenEnum.AddPoint);
|
}
|
}
|
});
|
}
|
|
return false;
|
}
|
return true;
|
}
|
|
private StringBuilder curRealmImgStr = new StringBuilder();
|
private StringBuilder needRealmImgStr = new StringBuilder();
|
private bool CheckPutOnRealm(int itemId)
|
{
|
var config = ItemConfig.Get(itemId);
|
curRealmImgStr.Length = 0;
|
needRealmImgStr.Length = 0;
|
var _realmLv = config.RealmLimit;
|
var needRealmConfig = RealmConfig.Get(_realmLv);
|
var curRealmConfig = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel);
|
|
if (PlayerDatas.Instance.baseData.realmLevel < _realmLv)
|
{
|
needRealmImgStr.AppendFormat("<Img img={0}/>", needRealmConfig.Img);
|
if (curRealmConfig != null && PlayerDatas.Instance.baseData.realmLevel > 0)
|
{
|
curRealmImgStr.AppendFormat("<Img img={0}/>", curRealmConfig.Img);
|
}
|
else
|
{
|
curRealmImgStr.AppendFormat("<Img img={0}/>", "NoRealm");
|
}
|
switch (config.EquipPlace)
|
{
|
case 0:
|
ConfirmCancel.ShowRealmPopConfirm(Language.Get("Mail101"), Language.Get("RealmNeeds", needRealmImgStr.ToString(), curRealmImgStr.ToString()), Language.Get("PopConfirmWin_Promote"), () =>
|
{
|
WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.RealmFunc1);
|
});
|
break;
|
default:
|
ConfirmCancel.ShowRealmPopConfirm(Language.Get("Mail101"), Language.Get("KnapS142", needRealmImgStr.ToString(), curRealmImgStr.ToString()), Language.Get("PopConfirmWin_Promote"), () =>
|
{
|
WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.RealmFunc1);
|
});
|
break;
|
}
|
return false;
|
}
|
return true;
|
}
|
|
private void RefreshFreePoint(PlayerDataRefresh refreshType)
|
{
|
switch (refreshType)
|
{
|
case PlayerDataRefresh.STR:
|
case PlayerDataRefresh.PNE:
|
case PlayerDataRefresh.PHY:
|
case PlayerDataRefresh.CON:
|
{
|
ConfirmCancel.ShowPopConfirm(Language.Get("KnapS138"), Language.Get("KnapS139"), () =>
|
{
|
|
CheckPutOnPlace();
|
});
|
PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= RefreshFreePoint;
|
}
|
break;
|
}
|
}
|
|
/// <summary>
|
/// 检测穿戴的位置对仙器进行特殊处理
|
/// </summary>
|
private void CheckPutOnPlace()
|
{
|
ItemModel putOnModel1 = null;
|
ItemModel putOnModel2 = null;
|
bool isSameEquip = false;
|
switch ((RoleEquipType)sendItemConfig.EquipPlace)
|
{
|
case RoleEquipType.FairyCan:
|
isSameEquip = true;
|
putOnModel1 = playerPack.GetItemModelByIndex(PackType.Equip, sendItemConfig.EquipPlace);
|
putOnModel2 = playerPack.GetItemModelByIndex(PackType.Equip, (int)RoleEquipType.FairyCan2);
|
break;
|
case RoleEquipType.JadeDynasty_Glove1:
|
isSameEquip = true;
|
putOnModel1 = playerPack.GetItemModelByIndex(PackType.JadeDynastyEquip, sendItemConfig.EquipPlace);
|
putOnModel2 = playerPack.GetItemModelByIndex(PackType.JadeDynastyEquip, (int)RoleEquipType.JadeDynasty_Glove2);
|
break;
|
case RoleEquipType.JadeDynasty_Ring1:
|
isSameEquip = true;
|
putOnModel1 = playerPack.GetItemModelByIndex(PackType.JadeDynastyEquip, sendItemConfig.EquipPlace);
|
putOnModel2 = playerPack.GetItemModelByIndex(PackType.JadeDynastyEquip, (int)RoleEquipType.JadeDynasty_Ring2);
|
break;
|
}
|
|
if (isSameEquip)
|
{
|
if (putOnModel1 != null || putOnModel2 != null)
|
{
|
WindowCenter.Instance.Open<FairyWearWin>();
|
return;
|
}
|
}
|
|
CheckSuitReplaceInfo(sendItemConfig.EquipPlace, selectedItem);
|
}
|
|
public void CheckSuitReplaceInfo(int equipPlace, ItemModel item)
|
{
|
if (item == null)
|
{
|
return;
|
}
|
|
if (item.packType == PackType.JadeDynastyItem)
|
{
|
if (equipPlace >= (int)RoleEquipType.JadeDynasty_Cloak && equipPlace <= (int)RoleEquipType.JadeDynasty_Sword4)
|
{
|
var jadeDynastyModel = ModelCenter.Instance.GetModel<JadeDynastyEquipModel>();
|
bool islock = jadeDynastyModel.IsLockEquipPlace(equipPlace);
|
if (islock)
|
{
|
int towerlayer = 0;
|
jadeDynastyModel.TryGetLockTowerLayer(equipPlace, out towerlayer);
|
SysNotifyMgr.Instance.ShowTip("JadeDynastyEquip", towerlayer);
|
return;
|
}
|
}
|
}
|
|
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)
|
{
|
EquipAttrShift(equipPlace, oldItem);
|
switch ((RoleEquipType)equipPlace)
|
{
|
case RoleEquipType.JadeDynasty_Cloak:
|
case RoleEquipType.JadeDynasty_FaceMask:
|
case RoleEquipType.JadeDynasty_Glove1:
|
case RoleEquipType.JadeDynasty_Glove2:
|
case RoleEquipType.JadeDynasty_Pendant:
|
case RoleEquipType.JadeDynasty_Ring1:
|
case RoleEquipType.JadeDynasty_Ring2:
|
case RoleEquipType.JadeDynasty_Ruyi:
|
case RoleEquipType.JadeDynasty_Sword1:
|
case RoleEquipType.JadeDynasty_Sword2:
|
case RoleEquipType.JadeDynasty_Sword3:
|
case RoleEquipType.JadeDynasty_Sword4:
|
PutOnJadeDynastyEquip(equipPlace, itemIndex);
|
break;
|
default:
|
PutOnNormalEquip(equipPlace, itemIndex);
|
break;
|
}
|
SoundPlayer.Instance.PlayUIAudio(24);
|
}
|
|
private void PutOnNormalEquip(int equipPlace, int itemIndex)
|
{
|
var putOnEquip = new C0703_tagCEquipItem();
|
putOnEquip.RoleEquipType = (byte)equipPlace;
|
putOnEquip.ItemIndex = (byte)itemIndex;
|
GameNetSystem.Instance.SendInfo(putOnEquip);
|
}
|
|
private void PutOnJadeDynastyEquip(int equipPlace, int itemIndex)
|
{
|
var equipZhuXianItem = new CA330_tagCMEquipZhuXianItem();
|
equipZhuXianItem.EquipIndex = (byte)(equipPlace - 121);
|
equipZhuXianItem.ItemIndex = (byte)itemIndex;
|
GameNetSystem.Instance.SendInfo(equipZhuXianItem);
|
}
|
|
/// <summary>
|
/// 替换装备时属性转移提示
|
/// </summary>
|
private void EquipAttrShift(int equipPlace, ItemModel item)
|
{
|
var packType = GeneralDefine.GetPackTypeByItemType(item.config.Type);
|
ItemModel putOnModel = null;
|
switch (packType)
|
{
|
case PackType.JadeDynastyItem:
|
putOnModel = playerPack.GetItemModelByIndex(PackType.JadeDynastyEquip, equipPlace);
|
break;
|
default:
|
putOnModel = playerPack.GetItemModelByIndex(PackType.Equip, equipPlace);
|
break;
|
}
|
|
if (putOnModel == null) return;
|
|
Dictionary<int, EquipmentInitialization> equipStrengthDic = strengthModel._EqInfo;
|
bool isPrompt = strengthModel.TheRatingPrompt(item.itemInfo.ItemID);
|
if (isPrompt && !PlayerPrefs.HasKey(PlayerPackModel.StrengthAttrShift_RecordKey))
|
{
|
LocalSave.SetBool(PlayerPackModel.StrengthAttrShift_RecordKey, true);
|
ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("SwitchEquip_Strengthen"));
|
}
|
|
if (equipStrengthDic.ContainsKey(equipPlace))
|
{
|
if (equipStrengthDic[equipPlace].EquipPartStarLV >= 1)
|
{
|
SysNotifyMgr.Instance.ShowTip("SwitchEquip_Strengthen2");
|
}
|
}
|
|
uint[] stones = null;
|
switch (packType)
|
{
|
case PackType.Item:
|
stones = PlayerStoneData.Instance.GetStoneInfo(equipPlace);
|
break;
|
case PackType.JadeDynastyItem:
|
JadeDynastyGemModel.GemEquipData equipData;
|
var model = ModelCenter.Instance.GetModel<JadeDynastyGemModel>();
|
var existGem = model.TryGetEquipGems(equipPlace, out equipData);
|
stones = existGem ? equipData.items : null;
|
break;
|
}
|
int[] gemOpenLvs = packType == PackType.JadeDynastyItem ? itemTipsModel.jadeDynastyGemOpenLvs : itemTipsModel.gemOpenLvs;
|
if (stones != null)
|
{
|
int i = 0;
|
for (i = 0; i < stones.Length; i++)
|
{
|
if (stones[i] != 0 && sendItemConfig.LV >= gemOpenLvs[0])
|
{
|
SysNotifyMgr.Instance.ShowTip("SwitchEquip_Gem");
|
break;
|
}
|
}
|
}
|
|
if (suitModel.IsPerfectGetSuitLv(sendItemConfig.ID, equipPlace))
|
{
|
SysNotifyMgr.Instance.ShowTip("SwitchEquip_SuitPanel");
|
}
|
|
WashProCount washPro = equipWashModel.GetWashEquipInfo(equipPlace);
|
|
if (washPro != null)
|
{
|
int i = 0;
|
for (i = 0; i < washPro.XLAttrCnt; i++)
|
{
|
if (washPro.proValuelist[i].XLAttrValue > 0)
|
{
|
SysNotifyMgr.Instance.ShowTip("SwitchEquip_Wash");
|
break;
|
}
|
}
|
}
|
|
}
|
#endregion
|
|
#region 发送脱下装备的请求
|
public void PutOffEquip(ItemOperateType btnType, string guid)
|
{
|
var item = playerPack.GetItemModelByGUID(guid);
|
if (item == null)
|
{
|
return;
|
}
|
|
SinglePackModel singlePack = null;
|
int remainGrid = 0;
|
int equipPlace = item.itemInfo.ItemPlace;
|
if (item.packType == PackType.JadeDynastyEquip)
|
{
|
equipPlace += 121;
|
}
|
|
switch ((RoleEquipType)equipPlace)
|
{
|
case RoleEquipType.JadeDynasty_Cloak:
|
case RoleEquipType.JadeDynasty_FaceMask:
|
case RoleEquipType.JadeDynasty_Glove1:
|
case RoleEquipType.JadeDynasty_Glove2:
|
case RoleEquipType.JadeDynasty_Pendant:
|
case RoleEquipType.JadeDynasty_Ring1:
|
case RoleEquipType.JadeDynasty_Ring2:
|
case RoleEquipType.JadeDynasty_Ruyi:
|
case RoleEquipType.JadeDynasty_Sword1:
|
case RoleEquipType.JadeDynasty_Sword2:
|
case RoleEquipType.JadeDynasty_Sword3:
|
case RoleEquipType.JadeDynasty_Sword4:
|
remainGrid = playerPack.GetReaminGridCount(PackType.JadeDynastyItem);
|
if (remainGrid < 1)
|
{
|
SysNotifyMgr.Instance.ShowTip("GeRen_chenxin_998371");
|
}
|
else
|
{
|
SendPutOffJadeDynastyEquip(equipPlace);
|
SoundPlayer.Instance.PlayUIAudio(25);
|
}
|
break;
|
default:
|
singlePack = playerPack.GetSinglePackModel(PackType.Item);
|
remainGrid = playerPack.GetReaminGridCount(PackType.Item);
|
if (remainGrid < 1)
|
{
|
SysNotifyMgr.Instance.ShowTip("GeRen_chenxin_998371");
|
}
|
else
|
{
|
if (singlePack != null)
|
{
|
int gridIndex = singlePack.GetNullGridIndex();
|
SendPutOffNormalEquip(equipPlace, gridIndex);
|
SoundPlayer.Instance.PlayUIAudio(25);
|
}
|
}
|
break;
|
}
|
}
|
|
private void SendPutOffNormalEquip(int equipPlace, int itemIndex)
|
{
|
var putOffEquip = new C0704_tagCUnEquipItem();
|
putOffEquip.EquipIndex = (byte)equipPlace;
|
putOffEquip.PackIndex = (byte)itemIndex;
|
GameNetSystem.Instance.SendInfo(putOffEquip);
|
}
|
|
private void SendPutOffJadeDynastyEquip(int equipPlace)
|
{
|
var unEquipZhuXianItem = new CA331_tagCMUnEquipZhuXianItem();
|
unEquipZhuXianItem.EquipIndex = (byte)(equipPlace - 121);
|
GameNetSystem.Instance.SendInfo(unEquipZhuXianItem);
|
}
|
|
#endregion
|
|
#region 发送放入仓库请求
|
public void PutInWareHouse(ItemOperateType btnType, string guid)
|
{
|
var itemModel = playerPack.GetItemModelByGUID(guid);
|
if (itemModel == null)
|
{
|
return;
|
}
|
|
var putInWarehouse = new C0C01_tagCPutItemInWarehouse();
|
putInWarehouse.ItemIndex = (ushort)itemModel.itemInfo.ItemPlace;
|
putInWarehouse.WarehouseIndex = 0;
|
putInWarehouse.Count = (ushort)itemModel.itemInfo.ItemCount;
|
GameNetSystem.Instance.SendInfo(putInWarehouse);
|
}
|
#endregion
|
|
#region 发送从仓库取出请求
|
public void TakeOutFromWarehouse(ItemOperateType btnType, string guid)
|
{
|
var itemModel = playerPack.GetItemModelByGUID(guid);
|
if (itemModel == null)
|
{
|
return;
|
}
|
|
var putOutWarehouse = new C0C02_tagCGetItemInWarehouse();
|
putOutWarehouse.WarehouseIndex = (ushort)itemModel.itemInfo.ItemPlace;
|
putOutWarehouse.ItemIndex = 0;
|
putOutWarehouse.Count = (ushort)itemModel.itemInfo.ItemCount;
|
GameNetSystem.Instance.SendInfo(putOutWarehouse);
|
}
|
#endregion
|
|
#region 发送使用物品请求
|
|
public ItemModel useItemModel { get; set; }
|
public void UseItem(ItemOperateType btnType, int itemIndex)
|
{
|
var singlePack = playerPack.GetSinglePackModel(PackType.Item);
|
if (singlePack == null)
|
{
|
return;
|
}
|
|
useItemModel = singlePack.GetItemModelByIndex(itemIndex);
|
if (useItemModel == null)
|
{
|
return;
|
}
|
|
switch (useItemModel.config.Type)
|
{
|
case (int)ItemType.Box:
|
BoxModel.SetModel(useItemModel.itemInfo.ItemGUID, useItemModel.itemInfo.ItemID);
|
return;
|
case 83:
|
var fashionModel = ModelCenter.Instance.GetModel<FashionDressModel>();
|
fashionModel.jumpFashionDress = useItemModel.config.EffectValueA1;
|
break;
|
}
|
|
switch (useItemModel.config.ID)
|
{
|
case 951:
|
int startLockIndex = singlePack.openGridCount - playerPack.InitBagGridCnt;
|
int chooseGridCnt = singlePack.openGridCount + GetExtendGridCnt(startLockIndex);
|
modelInterface.OpenGrid(chooseGridCnt, PackType.Item);
|
return;
|
case 1506:
|
var crossOneVsOneModel = ModelCenter.Instance.GetModel<CrossServerOneVsOneModel>();
|
if (!crossOneVsOneModel.TryGetBuyMatchTimes("CrossMatching26"))
|
{
|
return;
|
}
|
break;
|
}
|
if (playerPack.CheckIsDrugById(useItemModel.itemInfo.ItemID))
|
{
|
if (CheckItemUselimit(useItemModel.itemId))
|
{
|
WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.MakeDrug);
|
}
|
return;
|
}
|
|
int dungeonID = playerPack.GetDungeonIDByDrugID(useItemModel.itemInfo.ItemID);
|
if (dungeonID != 0)
|
{
|
MapConfig tagMapModel = MapConfig.Get(PlayerDatas.Instance.baseData.MapID);
|
if (tagMapModel.MapFBType == 0)
|
{
|
DungeonOpenTimeConfig timeConfig = DungeonOpenTimeConfig.Get(dungeonID);
|
ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("DrugUsePrompt", useItemModel.config.ItemName, timeConfig.FBName),
|
(bool isOk) =>
|
{
|
if (isOk)
|
{
|
CheckUseCondition(useItemModel);
|
}
|
});
|
return;
|
}
|
}
|
|
for (int i = 0; i < itemTipsModel.jumpAndUseTypes.Length; i++)
|
{
|
if (itemTipsModel.jumpAndUseTypes[i] == useItemModel.config.Type)
|
{
|
bool isMakeUse = CheckUseCondition(useItemModel);
|
if (isMakeUse && IsHaveMakeNumber(useItemModel.itemInfo.ItemPlace))
|
{
|
if (useItemModel.config.Jump != 0)
|
{
|
WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)useItemModel.config.Jump);
|
}
|
}
|
return;
|
}
|
}
|
|
if (useItemModel.config.Jump != 0)
|
{
|
WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)useItemModel.config.Jump);
|
}
|
else
|
{
|
CheckUseCondition(useItemModel);
|
}
|
}
|
|
/// <summary>
|
/// 获取当前道具可以开启的格子数
|
/// </summary>
|
/// <param name="startLockIndex"></param>
|
/// <param name="needTool"></param>
|
/// <param name="extendCnt"></param>
|
/// <returns></returns>
|
private int GetExtendGridCnt(int startLockIndex, int needTool = 0, int extendCnt = 0)
|
{
|
FuncConfigConfig _tagFuncModel = FuncConfigConfig.Get("OpenBagItem");
|
int haveCount = playerPack.GetItemCountByID(PackType.Item, useItemModel.itemId);
|
startLockIndex += 1;
|
Equation.Instance.Clear();
|
Equation.Instance.AddKeyValue("index", startLockIndex);
|
needTool += Equation.Instance.Eval<int>(_tagFuncModel.Numerical2);
|
if (haveCount >= needTool)
|
{
|
extendCnt += 1;
|
return GetExtendGridCnt(startLockIndex, needTool, extendCnt);
|
}
|
else
|
{
|
if (extendCnt <= 0)
|
{
|
extendCnt = 1;
|
}
|
int remianLock = playerPack.MaxBagGridCnt - playerPack.GetSinglePackModel(PackType.Item).openGridCount;
|
if (extendCnt > remianLock)
|
{
|
extendCnt = remianLock;
|
}
|
return extendCnt;
|
}
|
}
|
|
public bool CheckItemUselimit(int itemId)
|
{
|
var config = ItemConfig.Get(itemId);
|
int[] uselimits = config.UseCondiType;
|
if (uselimits == null) return true;
|
|
for (int i = 0; i < uselimits.Length; i++)
|
{
|
switch (uselimits[i])
|
{
|
case 0:
|
int playerLv = PlayerDatas.Instance.baseData.LV;
|
if (playerLv < config.UseLV)
|
{
|
ServerTipDetails.DisplayNormalTip(Language.Get("MakeUseItem101", useItemModel.config.UseLV));
|
return false;
|
}
|
break;
|
case 1:
|
return CheckPutOnRealm(itemId);
|
}
|
}
|
|
return true;
|
}
|
|
public bool CheckUseCondition(ItemModel itemModel)
|
{
|
if (!CheckItemUselimit(itemModel.itemId))
|
{
|
return false;
|
}
|
|
if (itemModel.config.Type == 59)
|
{
|
playerPack.SetWashAttrPointModel(itemModel.itemInfo.ItemGUID);
|
WindowCenter.Instance.Open<WashAttrPointWin>();
|
return true;
|
}
|
|
if (itemModel.config.Effect1 == 209
|
&& !PlayerDatas.Instance.fairyData.HasFairy)
|
{
|
SysNotifyMgr.Instance.ShowTip("jiazu_andyshao_0");
|
return false;
|
}
|
|
if (itemModel.itemId == 952)
|
{
|
int maxUseCnt = GetOfflineMaxNum(itemModel);
|
if (maxUseCnt <= 1)
|
{
|
if (!CheckIsMaxOfflineTime(maxUseCnt, itemModel))
|
{
|
SendMakeUseQuest(itemModel.itemInfo.ItemPlace);
|
}
|
else
|
{
|
return false;
|
}
|
}
|
else
|
{
|
BatchUseModel.Instance.SetOfflineUseModel(itemModel.itemInfo.ItemGUID);
|
WindowCenter.Instance.Open<OfflineHangUpUseWin>();
|
}
|
return true;
|
}
|
|
if (itemModel.itemInfo.ItemID == fairyModel.changeFairyNameItem)
|
{
|
if (PlayerDatas.Instance.fairyData.HasFairy)
|
{
|
WindowCenter.Instance.Open<FamilyChangeNameWin>();
|
return true;
|
}
|
else
|
{
|
SysNotifyMgr.Instance.ShowTip("jiazu_andyshao_0");
|
return false;
|
}
|
|
}
|
|
if (dogzModel.AddAssistItem == itemModel.itemInfo.ItemID)
|
{
|
dogzModel.MakeUseAddAssistNum();
|
return true;
|
}
|
|
ulong maxValue = 0;
|
playerPack.IsReachUseLimit(itemModel.itemInfo.ItemGUID, out maxValue);
|
if (itemModel.config.BatchUse != 0 && maxValue > 1)
|
{
|
BatchUseModel.Instance.SetBatchModel(itemModel.itemInfo.ItemGUID);
|
WindowCenter.Instance.Open<BatchWin>();
|
}
|
else
|
{
|
if (Buffmodel.BuffCover(itemModel.itemInfo.ItemID))
|
{
|
ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("FairyLand_Func22"), (bool isOk) =>
|
{
|
if (isOk)
|
{
|
SendMakeUseQuest(itemModel.itemInfo.ItemPlace);
|
}
|
}
|
);
|
}
|
else
|
{
|
switch (itemModel.itemInfo.ItemID)
|
{
|
case RoleRenameWin.renameToolId:
|
WindowCenter.Instance.Open<RoleRenameWin>();
|
break;
|
default:
|
ItemCDCool cool = KnapsackTimeCDMgr.Instance.GetItemCoolById(itemModel.itemInfo.ItemGUID);
|
if (cool == null || cool.GetRemainTime() <= 0)
|
{
|
SendMakeUseQuest(itemModel.itemInfo.ItemPlace);
|
}
|
else
|
{
|
return false;
|
}
|
break;
|
}
|
|
}
|
}
|
return true;
|
}
|
public int GetOfflineMaxNum(ItemModel itemModel)
|
{
|
int remainOffline = HangUpSetModel.Instance.maxOfflinePluginTime - HangUpSetModel.Instance.offlinePluginTime;
|
int maxUseCnt = 0;
|
if (remainOffline > 0)
|
{
|
int extraCnt = remainOffline % itemModel.config.EffectValueA1 > 0 ? 1 : 0;
|
maxUseCnt = remainOffline / itemModel.config.EffectValueA1 + extraCnt;
|
if (maxUseCnt > itemModel.itemInfo.ItemCount)
|
{
|
return itemModel.itemInfo.ItemCount;
|
}
|
}
|
return maxUseCnt;
|
}
|
|
public bool CheckIsMaxOfflineTime(int useNum, ItemModel itemModel)
|
{
|
int remainOffline = HangUpSetModel.Instance.maxOfflinePluginTime - HangUpSetModel.Instance.offlinePluginTime;
|
if (remainOffline <= 0)
|
{
|
SysNotifyMgr.Instance.ShowTip("OfflinePluginTime");
|
return true;
|
}
|
else
|
{
|
int willTime = HangUpSetModel.Instance.offlinePluginTime + itemModel.config.EffectValueA1 * useNum;
|
if (willTime > HangUpSetModel.Instance.maxOfflinePluginTime)
|
{
|
ConfirmCancel.ShowPopConfirm(Language.Get("OfflinePluginTime102"), Language.Get("OfflinePluginTime101"), (bool isOk) =>
|
{
|
if (isOk)
|
{
|
SendMakeUseQuest(itemModel.itemInfo.ItemPlace, useNum);
|
}
|
});
|
return true;
|
}
|
}
|
return false;
|
}
|
|
public void SendMakeUseQuest(int index, int useCnt = 1, int extra = 0)
|
{
|
ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.Item, index);
|
if (itemModel == null) return;
|
|
int haveUseCnt = playerPack.GetDayUseCntByID(itemModel.itemInfo.ItemID);
|
if (itemModel.config.MaxSkillCnt > 0 && itemModel.config.MaxSkillCnt <= haveUseCnt)
|
{
|
SysNotifyMgr.Instance.ShowTip("EverydayUseLimit");
|
return;
|
}
|
int sumHaveUseCnt = playerPack.GetSumUseCntByID(itemModel.itemInfo.ItemID);
|
AttrFruitConfig fruitConfig = AttrFruitConfig.Get(itemModel.itemInfo.ItemID);
|
if (fruitConfig != null && (sumHaveUseCnt >= fruitConfig.MaxUseCnt || useCnt > fruitConfig.MaxUseCnt))
|
{
|
SysNotifyMgr.Instance.ShowTip("UseCntLimit");
|
return;
|
}
|
|
SendMainServerMakeUseItem(index, useCnt, extra);
|
}
|
|
public bool IsHaveMakeNumber(int index, int useCnt = 1)
|
{
|
ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.Item, index);
|
if (itemModel == null) return false;
|
|
int haveUseCnt = playerPack.GetDayUseCntByID(itemModel.itemInfo.ItemID);
|
if (itemModel.config.MaxSkillCnt > 0 && itemModel.config.MaxSkillCnt <= haveUseCnt)
|
{
|
return false;
|
}
|
int sumHaveUseCnt = playerPack.GetSumUseCntByID(itemModel.itemInfo.ItemID);
|
AttrFruitConfig fruitConfig = AttrFruitConfig.Get(itemModel.itemInfo.ItemID);
|
if (fruitConfig != null
|
&& (sumHaveUseCnt >= fruitConfig.MaxUseCnt
|
|| useCnt > fruitConfig.MaxUseCnt))
|
{
|
return false;
|
}
|
return true;
|
}
|
|
public void SendMainServerMakeUseItem(int index, int useCnt, int extra)
|
{
|
ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.Item, index);
|
if (itemModel == null) return;
|
|
CA323_tagCMUseItems useItem = new CA323_tagCMUseItems();
|
useItem.ItemIndex = (byte)index;
|
useItem.UseCnt = (ushort)useCnt;
|
useItem.ExData = (uint)extra;
|
GameNetSystem.Instance.SendInfo(useItem); //使用物品
|
}
|
|
public void SendCrossServerMakeUseItem(int index)
|
{
|
ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.Item, index);
|
if (itemModel == null) return;
|
|
CC107_tagCMCrossUseItem useItem = new CC107_tagCMCrossUseItem();
|
useItem.ItemID = (uint)itemModel.itemId;
|
GameNetSystem.Instance.SendToCrossServer(useItem);
|
}
|
|
#endregion
|
|
#region 发送拆分请求
|
public void OnClickSplitBtn(ItemOperateType btnType, string guid)
|
{
|
WindowCenter.Instance.Open<SplitWin>();
|
}
|
public void SplitItem(string guid, int splitCount)
|
{
|
if (string.IsNullOrEmpty(guid))
|
{
|
return;
|
}
|
|
var itemModel = playerPack.GetItemModelByGUID(guid);
|
if (itemModel == null)
|
{
|
return;
|
}
|
|
var packType = GeneralDefine.GetPackTypeByItemType(itemModel.config.Type);
|
var singlePack = playerPack.GetSinglePackModel(packType);
|
if (playerPack.GetReaminGridCount(packType) < 1)
|
{
|
SysNotifyMgr.Instance.ShowTip("GeRen_chenxin_676165", packType);
|
}
|
else
|
{
|
var sendInfo = new C0708_tagCDragItem();
|
sendInfo.SrcIndex = (ushort)itemModel.itemInfo.ItemPlace;
|
sendInfo.DestIndex = (ushort)singlePack.GetNullGridIndex();
|
sendInfo.ItemCount = (ushort)splitCount;
|
GameNetSystem.Instance.SendInfo(sendInfo); //拆分物体
|
}
|
}
|
|
#endregion
|
|
#region 发送上架请求
|
public void PutAwayItem(ItemOperateType btnType, string guid)
|
{
|
var itemModel = playerPack.GetItemModelByGUID(guid);
|
if (itemModel == null || itemModel.packType != PackType.Item)
|
{
|
return;
|
}
|
|
PutawayData.Instance.Reset();
|
PutawayData.Instance.itemModel = itemModel;
|
WindowCenter.Instance.Open<PutawayWin>();
|
}
|
#endregion
|
|
#region 点击镶嵌按钮
|
public void GotoInlayItem(ItemOperateType btnType, string guid)
|
{
|
var model = playerPack.GetItemModelByGUID(guid);
|
var packType = GeneralDefine.GetPackTypeByItemType(model.config.Type);
|
switch (packType)
|
{
|
case PackType.JadeDynastyItem:
|
WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.JadeDynastyGem304);
|
break;
|
default:
|
WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.StrengthFunc2);
|
break;
|
}
|
}
|
#endregion
|
|
#region 点击合成按钮
|
public void GotoComposeItem(ItemOperateType btnType, int jumpId)
|
{
|
WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)jumpId);
|
}
|
#endregion
|
|
#region 发送出售请求
|
public void SellItem(ItemOperateType btnType, ItemAttrData attrData)
|
{
|
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.FairyCan)
|
{
|
ItemModel fairy2Model = playerPack.GetItemModelByIndex(PackType.Equip, (int)RoleEquipType.FairyCan2);
|
if (fairy2Model == null || putModel == null)
|
{
|
putModel = null;
|
}
|
else
|
{
|
putModel = putModel.equipScore > fairy2Model.equipScore ? fairy2Model : putModel;
|
}
|
}
|
|
if (!isLimit || isOverdue || (putModel != null && attrData.score < putModel.equipScore))
|
{
|
if (attrData.itemConfig.SellTip == 0)
|
{
|
SendSellQuest(attrData.packType, attrData.index);
|
}
|
else if (attrData.itemConfig.SellTip == 1)
|
{
|
SetSellItemPrompt(attrData, "KnapS128", attrData.itemConfig.ItemName);
|
}
|
}
|
else
|
{
|
if (putModel == null)
|
{
|
SetSellItemPrompt(attrData, "KnapS147", UIHelper.GetEquipPlaceName(attrData.itemConfig.EquipPlace));
|
}
|
else
|
{
|
if (attrData.itemConfig.SellTip == 0)
|
{
|
SetSellItemPrompt(attrData, "KnapS146", attrData.itemConfig.ItemName);
|
}
|
else if (attrData.itemConfig.SellTip == 1)
|
{
|
SetSellItemPrompt(attrData, "KnapS128", attrData.itemConfig.ItemName);
|
}
|
}
|
}
|
}
|
else
|
{
|
if (attrData.itemConfig.SellTip == 0)
|
{
|
SendSellQuest(attrData.packType, attrData.index);
|
}
|
else if (attrData.itemConfig.SellTip == 1)
|
{
|
SetSellItemPrompt(attrData, "KnapS128", attrData.itemConfig.ItemName);
|
}
|
}
|
|
}
|
|
private void SetSellItemPrompt(ItemAttrData attrData, string key, string parms)
|
{
|
ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get(key, parms), (bool isOK) =>
|
{
|
if (isOK)
|
{
|
SendSellQuest(attrData.packType, attrData.index);
|
}
|
});
|
}
|
|
private void SendSellQuest(PackType type, int index)
|
{
|
var sellItem = new C0806_tagCPlayerSellItem();
|
sellItem.PackType = (byte)type;
|
sellItem.ItemIndex = (byte)index;
|
GameNetSystem.Instance.SendInfo(sellItem);
|
|
}
|
#endregion
|
|
#region 发送拆解请求
|
public void DismantleItem(ItemOperateType btnType, ItemAttrData attrData)
|
{
|
List<int> dismantleReturnlist = attrData.GetUseDataModel((int)ItemUseDataKey.itemDecompound);
|
int needGridCnt = 0;
|
int fixedMatcnt = 0;
|
int unfixedMatId = 0;
|
for (int i = 0; i < dismantleReturnlist.Count; i++)
|
{
|
if (i == 0)
|
{
|
if (dismantleReturnlist[i] != 0)
|
{
|
needGridCnt += 1;
|
unfixedMatId = dismantleReturnlist[i];
|
}
|
}
|
else
|
{
|
if ((i - 1) % 3 == 0)
|
{
|
if (dismantleReturnlist[i] != 0)
|
{
|
needGridCnt += 1;
|
fixedMatcnt += dismantleReturnlist[i + 1];
|
}
|
}
|
}
|
}
|
|
int offsetGrid = needGridCnt - playerPack.GetReaminGridCount(PackType.Item);
|
if (offsetGrid > 0)
|
{
|
SysNotifyMgr.Instance.ShowTip("BagFull102", attrData.itemConfig.ItemName, offsetGrid);
|
return;
|
}
|
|
var itemConfig = ItemConfig.Get(unfixedMatId);
|
if (itemConfig != null)
|
{
|
ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("PinkChaiRemind2", fixedMatcnt, itemConfig.LV),
|
(bool ok) =>
|
{
|
if (ok)
|
{
|
var decompound = new CA313_tagCMItemDecompound();
|
decompound.Index = (byte)attrData.index;
|
GameNetSystem.Instance.SendInfo(decompound);
|
}
|
});
|
}
|
else
|
{
|
var decompound = new CA313_tagCMItemDecompound();
|
decompound.Index = (byte)attrData.index;
|
GameNetSystem.Instance.SendInfo(decompound);
|
}
|
}
|
#endregion
|
|
#region 发送续费请求
|
public void RenewalItem(ItemOperateType btnType, string guid)
|
{
|
GuardOverdueWin.guid = guid;
|
WindowCenter.Instance.Open<GuardOverdueWin>();
|
}
|
#endregion
|
|
#region 解锁背包格子数据
|
public int OpenCount
|
{
|
get; private set;
|
}
|
|
public PackType packType
|
{
|
get; private set;
|
}
|
|
public int Index
|
{
|
get; private set;
|
}
|
|
public void SetExtendGirdModel(int openCount = 0, int index = -1, PackType type = PackType.Deleted)
|
{
|
this.OpenCount = openCount;
|
this.packType = type;
|
this.Index = index;
|
}
|
|
#endregion
|
|
#region 获取仓库数据
|
public void SendOpenWarehouse()
|
{
|
var openWarehouse = new CA204_tagCMOpenLongWarehouse();
|
GameNetSystem.Instance.SendInfo(openWarehouse);
|
}
|
#endregion
|
}
|
}
|