| | |
| | | private string dogzGSFormula;
|
| | | private string normalGSFormula;
|
| | |
|
| | | private int[] preciousItemType;
|
| | | private int[] preciousItemTypes;
|
| | | private int[] drugIDs;
|
| | | private int[] onekeySellTypes;
|
| | | private int[] pushItemIds;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | preciousItemType = ConfigParse.GetMultipleStr<int>(FuncConfigConfig.Get("ItemPush").Numerical1);
|
| | | preciousItemTypes = ConfigParse.GetMultipleStr<int>(FuncConfigConfig.Get("ItemPush").Numerical1);
|
| | | promptUseLimitDict = ConfigParse.GetDic<int, int>(FuncConfigConfig.Get("NoPromptUsetItem").Numerical1);
|
| | |
|
| | | drugIDs = ConfigParse.GetMultipleStr<int>(FuncConfigConfig.Get("LifePotionlist").Numerical1);
|
| | |
| | | #region 主界面物品弹框展示
|
| | | public event Action<PackType, string> GetPreciousItemEvent; //得到珍品 value 物品的实例ID
|
| | |
|
| | | public void GetPreciousItem(ItemModel itemModel)
|
| | | public void RecommendItem(ItemModel item)
|
| | | {
|
| | | if (itemModel.packType != PackType.Item) return;
|
| | |
|
| | | if (itemModel.config.UseLV > PlayerDatas.Instance.baseData.LV) return;
|
| | |
|
| | | bool isOverdue = IsOverdue(itemModel.guid, itemModel.itemId, itemModel.useDataDict);
|
| | | if (isOverdue)
|
| | | if (item.packType != PackType.Item)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (preciousItemType != null)
|
| | | if (item.config.UseLV > PlayerDatas.Instance.baseData.LV)
|
| | | {
|
| | | int i = 0;
|
| | | for (i = 0; i < preciousItemType.Length; i++)
|
| | | {
|
| | | if (itemModel.config.Type == preciousItemType[i] && CheckPreciousCondition(itemModel))
|
| | | {
|
| | | if (GetPreciousItemEvent != null)
|
| | | {
|
| | | GetPreciousItemEvent(itemModel.packType, itemModel.guid);
|
| | | }
|
| | | }
|
| | | }
|
| | | return;
|
| | | }
|
| | |
|
| | | if (IsOverdue(item.guid, item.itemId, item.useDataDict))
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (!preciousItemTypes.Contains(item.config.Type))
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (!IsAbleToUse(item))
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (GetPreciousItemEvent != null)
|
| | | {
|
| | | GetPreciousItemEvent(item.packType, item.guid);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool CheckPreciousCondition(ItemModel itemModel)
|
| | | bool IsAbleToUse(ItemModel item)
|
| | | {
|
| | | bool isReach = true;
|
| | | WindowSearchConfig windowSearch = WindowSearchConfig.Get((int)itemModel.config.Jump);
|
| | | var windowSearch = WindowSearchConfig.Get(item.config.Jump);
|
| | | if (windowSearch != null)
|
| | | {
|
| | | if (!FuncOpen.Instance.IsFuncOpen(windowSearch.Lv) && windowSearch.Lv != 0)
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | }
|
| | | if (pushItemIds.Contains(itemModel.itemId))
|
| | |
|
| | | if (pushItemIds.Contains(item.itemId))
|
| | | {
|
| | | int itemCnt = playerPack.GetItemCountByID(PackType.Item, itemModel.itemId) - itemModel.count;
|
| | | var itemCnt = playerPack.GetItemCountByID(PackType.Item, item.itemId) - item.count;
|
| | | if (itemCnt > 0)
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | else
|
| | | {
|
| | | if (itemModel.preItemCount > 0)
|
| | | if (item.preItemCount > 0)
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | if (promptUseLimitDict.ContainsKey(itemModel.itemId))
|
| | | if (promptUseLimitDict.ContainsKey(item.itemId))
|
| | | {
|
| | | int playerLv = PlayerDatas.Instance.baseData.LV;
|
| | | if (playerLv < promptUseLimitDict[itemModel.itemId])
|
| | | var playerLv = PlayerDatas.Instance.baseData.LV;
|
| | | if (playerLv < promptUseLimitDict[item.itemId])
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | ulong canUseCnt = 0;
|
| | | if (playerPack.IsReachUseLimit(itemModel.guid, out canUseCnt))
|
| | | if (playerPack.IsReachUseLimit(item.guid, out canUseCnt))
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | |
|
| | | bool isBox = false;
|
| | | bool isCanOpen = ModelCenter.Instance.GetModel<BoxGetItemModel>().CheckOpenBoxCondition(itemModel.itemId, out isBox);
|
| | | bool isCanOpen = ModelCenter.Instance.GetModel<BoxGetItemModel>().CheckOpenBoxCondition(item.itemId, out isBox);
|
| | | if (isBox)
|
| | | {
|
| | | if (!isCanOpen)
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | if (trialModel.trialTokens.Contains(itemModel.itemId))
|
| | | if (trialModel.trialTokens.Contains(item.itemId))
|
| | | {
|
| | | if (!trialModel.IsAnySatisfyExchangeBetter(itemModel.itemId))
|
| | | if (!trialModel.IsAnySatisfyExchangeBetter(item.itemId))
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | if (playerPack.CheckIsDrugById(itemModel.itemId))
|
| | | if (playerPack.CheckIsDrugById(item.itemId))
|
| | | {
|
| | | if (itemModel.config.RealmLimit > PlayerDatas.Instance.baseData.realmLevel)
|
| | | if (item.config.RealmLimit > PlayerDatas.Instance.baseData.realmLevel)
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | switch (itemModel.config.Type)
|
| | | switch (item.config.Type)
|
| | | {
|
| | | case 8:
|
| | | if (buffDatas.BastBuff(itemModel.itemId))
|
| | | if (buffDatas.BastBuff(item.itemId))
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | break;
|
| | | case 20:
|
| | | if (magicianModel.IsGodWeaponMaxLevelByItem(itemModel.itemId))
|
| | | if (magicianModel.IsGodWeaponMaxLevelByItem(item.itemId))
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | break;
|
| | | case 21:
|
| | | if (!mountDatas.IsHint(HorseEnum.HorseDan, itemModel.itemId))
|
| | | if (!mountDatas.IsHint(HorseEnum.HorseDan, item.itemId))
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | break;
|
| | | case 22:
|
| | | if (!mountDatas.IsHint(HorseEnum.HorseStone, itemModel.itemId))
|
| | | if (!mountDatas.IsHint(HorseEnum.HorseStone, item.itemId))
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | break;
|
| | | case 41:
|
| | | if (!mountDatas.IsHint(HorseEnum.HorseDebris, itemModel.itemId))
|
| | | if (!mountDatas.IsHint(HorseEnum.HorseDebris, item.itemId))
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | break;
|
| | | case 26:
|
| | | if (!petDatas.IsHint(PetEnum.PetDebris, itemModel.itemId))
|
| | | if (!petDatas.IsHint(PetEnum.PetDebris, item.itemId))
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | break;
|
| | | case 27:
|
| | | if (!petDatas.IsHint(PetEnum.PetDan, itemModel.itemId))
|
| | | if (!petDatas.IsHint(PetEnum.PetDan, item.itemId))
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | break;
|
| | | case 28:
|
| | | if (!petDatas.IsHint(PetEnum.PetStone, itemModel.itemId))
|
| | | if (!petDatas.IsHint(PetEnum.PetStone, item.itemId))
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | break;
|
| | | case 25:
|
| | | if (!ModelCenter.Instance.GetModel<GemModel>().SatisfyBetter(itemModel.itemId))
|
| | | if (!ModelCenter.Instance.GetModel<GemModel>().SatisfyBetter(item.itemId))
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | break;
|
| | | case 39:
|
| | | if (!CheckIsBetterWings(itemModel))
|
| | | if (!IsBetterWings(item))
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | break;
|
| | | case 52:
|
| | | if (!strengthDatas.IsHint(itemModel.itemId))
|
| | | if (!strengthDatas.IsHint(item.itemId))
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | break;
|
| | | case 127:
|
| | | var error = 0;
|
| | | bool isHaveMakeNum = ItemOperateUtility.Instance.CanUseItem(itemModel.itemPlace, 1, out error);
|
| | | bool isHaveMakeNum = ItemOperateUtility.Instance.CanUseItem(item.itemPlace, 1, out error);
|
| | | int remainNum = CrossServerOneVsOnePlayerInfo.Instance.GetDayRemainNum();
|
| | | if (!CrossServerOneVsOnePKSeason.Instance.isSatisfyMatch
|
| | | || remainNum > 0
|
| | | || !isHaveMakeNum)
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | |
|
| | | switch (itemModel.itemId)
|
| | | switch (item.itemId)
|
| | | {
|
| | | case 951:
|
| | | if (!CheckIsExtendGrid(itemModel.itemId))
|
| | | if (!CheckIsExtendGrid(item.itemId))
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | break;
|
| | | case 952:
|
| | | int willTime = HangUpSetModel.Instance.offlinePluginTime + itemModel.config.EffectValueA1;
|
| | | int willTime = HangUpSetModel.Instance.offlinePluginTime + item.config.EffectValueA1;
|
| | | if (HangUpSetModel.Instance.offlinePluginTime >= HangUpSetModel.Instance.maxOfflinePluginTime)
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | return false;
|
| | | }
|
| | | break;
|
| | |
|
| | | }
|
| | |
|
| | | return isReach;
|
| | | return true;
|
| | | }
|
| | |
|
| | | private bool CheckIsBetterWings(ItemModel itemModel)
|
| | | private bool IsBetterWings(ItemModel item)
|
| | | {
|
| | | if (itemModel == null) return false;
|
| | | if (item == null)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | ItemModel putModel = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Wing);
|
| | | SinglePack singlePack = playerPack.GetSinglePack(PackType.Item);
|
| | | var putModel = playerPack.GetItemByIndex(PackType.Equip, (int)RoleEquipType.Wing);
|
| | | var singlePack = playerPack.GetSinglePack(PackType.Item);
|
| | | if (singlePack == null)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | int[] composeTypes = itemModel.config.JumpComposeCondi;
|
| | | int[] composeTypes = item.config.JumpComposeCondi;
|
| | | bool isOpenCompose = false;
|
| | | if (composeTypes != null && composeTypes.Length >= 3)
|
| | | {
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | if (putModel != null && putModel.config.LV >= itemModel.config.LV)
|
| | | if (putModel != null && putModel.config.LV >= item.config.LV)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
| | | {
|
| | | if (itemModels[i].config.JobLimit / 100 == PlayerDatas.Instance.baseData.Job)
|
| | | {
|
| | | if (itemModels[i].config.LV >= itemModel.config.LV)
|
| | | if (itemModels[i].config.LV >= item.config.LV)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public event Action<string> RefreshGetBetterEquipEvent; //得到更好的装备 value 物品的实例ID
|
| | | public event Action<string> GetBetterEquipEvent; //得到更好的装备 value 物品的实例ID
|
| | |
|
| | | public bool IsSameJob(int jobLimit)
|
| | | public void OnGetEquip(ItemModel item)
|
| | | {
|
| | | return jobLimit == 0 || jobLimit / 100 == PlayerDatas.Instance.baseData.Job;
|
| | | }
|
| | | if (item == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | public void OnGetEquip(ItemModel model)
|
| | | {
|
| | | if (model == null) return;
|
| | | if (model.packType != PackType.Item && model.packType != PackType.JadeDynastyItem) return;
|
| | | if (!IsSameJob(model.config.JobLimit)) return;
|
| | | if (item.packType != PackType.Item && item.packType != PackType.JadeDynastyItem)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | int equipPlace = model.config.EquipPlace;
|
| | | if (!IsSameJob(item.config.JobLimit))
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | int equipPlace = item.config.EquipPlace;
|
| | | switch ((RoleEquipType)equipPlace)
|
| | | {
|
| | | case RoleEquipType.Weapon:
|
| | |
| | | case RoleEquipType.JadeDynasty_Sword4:
|
| | | if (betterEquipExceptDungeonDict.ContainsKey(PlayerDatas.Instance.baseData.MapID))
|
| | | {
|
| | | if (betterEquipExceptDungeonDict[PlayerDatas.Instance.baseData.MapID].Contains(model.itemId))
|
| | | if (betterEquipExceptDungeonDict[PlayerDatas.Instance.baseData.MapID].Contains(item.itemId))
|
| | | {
|
| | | return;
|
| | | }
|
| | | }
|
| | | SetGetBetterEquipEvent(model);
|
| | | SetGetBetterEquipEvent(item);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | bool IsSameJob(int jobLimit)
|
| | | {
|
| | | return jobLimit == 0 || jobLimit / 100 == PlayerDatas.Instance.baseData.Job;
|
| | | }
|
| | |
|
| | | private void SetGetBetterEquipEvent(ItemModel model)
|
| | |
| | | }
|
| | | break;
|
| | | }
|
| | | if (RefreshGetBetterEquipEvent != null)
|
| | |
|
| | | if (GetBetterEquipEvent != null)
|
| | | {
|
| | | RefreshGetBetterEquipEvent(model.guid);
|
| | | GetBetterEquipEvent(model.guid);
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | private bool CheckIsBetterEquip(int curScore, int putOnScore = 0)
|
| | | {
|
| | |
|
| | | if (putOnScore <= 0)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
|
| | | if (curScore > putOnScore)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | else
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | public event Action<PackType, string> RefreshPickItemEvent; //捡起的物品
|
| | | public event Action<PackType, string> PickItemEvent; //捡起的物品
|
| | |
|
| | | public void RefreshPickItem(PackType type, string guid)
|
| | | {
|
| | | if (type != PackType.Item) return;
|
| | |
|
| | | if (RefreshPickItemEvent != null)
|
| | | if (PickItemEvent != null)
|
| | | {
|
| | | RefreshPickItemEvent(type, guid);
|
| | | PickItemEvent(type, guid);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | return RealmDruglist;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 解锁格子
|
| | |
|
| | | public void OpenGrid(int chooseGridCount, PackType type)
|
| | | {
|
| | | SinglePack singlePack = playerPack.GetSinglePack(type);
|
| | | int openCount = chooseGridCount - singlePack.unlockedGridCount;
|
| | | int index = 0;
|
| | | switch (type)
|
| | | {
|
| | | case PackType.Item:
|
| | | index = chooseGridCount - GeneralDefine.initBagGridCount;
|
| | | break;
|
| | | case PackType.Warehouse:
|
| | | index = chooseGridCount - GeneralDefine.initDepotGridCount;
|
| | | break;
|
| | | }
|
| | | itemTipsModel.SetExtendGirdModel(openCount, index, type);
|
| | | WindowCenter.Instance.Open<ExtendWin>();
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region 物品处于CD中的逻辑处理
|
| | |
| | | #endregion
|
| | |
|
| | | #region 背包整理后好的同类型最好的装备
|
| | | Dictionary<int, Dictionary<int, ItemModel>> itemModelDict = new Dictionary<int, Dictionary<int, ItemModel>>(); // key1 装备位置索引 key2 背包位置索引
|
| | | Dictionary<int, Dictionary<int, ItemModel>> itemModelDict = new Dictionary<int, Dictionary<int, ItemModel>>(); // key1 装备位置索引 key2 背包位置索引
|
| | |
|
| | | public void ClearSortedBetterEquip()
|
| | | {
|