Merge branch 'master' of http://mobile.173on.com:10010/r/snxxz_scripts
| | |
| | | var score = 0;
|
| | | if (ItemLogicUtility.Instance.IsRealmEquip(auctionItem.itemId))
|
| | | {
|
| | | score = ItemLogicUtility.Instance.GetEquipScore(auctionItem.itemId, auctionItem.userDataDict, true);
|
| | | score = ItemLogicUtility.Instance.GetEquipScore(auctionItem.itemId, auctionItem.userDataDict);
|
| | | var isUp = ItemLogicUtility.Instance.IsFightUp(auctionItem.itemId, score);
|
| | | m_ItemCell.stateIcon.gameObject.SetActive(isUp == 1);
|
| | | if (isUp == 1)
|
| | |
| | | var score = 0;
|
| | | if (ItemLogicUtility.Instance.IsRealmEquip(auctionItem.itemId))
|
| | | {
|
| | | score = ItemLogicUtility.Instance.GetEquipScore(auctionItem.itemId, auctionItem.userDataDict, true);
|
| | | score = ItemLogicUtility.Instance.GetEquipScore(auctionItem.itemId, auctionItem.userDataDict);
|
| | | var isUp = ItemLogicUtility.Instance.IsFightUp(auctionItem.itemId, score);
|
| | | m_ItemCell.stateIcon.gameObject.SetActive(isUp == 1);
|
| | | if (isUp == 1)
|
| | |
| | | var score = 0;
|
| | | if (ItemLogicUtility.Instance.IsRealmEquip(auctionItem.itemId))
|
| | | {
|
| | | score = ItemLogicUtility.Instance.GetEquipScore(auctionItem.itemId, auctionItem.userDataDict,true);
|
| | | score = ItemLogicUtility.Instance.GetEquipScore(auctionItem.itemId, auctionItem.userDataDict);
|
| | | var isUp = ItemLogicUtility.Instance.IsFightUp(auctionItem.itemId, score);
|
| | | m_ItemCell.stateIcon.gameObject.SetActive(isUp == 1);
|
| | | if (isUp == 1)
|
| | |
| | | var score = 0;
|
| | | if (ItemLogicUtility.Instance.IsRealmEquip(auctionItem.itemId))
|
| | | {
|
| | | score = ItemLogicUtility.Instance.GetEquipScore(auctionItem.itemId, auctionItem.userDataDict,true);
|
| | | score = ItemLogicUtility.Instance.GetEquipScore(auctionItem.itemId, auctionItem.userDataDict);
|
| | | var isUp = ItemLogicUtility.Instance.IsFightUp(auctionItem.itemId, score);
|
| | | m_ItemCell.stateIcon.gameObject.SetActive(isUp == 1);
|
| | | if (isUp == 1)
|
| | |
| | | strengthLvTxt.gameObject.SetActive(false);
|
| | | }
|
| | | m_StarLevelLabel.gameObject.SetActive(true);
|
| | | m_StarLevelLabel.text = dogzModel.GetStarLevelLabel(model.config.StarLevel);
|
| | | ItemConfig itemConfig = ItemConfig.Get(model.itemId);
|
| | | if (itemConfig != null && itemConfig.EquipPlace != 0)
|
| | | {
|
| | | m_StarLevelLabel.text = dogzModel.GetStarLevelLabel(model.config.StarLevel);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_StarLevelLabel.text = "";
|
| | | }
|
| | |
|
| | | itemBaisc.gameObject.SetActive(true);
|
| | | itemBaisc.Init(model,true);
|
| | |
| | | public bool IsReachSelectCondi(int itemId)
|
| | | {
|
| | | ItemConfig itemConfig = ItemConfig.Get(itemId);
|
| | | if (itemConfig == null || itemConfig.EquipPlace == 0) return false;
|
| | | if (itemConfig == null ) return false;
|
| | |
|
| | | if (SelectDogzItemQuality == 0 && SelectDogzItemStart == 0) return true;
|
| | |
|
| | |
| | | public List<Int2> trainProperties; |
| | | public Dictionary<int, bool> gemHoleActiveStates; |
| | | public Dictionary<int, int> gems; |
| | | public List<int> equipSkillList; |
| | | } |
| | | |
| | | public struct CustomItemPlus |
| | |
| | | baseProperty = GetBaseProperty(guid), |
| | | spiritWeaponProperty = GetSpiritWeaponProperty(item.itemId), |
| | | legendProperty = GetLegendProperty(guid), |
| | | skillInfo = GetSkillInfo(item.itemId), |
| | | skillInfo = GetSkillInfo(item.itemId, guid), |
| | | suitInfo = GetSuitInfo(guid), |
| | | starInfo = GetStarInfo(guid), |
| | | strengthenProperty = GetStrengthenProperty(guid), |
| | |
| | | properties = info.legendProperties, |
| | | }; |
| | | |
| | | var skillInfo = GetSkillInfo(info.itemId); |
| | | var skillInfo = GetSkillInfo(info.itemId, info); |
| | | var suitInfo = default(SuitInfo); |
| | | if (ItemLogicUtility.Instance.IsSuitEquip(info.itemId)) |
| | | { |
| | |
| | | baseProperty = GetBaseProperty(item.itemId), |
| | | spiritWeaponProperty = GetSpiritWeaponProperty(item.itemId), |
| | | legendProperty = legendProperty, |
| | | skillInfo = GetSkillInfo(item.itemId), |
| | | skillInfo = GetSkillInfo(item.itemId, guid), |
| | | suitInfo = GetSuitInfo(item.itemId), |
| | | operates = operatable ? GetOperates(guid) : null, |
| | | }; |
| | |
| | | data.isPreview = false; |
| | | data.itemId = item.itemId; |
| | | |
| | | var ids = item.GetUseData(17); |
| | | var values = item.GetUseData(19); |
| | | var ids = item.GetUseData((int)ItemUseDataKey.legendAttrID); |
| | | var values = item.GetUseData((int)ItemUseDataKey.legendAttrValue); |
| | | if (!ids.IsNullOrEmpty() && !values.IsNullOrEmpty()) |
| | | { |
| | | var properties = new List<Int2>(); |
| | |
| | | List<int> values = null; |
| | | if (userData != null) |
| | | { |
| | | userData.TryGetValue(17, out ids); |
| | | userData.TryGetValue(19, out values); |
| | | userData.TryGetValue((int)ItemUseDataKey.legendAttrID, out ids); |
| | | userData.TryGetValue((int)ItemUseDataKey.legendAttrValue, out values); |
| | | } |
| | | if (!ids.IsNullOrEmpty() && !values.IsNullOrEmpty()) |
| | | { |
| | |
| | | |
| | | return skillInfo; |
| | | } |
| | | |
| | | |
| | | private static SkillInfo GetSkillInfo(int itemId, CustomEquipInfo info) |
| | | { |
| | | var skillInfo = new SkillInfo(); |
| | | skillInfo.skills = new List<int>(); |
| | | if (!info.equipSkillList.IsNullOrEmpty()) |
| | | { |
| | | skillInfo.skills = info.equipSkillList; |
| | | } |
| | | else |
| | | { |
| | | return GetSkillInfo(itemId); |
| | | } |
| | | return skillInfo; |
| | | } |
| | | |
| | | private static SkillInfo GetSkillInfo(int itemId, string guid) |
| | | { |
| | | |
| | | var skillInfo = new SkillInfo(); |
| | | skillInfo.skills = new List<int>(); |
| | | |
| | | var item = packModel.GetItemByGuid(guid); |
| | | if (item == null) |
| | | { |
| | | return GetSkillInfo(itemId); |
| | | } |
| | | |
| | | var values = item.GetUseData((int)ItemUseDataKey.equipSkills); |
| | | if (!values.IsNullOrEmpty()) |
| | | { |
| | | skillInfo.skills = values; |
| | | } |
| | | else |
| | | { |
| | | return GetSkillInfo(itemId); |
| | | } |
| | | |
| | | return skillInfo; |
| | | } |
| | | |
| | | private static WingRefineMaterials GetWingRefineMaterials(string guid) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | operates.Add(ItemOperateType.exchange); |
| | | if (item.config.ItemColor > 3) |
| | | { |
| | | operates.Add(ItemOperateType.exchange); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | {
|
| | | var useDataDict = ConfigParse.Analysis(info.UserData);
|
| | | List<Int2> legendProperties = null;
|
| | | List<int> equipSkillList = null;
|
| | | if (useDataDict != null)
|
| | | {
|
| | | var count = 0;
|
| | |
| | | var y = useDataDict[(int)ItemUseDataKey.legendAttrValue][i];
|
| | | legendProperties.Add(new Int2(x, y));
|
| | | }
|
| | | if (useDataDict.ContainsKey((int)ItemUseDataKey.equipSkills))
|
| | | {
|
| | | equipSkillList = useDataDict[(int)ItemUseDataKey.equipSkills];
|
| | | }
|
| | | }
|
| | |
|
| | | var config = ItemConfig.Get(info.ItemID);
|
| | |
| | | score = ItemLogicUtility.Instance.GetEquipScore(info.ItemID, useDataDict),
|
| | | legendProperties = legendProperties,
|
| | | isEquiped = false,
|
| | | equipSkillList = equipSkillList,
|
| | | });
|
| | | }
|
| | | else
|
| | |
| | | } |
| | | } |
| | | |
| | | return CalculateEquipScore(itemId, properties); |
| | | return CalculateEquipScore(itemId, properties, useDataDic); |
| | | } |
| | | |
| | | private Dictionary<int, int> GetEquipLegendProperties(int itemId) |
| | |
| | | /// <param name="itemId"></param> |
| | | /// <returns></returns> |
| | | private Dictionary<PropertyType, float> curEquipAttrDict = new Dictionary<PropertyType, float>(); //存储当前装备属性对应的数值 key 属性 value 属性值 |
| | | private int CalculateEquipScore(int itemId, EquipSorceProperties properties) |
| | | private int CalculateEquipScore(int itemId, EquipSorceProperties properties, Dictionary<int, List<int>> useDataDic = null) |
| | | { |
| | | var config = ItemConfig.Get(itemId); |
| | | if (config == null || !GeneralDefine.CompareEquipPlaces.Contains(config.EquipPlace)) |
| | |
| | | } |
| | | |
| | | var skillScore = 0; |
| | | if (config.AddSkill1 != 0 && equipSkillScores.ContainsKey(config.AddSkill1)) |
| | | { |
| | | skillScore += equipSkillScores[config.AddSkill1]; |
| | | if (useDataDic != null && useDataDic.ContainsKey((int)ItemUseDataKey.equipSkills)) |
| | | {
|
| | | for (int i = 0; i < useDataDic[(int)ItemUseDataKey.equipSkills].Count; i++) |
| | | { |
| | | skillScore += equipSkillScores[useDataDic[(int)ItemUseDataKey.equipSkills][i]];
|
| | | }
|
| | | } |
| | | else
|
| | | {
|
| | |
|
| | | if (config.AddSkill1 != 0 && equipSkillScores.ContainsKey(config.AddSkill1))
|
| | | {
|
| | | skillScore += equipSkillScores[config.AddSkill1];
|
| | | }
|
| | |
|
| | | if (config.AddSkill2 != 0 && equipSkillScores.ContainsKey(config.AddSkill2))
|
| | | {
|
| | | skillScore += equipSkillScores[config.AddSkill2];
|
| | | }
|
| | | |
| | | } |
| | | |
| | | if (config.AddSkill2 != 0 && equipSkillScores.ContainsKey(config.AddSkill2)) |
| | | { |
| | | skillScore += equipSkillScores[config.AddSkill2]; |
| | | } |
| | | |
| | | var spiritWeaponScore = 0; |
| | | if (SpiritWeaponConfig.Has(itemId))
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | this.score = ItemLogicUtility.Instance.GetEquipScore(itemId, useDataDict, isAuction);
|
| | | this.score = ItemLogicUtility.Instance.GetEquipScore(itemId, useDataDict);
|
| | | }
|
| | |
|
| | | public void RefreshCount(int count)
|
| | |
| | | }
|
| | |
|
| | | var legendProperties = new List<Int2>();
|
| | | var equipSkillList = new List<int>();
|
| | | Dictionary<int, List<int>> useDataDict = null;
|
| | | if (!string.IsNullOrEmpty(itemplus.UserData))
|
| | | {
|
| | | useDataDict = ConfigParse.Analysis(itemplus.UserData);
|
| | | if (useDataDict != null && useDataDict.ContainsKey(17) && useDataDict.ContainsKey(19))
|
| | | if (useDataDict != null)
|
| | | {
|
| | | var count = Mathf.Min(useDataDict[17].Count, useDataDict[19].Count);
|
| | | for (int i = 0; i < count; i++)
|
| | | if(useDataDict.ContainsKey((int)ItemUseDataKey.legendAttrID) && useDataDict.ContainsKey((int)ItemUseDataKey.legendAttrValue))
|
| | | {
|
| | | legendProperties.Add(new Int2(useDataDict[17][i], useDataDict[19][i]));
|
| | | var count = Mathf.Min(useDataDict[(int)ItemUseDataKey.legendAttrID].Count, useDataDict[(int)ItemUseDataKey.legendAttrValue].Count);
|
| | | for (int i = 0; i < count; i++)
|
| | | {
|
| | | legendProperties.Add(new Int2(useDataDict[(int)ItemUseDataKey.legendAttrID][i], useDataDict[(int)ItemUseDataKey.legendAttrValue][i]));
|
| | | }
|
| | | }
|
| | | if (useDataDict.ContainsKey((int)ItemUseDataKey.equipSkills))
|
| | | {
|
| | | equipSkillList = useDataDict[(int)ItemUseDataKey.equipSkills];
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | trainProperties = trainProperties,
|
| | | isEquiped = itemplus.Equipped == 1,
|
| | | placeStars = placeStars,
|
| | | equipSkillList = equipSkillList,
|
| | | });
|
| | | }
|
| | | else
|
| | |
| | | equipInfo.suitLevels = equipDetailsGroups[level].GetSuitLevels(); |
| | | equipInfo.strengthenLevel = details.strengthenLevel; |
| | | equipInfo.starLevel = details.star; |
| | | |
| | | equipInfo.equipSkillList = details.equipSkillList; |
| | | equipInfo.trainProperties = details.trainProperties; |
| | | |
| | | var gemHoleActiveStates = new Dictionary<int, bool>(); |
| | |
| | | public int trainLevel; |
| | | public List<Int2> trainProperties = new List<Int2>(); |
| | | public List<Int2> legendProperties = new List<Int2>(); |
| | | public List<int> equipSkillList = new List<int>(); |
| | | |
| | | public EquipDetails(JsonData serverInfo) |
| | | { |
| | |
| | | if (serverInfo.Keys.Contains("UserData")) |
| | | { |
| | | userData = ConfigParse.Analysis(serverInfo["UserData"].ToString()); |
| | | if (userData.ContainsKey(17) && userData.ContainsKey(19)) |
| | | if (userData.ContainsKey((int)ItemUseDataKey.legendAttrID) && userData.ContainsKey((int)ItemUseDataKey.legendAttrValue)) |
| | | { |
| | | var count = Mathf.Min(userData[17].Count, userData[19].Count); |
| | | var count = Mathf.Min(userData[(int)ItemUseDataKey.legendAttrID].Count, userData[(int)ItemUseDataKey.legendAttrValue].Count); |
| | | for (int i = 0; i < count; i++) |
| | | { |
| | | legendProperties.Add(new Int2(userData[17][i], userData[19][i])); |
| | | legendProperties.Add(new Int2(userData[(int)ItemUseDataKey.legendAttrID][i], userData[(int)ItemUseDataKey.legendAttrValue][i])); |
| | | } |
| | | } |
| | | if (userData.ContainsKey((int)ItemUseDataKey.equipSkills)) |
| | | { |
| | | equipSkillList = userData[(int)ItemUseDataKey.equipSkills]; |
| | | } |
| | | } |
| | | |
| | | var legendIds = new List<int>(); |
| | |
| | | {
|
| | | godBeastBagClass.IsEquipment = 0;
|
| | | }
|
| | | if (itemModel.config.ItemColor > 4)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | godBeastBagClass.Color = itemModel.config.ItemColor;
|
| | | godBeastBagClass.Star = itemModel.config.StarLevel;
|
| | | godBeastBagClass.EquipScore = itemModel.score;
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | if (IsSatisfyAliveCondition && !IsBuyBool)
|
| | | if (IsSatisfyAliveCondition)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | limitedTimePackageItemModel.selectIndex = GetSelect();
|
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent += OperationTimeUpdateEvent;
|
| | | limitedTimePackageItemModel.UpdateLimitedTimePackageItem += UpdateLimitedTimePackageItem;
|
| | | GlobalTimeEvent.Instance.secondEvent += secondEvent;
|
| | | limitedTimePackageItemModel.selectUpdate += SelectChanged;
|
| | | time = 0;
|
| | | m_Buy_Btn.interactable = true;
|
| | | DisPlay();
|
| | | DisPlay(limitedTimePackageItemModel.selectIndex);
|
| | | }
|
| | |
|
| | | private void SelectChanged(int select)
|
| | |
| | | {
|
| | | DisPlay();
|
| | | }
|
| | | }
|
| | |
|
| | | private int GetSelect()
|
| | | {
|
| | | OperationBase operationBase;
|
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.GiftPackage, out operationBase))
|
| | | {
|
| | | GiftPackageClass operation = operationBase as GiftPackageClass;
|
| | | GiftPackageClass.Gift_Package gift;
|
| | | if (operation.TryGetGift(TimeUtility.ServerNow, out gift))
|
| | | {
|
| | | for (int i = 0; i < gift.gifts.Length; i++)
|
| | | {
|
| | | int BuyCountLimit = gift.gifts[i].limitNum;//限购数量
|
| | | int GiftID = gift.gifts[i].id;//礼包ID
|
| | | if (limitedTimePackageItemModel.DicBuyPackage.ContainsKey(GiftID) && limitedTimePackageItemModel.DicBuyPackage[GiftID] >= BuyCountLimit)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | return i;
|
| | | }
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | private void DisPlay(int _index = 0)
|
| | |
| | | limitedTimePackageItemModel.UpdateLimitedTimePackageItem -= UpdateLimitedTimePackageItem;
|
| | | GlobalTimeEvent.Instance.secondEvent -= secondEvent;
|
| | | limitedTimePackageItemModel.selectUpdate -= SelectChanged;
|
| | | |
| | | }
|
| | |
|
| | |
|
| | |
| | | itemDecompound = 33, //合成物品拆解返还物品列表 [装备ID,材料1ID,个数,是否绑定,材料2ID,个数,是否绑定,...]
|
| | | createItemLoginDay = 34, //创建物品时的登录天数
|
| | | lastOpenItemLoginDay = 36, //上一次开启物品时的登录天数
|
| | | equipSkills = 37, //装备技能,没有记录则读取表
|
| | | runeLV = 38, // 符印等级
|
| | | birthChartLV = 40, // 命格等级
|
| | | wingProgressValue = 42, //羽翼精炼值
|