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

@@ -11,7 +11,7 @@ using Content.Shared.Follower;
using Content.Shared.GameTicking;
using Content.Shared.Ghost;
using Content.Shared.Ghost.Roles;
using Content.Shared.MobState;
using Content.Shared.Mobs;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Server.Player;
@@ -56,16 +56,16 @@ namespace Content.Server.Ghost.Roles
private void OnMobStateChanged(EntityUid uid, GhostRoleComponent component, MobStateChangedEvent args)
{
switch (args.CurrentMobState)
switch (args.NewMobState)
{
case DamageState.Alive:
case MobState.Alive:
{
if (!component.Taken)
RegisterGhostRole(component);
break;
}
case DamageState.Critical:
case DamageState.Dead:
case MobState.Critical:
case MobState.Dead:
UnregisterGhostRole(component);
break;
}