コード例 #1
0
        public void OnAttrChangedMain(eSkillAttrIndex attrIdx)
        {
            if (mUpdateAttrList.Find(x => x == attrIdx) != eSkillAttrIndex.None)
            {
                return;
            }

            mUpdateAttrList.Add(attrIdx);
        }
コード例 #2
0
ファイル: RoleValue.cs プロジェクト: 372285834/GServer
        /// <summary>
        /// 获取最终属性值
        /// </summary>
        public int GetAttrValue(eSkillAttrIndex idx)
        {
            int currValue = 0;

            currValue += GetAttrValueMain(idx);
            currValue += GetAttrValueEx(idx);

            return(currValue);
        }
コード例 #3
0
        public void OnAttrChanged(eSkillAttrIndex attrIdx)
        {
            if (mUpdateAttrList.Find(x => x.Equals(attrIdx)) != eSkillAttrIndex.None)
            {
                return;
            }

            OnAttrChangedMain(attrIdx);
            OnAttrChangedEx(attrIdx);
        }
コード例 #4
0
ファイル: RoleValue.cs プロジェクト: 372285834/GServer
 public int GetAttrBase(eValueType type, eSkillAttrIndex idx)
 {
     if (idx >= eSkillAttrIndex.Power && idx <= eSkillAttrIndex.Dex)
     {
         return(mAttrs[type][(int)idx].Base);
     }
     if (idx >= eSkillAttrIndex.HP && idx < eSkillAttrIndex.MAX)
     {
         return(mSecondAttrs[type][(int)idx].Base);
     }
     return(0);
 }
コード例 #5
0
 public void AddAttrBasePer(eValueType type, eSkillAttrIndex idx, float value)
 {
     OnAttrChanged(idx);
     if (idx >= eSkillAttrIndex.Power && idx <= eSkillAttrIndex.Dex)
     {
         FinalRoleValue.AddAttrBasePer(type, idx, value);
         return;
     }
     if (idx >= eSkillAttrIndex.HP && idx < eSkillAttrIndex.MAX)
     {
         FinalRoleValue.AddSecondAttrBasePer(type, idx, value);
     }
 }
コード例 #6
0
        /// <summary>
        /// 是否广播该属性
        /// </summary>
        /// <param name="idx"></param>
        public bool IsBroadCastAttr(eSkillAttrIndex idx)
        {
            switch (idx)
            {
            case eSkillAttrIndex.Level:
            case eSkillAttrIndex.HP:
            case eSkillAttrIndex.MP:
            case eSkillAttrIndex.MaxHP:
            case eSkillAttrIndex.MaxHPRate:
            case eSkillAttrIndex.MaxMP:
            case eSkillAttrIndex.MoveSpeed:
                return(true);
            }

            return(false);
        }
コード例 #7
0
ファイル: RoleValue.cs プロジェクト: 372285834/GServer
        public int GetAttrValueEx(eSkillAttrIndex idx)
        {
            if (idx >= eSkillAttrIndex.Power && idx <= eSkillAttrIndex.Dex)
            {
            }
            if (idx >= eSkillAttrIndex.HP && idx < eSkillAttrIndex.MAX)
            {
                //float tempValue = 0;
                //tempValue = BuffMgr.GetEffectValue(BuffMgr.BufferTypeTranslate(idx));
                //if (tempValue < 0 && tempValue + GetAttrValueMain(idx) < 0)
                //    tempValue = -1 * GetAttrValueMain(idx);

                //return tempValue;
            }
            return(0);
        }
コード例 #8
0
        /// <summary>
        /// 获取属性值
        /// </summary>
        public bool GetAttrStruct(ref AttrStruct attr, eSkillAttrIndex idx)
        {
            if (idx <= eSkillAttrIndex.None || idx >= eSkillAttrIndex.MAX)
            {
                return(false);
            }

            attr.attrIdx = (byte)idx;
            switch (idx)
            {
            case eSkillAttrIndex.Level:
                attr.attrValue = mRoleLevel.ToString();
                break;

            case eSkillAttrIndex.HP:
                attr.attrValue = CurHP.ToString();
                break;

            case eSkillAttrIndex.MaxHP:
            case eSkillAttrIndex.MaxHPRate:
                attr.attrValue = FinalRoleValue.MaxHP.ToString();
                break;

            case eSkillAttrIndex.MP:
                attr.attrValue = CurMP.ToString();
                break;

            case eSkillAttrIndex.MaxMP:
                attr.attrValue = FinalRoleValue.MaxMP.ToString();
                break;

            case eSkillAttrIndex.MoveSpeed:
                attr.attrValue = FinalRoleValue.Speed.ToString();
                break;

            default:
                return(false);
            }

            return(true);
        }
コード例 #9
0
ファイル: RoleValue.cs プロジェクト: 372285834/GServer
 public int GetAttrValueMain(eSkillAttrIndex idx)
 {
     if (idx >= eSkillAttrIndex.Power && idx <= eSkillAttrIndex.Dex)
     {
         int tempValue = 0;
         for (var i = eValueType.Base; i < eValueType.MAX; i++)
         {
             tempValue += mAttrs[i][(int)idx].Value;
         }
         return(tempValue);
     }
     if (idx >= eSkillAttrIndex.HP && idx < eSkillAttrIndex.MAX)
     {
         int tempValue = 0;
         for (var i = eValueType.Base; i < eValueType.MAX; i++)
         {
             tempValue += mSecondAttrs[i][(int)idx].Value;
         }
         return(tempValue);
     }
     return(0);
 }
コード例 #10
0
 public void OnAttrChangedEx(eSkillAttrIndex attrIdx)
 {
 }
コード例 #11
0
ファイル: RoleValue.cs プロジェクト: 372285834/GServer
 public void AddSecondAttrBasePer(eValueType type, eSkillAttrIndex idx, float value)
 {
     mSecondAttrs[type][(int)idx].AddBasePer(value);
 }
コード例 #12
0
ファイル: RoleValue.cs プロジェクト: 372285834/GServer
 public void SetAttrBasePer(eValueType type, eSkillAttrIndex idx, float value)
 {
     mAttrs[type][(int)idx].SetBasePer(value);
 }
コード例 #13
0
ファイル: RoleValue.cs プロジェクト: 372285834/GServer
 public void AddAttrBase(eValueType type, eSkillAttrIndex idx, int value)
 {
     mAttrs[type][(int)idx].AddBase(value);
 }
コード例 #14
0
ファイル: RoleValue.cs プロジェクト: 372285834/GServer
 public void SetSecondAttrBase(eValueType type, eSkillAttrIndex idx, int value)
 {
     mSecondAttrs[type][(int)idx].Base = value;
 }