using System.Collections.Generic; /** * 无尽模式buff基类 * @Author: chenxin * @Date: 2020-11-16 18:21:10 */ namespace KTGMGemClient { public class EndlessBuff { public EndlessBuff() { BuffList = new List(); } /// /// 属于自己这个类别的buff列表 /// public List BuffList; /// /// 添加buff的时候会调用Handle处理函数 /// public virtual void Handle() { } /// /// 当buff失效时会调用次函数 /// public virtual void LoseEffect() { } /// /// 判断buff是否生效 /// /// protected bool IsEffective(EndlessBuffConfig buffData, int gemId) { bool isEffective = false; switch (buffData.UseTarget) { case EndlessBuffUseTarget.All: isEffective = true; break; case EndlessBuffUseTarget.Element: int attributeId = 0; if (gemId == 101) attributeId = 1; else if (gemId == 105) attributeId = 2; else if (gemId == 109) attributeId = 3; isEffective = attributeId == buffData.Config.target_type[1]; break; case EndlessBuffUseTarget.Designated: isEffective = gemId == buffData.Config.target_type[1]; break; } return isEffective; } } }