| | |
| | |
|
| | | if (attrData.itemConfig.UseTag == 1)
|
| | | {
|
| | | if(attrData.itemConfig.ID != 951)
|
| | | {
|
| | | attrData.SetTipsFuncBtn(ItemWinBtnType.makeUse, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendUseItemQuest(ItemWinBtnType.makeUse, attrData.index); });
|
| | | }
|
| | | |
| | | attrData.SetTipsFuncBtn(ItemWinBtnType.makeUse, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendUseItemQuest(ItemWinBtnType.makeUse, attrData.index); });
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return isReach;
|
| | | }
|
| | |
|
| | | if(itemModel.itemId == 952)
|
| | | {
|
| | | int willTime = HangUpSetModel.Instance.offlinePluginTime + itemModel.chinItemModel.EffectValueA1;
|
| | | if (HangUpSetModel.Instance.offlinePluginTime >= HangUpSetModel.Instance.maxOfflinePluginTime)
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | }
|
| | | }
|
| | |
|
| | | bool isBox = false;
|
| | | bool isCanOpen = ModelCenter.Instance.GetModel<BoxGetItemModel>().CheckOpenBoxCondition(itemModel.itemId,out isBox);
|
| | | if(isBox)
|
| | |
| | | break;
|
| | | }
|
| | |
|
| | | switch(itemModel.itemId)
|
| | | {
|
| | | case 951:
|
| | | if(!CheckIsExtendGrid(itemModel.itemId))
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | }
|
| | | break;
|
| | | case 952:
|
| | | int willTime = HangUpSetModel.Instance.offlinePluginTime + itemModel.chinItemModel.EffectValueA1;
|
| | | if (HangUpSetModel.Instance.offlinePluginTime >= HangUpSetModel.Instance.maxOfflinePluginTime)
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | }
|
| | | break;
|
| | | }
|
| | |
|
| | | return isReach;
|
| | | }
|
| | |
|
| | | private bool CheckIsExtendGrid(int itemId)
|
| | | {
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | if (singlePack == null) return false;
|
| | |
|
| | | int startLockIndex = singlePack.openGridCount - GetInitGridCount(PackType.rptItem);
|
| | | FuncConfigConfig _tagFuncModel = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("OpenBagItem");
|
| | | int haveCount = playerPack.GetItemCountByID(PackType.rptItem,itemId);
|
| | | Equation.Instance.Clear();
|
| | | Equation.Instance.AddKeyValue("index", startLockIndex + 1);
|
| | | int needTool = Equation.Instance.Eval<int>(_tagFuncModel.Numerical2);
|
| | | if (haveCount >= needTool)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | else
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | public event Action<string> RefreshGetBetterEquipEvent; //得到更好的装备 value 物品的实例ID
|
| | |
| | |
|
| | | #region 解锁格子
|
| | |
|
| | | private int GetInitGridCount(PackType type)
|
| | | public int GetInitGridCount(PackType type)
|
| | | {
|
| | | FuncConfigConfig initGridCount = null;
|
| | | if (type == PackType.rptItem)
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if(useItemModel.itemInfo.ItemID == fairyModel.changeFairyNameItem)
|
| | | if (useItemModel.itemId == 951)
|
| | | {
|
| | | int startLockIndex = singlePack.openGridCount - modelInterface.GetInitGridCount(PackType.rptItem);
|
| | | int chooseGridCnt = singlePack.openGridCount + GetExtendGridCnt(startLockIndex);
|
| | | modelInterface.OpenGrid(chooseGridCnt, PackType.rptItem);
|
| | | return;
|
| | | }
|
| | |
|
| | | if (useItemModel.itemInfo.ItemID == fairyModel.changeFairyNameItem)
|
| | | {
|
| | | if(PlayerDatas.Instance.fairyData.HasFairy)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /// <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 = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("OpenBagItem");
|
| | | int haveCount = playerPack.GetItemCountByID(PackType.rptItem, 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;
|
| | | }
|
| | | return extendCnt;
|
| | | }
|
| | | }
|
| | |
|
| | | public bool CheckItemUselimit(ItemConfig config)
|
| | | {
|
| | | int[] uselimits = config.UseCondiType;
|
| | |
| | |
|
| | | gridCell.lockBtn.onClick.RemoveAllListeners();
|
| | | gridCell.lockBtn.onClick.AddListener(() => {
|
| | | OnClickLockBtn(cell.index, gridCell.gameObject,packModel);
|
| | | int selectGridIndex = cell.index * 5 + int.Parse(gridCell.gameObject.name.Substring(gridCell.gameObject.name.Length - 1, 1));
|
| | | OnClickLockBtn(selectGridIndex,packModel);
|
| | | });
|
| | |
|
| | | }
|
| | |
| | | gridCell.lockBtn.onClick.RemoveAllListeners();
|
| | | gridCell.lockBtn.onClick.AddListener(() =>
|
| | | {
|
| | | OnClickLockBtn(cell.index, gridCell.gameObject, packModel);
|
| | | int selectGridIndex = cell.index * 5 + int.Parse(gridCell.gameObject.name.Substring(gridCell.gameObject.name.Length - 1, 1));
|
| | | OnClickLockBtn(selectGridIndex, packModel);
|
| | | });
|
| | |
|
| | | }
|
| | |
| | | |
| | | #endregion |
| | | |
| | | protected virtual void OnClickLockBtn(int gridLine,GameObject itemCell,SinglePackModel packModel) |
| | | protected virtual void OnClickLockBtn(int selectGridIndex,SinglePackModel packModel) |
| | | { |
| | | int gridCount = gridLine*5 + int.Parse(itemCell.name.Substring(itemCell.name.Length-1,1)); |
| | | modelInterface.OpenGrid(gridCount,packModel.packType); |
| | | modelInterface.OpenGrid(selectGridIndex,packModel.packType); |
| | | } |
| | | |
| | | } |