49 lines
1.5 KiB
C#
49 lines
1.5 KiB
C#
namespace BaseGames.Combat
|
||
{
|
||
/// <summary>
|
||
/// 可受击实体接口。PlayerController 和 EnemyBase 实现此接口。
|
||
/// HurtBox.Awake 通过 GetComponentInParent<IDamageable>() 注入。
|
||
/// </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);
|
||
}
|
||
}
|