Ejemplo n.º 1
0
    /// <summary>
    /// 英雄属性显示
    /// </summary>
    /// m_InfoValue_txt 气血的值
    /// m_InfoValue_txt_1 物理攻击的值
    /// m_InfoValue_txt_2 法术攻击的值
    /// m_InfoValue_txt_3 物理防御的值
    /// m_InfoValue_txt_4 法术防御的值
    private void ShowHeroLevelAndExp(ObjectCard card)
    {
        //m_HeroMake_btn.gameObject.SetActive(!(m_HeroData.getHeroDes() == "-1.0"));

        //等级显示
        if (card.GetHeroData().Level > m_HeroData.getMaxLevel())
        {
            m_Level_txt.text = m_HeroData.getMaxLevel().ToString();
        }
        else if (card.GetHeroData().Level <= 1)
        {
            m_Level_txt.text = "1";
        }
        else
        {
            m_Level_txt.text = card.GetHeroData().Level.ToString();
        }
        //经验条显示
        //m_ExpBar.value = CurCard.GetHeroData().GetExpPercentage();
        //基础属性
        m_InfoValue_txt.text   = card.GetMaxHP().ToString();
        m_InfoValue_txt_1.text = card.GetPhysicalAttack().ToString();
        m_InfoValue_txt_2.text = card.GetMagicAttack().ToString();
        m_InfoValue_txt_3.text = card.GetPhysicalDefence().ToString();
        m_InfoValue_txt_4.text = card.GetMagicDefence().ToString();
    }
Ejemplo n.º 2
0
        //英雄属性
        private void InitCardData()
        {
            HeroTemplate heroTemp = CurCard.GetHeroRow();

            //星级
            m_HeroStar = heroTemp.getQuality();
            int maxStar = heroTemp.getMaxQuality();

            //星级品质界面控制
            for (int i = 0; i < 5; i++)
            {
                star[i].enabled   = i + 1 <= m_HeroStar;
                starBG[i].enabled = i + 1 <= maxStar;
            }


            //等级显示
            m_HeroLevel       = CurCard.GetHeroData().Level;
            HeroLevelTxt.text = m_HeroLevel.ToString();
            //经验条显示
            ExpSlider.value        = CurCard.GetHeroData().GetExpPercentage();
            m_ExpSliderImg.enabled = false;
            if (m_HeroLevel >= heroTemp.getMaxLevel())
            {
                m_ExpSliderImg.enabled = true;
            }
            CurCard.UpdateAttributeValue();
            //基础属性
            HpTxt.text         = CurCard.GetMaxHP().ToString();
            PhyAtkTxt.text     = CurCard.GetPhysicalAttack().ToString();
            ApAtkTxt.text      = CurCard.GetMagicAttack().ToString();
            PhyDefenseTxt.text = CurCard.GetPhysicalDefence().ToString();
            ApDefenseTxt.text  = CurCard.GetMagicDefence().ToString();
            if (CurCard.GetHeroRow().getStageUpTargetID() == -1)
            {
                //OrderUpImage.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_xinxi_31");
                GameUtils.SetBtnSpriteGrayState(OrderUp, true);
            }
            else
            {
                //OrderUpImage.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_xinxi_22");
                GameUtils.SetBtnSpriteGrayState(OrderUp, false);
            }

            InitCardDetailedData();
        }
