Exemplo 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);
        }
Exemplo n.º 2
0
        /*
         *
         */
        private HandbookData Parse(object value, int HandbookId)
        {
            if (value == null)
            {
                return(null);
            }
            HandbookData item = Find((Hotfix_LT.Data.eRoleAttr)HandbookId) ?? new HandbookData();

            int type = EB.Dot.Integer("type", value, 0);

            item.HandbookId = (Hotfix_LT.Data.eRoleAttr)type;

            item.BreakLevel = EB.Dot.Integer("break", value, item.BreakLevel);

            item.HasAvailableCard = false;
            ArrayList handBookCards = Hotfix_LT.EBCore.Dot.Array("buddyInfo", value, null);

            if (handBookCards != null)
            {
                item.CardsInfo.Clear();
                for (int i = 0; i < (LTPartnerConfig.MAX_HANDBOOKPAGE + 1) * 5; ++i)
                {
                    HandbookCardData hbcData = new HandbookCardData();
                    hbcData.handbookId          = (Hotfix_LT.Data.eRoleAttr)HandbookId;
                    hbcData.handBookAddAttrType = (IHandBookAddAttrType)(i % 5);
                    hbcData.index = i;
                    int    state   = 0;
                    string buddyId = null;
                    if (i < handBookCards.Count)
                    {
                        IDictionary dic = handBookCards[i] as IDictionary;
                        state   = EB.Dot.Integer("useStats", dic, 0);
                        buddyId = EB.Dot.String("id", dic, null);
                    }
                    hbcData.State = GetCardState(item.BreakLevel, i, (HandbookCardState)state, out hbcData.UnlockLevel);
                    if (hbcData.State == HandbookCardState.Empty)
                    {
                        item.HasAvailableCard = true;
                    }
                    if (buddyId != null)
                    {
                        hbcData.BuddyId = buddyId;
                        if (!HandbookBunddysList.Contains(buddyId))
                        {
                            HandbookBunddysList.Add(buddyId);
                        }
                    }

                    item.CardsInfo.Add(hbcData);
                }
            }
            return(item);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 获取图鉴所有等级
        /// </summary>
        /// <returns></returns>
        public List <int> GetHandbookLevelList()
        {
            List <int>          handBookLevels = new List <int>();
            List <HandbookData> handbookDatas  = TheHandbookList.Handbooks;

            for (var i = 0; i < handbookDatas.Count; i++)
            {
                HandbookData bookData = handbookDatas[i];
                int          score    = 0;// bookData.Score;
                Hotfix_LT.Data.MannualScoreTemplate _scoreTemplate = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetMannualScoreTemplateByScore(score);
                handBookLevels.Add(_scoreTemplate.id);
            }

            return(handBookLevels);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获取对应图鉴的加成属性
        /// </summary>
        /// <param name="handbookId">1,2,3,7,8,9,10,11</param>
        /// <returns></returns>
        public float GetHanbookAddtion(Hotfix_LT.Data.eRoleAttr handbookId)
        {
            List <HandbookData> handbookDatas = TheHandbookList.Handbooks;

            for (var i = 0; i < handbookDatas.Count; i++)
            {
                HandbookData bookData = handbookDatas[i];
                if (bookData.HandbookId == handbookId)
                {
                    int score = 0;//; bookData.Score;
                    Hotfix_LT.Data.MannualScoreTemplate _scoreTemplate = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetMannualScoreTemplateByScore(score);
                    return(_scoreTemplate.attribute_addition);
                }
            }
            EB.Debug.Log("can not find handbook id : {0}", handbookId);
            return(0);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 获取指定图鉴位置的加成属性
        /// </summary>
        /// <param name="attr">属性类型</param>
        /// <returns></returns>
        public float GetHandbookAddtionFromCard(LTPartnerData partner, IHandBookAddAttrType attr)
        {
            if (partner == null)
            {
                EB.Debug.LogError("Get Partner is null");
                return(0);
            }
            //int race = partner.HeroInfo.race;
            //int charType = (int)partner.HeroInfo.char_type;
            float addNum = 0;

            if (TheHandbookList == null)
            {
                EB.Debug.LogError("LTPartnerHandbookManager.GetHandbookAddtionFromCard TheHandbookList is null");
                return(0);
            }
            List <HandbookData> handbookDatas = TheHandbookList.Handbooks;

            if (handbookDatas == null)
            {
                EB.Debug.LogError("LTPartnerHandbookManager.GetHandbookAddtionFromCard handbookDatas is null");
                return(0);
            }
            for (var i = 0; i < handbookDatas.Count; i++)
            {
                HandbookData bookData = handbookDatas[i];
                if (bookData.HandbookId == partner.HeroInfo.char_type)
                {
                    for (int j = 0; j < (LTPartnerConfig.MAX_HANDBOOKPAGE + 1); j++)//兼容多页签
                    {
                        LTPartnerData cardPartner = bookData.CardsInfo[(int)attr + j * 5].SetHandBookCard();
                        if (cardPartner != null)
                        {
                            Hotfix_LT.Data.MannualRoleGradeTemplate roleGrade = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetMannualRoleGradeTempleteByRoleGrade(cardPartner.HeroInfo.role_grade);
                            if (roleGrade != null)
                            {
                                addNum += cardPartner.Star * roleGrade.star_addition * 100;
                            }
                        }
                    }
                }
            }
            return(addNum);
        }
Exemplo n.º 6
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);
        }
Exemplo n.º 7
0
        public bool IsHandPartnerCanUp(eRoleAttr handbookId)
        {
            if (GetHandBookLevel() < UnLockLevel)
            {
                return(false);
            }
            if (TheHandbookList == null)
            {
                EB.Debug.LogError("LTPartnerHandbookManager.IsHandPartnerCanUp TheHandbookList is null");
                return(false);
            }
            HandbookData templist = TheHandbookList.Find(handbookId);

            if (templist == null)
            {
                EB.Debug.LogError("LTPartnerHandbookManager.IsHandPartnerCanUp templist is null");
                return(false);
            }
            return(templist.HasAvailableCard);
        }
Exemplo n.º 8
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);
        }
Exemplo n.º 9
0
        public HandbookData Find(Hotfix_LT.Data.eRoleAttr HandbookId)
        {
            HandbookData item = Handbooks.Where(m => m.HandbookId == HandbookId).FirstOrDefault();

            return(item);
        }