多轮审查和修复

This commit is contained in:
2026-05-12 15:34:08 +08:00
parent f55d2a57c3
commit ebbbb7332e
805 changed files with 838724 additions and 1905 deletions

View File

@@ -0,0 +1,54 @@
namespace BaseGames.Combat.StatusEffects
{
/// <summary>
/// 中毒效果(架构 06_CombatModule §11
/// 规则:最多叠加 3 层;每层叠加伤害 +1每 1 秒造成 StackCount 点 True 伤害。
/// </summary>
public class PoisonEffect : StatusEffect
{
private const float BaseDuration = 5.0f; // 持续 5 秒
private const float DotInterval = 1.0f; // 每 1 秒一次
public override StatusEffectType EffectType => StatusEffectType.Poison;
public override int MaxStacks => 3;
public PoisonEffect()
{
TickInterval = DotInterval;
}
public override void OnApply(StatusEffectManager owner)
{
base.OnApply(owner);
UpdateShader();
}
public override void OnStack()
{
base.OnStack();
UpdateShader();
}
public override void OnTick()
{
var info = new DamageInfo.Builder()
.SetRaw(StackCount) // 叠层越多伤害越高
.SetType(DamageType.True)
.SetFlags(DamageFlags.IgnoreIFrame)
.Build();
Owner?.ApplyDirectDamage(info);
}
public override void OnExpire()
{
StackCount = 0;
Owner?.SetShaderParam("_PoisonGlow", 0f);
}
private void UpdateShader()
=> Owner?.SetShaderParam("_PoisonGlow", StackCount / (float)MaxStacks);
protected override float GetBaseDuration() => BaseDuration;
public override string GetDisplayName() => $"中毒 ×{StackCount}";
}
}