Files
zeling_v2/Assets/Scripts/Combat/CombatInterfaces.cs
2026-05-08 11:04:00 +08:00

49 lines
1.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
namespace BaseGames.Combat
{
/// <summary>
/// 可受击实体接口。PlayerController 和 EnemyBase 实现此接口。
/// HurtBox.Awake 通过 GetComponentInParent&lt;IDamageable&gt;() 注入。
/// </summary>
public interface IDamageable
{
bool IsInvincible { get; }
int Defense { get; }
void TakeDamage(DamageInfo info);
}
/// <summary>
/// 可持有霸体的实体接口。HurtBox 在 ReceiveDamage 中做等级比较。
/// </summary>
public interface IPoiseSource
{
PoiseLevel GetCurrentPoiseLevel();
}
/// <summary>
/// 护盾接口(玩家专属)。由 PlayerController.Awake() 注入 HurtBox。
/// AbsorbDamage 返回穿透量0 = 全部吸收,>0 = 穿透量继续走 TakeDamage 流程)。
/// </summary>
public interface IShieldable
{
bool HasShield { get; }
int AbsorbDamage(int amount);
}
/// <summary>
/// 可破坏机关/障碍物接口。HitBox 在命中非 HurtBox 对象时尝试调用。
/// </summary>
public interface IBreakable
{
void TryInteract(DamageInfo info);
}
/// <summary>
/// 可施加状态效果的实体接口(避免 Combat 直接引用 StatusEffects 程序集)。
/// StatusEffectManager 实现此接口HurtBox.ReceiveDamage 步骤 8 通过此接口调用。
/// </summary>
public interface IStatusEffectable
{
void ApplyStatusEffect(DamageType type);
}
}