From 6fcd076e11f1ec6a6ba5427acfa0d739e2c2ea4f Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期三, 26 九月 2018 21:33:44 +0800
Subject: [PATCH] 3687 天赋功能

---
 System/Skill/TalentModel.cs |   43 +++++++++++++++++++++++++++++++++++--------
 1 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/System/Skill/TalentModel.cs b/System/Skill/TalentModel.cs
index 644b254..6d9c44d 100644
--- a/System/Skill/TalentModel.cs
+++ b/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)

--
Gitblit v1.8.0