Ejemplo n.º 3
0
    //英雄属性
    private void InitCardData()
    {
        //星级
        m_HeroStar = _HeroItem.getQuality();
        int maxStar = _HeroItem.getMaxQuality();

        for (int i = 5; i < 10; ++i)
        {
            selfTransform.FindChild("HeroInof_LeftUP/Stars").GetChild(i).GetComponent <Image>().enabled     = i < 5 + m_HeroStar;
            selfTransform.FindChild("HeroInof_LeftUP/Stars").GetChild(i - 5).GetComponent <Image>().enabled = i < 5 + maxStar;
            //if (i < 5 + m_HeroStar)
            //{
            //    Image temp = selfTransform.FindChild("HeroInof_LeftUP/Stars").GetChild(i).GetComponent<Image>();
            //    temp.enabled = true;
            //}
            //else
            //{

            //    Image temp = selfTransform.FindChild("HeroInof_LeftUP/Stars").GetChild(i).GetComponent<Image>();
            //    temp.enabled = false;
            //}
        }
        //等级显示
        m_HeroLevel       = CurCard.GetHeroData().Level;
        HeroLevelTxt.text = m_HeroLevel.ToString();
        //经验条显示
        ExpSlider.value = CurCard.GetHeroData().GetExpPercentage();
        //基础属性
        HpTxt.text         = CurCard.GetMaxHP().ToString();
        PhyAtkTxt.text     = CurCard.GetPhysicalAttack().ToString();
        ApAtkTxt.text      = CurCard.GetMagicAttack().ToString();
        PhyDefenseTxt.text = CurCard.GetPhysicalDefence().ToString();
        ApDefenseTxt.text  = CurCard.GetMagicDefence().ToString();
        //if (CurCard.GetHeroRow().getQuality() == CurCard.GetHeroRow().getMaxQuality())
        //{
        //	OrderUpImage.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_xinxi_31", typeof(Sprite)) as Sprite;
        //}
        //else
        //{
        //	OrderUpImage.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_xinxi_22", typeof(Sprite)) as Sprite;
        //}
    }
Ejemplo n.º 4
0
        //public void OnClickSelf()
        //{
        //    UI_HomeControler.Inst.AddUI("UI_Home/UI_ItemMessage_2_2");
        //    UI_Item._instance.UpdateShow(mItem);

        //}

        //显示英雄信息界面详细信息界面
        public void InitCardDetailedData(int num, ObjectCard _card)
        {
            CardDetailedDataName      = selfTransform.FindChild("Name").GetComponent <Text>();
            CardDetailedDataBaseValue = selfTransform.FindChild("BaseValue").GetComponent <Text>();
            CardDetailedDataBuffValue = selfTransform.FindChild("BuffValue").GetComponent <Text>();
            switch (num)
            {
            case 1:    //生命值
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute1des");
                CardDetailedDataBaseValue.text = _card.GetBaseMaxHP().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetMaxHP() - _card.GetBaseMaxHP()).ToString();
            }
            break;

            case 2:    //物理攻击力
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute2des");
                CardDetailedDataBaseValue.text = _card.GetPhysicalBaseAttack().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetPhysicalAttack() - _card.GetPhysicalBaseAttack()).ToString();
            }
            break;

            case 3:    //法术攻击力
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute4des");
                CardDetailedDataBaseValue.text = _card.GetMagicBaseAttack().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetMagicAttack() - _card.GetMagicBaseAttack()).ToString();
            }
            break;

            case 4:    //物理防御力
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute3des");
                CardDetailedDataBaseValue.text = _card.GetPhysicalBaseDefence().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetPhysicalDefence() - _card.GetPhysicalBaseDefence()).ToString();
            }
            break;

            case 5:    //法术防御力
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute5des");
                CardDetailedDataBaseValue.text = _card.GetMagicBaseDefence().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetMagicDefence() - _card.GetMagicBaseDefence()).ToString();
            }
            break;

            case 6:    //命中
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute6des");
                CardDetailedDataBaseValue.text = _card.GetBaseHit().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetHit() - _card.GetBaseHit()).ToString();
            }
            break;

            case 7:    //闪避
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute7des");
                CardDetailedDataBaseValue.text = _card.GetBaseDodge().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetDodge() - _card.GetBaseDodge()).ToString();
            }
            break;

            case 8:    //暴击
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute8des");
                CardDetailedDataBaseValue.text = _card.GetBaseCritical().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetCritical() - _card.GetBaseCritical()).ToString();
            }
            break;

            case 9:    //暴击伤害率
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute16des");
                CardDetailedDataBaseValue.text = _card.GetCriticalHurtAddRate() * 100 + "%";
                CardDetailedDataBuffValue.text = "+" + (_card.GetCriticalHurtAddRate() - _card.GetCriticalHurtAddRate()).ToString();
            }
            break;

            case 10:    //韧性
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute9des");
                CardDetailedDataBaseValue.text = _card.GetBaseTenacity().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetTenacity() - _card.GetBaseTenacity()).ToString();
            }
            break;

            case 11:    //速度
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute10des");
                CardDetailedDataBaseValue.text = _card.GetBaseSpeed().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetSpeed() - _card.GetBaseSpeed()).ToString();
            }
            break;

            case 12:    //生命恢复力
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute11des");
                CardDetailedDataBaseValue.text = _card.GetHpRecover().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetHpRecover() - _card.GetHpRecover()).ToString();
            }
            break;

            case 13:    //初始怒气值
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute25des");
                CardDetailedDataBaseValue.text = _card.GetInitPowerAddition().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetInitPowerAddition() - _card.GetInitPowerAddition()).ToString();
            }
            break;

            case 14:    //物理伤害加深率
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute20des");
                CardDetailedDataBaseValue.text = _card.GetPhysicalHurtAddPermil() * 100 + "%";
                CardDetailedDataBuffValue.text = "+" + (_card.GetPhysicalHurtAddPermil() - _card.GetPhysicalHurtAddPermil()).ToString();
            }
            break;

            case 15:    //法术伤害加深率
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute18des");
                CardDetailedDataBaseValue.text = _card.GetMagicHurtAddPermil() * 100 + "%";
                CardDetailedDataBuffValue.text = "+" + (_card.GetMagicHurtAddPermil() - _card.GetMagicHurtAddPermil()).ToString();
            }
            break;

            case 16:    //伤害附加值
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute21des");
                CardDetailedDataBaseValue.text = _card.GetExtraHurt().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetExtraHurt() - _card.GetExtraHurt()).ToString();
            }
            break;

            case 17:    //物理伤害减免率
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute17des");
                CardDetailedDataBaseValue.text = _card.GetPhysicalHurtReducePermil() * 100 + "%";
                CardDetailedDataBuffValue.text = "+" + (_card.GetPhysicalHurtReducePermil() - _card.GetPhysicalHurtReducePermil()).ToString();
            }
            break;

            case 18:    //法术伤害减免率
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute19des");
                CardDetailedDataBaseValue.text = _card.GetMagicHurtReducePermil() * 100 + "%";
                CardDetailedDataBuffValue.text = "+" + (_card.GetMagicHurtReducePermil() - _card.GetMagicHurtReducePermil()).ToString();
            }
            break;

            case 19:    //伤害减免值
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute22des");
                CardDetailedDataBaseValue.text = _card.GetReduceHurtPoint().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetReduceHurtPoint() - _card.GetReduceHurtPoint()).ToString();
            }
            break;
            }
        }
