New Feature: Kitchen spike rework (#38723)

* Start

* Wow, text

* Ultra raw

* More stuff

* Wow, DOT and gibbing!!!

* More stuff

* More

* Update

* Yes

* Almost there

* Done?

* I forgot

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Beck

* Unhardcode
This commit is contained in:
Winkarst-cpu
2025-08-19 20:56:36 +03:00
committed by GitHub
parent de240e1739
commit 021adbe1e1
16 changed files with 688 additions and 388 deletions

View File

@@ -1,34 +1,51 @@
using Content.Shared.Kitchen;
using Content.Shared.Storage;
using Robust.Shared.GameStates;
namespace Content.Shared.Nutrition.Components
namespace Content.Shared.Nutrition.Components;
/// <summary>
/// Indicates that the entity can be butchered.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class ButcherableComponent : Component
{
/// <summary>
/// Indicates that the entity can be thrown on a kitchen spike for butchering.
/// List of the entities that this entity should spawn after being butchered.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class ButcherableComponent : Component
{
[DataField("spawned", required: true)]
public List<EntitySpawnEntry> SpawnedEntities = new();
/// <remarks>
/// Note that <see cref="SharedKitchenSpikeSystem"/> spawns one item at a time and decreases the amount until it's zero and then removes the entry.
/// </remarks>
[DataField("spawned", required: true), AutoNetworkedField]
public List<EntitySpawnEntry> SpawnedEntities = [];
[ViewVariables(VVAccess.ReadWrite), DataField("butcherDelay")]
public float ButcherDelay = 8.0f;
/// <summary>
/// Time required to butcher that entity.
/// </summary>
[DataField, AutoNetworkedField]
public float ButcherDelay = 8.0f;
[ViewVariables(VVAccess.ReadWrite), DataField("butcheringType")]
public ButcheringType Type = ButcheringType.Knife;
/// <summary>
/// Prevents butchering same entity on two and more spikes simultaneously and multiple doAfters on the same Spike
/// </summary>
[ViewVariables]
public bool BeingButchered;
}
public enum ButcheringType : byte
{
Knife, // e.g. goliaths
Spike, // e.g. monkeys
Gibber // e.g. humans. TODO
}
/// <summary>
/// Tool type used to butcher that entity.
/// </summary>
[DataField("butcheringType"), AutoNetworkedField]
public ButcheringType Type = ButcheringType.Knife;
}
public enum ButcheringType : byte
{
/// <summary>
/// E.g. goliaths.
/// </summary>
Knife,
/// <summary>
/// E.g. monkeys.
/// </summary>
Spike,
/// <summary>
/// E.g. humans.
/// </summary>
Gibber // TODO
}