public int AddBuff(BuffParam param) { if (param.templateID <= 0) { return((int)BuffDefines.ActionReult.Act_ParamError); } Buff_Tbl buffTbl = TemplatePool.Instance.GetDataByKey <Buff_Tbl>(param.templateID); if (null == buffTbl) { return((int)BuffDefines.ActionReult.Act_CfgError); } // firstly cover same series foreach (var value in m_buffList.Values) { if (null == value) { continue; } Buff_Tbl buffTemp = value.GetTemplate(); if (buffTemp.buffType == buffTbl.buffType) { if ((int)BuffDefines.CoverType.Cover == buffTbl.coverType) { CoverBuff(value, param); return((int)BuffDefines.ActionReult.Act_Success); } } } return(DoAddBuff(param)); }
public void Reset() { mId = 0; mValid = false; mTemplate = null; mLogic = null; mSpawnTime = 0; mLifeTime = 0; mLastEffectTimePassed = 0; }
public void Init(int id, BuffParam param) { Reset(); this.m_id = id; m_template = TemplatePool.Instance.GetDataByKey <Buff_Tbl>(param.templateID); if (m_template != null) { } }
public void Reset() { m_id = 0; m_valid = false; m_param = null; m_template = null; m_birthTime = 0; m_lifeTime = 0; m_persistTime = 0; }
public void Init(int instId, BuffParam param) { Reset(); this.mId = instId; mParam = param; mTemplate = ConfigPool.Instance.GetDataByKey<Buff_Tbl>(param.templateID); if (mTemplate == null) { this.Valid = false; Log.LogError("Buff : wrong template id " + param.templateID); } else { mLogic = BuffLogicManager.GetBuffLogic(mTemplate.buffType); if (null == mLogic) { Log.LogError("Buff.Init : bufflogic is null, buff id is " + param.templateID); } } }