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:
@@ -3,12 +3,12 @@ using System.Linq;
|
||||
using Content.Server.GameTicking.Presets;
|
||||
using Content.Server.GameTicking.Rules;
|
||||
using Content.Server.Ghost.Components;
|
||||
using Content.Server.MobState;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Damage.Prototypes;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.MobState.Components;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Robust.Server.Player;
|
||||
|
||||
namespace Content.Server.GameTicking
|
||||
@@ -17,6 +17,8 @@ namespace Content.Server.GameTicking
|
||||
{
|
||||
public const float PresetFailedCooldownIncrease = 30f;
|
||||
|
||||
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
|
||||
|
||||
public GamePresetPrototype? Preset { get; private set; }
|
||||
|
||||
private bool StartPreset(IPlayerSession[] origReadyPlayers, bool force)
|
||||
@@ -193,7 +195,7 @@ namespace Content.Server.GameTicking
|
||||
|
||||
if (canReturnGlobal && TryComp(playerEntity, out MobStateComponent? mobState))
|
||||
{
|
||||
if (_mobState.IsCritical(playerEntity.Value, mobState))
|
||||
if (_mobStateSystem.IsCritical(playerEntity.Value, mobState))
|
||||
{
|
||||
canReturn = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user