| | |
| | | selectEquipPlacelist = new List<ItemModel>();
|
| | | dogzAssistStateDict = new Dictionary<int, int>();
|
| | | m_DogzEquipAttrDict = new Dictionary<int, int>();
|
| | | m_DogzAttrDict = new Dictionary<int, int>();
|
| | | }
|
| | |
|
| | | public void OnAfterPlayerDataInitialize()
|
| | |
| | | public int DogzPackGridCnt { get; private set; } //神兽物品背包格子数
|
| | | public int[] AddAssistItemCnt { get; private set; } //增加助战神兽总数的物品数量
|
| | | public Dictionary<int, int> m_DogzEquipStrenLimit { get; private set;} //神兽装备强化上限 品质 强化等级
|
| | |
|
| | | public string dogzScoreFormula { get; private set; } //神兽评分公式
|
| | | void ParseConfig()
|
| | | {
|
| | | var _dogzCfgs = Config.Instance.GetAllValues<DogzConfig>();
|
| | |
| | | m_DogzEquipStrenLimit = ConfigParse.GetDic<int, int>(_funcCfg.Numerical4);
|
| | | _funcCfg = Config.Instance.Get<FuncConfigConfig>("DogzPack");
|
| | | DogzPackGridCnt = int.Parse(_funcCfg.Numerical1);
|
| | | _funcCfg = Config.Instance.Get<FuncConfigConfig>("DogzGrade");
|
| | | dogzScoreFormula = _funcCfg.Numerical1;
|
| | | }
|
| | | /// <summary>
|
| | | /// 获得格子可以穿戴的装备限制 神兽Id 格子索引
|
| | |
| | | /// </summary>
|
| | | /// <param name="_index"></param>
|
| | | /// <returns></returns>
|
| | | public static string GetDogzPartNameByIndex(int _index)
|
| | | public string GetDogzPartNameByIndex(int _index)
|
| | | {
|
| | | switch (_index)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public static string GetItemColorName(int _itemColor)
|
| | | public string GetItemColorName(int _itemColor)
|
| | | {
|
| | | switch (_itemColor)
|
| | | {
|
| | |
| | | return string.Empty;
|
| | | }
|
| | | }
|
| | |
|
| | | public int GetDogzScoreById(int dogzId)
|
| | | {
|
| | | DogzConfig dogzConfig = Config.Instance.Get<DogzConfig>(dogzId);
|
| | | if (dogzConfig == null) return 0;
|
| | | Equation.Instance.Clear();
|
| | | Equation.Instance.AddKeyValue("FightPowerEx",dogzConfig.FightPowerEx);
|
| | | Equation.Instance.AddKeyValue("EquipGSFormula", GetDogzEquipScore(dogzId));
|
| | | GetDogzAttrDictById(dogzId);
|
| | | foreach(var key in m_DogzAttrDict.Keys)
|
| | | {
|
| | | PlayerPropertyConfig propertyConfig = Config.Instance.Get<PlayerPropertyConfig>(key);
|
| | | if (propertyConfig != null)
|
| | | {
|
| | | Equation.Instance.AddKeyValue(propertyConfig.Parameter, m_DogzAttrDict[key]);
|
| | | }
|
| | | }
|
| | | return Equation.Instance.Eval<int>(dogzScoreFormula);
|
| | | }
|
| | | public Dictionary<int, int> m_DogzAttrDict { get; private set; }
|
| | | public Dictionary<int, int> GetDogzAttrDictById(int dogzId)
|
| | | {
|
| | | m_DogzAttrDict.Clear();
|
| | | DogzConfig dogzConfig = Config.Instance.Get<DogzConfig>(dogzId);
|
| | | int[] baseAttrIds = dogzConfig.BaseAttrTypes;
|
| | | int[] baseAttrValues = dogzConfig.BaseAttrValues;
|
| | | for (int i = 0; i < baseAttrIds.Length; i++)
|
| | | {
|
| | | if (!m_DogzAttrDict.ContainsKey(baseAttrIds[i]))
|
| | | {
|
| | | m_DogzAttrDict.Add(baseAttrIds[i], baseAttrValues[i]);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_DogzAttrDict[baseAttrIds[i]] += baseAttrValues[i];
|
| | | }
|
| | | }
|
| | |
|
| | | Dictionary<int, int> dogzStrenDict = beastModel.AllEnhancedProperties(dogzId);
|
| | | foreach (var key in dogzStrenDict.Keys)
|
| | | {
|
| | | if (!m_DogzAttrDict.ContainsKey(key))
|
| | | {
|
| | | m_DogzAttrDict.Add(key, dogzStrenDict[key]);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_DogzAttrDict[key] += dogzStrenDict[key];
|
| | | }
|
| | | }
|
| | | return m_DogzAttrDict;
|
| | | }
|
| | |
|
| | | public int GetDogzEquipScore(int dogzId)
|
| | | {
|
| | | int score = 0;
|
| | | List<ItemModel> itemModels = GetDogzEquips(dogzId);
|
| | | if(itemModels != null)
|
| | | {
|
| | | for(int i = 0; i < itemModels.Count; i++)
|
| | | {
|
| | | score += itemModels[i].equipScore;
|
| | | }
|
| | | }
|
| | | return score;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | public int GetAssistItemCnt()
|