using System.Collections.Generic;
|
|
/**
|
* 无尽模式buff基类
|
* @Author: chenxin
|
* @Date: 2020-11-16 18:21:10
|
*/
|
namespace KTGMGemClient
|
{
|
public class EndlessBuff
|
{
|
public EndlessBuff()
|
{
|
BuffList = new List<EndlessBuffConfig>();
|
}
|
|
/// <summary>
|
/// 属于自己这个类别的buff列表
|
/// </summary>
|
public List<EndlessBuffConfig> BuffList;
|
|
/// <summary>
|
/// 添加buff的时候会调用Handle处理函数
|
/// </summary>
|
public virtual void Handle()
|
{
|
|
}
|
|
/// <summary>
|
/// 当buff失效时会调用次函数
|
/// </summary>
|
public virtual void LoseEffect()
|
{
|
|
}
|
|
/// <summary>
|
/// 判断buff是否生效
|
/// </summary>
|
/// <param name="gemId"></param>
|
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 == 201)
|
attributeId = 2;
|
else if (gemId == 301)
|
attributeId = 3;
|
isEffective = attributeId == buffData.Config.target_type[1];
|
break;
|
case EndlessBuffUseTarget.Designated:
|
isEffective = gemId == buffData.Config.target_type[1];
|
break;
|
}
|
|
return isEffective;
|
}
|
}
|
}
|