Files
space-station-14/Content.Shared/Kitchen/Components/HandheldGrinderComponent.cs
ScarKy0 897a2d40bc Add Mortar and Handheld Juicer (#42019)
* init

* API

* testing

* review

* return

* good enough, fix later

TODO:
Proper prototype
DoAfter
Sounds

* "proper" prototype

TODO
DoAfter
Sprite

* proper protos, mortar sprite

* juicer sprites

TODO:
Juicer sounds
Makeshift crafting recipes
Add regular to vendors

* sprite tweak

* juicing sound, cleanup, construction

* vendors

* line end

* attribution newline

* small balance tweak

* Let it be known id never webedit

* meta

* item size

* review

* handhelds

* partial review

* cache solution, looping

* graph

* review

* popup

---------

Co-authored-by: Janet Blackquill <uhhadd@gmail.com>
2026-01-16 00:19:42 +00:00

55 lines
1.8 KiB
C#

using Content.Shared.Chemistry.Components;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
namespace Content.Shared.Kitchen.Components;
/// <summary>
/// Indicates this entity is a handheld grinder.
/// Entities with <see cref="ExtractableComponent"/> can be used on handheld grinders to extract their solutions.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class HandheldGrinderComponent : Component
{
/// <summary>
/// The length of the doAfter.
/// After it ends, the respective GrinderProgram is used on the contents.
/// </summary>
[DataField, AutoNetworkedField]
public TimeSpan DoAfterDuration = TimeSpan.FromSeconds(4f);
/// <summary>
/// Popup to use after the current item is done processing.
/// </summary>
[DataField, AutoNetworkedField]
public LocId FinishedPopup = "handheld-grinder-default";
/// <summary>
/// The sound to play when the doAfter starts.
/// </summary>
[DataField]
public SoundSpecifier Sound = new SoundPathSpecifier("/Audio/Items/Culinary/mortar_grinding.ogg", AudioParams.Default.WithLoop(true));
/// <summary>
/// The grinder program to use.
/// Decides whether this one will Juice or Grind the objects.
/// </summary>
[DataField, AutoNetworkedField]
public GrinderProgram Program = GrinderProgram.Grind;
/// <summary>
/// The solution into which the output reagents will go.
/// </summary>
[DataField, AutoNetworkedField]
public string SolutionName = "grinderOutput";
/// <summary>
/// Cached solution from the grinder.
/// </summary>
[ViewVariables]
public Entity<SolutionComponent>? GrinderSolution;
// Used to cancel the sound.
public EntityUid? AudioStream;
}