| | |
| | | }
|
| | |
|
| | | funcConfig = Config.Instance.Get<FuncConfigConfig>("GatherSoulLevelUp");
|
| | | qualityCostModulus = new Dictionary<int, Dictionary<int, float>>();
|
| | | if (funcConfig != null)
|
| | | {
|
| | | levelUpCostFormula = funcConfig.Numerical1;
|
| | | qualityCostModulus = ConfigParse.GetDic<int, float>(funcConfig.Numerical2);
|
| | | var json = LitJson.JsonMapper.ToObject(funcConfig.Numerical2);
|
| | | foreach (var typeKey in json.Keys)
|
| | | {
|
| | | var itemType = int.Parse(typeKey);
|
| | | Dictionary<int, float> dict;
|
| | | if (!qualityCostModulus.TryGetValue(itemType, out dict))
|
| | | {
|
| | | dict = new Dictionary<int, float>();
|
| | | qualityCostModulus.Add(itemType, dict);
|
| | | }
|
| | | foreach (var key in json[typeKey].Keys)
|
| | | {
|
| | | var quality = int.Parse(key);
|
| | | var modulus = float.Parse(json[typeKey][key].ToJson());
|
| | | dict.Add(quality, modulus);
|
| | | }
|
| | | }
|
| | | multiPropertyModulus = ConfigParse.GetDic<int, float>(funcConfig.Numerical3);
|
| | | qualityResolveCostDict = ConfigParse.GetDic<int, float>(funcConfig.Numerical4);
|
| | | soulStageModulusDict = ConfigParse.GetDic<int, float>(funcConfig.Numerical5);
|
| | |
| | | #region 消耗计算
|
| | | string levelUpCostFormula = string.Empty;
|
| | | Dictionary<int, float> levelUpFormulaCostDict = new Dictionary<int, float>();
|
| | | Dictionary<int, float> qualityCostModulus;
|
| | | Dictionary<int, Dictionary<int, float>> qualityCostModulus;
|
| | | Dictionary<int, float> multiPropertyModulus;
|
| | | Dictionary<int, float> soulStageModulusDict;
|
| | | public int RequireLevelUpCost(GatherSoulItem item)
|
| | |
| | | }
|
| | | var soulStageModulus = soulStageModulusDict != null && soulStageModulusDict.ContainsKey(stage) ?
|
| | | soulStageModulusDict[stage] : 1;
|
| | | var qualityModulus = 1f;
|
| | | if (qualityCostModulus.ContainsKey(itemConfig.Type))
|
| | | {
|
| | | if (qualityCostModulus[itemConfig.Type].ContainsKey(itemConfig.ItemColor))
|
| | | {
|
| | | qualityModulus = qualityCostModulus[itemConfig.Type][itemConfig.ItemColor];
|
| | | }
|
| | | }
|
| | | if (multiPropertyModulus.ContainsKey(propertyCount))
|
| | | {
|
| | | result = formulaResult * qualityCostModulus[itemConfig.ItemColor]
|
| | | * soulStageModulus * multiPropertyModulus[propertyCount];
|
| | | result = formulaResult * qualityModulus * soulStageModulus
|
| | | * multiPropertyModulus[propertyCount];
|
| | | }
|
| | | else
|
| | | {
|
| | | result = formulaResult * qualityCostModulus[itemConfig.ItemColor] * soulStageModulus;
|
| | | result = formulaResult * qualityModulus * soulStageModulus;
|
| | | }
|
| | | return Mathf.RoundToInt(result);
|
| | | }
|