Convert suicide to ecs (#8091)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -15,6 +15,8 @@ using System;
|
||||
using Content.Shared.Storage;
|
||||
using Robust.Shared.Random;
|
||||
using static Content.Shared.Kitchen.Components.SharedKitchenSpikeComponent;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Popups;
|
||||
|
||||
namespace Content.Server.Kitchen.EntitySystems
|
||||
{
|
||||
@@ -35,6 +37,20 @@ namespace Content.Server.Kitchen.EntitySystems
|
||||
//DoAfter
|
||||
SubscribeLocalEvent<KitchenSpikeComponent, SpikingFinishedEvent>(OnSpikingFinished);
|
||||
SubscribeLocalEvent<KitchenSpikeComponent, SpikingFailEvent>(OnSpikingFail);
|
||||
|
||||
SubscribeLocalEvent<KitchenSpikeComponent, SuicideEvent>(OnSuicide);
|
||||
}
|
||||
|
||||
private void OnSuicide(EntityUid uid, KitchenSpikeComponent component, SuicideEvent args)
|
||||
{
|
||||
if (args.Handled) return;
|
||||
args.SetHandled(SuicideKind.Piercing);
|
||||
var victim = args.Victim;
|
||||
var othersMessage = Loc.GetString("comp-kitchen-spike-suicide-other", ("victim", victim));
|
||||
victim.PopupMessageOtherClients(othersMessage);
|
||||
|
||||
var selfMessage = Loc.GetString("comp-kitchen-spike-suicide-self");
|
||||
victim.PopupMessage(selfMessage);
|
||||
}
|
||||
|
||||
private void OnSpikingFail(EntityUid uid, KitchenSpikeComponent component, SpikingFailEvent args)
|
||||
|
||||
Reference in New Issue
Block a user