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:
@@ -1,7 +1,6 @@
|
||||
using Content.Server.Actions;
|
||||
using Content.Server.Inventory;
|
||||
using Content.Server.Mind.Components;
|
||||
using Content.Server.MobState;
|
||||
using Content.Server.Polymorph.Components;
|
||||
using Content.Server.Popups;
|
||||
using Content.Shared.Actions;
|
||||
@@ -9,7 +8,8 @@ using Content.Shared.Actions.ActionTypes;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.IdentityManagement;
|
||||
using Content.Shared.MobState.Components;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Content.Shared.Polymorph;
|
||||
using Robust.Server.Containers;
|
||||
using Robust.Shared.Containers;
|
||||
@@ -23,6 +23,7 @@ namespace Content.Server.Polymorph.Systems
|
||||
[Dependency] private readonly IPrototypeManager _proto = default!;
|
||||
[Dependency] private readonly ActionsSystem _actions = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageable = default!;
|
||||
[Dependency] private readonly MobThresholdSystem _mobThresholdSystem = default!;
|
||||
[Dependency] private readonly PopupSystem _popup = default!;
|
||||
[Dependency] private readonly ServerInventorySystem _inventory = default!;
|
||||
[Dependency] private readonly SharedHandsSystem _sharedHands = default!;
|
||||
@@ -75,7 +76,7 @@ namespace Content.Server.Polymorph.Systems
|
||||
|
||||
if (proto.TransferDamage &&
|
||||
TryComp<DamageableComponent>(component.Parent, out var damageParent) &&
|
||||
_damageable.GetScaledDamage(uid, component.Parent, out var damage) &&
|
||||
_mobThresholdSystem.GetScaledDamage(uid, component.Parent, out var damage) &&
|
||||
damage != null)
|
||||
{
|
||||
_damageable.SetDamage(damageParent, damage);
|
||||
|
||||
Reference in New Issue
Block a user