增加有概率免疫debuff
parent
bffe80b466
commit
82bb5cbe2d
|
|
@ -106,6 +106,9 @@ namespace Gameplay.Buff
|
|||
case EPropType.IgnoreShieldRate:
|
||||
owner.fightData.ignoreShieldRate += changeValue;
|
||||
break;
|
||||
case EPropType.ignoreDebuffRate:
|
||||
owner.fightData.ignoreDebuffRate += changeValue;
|
||||
break;
|
||||
default:
|
||||
DebugUtil.LogError("暂未处理的属性类型:{0}", propType);
|
||||
break;
|
||||
|
|
@ -218,6 +221,9 @@ namespace Gameplay.Buff
|
|||
case EPropType.IgnoreShieldRate:
|
||||
owner.fightData.ignoreShieldRate -= changeValue;
|
||||
break;
|
||||
case EPropType.ignoreDebuffRate:
|
||||
owner.fightData.ignoreDebuffRate -= changeValue;
|
||||
break;
|
||||
default:
|
||||
DebugUtil.LogError("暂未处理的属性类型:{0}", propType);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -109,6 +109,18 @@ namespace Gameplay.Buff
|
|||
DebugUtil.LogError("buff为空");
|
||||
return;
|
||||
}
|
||||
if (buff.configData.BuffEffectType == EBuffEffectType.NegativeBuff)
|
||||
{
|
||||
// 负面buff
|
||||
var randomValue = UnityEngine.Random.Range(0, 1f);
|
||||
var ignoreRate = owner.fightData.ignoreDebuffRate;
|
||||
if (randomValue < ignoreRate)
|
||||
{
|
||||
// 免疫
|
||||
DebugUtil.Log("触发免疫debuff");
|
||||
return;
|
||||
}
|
||||
}
|
||||
var repeatType = buff.configData.RepeatType;
|
||||
var noAdd = false;
|
||||
switch (repeatType)
|
||||
|
|
|
|||
|
|
@ -198,6 +198,11 @@ namespace Gameplay.Common
|
|||
/// </summary>
|
||||
public ObscuredFloat ignoreShieldRate = 0f;
|
||||
|
||||
/// <summary>
|
||||
/// 抵抗debuff的概率
|
||||
/// </summary>
|
||||
public ObscuredFloat ignoreDebuffRate = 0f;
|
||||
|
||||
public UnitFightData(GameUnit owner)
|
||||
{
|
||||
this.owner = owner;
|
||||
|
|
|
|||
|
|
@ -87,6 +87,10 @@ namespace cfg.BuffCfg
|
|||
/// 攻击无视护甲概率
|
||||
/// </summary>
|
||||
IgnoreShieldRate = 18,
|
||||
/// <summary>
|
||||
/// 抵抗debuff概率
|
||||
/// </summary>
|
||||
ignoreDebuffRate = 19,
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue