Пример #1
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));
        }
    }
Пример #2
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));
    }