示例#1
0
 /// <summary>
 /// 通过状态BUFF的类型获取当前BUFF对象
 /// </summary>
 public BuffBase GetStateBuff(eBuffState type)
 {
     for (int i = 0; i < m_buffList.Count; i++)
     {
         BuffBase buff = m_buffList[i];
         if (buff.IsStateBuff() && buff.GetVal1() == (int)type)
         {
             return(buff);
         }
     }
     return(null);
 }
示例#2
0
 /// <summary>
 /// 包含状态类BUFF
 /// </summary>
 public bool bStateBuff(eBuffState type)
 {
     if (m_buffList == null)
     {
         return(false);
     }
     for (int i = 0; i < m_buffList.Count; i++)
     {
         BuffBase buff = m_buffList[i];
         if (buff.IsStateBuff() && buff.GetVal1() == (int)type)
         {
             return(true);
         }
     }
     return(false);
 }
示例#3
0
        /// <summary>
        /// 通过BUFF的攻击增减
        /// </summary>
        public FixedPoint GetBuffSpeed(FixedPoint cur)
        {
            if (m_buffList == null)
            {
                return(FixedPoint.N_0);
            }
            FixedPoint newVal = FixedPoint.N_0;

            for (int i = 0; i < m_buffList.Count; i++)
            {
                BuffBase buff = m_buffList[i];
                if (buff.GetBuffType() == eBuffType.speed)
                {
                    FixedPoint pct = buff.GetVal1() * new FixedPoint(0.01f);
                    newVal += cur * pct;
                }
            }
            return(newVal);
        }
示例#4
0
        /// <summary>
        /// 通过BUFF的攻击增减
        /// </summary>
        public int GetBuffAp(int cur)
        {
            if (m_buffList == null)
            {
                return(0);
            }
            int newVal = 0;

            for (int i = 0; i < m_buffList.Count; i++)
            {
                BuffBase buff = m_buffList[i];
                if (buff.GetBuffType() == eBuffType.atk)
                {
                    FixedPoint pct = buff.GetVal1() * new FixedPoint(0.01f);
                    newVal += (int)(cur * pct).value;
                }
            }
            return(newVal);
        }