Ejemplo n.º 5
0
    /// <summary>
    /// 属性类型                    是否显示
    ///1 生命值                        1
    ///2 物攻值                        1
    ///3 物防值                        1
    ///4 法攻值                        1
    ///5 法防值                        1
    ///6 命中值                        1
    ///7 闪避值
    ///8 暴击值
    ///9 韧性值
    ///10 速度值
    ///11 恢复值
    ///12 命中率*1000
    ///13 闪避率*1000
    ///14 暴击率*1000
    ///15 韧性率*1000
    ///16 暴击伤害率*1000
    ///17 物伤加成率*1000
    ///18 物伤减免率*1000
    ///19 法伤加成率*1000
    ///20 法伤减免率*1000
    ///21 附加伤害值
    ///22 绝对减伤值
    ///23 普攻吸血*1000
    ///24 减少技能CD*1000
    ///25 初始加成怒气*1000
    ///26 攻击额外怒气*1000
    ///27 受击额外怒气*1000
    ///101 生命率*1000
    ///102 物攻率*1000
    ///103 物防率*1000
    ///104 法攻率*1000
    ///105 法防率*1000
    /// </summary>
    /// <param name="data"></param>
    /// <returns></returns>
    public static Dictionary <int, Pair> CompareAttriDic(ObjectCard _ObjectCard, List <X_GUID> items = null)
    {
        Dictionary <int, int> curDic   = new Dictionary <int, int>();
        Dictionary <int, int> afterDic = new Dictionary <int, int>();

        HeroData curHd = _ObjectCard.GetHeroData();

        ObjectCard beforC   = new ObjectCard();
        HeroData   beforCHd = beforC.GetHeroData();

        beforCHd.Copy(curHd);
        beforC.UpdateAttributeValue();

        curDic.Add(1, (int)beforC.GetMaxHP());                     //生命值;
        curDic.Add(2, beforC.GetPhysicalAttack());                 //物理攻击力;
        curDic.Add(4, beforC.GetMagicAttack());                    //法术攻击力
        curDic.Add(3, beforC.GetPhysicalDefence());                //物理防御力
        curDic.Add(5, beforC.GetMagicDefence());                   //法术防御力;
        curDic.Add(6, beforC.GetHit());                            //命中;
        curDic.Add(7, beforC.GetDodge());                          //闪避;
        curDic.Add(8, beforC.GetCritical());                       //暴击;
        curDic.Add(16, (int)beforC.GetCriticalRate());             //暴击率;
        curDic.Add(9, beforC.GetTenacity());                       //韧性;
        curDic.Add(10, beforC.GetSpeed());                         //速度;
        curDic.Add(11, (int)beforC.GetHpRecover());                //生命恢复力;
        curDic.Add(25, (int)beforC.GetInitPowerAddition());        //初始怒气;
        curDic.Add(17, (int)beforC.GetPhysicalHurtAddPermil());    //物理伤害加成率;
        curDic.Add(19, (int)beforC.GetMagicHurtAddPermil());       //法伤加成率;
        curDic.Add(21, beforC.GetExtraHurt());                     //伤害附加值;
        curDic.Add(18, (int)beforC.GetPhysicalHurtReducePermil()); //物伤减免率;
        curDic.Add(20, (int)beforC.GetMagicHurtReducePermil());    //法伤减免率;
        curDic.Add(22, (int)beforC.GetReduceHurtPoint());          //伤害减免值;

        ObjectCard tmpCard = new ObjectCard();
        HeroData   tmpHD   = tmpCard.GetHeroData();

        tmpHD.Copy(curHd);
        // 全部符文(当前属性是装备符文后的-没有符文的)属性加成与符文更换(符文更改后的减去-符文更改前的);
        bool isInverse = true;

        if (items != null)
        {
            isInverse = false;
            //如果选择的更换符文已经装备在其身上,那么相当于换位置或者卸载--所以需要去除重复值;
            List <X_GUID> tmpItems = new List <X_GUID>();
            foreach (X_GUID x in items)
            {
                X_GUID i = new X_GUID();
                i.Copy(x);
                tmpItems.Add(i);
            }

            int idx = -1;
            if (GetItemsListRepeatFirstIdx(tmpItems, ref idx))
            {
                tmpItems[idx].CleanUp();
            }

            tmpHD.SetEquipItems(tmpItems);
            tmpCard.UpdateItemEffectValue();
        }

        tmpCard.UpdateSpellEffectValue();
        tmpCard.UpdateTeamEffectValue();

        afterDic.Add(1, (int)tmpCard.GetMaxHP());                     //生命值;
        afterDic.Add(2, tmpCard.GetPhysicalAttack());                 //物理攻击力;
        afterDic.Add(3, tmpCard.GetPhysicalDefence());                //物理防御力;
        afterDic.Add(4, tmpCard.GetMagicAttack());                    //法术攻击力;
        afterDic.Add(5, tmpCard.GetMagicDefence());                   //法术防御力;
        afterDic.Add(6, tmpCard.GetHit());                            //命中;
        afterDic.Add(7, tmpCard.GetDodge());                          //闪避;
        afterDic.Add(8, tmpCard.GetCritical());                       //暴击;
        afterDic.Add(16, (int)tmpCard.GetCriticalRate());             //暴击率;
        afterDic.Add(9, tmpCard.GetTenacity());                       //韧性;
        afterDic.Add(10, tmpCard.GetSpeed());                         //速度;
        afterDic.Add(11, (int)tmpCard.GetHpRecover());                //生命恢复力;
        afterDic.Add(25, (int)tmpCard.GetInitPowerAddition());        //初始怒气;
        afterDic.Add(17, (int)tmpCard.GetPhysicalHurtAddPermil());    //物理伤害加成率;
        afterDic.Add(19, (int)tmpCard.GetMagicHurtAddPermil());       //法伤加成率;
        afterDic.Add(21, tmpCard.GetExtraHurt());                     //伤害附加值;
        afterDic.Add(18, (int)tmpCard.GetPhysicalHurtReducePermil()); //物伤减免率;
        afterDic.Add(20, (int)tmpCard.GetMagicHurtReducePermil());    //法伤减免率;
        afterDic.Add(22, tmpCard.GetReduceHurtPoint());               //伤害减免值;

        if (isInverse)
        {
            return(GetDifference(afterDic, curDic));
        }
        else
        {
            return(GetDifference(curDic, afterDic));
        }
    }
