Files
OldThink/Content.Server/Kitchen/Components/KitchenSpikeComponent.cs

48 lines
1.7 KiB
C#
Raw Normal View History

2021-06-09 22:19:39 +02:00
using Content.Server.Act;
using Content.Server.Chat.Managers;
2021-12-26 05:32:01 +03:00
using Content.Server.Kitchen.EntitySystems;
2021-09-26 15:18:45 +02:00
using Content.Server.Popups;
2021-06-09 22:19:39 +02:00
using Content.Shared.DragDrop;
using Content.Shared.Kitchen.Components;
2021-09-26 15:18:45 +02:00
using Content.Shared.Popups;
2021-12-26 05:32:01 +03:00
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
2021-12-26 05:32:01 +03:00
using System.Threading;
2021-06-09 22:19:39 +02:00
namespace Content.Server.Kitchen.Components
{
2021-12-26 05:32:01 +03:00
[RegisterComponent, Friend(typeof(KitchenSpikeSystem))]
public class KitchenSpikeComponent : SharedKitchenSpikeComponent, ISuicideAct
{
2021-12-26 05:32:01 +03:00
public int MeatParts;
public string? MeatPrototype;
2021-12-08 17:17:12 +01:00
2021-12-26 05:32:01 +03:00
// TODO: Spiking alive mobs? (Replace with uid) (deal damage to their limbs on spiking, kill on first butcher attempt?)
public string MeatSource1p = "?";
public string MeatSource0 = "?";
public string MeatName = "?";
2021-12-26 05:32:01 +03:00
// Prevents simultaneous spiking of two bodies (could be replaced with CancellationToken, but I don't see any situation where Cancel could be called)
public bool InUse;
2021-12-26 05:32:01 +03:00
// ECS this out!, when DragDropSystem and InteractionSystem refactored
public override bool DragDropOn(DragDropEvent eventArgs)
{
return true;
}
2021-12-26 05:32:01 +03:00
// ECS this out!, Handleable SuicideEvent?
2021-12-05 18:09:01 +01:00
SuicideKind ISuicideAct.Suicide(EntityUid victim, IChatManager chat)
{
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);
return SuicideKind.Piercing;
}
}
}