示例#1
0
文件: Bio.cs 项目: niuniuzhu/Lockstep
        internal void CreateBuffState(string id, Buff buff)
        {
            BuffStateData buffStateData = ModelFactory.GetBuffStateData(id);

            //有免疫限制技能的属性,并且将要产生的state是限制类型,则不会生效
            if (this.property.immuneDisables > 0 &&
                buffStateData.beneficialType == BeneficialType.Debuff)
            {
                return;
            }

            bool create = true;

            if (buffStateData.overlapType == BuffStateOverlapType.Replace ||
                buffStateData.overlapType == BuffStateOverlapType.Unique)
            {
                BSBase bs = this.GetBuffState(id);
                if (bs != null)
                {
                    switch (buffStateData.overlapType)
                    {
                    case BuffStateOverlapType.Replace:
                        this.DestroyBuffStateImmediately(bs);
                        break;

                    case BuffStateOverlapType.Unique:
                        bs.Unite();
                        create = false;
                        break;
                    }
                }
            }
            if (create)
            {
                SyncEventHelper.BuffStateAdded(this.rid, id, buff.rid);
                BSBase buffState = BSBase.Create(buffStateData.type);
                buffState.Init(id, this, buff);
                this._buffStates.Add(buffState);
            }
        }