少年修仙传客户端代码仓库
client_linchunjie
2018-09-26 ee41c1b1aee9fb8e7dcfdc05113bc74e0da7ffb0
System/Skill/TalentModel.cs
@@ -54,6 +54,8 @@
            }
        }
        bool serverInited = false;
        public event Action selectTalentTypeEvnet;
        public event Action selectSeriesEvent;
        public event Action selectSkillEvent;
@@ -72,10 +74,12 @@
            {
                talent.level = 0;
            }
            serverInited = false;
        }
        public void OnPlayerLoginOk()
        {
            serverInited = true;
        }
        public override void UnInit()
@@ -91,6 +95,8 @@
            }
        }
        public int talentResetBook { get; private set; }
        public int storeId { get; private set; }
        void ParseConfig()
        {
            var configs = Config.Instance.GetAllValues<TalentConfig>();
@@ -112,6 +118,20 @@
                        talentTreeDict.Add(skillConfig.UseType, talentTree);
                    }
                    talentTree.Add(configs[i], skillConfig.SkillTypeID);
                }
            }
            var config = Config.Instance.Get<FuncConfigConfig>("");
            if (config != null)
            {
                talentResetBook = int.Parse(config.Numerical1);
            }
            var storeConfigs = Config.Instance.GetAllValues<StoreConfig>();
            for (int i = 0; i < storeConfigs.Count; i++)
            {
                if (storeConfigs[i].ItemID == talentResetBook)
                {
                    storeId = storeConfigs[i].ID;
                    break;
                }
            }
        }
@@ -187,7 +207,7 @@
                    var requireSeries = skillConfig.RequireSeries();
                    if (GetSeriesPoint(talentConfig.type, requireSeries) < requireSeriesPoint)
                    {
                        error = 4;
                        error = 3;
                        return false;
                    }
                }
@@ -198,7 +218,7 @@
                    {
                        if (learnTalent.level < skillConfig.LearnSkillLV)
                        {
                            error = 5;
                            error = 4;
                            return false;
                        }
                    }
@@ -209,7 +229,15 @@
        public void ProcessLevelUpError(int error)
        {
            switch (error)
            {
                case 2:
                    break;
                case 3:
                    break;
                case 4:
                    break;
            }
        }
        #region 服务端数据
@@ -220,6 +248,20 @@
            UpdateRedpoint();
        }
        public void UpdateTalentSkill(int _oldSkillId, int _newSkillId)
        {
            var config = Config.Instance.Get<SkillConfig>(_newSkillId);
            if (talentSkills.ContainsKey(config.SkillTypeID))
            {
                var talentSkill = talentSkills[config.SkillTypeID];
                talentSkill.level = config.SkillLV;
                if (talentSkillUpdate != null)
                {
                    talentSkillUpdate(config.SkillTypeID);
                }
            }
        }
        #endregion
        #region 红点