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); }
public void ClearUp() { mId = 0; mRemindTime = 0; mIntervalTime = 0; mCaster = null; mBuffMgr = null; mData = null; mLvData = null; mEffectValue.Clear(); mAllEffectValue.Clear(); }
private bool CheckReplace(CSTable.BuffLevelData buffData) { Buff buff = GetBuff(buffData.id); if (null == buff) { return(true); } if (buff.Data.replaceMode == (int)eBuffReplaceMode.NoReplace) { return(false); } if (buff.Data.replaceMode == (int)eBuffReplaceMode.ReplaceLevel) { if (buffData.level < buff.Level) { return(false); } } return(true); }