Esempio n. 1
0
        /// <summary>
        /// 获取图鉴加成
        /// </summary>
        private static LTAttributesData GetPartnerHandBookAttributes(LTAttributesData baseAttr, LTPartnerData partnerData)
        {
            LTAttributesData attrData = new LTAttributesData();

            if (LTPartnerHandbookManager.Instance.TheHandbookList != null)
            {
                HandbookData handbookDatas = LTPartnerHandbookManager.Instance.TheHandbookList.Find(partnerData.HeroInfo.char_type);
                if (handbookDatas != null)
                {
                    Hotfix_LT.Data.MannualBreakTemplate temp = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetBreakTemplateByLevel(handbookDatas.HandbookId, handbookDatas.BreakLevel);
                    if (temp != null)
                    {
                        attrData.m_MaxHP = baseAttr.m_MaxHP * temp.IncATK;
                        attrData.m_ATK   = baseAttr.m_ATK * temp.IncDEF;
                        attrData.m_DEF   = baseAttr.m_DEF * temp.IncMaxHp;
                    }
                }
            }
            attrData.m_Speed        = baseAttr.m_Speed * LTPartnerHandbookManager.Instance.GetHandbookAddtionFromCard(partnerData, IHandBookAddAttrType.ATTR_Speed) / 100;
            attrData.m_CritP        = LTPartnerHandbookManager.Instance.GetHandbookAddtionFromCard(partnerData, IHandBookAddAttrType.ATTR_CritP) / 100;
            attrData.m_CritDef      = LTPartnerHandbookManager.Instance.GetHandbookAddtionFromCard(partnerData, IHandBookAddAttrType.ATTR_CRIresist) / 100;       //暴击抵抗
            attrData.m_DamageAdd    = LTPartnerHandbookManager.Instance.GetHandbookAddtionFromCard(partnerData, IHandBookAddAttrType.ID_ATTR_DMGincrease) / 100;  //伤害加成
            attrData.m_DamageReduce = LTPartnerHandbookManager.Instance.GetHandbookAddtionFromCard(partnerData, IHandBookAddAttrType.ID_ATTR_DMGreduction) / 100; //伤害减免

            return(attrData);
        }
Esempio n. 2
0
        /// <summary>
        /// 计算单张图鉴卡片得分
        /// </summary>
        /// <param name="mannualBreakTemplate"></param>
        /// <param name="heroGrade"></param>
        /// <param name="heroLevel"></param>
        /// <returns></returns>
        public int HandleHandbookCardScore(Hotfix_LT.Data.MannualBreakTemplate mannualBreakTemplate, int heroGrade, int upgradeLevel)
        {
            Hotfix_LT.Data.MannualRoleGradeTemplate _CurrentRoleGradeInfo =
                Hotfix_LT.Data.CharacterTemplateManager.Instance.GetMannualRoleGradeTempleteByRoleGrade(heroGrade);
            int baseScore   = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetCharacterScoreByLevel(upgradeLevel);
            int originScore = (int)Math.Round(baseScore * _CurrentRoleGradeInfo.score_addition);
            int Score       = originScore + (int)((float)originScore * mannualBreakTemplate.score_promotion);

            return(Score);
        }
Esempio n. 3
0
        /// <summary>
        /// 获取对应图鉴的加成属性
        /// </summary>
        /// <param name="handbookId">1,2,3</param>
        /// <returns></returns>
        public float GetHanbookAddtion(LTPartnerData partner)
        {
            //int race = partner.HeroInfo.race;
            //int charType = (int) partner.HeroInfo.char_type;
            float addNum = 0;

            if (TheHandbookList != null)
            {
                HandbookData handbookDatas = TheHandbookList.Find(partner.HeroInfo.char_type);
                if (handbookDatas != null)
                {
                    Hotfix_LT.Data.MannualBreakTemplate temp = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetBreakTemplateByLevel(handbookDatas.HandbookId, handbookDatas.BreakLevel);
                    int score = 0;// bookData.Score;
                    Hotfix_LT.Data.MannualScoreTemplate _scoreTemplate = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetMannualScoreTemplateByScore(score);
                    addNum += _scoreTemplate.attribute_addition;
                }
            }
            return(addNum);
        }
Esempio n. 4
0
        public bool IsHandBookCanBreakUp(Hotfix_LT.Data.eRoleAttr attr = Hotfix_LT.Data.eRoleAttr.None)
        {
            if (GetHandBookLevel() < UnLockLevel)
            {
                return(false);
            }
            if (TheHandbookList != null && TheHandbookList.Handbooks != null)
            {
                for (var i = 0; i < TheHandbookList.Handbooks.Count; i++)
                {
                    HandbookData handbook = TheHandbookList.Handbooks[i];
                    if (attr != Hotfix_LT.Data.eRoleAttr.None && attr != handbook.HandbookId)
                    {
                        continue;
                    }
                    int curLevel        = LTPartnerHandbookManager.Instance.GetHandBookLevel();
                    var curHandBookInfo = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetMannualScoreTemplateById(curLevel);
                    if (curHandBookInfo == null || handbook.BreakLevel >= curHandBookInfo.levelLimit)
                    {
                        continue;
                    }

                    var data = LTPartnerHandbookManager.Instance.TheHandbookList.Find(handbook.HandbookId);
                    Hotfix_LT.Data.MannualBreakTemplate breakThrough = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetBreakTemplateByLevel(data.HandbookId, data.BreakLevel + 1);
                    if (breakThrough != null)
                    {
                        int curCount  = GameItemUtil.GetInventoryItemNum(breakThrough.material_1);
                        int nextCount = breakThrough.quantity_1;
                        if (curCount < nextCount)
                        {
                            continue;
                        }
                        return(true);
                    }
                }
            }
            return(false);
        }