Refactors stunnable to be ECS. (#4819)

Also cleans up StandingStatesystem.
This commit is contained in:
Vera Aguilera Puerto
2021-10-10 12:47:26 +02:00
committed by GitHub
parent 19a588a70a
commit 6eee256b11
34 changed files with 776 additions and 633 deletions

View File

@@ -1,13 +1,16 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using Content.Server.Items;
using Content.Server.MachineLinking.Events;
using Content.Server.MachineLinking.Models;
using Content.Server.Power.Components;
using Content.Server.Stunnable;
using Content.Server.Stunnable.Components;
using Content.Shared.Conveyor;
using Content.Shared.MachineLinking;
using Content.Shared.Movement.Components;
using Content.Shared.Popups;
using Content.Shared.Stunnable;
using Robust.Server.GameObjects;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
@@ -20,6 +23,7 @@ namespace Content.Server.Conveyor
{
public class ConveyorSystem : EntitySystem
{
[Dependency] private StunSystem _stunSystem = default!;
[Dependency] private IEntityLookup _entityLookup = default!;
public override void Initialize()
@@ -60,7 +64,7 @@ namespace Content.Server.Conveyor
args.Cancel();
if (args.Attemptee.TryGetComponent<StunnableComponent>(out var stunnableComponent))
{
stunnableComponent.Paralyze(2);
_stunSystem.Paralyze(uid, TimeSpan.FromSeconds(2f), stunnableComponent);
component.Owner.PopupMessage(args.Attemptee, Loc.GetString("conveyor-component-failed-link"));
}
}