多轮审查和修复
This commit is contained in:
45
Assets/Scripts/Combat/StatusEffects/FireEffect.cs
Normal file
45
Assets/Scripts/Combat/StatusEffects/FireEffect.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
namespace BaseGames.Combat.StatusEffects
|
||||
{
|
||||
/// <summary>
|
||||
/// 燃烧效果(架构 06_CombatModule §11)。
|
||||
/// 规则:不可叠加(MaxStacks = 1);重复施加刷新持续时间;每 0.5 秒造成 1 点 True 伤害。
|
||||
/// </summary>
|
||||
public class FireEffect : StatusEffect
|
||||
{
|
||||
private const float BaseDuration = 3.0f; // 持续 3 秒
|
||||
private const float DotInterval = 0.5f; // 每 0.5 秒一次
|
||||
|
||||
public override StatusEffectType EffectType => StatusEffectType.Fire;
|
||||
public override int MaxStacks => 1;
|
||||
|
||||
public FireEffect()
|
||||
{
|
||||
TickInterval = DotInterval;
|
||||
}
|
||||
|
||||
public override void OnApply(StatusEffectManager owner)
|
||||
{
|
||||
base.OnApply(owner);
|
||||
owner.SetShaderParam("_FireGlow", 1f);
|
||||
}
|
||||
|
||||
/// <summary>每次 DoT Tick 造成 1 点 True 伤害(绕过护盾,无敌帧不免疫)。</summary>
|
||||
public override void OnTick()
|
||||
{
|
||||
var info = new DamageInfo.Builder()
|
||||
.SetRaw(1)
|
||||
.SetType(DamageType.True)
|
||||
.SetFlags(DamageFlags.IgnoreIFrame)
|
||||
.Build();
|
||||
Owner?.ApplyDirectDamage(info);
|
||||
}
|
||||
|
||||
public override void OnExpire()
|
||||
{
|
||||
Owner?.SetShaderParam("_FireGlow", 0f);
|
||||
}
|
||||
|
||||
protected override float GetBaseDuration() => BaseDuration;
|
||||
public override string GetDisplayName() => "燃烧";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user