Ejemplo n.º 1
0
        private void calculate(LTPartnerData data, RefreshType type)
        {
            switch (type)
            {
            case RefreshType.Attribute:
                attripower = AttributesManager.GetSelfAttributeCombatPower(data);
                break;

            case RefreshType.Skill:
                skillper   = AttributesManager.GetPartnerSkillPowerPer(data);
                attripower = AttributesManager.GetSelfAttributeCombatPower(data);
                break;

            case RefreshType.EquipsuitSkill:
                suitskillper = AttributesManager.GetEquipSuitPer(data);
                attripower   = AttributesManager.GetSelfAttributeCombatPower(data);
                break;

            case RefreshType.All:
                attripower   = AttributesManager.GetSelfAttributeCombatPower(data);
                skillper     = AttributesManager.GetPartnerSkillPowerPer(data);
                suitskillper = AttributesManager.GetEquipSuitPer(data);
                break;

            default:
                break;
            }
            curPower = (int)(attripower * (1 + skillper + suitskillper));
        }
Ejemplo n.º 2
0
        private void ShowAttri()
        {
            LTAttributesData attriData = AttributesManager.GetPartnerAttributesByParnterData(curParData);

            double addHP    = 0;
            double addAtk   = 0;
            double addDef   = 0;
            double addSpeed = 0;

            if (curType == LTParGradeStarUp.GradeUp)
            {
                addHP    = attriData.m_MaxHP - oldAttrData.m_MaxHP;
                addAtk   = attriData.m_ATK - oldAttrData.m_ATK;
                addDef   = attriData.m_DEF - oldAttrData.m_DEF;
                addSpeed = attriData.m_Speed - oldAttrData.m_Speed;
            }
            else if (curType == LTParGradeStarUp.StarUp)
            {
                addHP    = attriData.m_MaxHP - oldAttrData.m_MaxHP;
                addAtk   = attriData.m_ATK - oldAttrData.m_ATK;
                addDef   = attriData.m_DEF - oldAttrData.m_DEF;
                addSpeed = attriData.m_Speed - oldAttrData.m_Speed;
            }

            string strHp    = addHP >= 0 ? " [42fe79]+" : " [42fe79]-";
            string strAtk   = addAtk >= 0 ? " [42fe79]+" : " [42fe79]-";
            string strDef   = addDef >= 0 ? " [42fe79]+" : " [42fe79]-";
            string strSpeed = addSpeed >= 0 ? " [42fe79]+" : " [42fe79]-";

            // 加上0.5是为了做四舍五入
            LifeLabel.text = addHP == 0 ? ((int)(attriData.m_MaxHP + 0.5)).ToString() : (int)(attriData.m_MaxHP - addHP + 0.5) + strHp + Mathf.Abs((int)(attriData.m_MaxHP + 0.5) - (int)(attriData.m_MaxHP - addHP + 0.5));
            AtkLabel.text  = addAtk == 0 ? ((int)(attriData.m_ATK + 0.5)).ToString() : (int)(attriData.m_ATK - addAtk + 0.5) + strAtk + Mathf.Abs((int)(attriData.m_ATK + 0.5) - (int)(attriData.m_ATK - addAtk + 0.5));
            DefLabel.text  = addDef == 0 ? ((int)(attriData.m_DEF + 0.5)).ToString() : (int)(attriData.m_DEF - addDef + 0.5) + strDef + Mathf.Abs((int)(attriData.m_DEF + 0.5) - (int)(attriData.m_DEF - addDef + 0.5));
            CritLabel.text = addSpeed == 0 ? ((int)(attriData.m_Speed + 0.5)).ToString() : (int)(attriData.m_Speed - addSpeed + 0.5) + strSpeed + Mathf.Abs((int)(attriData.m_Speed + 0.5) - (int)(attriData.m_Speed - addSpeed + 0.5));
        }
