Example #1
0
        private SkillLevelUpTemplate ParseSkillLevelUpTemplate(GM.DataCache.SkillLevelUp skillLevelUp)
        {
            SkillLevelUpTemplate skillLevelUpData = new SkillLevelUpTemplate();

            skillLevelUpData.ID               = skillLevelUp.Id;
            skillLevelUpData.Rating           = skillLevelUp.Rating;
            skillLevelUpData.DamageIncPercent = skillLevelUp.DamageIncPercent;
            skillLevelUpData.AtkIncPercent    = skillLevelUp.ATKIncPercent;
            skillLevelUpData.DefIncPercnet    = skillLevelUp.DEFIncPercent;
            skillLevelUpData.MaxHpIncPercent  = skillLevelUp.MaxHPIncPercent;

            if (string.IsNullOrEmpty(skillLevelUp.ReduceCdRating))
            {
                return(skillLevelUpData);
            }
            string[] strs = skillLevelUp.ReduceCdRating.Split('#');
            if (strs.Length < 2)
            {
                EB.Debug.LogError("SkillLevelUpTemplate Init Error, ReduceCDRating Length Less 2, SkillID : {0}", skillLevelUp.Id);
            }
            else
            {
                float cdRating = 0;
                float.TryParse(strs[0], out cdRating);
                skillLevelUpData.CDRating = cdRating;

                int cdCount = 0;
                int.TryParse(strs[1], out cdCount);
                skillLevelUpData.CDCount = cdCount;
            }

            return(skillLevelUpData);
        }
Example #2
0
        /// <summary>计算单技能加成属性</summary>
        private static LTAttributesData GetSkillAttr(LTAttributesData baseAttr, int skillDskillId, int skillLevel)
        {
            LTAttributesData attrData = new LTAttributesData();

            Hotfix_LT.Data.SkillLevelUpTemplate skillData = Hotfix_LT.Data.SkillTemplateManager.Instance.GetSkillLevelUpTemplate(skillDskillId);
            if (skillData == null)
            {
                return(baseAttr);
            }
            if (skillData.MaxHpIncPercent > 0)
            {
                attrData.m_MaxHP = baseAttr.m_MaxHP * skillData.MaxHpIncPercent * (skillLevel - 1);
            }
            if (skillData.AtkIncPercent > 0)
            {
                attrData.m_ATK = baseAttr.m_ATK * skillData.AtkIncPercent * (skillLevel - 1);
            }
            if (skillData.DefIncPercnet > 0)
            {
                attrData.m_DEF = baseAttr.m_DEF * skillData.DefIncPercnet * (skillLevel - 1);
            }
            return(attrData);
        }