Convert suicide to ecs (#8091)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -14,7 +14,7 @@ namespace Content.Server.Recycling.Components
|
||||
// TODO: Add sound and safe beep
|
||||
[RegisterComponent]
|
||||
[Friend(typeof(RecyclerSystem))]
|
||||
public sealed class RecyclerComponent : Component, ISuicideAct
|
||||
public sealed class RecyclerComponent : Component
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
|
||||
@@ -44,27 +44,6 @@ namespace Content.Server.Recycling.Components
|
||||
}
|
||||
}
|
||||
|
||||
SuicideKind ISuicideAct.Suicide(EntityUid victim, IChatManager chat)
|
||||
{
|
||||
if (_entMan.TryGetComponent(victim, out ActorComponent? actor) &&
|
||||
actor.PlayerSession.ContentData()?.Mind is { } mind)
|
||||
{
|
||||
EntitySystem.Get<GameTicker>().OnGhostAttempt(mind, false);
|
||||
mind.OwnedEntity?.PopupMessage(Loc.GetString("recycler-component-suicide-message"));
|
||||
}
|
||||
|
||||
victim.PopupMessageOtherClients(Loc.GetString("recycler-component-suicide-message-others",
|
||||
("victim", victim)));
|
||||
|
||||
if (_entMan.TryGetComponent<SharedBodyComponent?>(victim, out var body))
|
||||
{
|
||||
body.Gib(true);
|
||||
}
|
||||
|
||||
EntitySystem.Get<RecyclerSystem>().Bloodstain(this);
|
||||
return SuicideKind.Bloodloss;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Default sound to play when recycling
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user