Ejemplo n.º 3
0
        private void Refresh()
        {
            LTAttributesData oldLevelAttr = AttributesManager.GetPartnerAttributesByParnterData(curAniData.parData, curAniData.oldLv + aniPlayCount - 1);
            LTAttributesData addLevelAttr = AttributesManager.GetPartnerAttributesByParnterData(curAniData.parData, curAniData.oldLv + aniPlayCount);

            addLevelAttr.Sub(oldLevelAttr);
            LTAttributesData oldAttrData = new LTAttributesData(curAniData.oldAttr);

            curAniData.oldAttr.Add(addLevelAttr);
            curAniData.culCon.PlayAttrAni(oldAttrData, curAniData.oldAttr, curAniData.oldLv + aniPlayCount);
        }
Ejemplo n.º 4
0
        /// <summary>获取觉醒加成</summary>
        public static LTAttributesData GetPartnerAwakenAttributes(LTPartnerData partnerData)
        {
            LTAttributesData attrData = new LTAttributesData();

            if (partnerData.IsAwaken <= 0)
            {
                return(attrData);
            }
            LTAttributesData baseAttr = AttributesManager.GetPartnerBaseAttr(partnerData.HeroStat.id, partnerData.UpGradeId, partnerData.Star, partnerData.StarHole, partnerData.Level, partnerData.AllRoundLevel, partnerData.ControlLevel, partnerData.StrongLevel, partnerData.RageLevel, partnerData.AbsorbedLevel, partnerData.IsAwaken, partnerData.InfoId);

            Hotfix_LT.Data.HeroAwakeInfoTemplate temp = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroAwakeInfoByInfoID(partnerData.InfoId);
            attrData.m_MaxHP = baseAttr.m_MaxHP * temp.inc_MaxHP;
            attrData.m_ATK   = baseAttr.m_ATK * temp.inc_ATK;
            attrData.m_DEF   = baseAttr.m_DEF * temp.inc_DEF;
            attrData.m_Speed = baseAttr.m_Speed * temp.inc_speed;
            return(attrData);
        }
Ejemplo n.º 5
0
 public void ShowAwaken()
 {
     //获取基础属性
     canClose    = false;
     hasShow     = false;
     isInitLobby = true;
     controller.gameObject.CustomSetActive(true);
     StartCoroutine(CreateBuddyModel(ShowLobbyTexture, curpartnerData.HeroInfo.model_name, true, false));
     BeforeAttriData = AttributesManager.GetPartnerAttributesByParnterData(curpartnerData);
     RaiseAttriData  = AttributesManager.GetPartnerAwakenAttributes(curpartnerData);
     BeforeAttriData.Sub(RaiseAttriData);
     //初始化数据
     SetInfo();
     controller.gameObject.CustomSetActive(true);
     playtween = PlayAwakenTween();
     StartCoroutine(playtween);
 }
Ejemplo n.º 6
0
        private void ShowAttr()
        {
            LTAttributesData curAttrData  = AttributesManager.GetPartnerAttributesByParnterData(partnerData);
            LTAttributesData baseAttrData = AttributesUtil.GetBaseAttributes(partnerData);
            LTAttributesData equipData    = AttributesManager.GetPartnerEquipmentAttributes(baseAttrData, partnerData.EquipmentTotleAttr);

            curAttrData.Add(equipData);

            AttrNumLabels[0].text = Mathf.FloorToInt(curAttrData.m_ATK).ToString();

            AttrNumLabels[1].text = Mathf.FloorToInt(curAttrData.m_DEF).ToString();

            AttrNumLabels[2].text = Mathf.FloorToInt(curAttrData.m_MaxHP).ToString();

            float num = curAttrData.m_CritP * 100;

            AttrNumLabels[3].text = string.Format("{0}%", num.ToString("f1"));

            num = curAttrData.m_CritV * 100;
            AttrNumLabels[4].text = string.Format("{0}%", num.ToString("f1"));

            AttrNumLabels[5].text = Mathf.FloorToInt(curAttrData.m_Speed).ToString();

            num = curAttrData.m_SpExtra * 100;
            AttrNumLabels[6].text = string.Format("{0}%", num.ToString("f1"));

            num = curAttrData.m_SpRes * 100;
            AttrNumLabels[7].text = string.Format("{0}%", num.ToString("f1"));

            num = curAttrData.m_DamageAdd * 100;
            AttrNumLabels[8].text = string.Format("{0}%", num.ToString("f1"));

            num = curAttrData.m_DamageReduce * 100;
            AttrNumLabels[9].text = string.Format("{0}%", num.ToString("f1"));

            num = curAttrData.m_CritDef * 100;
            AttrNumLabels[10].text = string.Format("{0}%", num.ToString("f1"));
        }