Ejemplo n.º 6
0
    // 英雄最大属性值 [6/4/2015 Zmy]
    public float GetHeroMaxAttributeValue(EM_ATTRIBUTE _type)
    {
        float[] _attriValue = new float[GlobalMembers.MAX_TEAM_CELL_COUNT];
        for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; i++)
        {
            ObjectCard pHero = ObjectSelf.GetInstance().HeroContainerBag.FindHero(m_HeroInfo[i]);
            if (pHero != null)
            {
                switch (_type)
                {
                case EM_ATTRIBUTE.EM_ATTRIBUTE_MAXHP:
                    _attriValue[i] = pHero.GetMaxHP();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_PHYSICALATTACK:
                    _attriValue[i] = pHero.GetPhysicalAttack();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_MAGICATTACK:
                    _attriValue[i] = pHero.GetMagicAttack();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_PHYSICALDEFENCE:
                    _attriValue[i] = pHero.GetPhysicalDefence();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_MAGICDEFENCE:
                    _attriValue[i] = pHero.GetMagicDefence();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_HIT:
                    _attriValue[i] = pHero.GetHit();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_DODGE:
                    _attriValue[i] = pHero.GetDodge();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_CRITICAL:
                    _attriValue[i] = pHero.GetCritical();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_TENACITY:
                    _attriValue[i] = pHero.GetTenacity();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_MOVESPEED:
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_SPEED:
                    _attriValue[i] = pHero.GetSpeed();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_HIT_RATE:
                    _attriValue[i] = pHero.GetHitRate();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_DODGE_RATE:
                    _attriValue[i] = pHero.GetDodgeRate();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_CRITICAL_RATE:
                    _attriValue[i] = pHero.GetCriticalRate();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_TENACITY_RATE:
                    _attriValue[i] = pHero.GetTenacityRate();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_PHYSICAL_HURT_ADD_PERMIL:
                    _attriValue[i] = pHero.GetPhysicalHurtAddPermil();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_PHYSICAL_HRUT_REDUCE_PERMIL:
                    _attriValue[i] = pHero.GetPhysicalHurtReducePermil();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_MAGIC_HURT_ADD_PERMIL:
                    _attriValue[i] = pHero.GetMagicHurtAddPermil();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_MAGIC_HURT_REDUCE_PERMIL:
                    _attriValue[i] = pHero.GetMagicHurtReducePermil();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_CRITICAL_HURT_ADD_RATE:
                    _attriValue[i] = pHero.GetCriticalHurtAddRate();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_CRITICAL_HURT_REDUCE_RATE:
                    _attriValue[i] = pHero.GetCriticalHurtReduceRate();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_EXTRA_HURT:
                    _attriValue[i] = pHero.GetExtraHurt();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_REDUCE_HURT_POINT:
                    _attriValue[i] = pHero.GetReduceHurtPoint();
                    break;

                case EM_ATTRIBUTE.EM_ATTRIBUTE_HPRECOVER:
                    _attriValue[i] = pHero.GetHpRecover();
                    break;

                default:
                    break;
                }
            }
        }

        return(GameUtils.MaxValue(_attriValue));
    }