Пример #1
0
        /// <summary>进阶数值</summary>
        private static LTAttributesData GetPartnerGradeAttributes(int heroStatId, int gradeId)
        {
            LTAttributesData attrData = new LTAttributesData();

            Hotfix_LT.Data.HeroStatTemplate heroTem = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(heroStatId);
            if (heroTem != null)
            {
                Hotfix_LT.Data.HeroInfoTemplate heroInfoTpl = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(heroTem.character_id);
                if (heroInfoTpl == null)
                {
                    EB.Debug.LogError("伙伴信息为空,Characterid = {0}", heroTem.character_id);
                    return(attrData);
                }
                Hotfix_LT.Data.UpGradeInfoTemplate gradeInfoByGrade = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetUpGradeInfo(gradeId, heroInfoTpl.char_type);
                if (gradeInfoByGrade == null)
                {
                    EB.Debug.LogError("gradeInfoByGrade升阶信息为空,gradeid = {0}", gradeId);
                    return(attrData);
                }
                Hotfix_LT.Data.LevelUpInfoTemplate BaseAttr = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetLevelUpInfoByIDAndLevel(heroStatId, gradeInfoByGrade.level);
                if (gradeInfoByGrade != null)
                {
                    attrData.m_MaxHP = BaseAttr.maxHP * gradeInfoByGrade.inc_maxhp;
                    attrData.m_ATK   = BaseAttr.ATK * gradeInfoByGrade.inc_atk;
                    attrData.m_DEF   = BaseAttr.DEF * gradeInfoByGrade.inc_def;
                    attrData.m_Speed = BaseAttr.speed * gradeInfoByGrade.inc_speed;
                }
            }

            return(attrData);
        }
Пример #2
0
        public void ShowUI(string heroId, bool isShowHp = false, bool isShowTempHp = false)
        {
            ResetStarGrid();
            int star        = 0;
            var tpl         = new Hotfix_LT.Data.HeroStatTemplate();
            var charTpl     = new Hotfix_LT.Data.HeroInfoTemplate();
            int upGradeId   = 0;
            int awakenLevel = 0;

            if (int.Parse(heroId) < 0)//hire
            {
                var hireInfo = LTInstanceHireUtil.GetHireInfoByHeroId(int.Parse(heroId));
                if (hireInfo == null)
                {
                    EB.Debug.Log("userTeam data heroID <= {0}", heroId);
                    mDMono.gameObject.CustomSetActive(false);
                    return;
                }
                int nInfoID = int.Parse(hireInfo.character_id);

                star      = hireInfo.star;
                tpl       = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStatByInfoId(nInfoID);
                charTpl   = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(nInfoID);
                upGradeId = hireInfo.upgrade;
                if (HireObj != null)
                {
                    HireObj.CustomSetActive(true);
                }
            }
            else
            {
                HireObj.CustomSetActive(false);
                Hashtable heroStatData = null;
                if (!DataLookupsCache.Instance.SearchDataByID <Hashtable>(SmallPartnerPacketRule.OWN_HERO_STATS + "." + heroId, out heroStatData))
                {
                    EB.Debug.LogError("not hero data for heroId ={0}", heroId);
                    mDMono.gameObject.CustomSetActive(false);
                    return;
                }

                string hero_templateid = EB.Dot.String("template_id", heroStatData, "");
                if (string.IsNullOrEmpty(hero_templateid))
                {
                    EB.Debug.LogError("hero_templateid is IsNullOrEmpty");
                    return;
                }

                star        = EB.Dot.Integer("star", heroStatData, 0);
                tpl         = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(hero_templateid);
                charTpl     = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(tpl.character_id, EB.Dot.Integer("skin", heroStatData, 0));
                upGradeId   = EB.Dot.Integer("stat.awake.level", heroStatData, 0);
                awakenLevel = EB.Dot.Integer("stat.awaken.level", heroStatData, 0);
            }

            OnShow(heroId, charTpl, star, upGradeId, awakenLevel, isShowHp, isShowTempHp);
        }
Пример #3
0
        /// <summary>技能加成</summary>
        private static LTAttributesData GetPartnerSkillAttributes(LTAttributesData baseAttr, int heroStatId, int commonSkillLevel, int activeSkillLevel, int passiveSkillLevel)
        {
            LTAttributesData attrData = new LTAttributesData();

            Hotfix_LT.Data.HeroStatTemplate heroTem = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(heroStatId);
            if (heroTem != null)
            {
                LTAttributesData attr1 = GetSkillAttr(baseAttr, heroTem.common_skill, commonSkillLevel);
                attrData.Add(attr1);
                LTAttributesData attr2 = GetSkillAttr(baseAttr, heroTem.active_skill, activeSkillLevel);
                attrData.Add(attr2);
                LTAttributesData attr3 = GetSkillAttr(baseAttr, heroTem.passive_skill, passiveSkillLevel);
                attrData.Add(attr3);
            }
            return(attrData);
        }
Пример #4
0
        /// <summary>星级加成</summary>
        private static LTAttributesData GetPartnerStarNewAttributes(LTAttributesData baseAttr, int heroStatId, int star)
        {
            LTAttributesData attrData = new LTAttributesData();;

            Hotfix_LT.Data.HeroStatTemplate heroTem = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(heroStatId);
            if (heroTem != null)
            {
                Hotfix_LT.Data.StarUpInfoTemplate tpl = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetStarUpInfo(star);
                if (tpl != null)
                {
                    attrData.m_MaxHP = baseAttr.m_MaxHP * (tpl.IncMaxHp - 1);
                    attrData.m_ATK   = baseAttr.m_ATK * (tpl.IncATK - 1);
                    attrData.m_DEF   = baseAttr.m_DEF * (tpl.IncDEF - 1);
                }
            }

            return(attrData);
        }