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;
|
2020-09-26 14:28:55 +01:00
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
using Robust.Shared.Localization;
|
2021-12-26 05:32:01 +03:00
|
|
|
using System.Threading;
|
2020-09-26 14:28:55 +01:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Kitchen.Components
|
2020-09-26 14:28:55 +01:00
|
|
|
{
|
2021-12-26 05:32:01 +03:00
|
|
|
[RegisterComponent, Friend(typeof(KitchenSpikeSystem))]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class KitchenSpikeComponent : SharedKitchenSpikeComponent, ISuicideAct
|
2020-09-26 14:28:55 +01:00
|
|
|
{
|
2021-12-26 05:32:01 +03:00
|
|
|
public int MeatParts;
|
|
|
|
|
public string? MeatPrototype;
|
2021-12-08 17:17:12 +01:00
|
|
|
|
2022-02-16 00:23:23 -07:00
|
|
|
// TODO: Spiking alive mobs? (Replace with uid) (deal damage to their limbs on spiking, kill on first butcher attempt?)
|
2021-12-26 05:32:01 +03:00
|
|
|
public string MeatSource1p = "?";
|
|
|
|
|
public string MeatSource0 = "?";
|
|
|
|
|
public string MeatName = "?";
|
2020-09-26 14:28:55 +01:00
|
|
|
|
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-02-18 14:49:50 +07:00
|
|
|
|
2021-12-26 05:32:01 +03:00
|
|
|
// ECS this out!, when DragDropSystem and InteractionSystem refactored
|
2021-05-22 21:06:40 -07:00
|
|
|
public override bool DragDropOn(DragDropEvent eventArgs)
|
2021-02-18 14:49:50 +07:00
|
|
|
{
|
|
|
|
|
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)
|
2020-09-26 14:28:55 +01:00
|
|
|
{
|
2021-05-17 02:12:17 -07:00
|
|
|
var othersMessage = Loc.GetString("comp-kitchen-spike-suicide-other", ("victim", victim));
|
2020-09-26 14:28:55 +01:00
|
|
|
victim.PopupMessageOtherClients(othersMessage);
|
|
|
|
|
|
2021-05-17 02:12:17 -07:00
|
|
|
var selfMessage = Loc.GetString("comp-kitchen-spike-suicide-self");
|
2020-09-26 14:28:55 +01:00
|
|
|
victim.PopupMessage(selfMessage);
|
|
|
|
|
|
|
|
|
|
return SuicideKind.Piercing;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|