2021-11-03 16:48:03 -07:00
|
|
|
|
using Content.Shared.FixedPoint;
|
|
|
|
|
|
using Robust.Shared.GameObjects;
|
2021-03-05 01:08:38 +01:00
|
|
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
2020-12-07 14:52:55 +01:00
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
|
namespace Content.Shared.MobState.State
|
2020-12-07 14:52:55 +01:00
|
|
|
|
{
|
2021-03-05 01:08:38 +01:00
|
|
|
|
[ImplicitDataDefinitionForInheritors]
|
2020-12-07 14:52:55 +01:00
|
|
|
|
public abstract class BaseMobState : IMobState
|
|
|
|
|
|
{
|
|
|
|
|
|
protected abstract DamageState DamageState { get; }
|
|
|
|
|
|
|
|
|
|
|
|
public virtual bool IsAlive()
|
|
|
|
|
|
{
|
|
|
|
|
|
return DamageState == DamageState.Alive;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public virtual bool IsCritical()
|
|
|
|
|
|
{
|
|
|
|
|
|
return DamageState == DamageState.Critical;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public virtual bool IsDead()
|
|
|
|
|
|
{
|
|
|
|
|
|
return DamageState == DamageState.Dead;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public virtual bool IsIncapacitated()
|
|
|
|
|
|
{
|
|
|
|
|
|
return IsCritical() || IsDead();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public virtual void EnterState(IEntity entity) { }
|
|
|
|
|
|
|
|
|
|
|
|
public virtual void ExitState(IEntity entity) { }
|
|
|
|
|
|
|
2021-11-03 16:48:03 -07:00
|
|
|
|
public virtual void UpdateState(IEntity entity, FixedPoint2 threshold) { }
|
2020-12-07 14:52:55 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|