Convert suicide to ecs (#8091)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -1,15 +1,11 @@
|
||||
using Content.Server.Act;
|
||||
using Content.Server.Chat.Managers;
|
||||
using Content.Shared.Sound;
|
||||
using Content.Shared.Tools;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Server.Toilet
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class ToiletComponent : Component, ISuicideAct
|
||||
public sealed class ToiletComponent : Component
|
||||
{
|
||||
[DataField("pryLidTime")]
|
||||
public float PryLidTime = 1f;
|
||||
@@ -23,12 +19,5 @@ namespace Content.Server.Toilet
|
||||
public bool LidOpen = false;
|
||||
public bool IsSeatUp = false;
|
||||
public bool IsPrying = false;
|
||||
|
||||
// todo: move me to ECS
|
||||
SuicideKind ISuicideAct.Suicide(EntityUid victim, IChatManager chat)
|
||||
{
|
||||
return EntitySystem.Get<ToiletSystem>().Suicide(Owner, victim, this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ using Content.Shared.Body.Components;
|
||||
using Content.Shared.Body.Part;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Toilet;
|
||||
using Content.Shared.Tools.Components;
|
||||
using Robust.Shared.Audio;
|
||||
@@ -35,10 +36,16 @@ namespace Content.Server.Toilet
|
||||
SubscribeLocalEvent<ToiletComponent, InteractUsingEvent>(OnInteractUsing);
|
||||
SubscribeLocalEvent<ToiletComponent, InteractHandEvent>(OnInteractHand);
|
||||
SubscribeLocalEvent<ToiletComponent, ExaminedEvent>(OnExamine);
|
||||
SubscribeLocalEvent<ToiletComponent, SuicideEvent>(OnSuicide);
|
||||
SubscribeLocalEvent<ToiletPryFinished>(OnToiletPried);
|
||||
SubscribeLocalEvent<ToiletPryInterrupted>(OnToiletInterrupt);
|
||||
}
|
||||
|
||||
private void OnSuicide(EntityUid uid, ToiletComponent component, SuicideEvent args)
|
||||
{
|
||||
Suicide(component.Owner, uid, component);
|
||||
}
|
||||
|
||||
private void OnInit(EntityUid uid, ToiletComponent component, ComponentInit args)
|
||||
{
|
||||
EntityManager.EnsureComponent<SecretStashComponent>(uid);
|
||||
|
||||
Reference in New Issue
Block a user