Exemplo n.º 1
0
        public bool Init(CSTable.BuffLevelData levelData)
        {
            if (null == levelData)
            {
                return(false);
            }

            if (mId == 0)
            {
                mId = ServerFrame.Util.GenerateObjID(ServerFrame.GameObjectType.Buffer);
            }
            mLvData       = levelData;
            mData         = CSTable.StaticDataManager.Buff[levelData.id];
            mRemindTime   = (long)(LevelData.affectTime * 1000);
            mIntervalTime = LevelData.affectRate * 1000;
            mIntervalTime = mIntervalTime != 0 ? mIntervalTime : -1000;
            ParseEffectParam();
            if (LevelData.affectRate < 0)
            {
                mLogicType = eBuffLogicType.Static;
            }
            else if (LevelData.affectRate == 0)
            {
                mLogicType = eBuffLogicType.Fixed;
            }
            else
            {
                mLogicType = eBuffLogicType.Continual;
            }

            return(true);
        }
Exemplo n.º 2
0
        public void Tick(long elapsedMillisecond)
        {
            mDelList.Clear();
            mAddList.Clear();
            foreach (var val in mBuffers.Values)
            {
                if (!val.Tick(elapsedMillisecond))
                {
                    if (null == mOwner || mOwner.IsDie)
                    {
                        return;
                    }

                    mDelList.Add(val);
                }
            }

            foreach (var buff in mDelList)
            {
                CSTable.BuffData tempData = buff.Data;
                DeleteBuffer(buff.Id);
                if (tempData.assId > 0)
                {
                    //触发后续buff
                    mAddList.Add(tempData);
                }
            }
            foreach (var val in mAddList)
            {
                CreateBuff(val.assId, val.assLevel);
            }
        }
Exemplo n.º 3
0
 public void ClearUp()
 {
     mId           = 0;
     mRemindTime   = 0;
     mIntervalTime = 0;
     mCaster       = null;
     mBuffMgr      = null;
     mData         = null;
     mLvData       = null;
     mEffectValue.Clear();
     mAllEffectValue.Clear();
 }
Exemplo n.º 4
0
        /// <summary>
        /// 计算实际影响
        /// </summary>
        public override void ComputeImpact()
        {
            if (null == Owner || null == Target || null == Skill)
            {
                return;
            }

            Action action = Skill.mAction;

            if (null == action.actionParams || action.actionParams.Count != 4)
            {
                return;
            }

            int   buffId     = (int)action.actionParams[0];
            int   buffLevel  = (int)action.actionParams[1];
            int   buffTarget = (int)action.actionParams[2];
            float buffRate   = (float)action.actionParams[3];

            if (Util.Rand.Next(100) > buffRate)
            {
                return;
            }

            CSTable.BuffData buffData = CSTable.StaticDataManager.Buff[buffId];
            if (null == buffData)
            {
                return;
            }

            if (null != Owner.BuffMgr.GetBuff(buffId))
            {
                if (Skill.mStep == eSkillStep.Delay)
                {
                    return;
                }
            }

            if (Target.PlayerStatus.IsImmunityBuffStatus(buffData.type))
            {
                return;
            }

            if (!Target.IsImmunityDebuff())
            {
            }

            Target.BuffMgr.CreateBuffBySkill(buffId, buffLevel, Skill);
        }
Exemplo n.º 5
0
        public bool BuffAddStatusType(CSTable.BuffData data, RoleActor owner)
        {
            if (null == data || null == owner)
            {
                return(false);
            }

            if (!AddStatusType(data.type))
            {
                return(false);
            }

            //对特殊buff状态的处理

            return(true);
        }