少年修仙传客户端代码仓库
client_linchunjie
2018-09-26 6fcd076e11f1ec6a6ba5427acfa0d739e2c2ea4f
System/Skill/TalentModel.cs
@@ -3,6 +3,7 @@
using UnityEngine;
using TableConfig;
using System;
using System.Linq;
namespace Snxxz.UI
{
@@ -99,7 +100,8 @@
        }
        public int talentResetBook { get; private set; }
        public int storeId { get; private set; }
        public int talentResetBookCost { get; private set; }
        Dictionary<int, List<int>> jobTalentTypeDict = new Dictionary<int, List<int>>();
        void ParseConfig()
        {
            var configs = Config.Instance.GetAllValues<TalentConfig>();
@@ -121,22 +123,47 @@
                        talentTreeDict.Add(skillConfig.UseType, talentTree);
                    }
                    talentTree.Add(configs[i], skillConfig.SkillTypeID);
                    List<int> list = null;
                    if (!jobTalentTypeDict.TryGetValue(skillConfig.UseType, out list))
                    {
                        list = new List<int>();
                        jobTalentTypeDict.Add(skillConfig.UseType, list);
                    }
                    if (!list.Contains(configs[i].type))
                    {
                        list.Add(configs[i].type);
                    }
                }
            }
            var jobs = jobTalentTypeDict.Keys.ToList();
            for (int i = 0; i < jobs.Count; i++)
            {
                var list = jobTalentTypeDict[jobs[i]];
                list.Sort((x, y) =>
                {
                    return x.CompareTo(y);
                });
            }
            var config = Config.Instance.Get<FuncConfigConfig>("");
            if (config != null)
            {
                talentResetBook = int.Parse(config.Numerical1);
                talentResetBookCost = int.Parse(config.Numerical2);
            }
            var storeConfigs = Config.Instance.GetAllValues<StoreConfig>();
            for (int i = 0; i < storeConfigs.Count; i++)
        }
        public int GetTalentType(int index)
        {
            var job = (int)Math.Pow(2, PlayerDatas.Instance.baseData.Job);
            if (jobTalentTypeDict.ContainsKey(job))
            {
                if (storeConfigs[i].ItemID == talentResetBook)
                {
                    storeId = storeConfigs[i].ID;
                    break;
                }
                var list = jobTalentTypeDict[job];
                return index < list.Count ? list[index] : list[0];
            }
            return 1;
        }
        public bool TryGetTalents(int job, int talentType, int talentSeries, out List<int> talents)