| | |
| | |
|
| | | }
|
| | |
|
| | | // public int GetEquipScore(int itemId, Dictionary<int, List<int>> useDataDic = null, bool isPreview = false)
|
| | | // {
|
| | | // var config = ItemConfig.Get(itemId);
|
| | | // if (config == null) return 0;
|
| | | // if (config.EquipPlace == 0)
|
| | | // {
|
| | | // return 0;
|
| | | // }
|
| | | public int GetEquipScore(int itemId, Dictionary<int, List<int>> useDataDic = null, bool isPreview = false)
|
| | | {
|
| | | var config = ItemConfig.Get(itemId);
|
| | | if (config == null) return 0;
|
| | | if (config.EquipPlace == 0)
|
| | | {
|
| | | return 0;
|
| | | }
|
| | |
|
| | | // var properties = new EquipSorceProperties();
|
| | | var properties = new EquipSorceProperties();
|
| | |
|
| | | // if (IsCustomItem(itemId))
|
| | | // {
|
| | | // properties.AddBaseProperties(config.EffectValueA1, equipBaseProperties);
|
| | | // properties.AddCustomProperties(itemId);
|
| | | // return CalculateEquipScore(config.EffectValueA1, properties);
|
| | | // }
|
| | | if (IsCustomItem(itemId))
|
| | | {
|
| | | properties.AddBaseProperties(config.EffectValueA1, equipBaseProperties);
|
| | | properties.AddCustomProperties(itemId);
|
| | | return CalculateEquipScore(config.EffectValueA1, properties);
|
| | | }
|
| | |
|
| | | // properties.AddBaseProperties(itemId, equipBaseProperties);
|
| | | // if (isPreview)
|
| | | // {
|
| | | // switch ((RoleEquipType)config.EquipPlace)
|
| | | // {
|
| | | // case RoleEquipType.Weapon:
|
| | | // case RoleEquipType.Weapon2:
|
| | | // case RoleEquipType.Hat:
|
| | | // case RoleEquipType.Clothes:
|
| | | // case RoleEquipType.Belt:
|
| | | // case RoleEquipType.Trousers:
|
| | | // case RoleEquipType.Shoes:
|
| | | // case RoleEquipType.Glove:
|
| | | // case RoleEquipType.Neck:
|
| | | // case RoleEquipType.FairyCan1:
|
| | | // case RoleEquipType.FairyCan2:
|
| | | // case RoleEquipType.Jade:
|
| | | // properties.AddRange(GetEquipLegendProperties(itemId));
|
| | | // break;
|
| | | // }
|
| | | properties.AddBaseProperties(itemId, equipBaseProperties);
|
| | |
|
| | | // return CalculateEquipScore(itemId, properties);
|
| | | // }
|
| | |
|
| | | // if (useDataDic != null)
|
| | | // {
|
| | | // if (useDataDic.ContainsKey((int)ItemUseDataKey.legendAttrID))
|
| | | // {
|
| | | // properties.AddRange(useDataDic[(int)ItemUseDataKey.legendAttrID], useDataDic[(int)ItemUseDataKey.legendAttrValue]);
|
| | | // }
|
| | | if (useDataDic != null)
|
| | | {
|
| | | if (useDataDic.ContainsKey((int)ItemUseDataKey.legendAttrID))
|
| | | {
|
| | | properties.AddRange(useDataDic[(int)ItemUseDataKey.legendAttrID], useDataDic[(int)ItemUseDataKey.legendAttrValue]);
|
| | | }
|
| | |
|
| | | // if (useDataDic.ContainsKey((int)ItemUseDataKey.outOfPrintAttrID))
|
| | | // {
|
| | | // properties.AddRange(useDataDic[(int)ItemUseDataKey.outOfPrintAttrID], useDataDic[(int)ItemUseDataKey.outOfPrintAttrValue]);
|
| | | // }
|
| | | // }
|
| | | if (useDataDic.ContainsKey((int)ItemUseDataKey.outOfPrintAttrID))
|
| | | {
|
| | | properties.AddRange(useDataDic[(int)ItemUseDataKey.outOfPrintAttrID], useDataDic[(int)ItemUseDataKey.outOfPrintAttrValue]);
|
| | | }
|
| | | }
|
| | |
|
| | | // return CalculateEquipScore(itemId, properties, useDataDic);
|
| | | // }
|
| | | 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, Dictionary<int, List<int>> useDataDic = null)
|
| | | // {
|
| | | // var config = ItemConfig.Get(itemId);
|
| | | // if (config == null || !GeneralDefine.CompareEquipPlaces.Contains(config.EquipPlace))
|
| | | // {
|
| | | // return 0;
|
| | | // }
|
| | | 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))
|
| | | {
|
| | | return 0;
|
| | | }
|
| | |
|
| | | // properties.AddRange(GetEquipShenProperties(itemId));
|
| | | //properties.AddRange(GetEquipShenProperties(itemId));
|
| | |
|
| | | // var minAttack = properties.ContainsKey((int)PropertyType.MinAtk) ? properties[(int)PropertyType.MinAtk] : 0;
|
| | | // var maxAttack = properties.ContainsKey((int)PropertyType.MaxAtk) ? properties[(int)PropertyType.MaxAtk] : 0;
|
| | | // var attack = properties.ContainsKey((int)PropertyType.ATK) ? properties[(int)PropertyType.ATK] : 0;
|
| | | var minAttack = properties.ContainsKey((int)PropertyType.MinAtk) ? properties[(int)PropertyType.MinAtk] : 0;
|
| | | var maxAttack = properties.ContainsKey((int)PropertyType.MaxAtk) ? properties[(int)PropertyType.MaxAtk] : 0;
|
| | | var attack = properties.ContainsKey((int)PropertyType.ATK) ? properties[(int)PropertyType.ATK] : 0;
|
| | |
|
| | | // properties[(int)PropertyType.MinAtk] = minAttack + attack;
|
| | | // properties[(int)PropertyType.MaxAtk] = maxAttack + attack;
|
| | | properties[(int)PropertyType.MinAtk] = minAttack + attack;
|
| | | properties[(int)PropertyType.MaxAtk] = maxAttack + attack;
|
| | |
|
| | | // Equation.Instance.Clear();
|
| | | // curEquipAttrDict.Clear();
|
| | | Equation.Instance.Clear();
|
| | | curEquipAttrDict.Clear();
|
| | |
|
| | | // var GSProValueDict = EquipGSParamConfig.GetTagGsProValueDict(config.LV, config.ItemColor, config.SuiteiD > 0 ? 1 : 0, config.StarLevel);
|
| | | // foreach (var key in properties.Keys)
|
| | | // {
|
| | | // var attrType = (PropertyType)key;
|
| | | // switch (attrType)
|
| | | // {
|
| | | // case PropertyType.ATKSPEED:
|
| | | // case PropertyType.OnlyFinalHurt:
|
| | | // case PropertyType.PVPAtkBackHP:
|
| | | // case PropertyType.MinAtk:
|
| | | // case PropertyType.MaxAtk:
|
| | | // case PropertyType.AddFinalHurt:
|
| | | // case PropertyType.ReduceFinalHurt:
|
| | | // curEquipAttrDict.Add(attrType, properties[key]);
|
| | | // break;
|
| | | // default:
|
| | | // if (GSProValueDict != null && GSProValueDict.ContainsKey(attrType))
|
| | | // {
|
| | | // var curProValue = properties[key] * GSProValueDict[attrType];
|
| | | // curEquipAttrDict.Add(attrType, curProValue);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // curEquipAttrDict.Add(attrType, properties[key]);
|
| | | // }
|
| | | // break;
|
| | | // }
|
| | | // }
|
| | | var GSProValueDict = EquipGSParamConfig.GetTagGsProValueDict(config.LV, config.ItemColor, config.SuiteiD > 0 ? 1 : 0, config.StarLevel);
|
| | | foreach (var key in properties.Keys)
|
| | | {
|
| | | var attrType = (PropertyType)key;
|
| | | switch (attrType)
|
| | | {
|
| | | case PropertyType.ATKSPEED:
|
| | | case PropertyType.OnlyFinalHurt:
|
| | | case PropertyType.PVPAtkBackHP:
|
| | | case PropertyType.MinAtk:
|
| | | case PropertyType.MaxAtk:
|
| | | case PropertyType.AddFinalHurt:
|
| | | case PropertyType.ReduceFinalHurt:
|
| | | curEquipAttrDict.Add(attrType, properties[key]);
|
| | | break;
|
| | | default:
|
| | | if (GSProValueDict != null && GSProValueDict.ContainsKey(attrType))
|
| | | {
|
| | | var curProValue = properties[key] * GSProValueDict[attrType];
|
| | | curEquipAttrDict.Add(attrType, curProValue);
|
| | | }
|
| | | else
|
| | | {
|
| | | curEquipAttrDict.Add(attrType, properties[key]);
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | // foreach (var key in curEquipAttrDict.Keys)
|
| | | // {
|
| | | // var propertyConfig = PlayerPropertyConfig.Get((int)key);
|
| | | // if (propertyConfig != null)
|
| | | // {
|
| | | // Equation.Instance.AddKeyValue(propertyConfig.Parameter, curEquipAttrDict[key]);
|
| | | // }
|
| | | // }
|
| | | foreach (var key in curEquipAttrDict.Keys)
|
| | | {
|
| | | var propertyConfig = PlayerPropertyConfig.Get((int)key);
|
| | | if (propertyConfig != null)
|
| | | {
|
| | | Equation.Instance.AddKeyValue(propertyConfig.Parameter, curEquipAttrDict[key]);
|
| | | }
|
| | | }
|
| | |
|
| | | // var skillScore = 0;
|
| | | // 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
|
| | | // {
|
| | | var skillScore = 0;
|
| | | 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.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))
|
| | | // {
|
| | | // spiritWeaponScore = SpiritWeaponConfig.Get(itemId).AttrScore;
|
| | | // }
|
| | |
|
| | | // if (IsDogzEquip(itemId))
|
| | | // {
|
| | | // return Equation.Instance.Eval<int>(dogzGSFormula);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // return spiritWeaponScore + skillScore + Equation.Instance.Eval<int>(normalGSFormula);
|
| | | // }
|
| | | // }
|
| | | return skillScore + Equation.Instance.Eval<int>(normalGSFormula);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|