Ejemplo n.º 7
0
        /// <summary>[伙伴基础白字属性]</summary>
        public static LTAttributesData GetPartnerBaseAttributesByParnterData(int heroStatId, int heroUpgradeId, int star, int starHole, int heroLevel, int AllRoundLevel, int ControlLevel, int StrongLevel, int RageLevel, int AbsorbedLevel, int AwakenLevel, int infoId, IDictionary fetter, int commonSkillLevel, int activeSkillLevel, int passiveSkillLevel)
        {
            //********最终白字计算*********
            //伙伴基础白字属性 = [角色成长数值 + 觉醒固定值(只有速度需要计算) + 进阶数值 + 星槽数值 + 潜能固定值(只有速度需要计算)] * [星级加成% + 技能加成% + 巅峰加成% + 觉醒加成% + 羁绊加成%]
            //*****************************
            LTAttributesData baseAttrData = AttributesManager.GetPartnerBaseAttr(heroStatId, heroUpgradeId, star, starHole, heroLevel,
                                                                                 AllRoundLevel, ControlLevel, StrongLevel, RageLevel, AbsorbedLevel,
                                                                                 AwakenLevel, infoId);

            LTAttributesData totalAttrData = new LTAttributesData(baseAttrData);
            LTAttributesData tempAttrData  = new LTAttributesData();

            //星级加成
            tempAttrData = GetPartnerStarNewAttributes(baseAttrData, heroStatId, star);
            totalAttrData.Add(tempAttrData);

            //技能加成
            tempAttrData = GetPartnerSkillAttributes(baseAttrData, heroStatId, commonSkillLevel, activeSkillLevel, passiveSkillLevel);
            totalAttrData.Add(tempAttrData);

            //巅峰加成
            tempAttrData = GetProficiencyMultiAttributes(AllRoundLevel, ControlLevel, StrongLevel, RageLevel, AbsorbedLevel, baseAttrData);
            totalAttrData.Add(tempAttrData);

            //觉醒加成
            tempAttrData = GetPartnerShowAwakenAttributes(baseAttrData, infoId, AwakenLevel > 0);
            totalAttrData.Add(tempAttrData);

            //羁绊加成
            if (fetter != null)
            {
                tempAttrData = GetOtherPartnerGuardAttributes(baseAttrData, fetter);
                totalAttrData.Add(tempAttrData);
            }
            return(totalAttrData);
        }
Ejemplo n.º 8
0
        public static LTAttributesData GetBaseAttributes(LTPartnerData partnerData)
        {
            LTAttributesData baseAttrData = AttributesManager.GetPartnerBaseAttributesByParnterData(partnerData.HeroStat.id, partnerData.UpGradeId, partnerData.Star, partnerData.StarHole, partnerData.Level, partnerData.AllRoundLevel, partnerData.ControlLevel, partnerData.StrongLevel, partnerData.RageLevel, partnerData.AbsorbedLevel, partnerData.IsAwaken, partnerData.InfoId, LTPartnerDataManager.Instance.GetGuardHash(partnerData.HeroId), partnerData.CommonSkillLevel, partnerData.ActiveSkillLevel, partnerData.PassiveSkillLevel);

            return(baseAttrData);
        }