Mobstate Refactor (#13389)

Refactors mobstate and moves mob health thresholds to their own component

Co-authored-by: DrSmugleaf <drsmugleaf@gmail.com>
This commit is contained in:
Jezithyr
2023-01-13 16:57:10 -08:00
committed by GitHub
parent 97e4c477bd
commit eeb5b17b34
148 changed files with 1517 additions and 1290 deletions

View File

@@ -7,7 +7,6 @@ namespace Content.Shared.Alert;
public abstract class AlertsSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
private readonly Dictionary<AlertType, AlertPrototype> _typeToAlert = new();
public IReadOnlyDictionary<AlertKey, AlertState>? GetActiveAlerts(EntityUid euid)
@@ -17,6 +16,16 @@ public abstract class AlertsSystem : EntitySystem
: null;
}
public short GetMaxSeverity(AlertType alertType)
{
return _typeToAlert[alertType].MaxSeverity;
}
public short GetMinSeverity(AlertType alertType)
{
return _typeToAlert[alertType].MinSeverity;
}
public bool IsShowingAlert(EntityUid euid, AlertType alertType)
{
if (!EntityManager.TryGetComponent(euid, out AlertsComponent? alertsComponent))