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

50 lines
2.0 KiB
C#
Raw Normal View History

using Content.Shared.Kitchen;
using Content.Server.Kitchen.EntitySystems;
2022-07-29 14:13:12 +12:00
using Robust.Shared.Audio;
Rerun of "Add Reagent Grinder/Juicer" (#2570) * commit skeleton reagent grinder component * add reagentgrinder bounduserinterface, add suffix to grinder yml, add reagentgrinder sprites * implement much more of the grinder ui functionality * get more use out of hasbeaker bool * complete wiring up most of the chamber/beaker UI controls * remove whitelist prototype id. add grindable tag component * add juiceable component * rename boolparam to be clearer * more juice * add some juice reagents and apply them to their drink prototypes * re add glassyellow * implement juicing and results * add time delay to grindjuice * add reagent grinder visualizer, add reagent grinder sounds, fix some yaml errors too * interface has clear indication of currennt operation, and busy status * add ReagentGrinder to Client ignnored components * Update Content.Client/GameObjects/Components/Kitchen/ReagentGrinderBoundUserInterface.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Client/GameObjects/Components/Kitchen/ReagentGrinderBoundUserInterface.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Shared/Kitchen/SharedReagentGrinderComponent.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * implemennt sloth changes * fix isbusy * Disable grind/juice buttons if there's nothing to grind or juice, also some misc fixes * unsubscribe from messages on remove + fix xmlcomment * fix bounding box * Add these to dictionary * Add these to client ignore * Whitespace and unneeded import fixes * tommy's toes * Where'd these newlines come from * power * improve bounding box * Check power better & show contents when beaker is ejected * check power here * Disable eject buttons when running * improve comments * readwrite for viewvars on work time and capacity * Address most of Sloth's reviews * Make this cleaner * add grindablecomponent to motherfucking everything * Fix reviews * some more null suppressions * remove unused random field Co-authored-by: scuffedjays <yetanotherscuffed@gmail.com> Co-authored-by: namespace-Memory <66768086+namespace-Memory@users.noreply.github.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2020-11-26 14:53:42 +02:00
2021-06-09 22:19:39 +02:00
namespace Content.Server.Kitchen.Components
Rerun of "Add Reagent Grinder/Juicer" (#2570) * commit skeleton reagent grinder component * add reagentgrinder bounduserinterface, add suffix to grinder yml, add reagentgrinder sprites * implement much more of the grinder ui functionality * get more use out of hasbeaker bool * complete wiring up most of the chamber/beaker UI controls * remove whitelist prototype id. add grindable tag component * add juiceable component * rename boolparam to be clearer * more juice * add some juice reagents and apply them to their drink prototypes * re add glassyellow * implement juicing and results * add time delay to grindjuice * add reagent grinder visualizer, add reagent grinder sounds, fix some yaml errors too * interface has clear indication of currennt operation, and busy status * add ReagentGrinder to Client ignnored components * Update Content.Client/GameObjects/Components/Kitchen/ReagentGrinderBoundUserInterface.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Client/GameObjects/Components/Kitchen/ReagentGrinderBoundUserInterface.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Shared/Kitchen/SharedReagentGrinderComponent.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * implemennt sloth changes * fix isbusy * Disable grind/juice buttons if there's nothing to grind or juice, also some misc fixes * unsubscribe from messages on remove + fix xmlcomment * fix bounding box * Add these to dictionary * Add these to client ignore * Whitespace and unneeded import fixes * tommy's toes * Where'd these newlines come from * power * improve bounding box * Check power better & show contents when beaker is ejected * check power here * Disable eject buttons when running * improve comments * readwrite for viewvars on work time and capacity * Address most of Sloth's reviews * Make this cleaner * add grindablecomponent to motherfucking everything * Fix reviews * some more null suppressions * remove unused random field Co-authored-by: scuffedjays <yetanotherscuffed@gmail.com> Co-authored-by: namespace-Memory <66768086+namespace-Memory@users.noreply.github.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2020-11-26 14:53:42 +02:00
{
/// <summary>
/// The combo reagent grinder/juicer. The reason why grinding and juicing are seperate is simple,
/// think of grinding as a utility to break an object down into its reagents. Think of juicing as
/// converting something into its single juice form. E.g, grind an apple and get the nutriment and sugar
/// it contained, juice an apple and get "apple juice".
/// </summary>
[Access(typeof(ReagentGrinderSystem)), RegisterComponent]
public sealed partial class ReagentGrinderComponent : Component
Rerun of "Add Reagent Grinder/Juicer" (#2570) * commit skeleton reagent grinder component * add reagentgrinder bounduserinterface, add suffix to grinder yml, add reagentgrinder sprites * implement much more of the grinder ui functionality * get more use out of hasbeaker bool * complete wiring up most of the chamber/beaker UI controls * remove whitelist prototype id. add grindable tag component * add juiceable component * rename boolparam to be clearer * more juice * add some juice reagents and apply them to their drink prototypes * re add glassyellow * implement juicing and results * add time delay to grindjuice * add reagent grinder visualizer, add reagent grinder sounds, fix some yaml errors too * interface has clear indication of currennt operation, and busy status * add ReagentGrinder to Client ignnored components * Update Content.Client/GameObjects/Components/Kitchen/ReagentGrinderBoundUserInterface.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Client/GameObjects/Components/Kitchen/ReagentGrinderBoundUserInterface.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Shared/Kitchen/SharedReagentGrinderComponent.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * implemennt sloth changes * fix isbusy * Disable grind/juice buttons if there's nothing to grind or juice, also some misc fixes * unsubscribe from messages on remove + fix xmlcomment * fix bounding box * Add these to dictionary * Add these to client ignore * Whitespace and unneeded import fixes * tommy's toes * Where'd these newlines come from * power * improve bounding box * Check power better & show contents when beaker is ejected * check power here * Disable eject buttons when running * improve comments * readwrite for viewvars on work time and capacity * Address most of Sloth's reviews * Make this cleaner * add grindablecomponent to motherfucking everything * Fix reviews * some more null suppressions * remove unused random field Co-authored-by: scuffedjays <yetanotherscuffed@gmail.com> Co-authored-by: namespace-Memory <66768086+namespace-Memory@users.noreply.github.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2020-11-26 14:53:42 +02:00
{
[DataField, ViewVariables(VVAccess.ReadWrite)]
public int StorageMaxEntities = 6;
[DataField("workTime"), ViewVariables(VVAccess.ReadWrite)]
public TimeSpan WorkTime = TimeSpan.FromSeconds(3.5); // Roughly matches the grind/juice sounds.
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float WorkTimeMultiplier = 1;
[DataField("clickSound"), ViewVariables(VVAccess.ReadWrite)]
public SoundSpecifier ClickSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg");
Rerun of "Add Reagent Grinder/Juicer" (#2570) * commit skeleton reagent grinder component * add reagentgrinder bounduserinterface, add suffix to grinder yml, add reagentgrinder sprites * implement much more of the grinder ui functionality * get more use out of hasbeaker bool * complete wiring up most of the chamber/beaker UI controls * remove whitelist prototype id. add grindable tag component * add juiceable component * rename boolparam to be clearer * more juice * add some juice reagents and apply them to their drink prototypes * re add glassyellow * implement juicing and results * add time delay to grindjuice * add reagent grinder visualizer, add reagent grinder sounds, fix some yaml errors too * interface has clear indication of currennt operation, and busy status * add ReagentGrinder to Client ignnored components * Update Content.Client/GameObjects/Components/Kitchen/ReagentGrinderBoundUserInterface.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Client/GameObjects/Components/Kitchen/ReagentGrinderBoundUserInterface.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Shared/Kitchen/SharedReagentGrinderComponent.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * implemennt sloth changes * fix isbusy * Disable grind/juice buttons if there's nothing to grind or juice, also some misc fixes * unsubscribe from messages on remove + fix xmlcomment * fix bounding box * Add these to dictionary * Add these to client ignore * Whitespace and unneeded import fixes * tommy's toes * Where'd these newlines come from * power * improve bounding box * Check power better & show contents when beaker is ejected * check power here * Disable eject buttons when running * improve comments * readwrite for viewvars on work time and capacity * Address most of Sloth's reviews * Make this cleaner * add grindablecomponent to motherfucking everything * Fix reviews * some more null suppressions * remove unused random field Co-authored-by: scuffedjays <yetanotherscuffed@gmail.com> Co-authored-by: namespace-Memory <66768086+namespace-Memory@users.noreply.github.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2020-11-26 14:53:42 +02:00
[DataField("grindSound"), ViewVariables(VVAccess.ReadWrite)]
public SoundSpecifier GrindSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/blender.ogg");
[DataField("juiceSound"), ViewVariables(VVAccess.ReadWrite)]
public SoundSpecifier JuiceSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/juicer.ogg");
public EntityUid? AudioStream;
}
[Access(typeof(ReagentGrinderSystem)), RegisterComponent]
public sealed partial class ActiveReagentGrinderComponent : Component
{
Rerun of "Add Reagent Grinder/Juicer" (#2570) * commit skeleton reagent grinder component * add reagentgrinder bounduserinterface, add suffix to grinder yml, add reagentgrinder sprites * implement much more of the grinder ui functionality * get more use out of hasbeaker bool * complete wiring up most of the chamber/beaker UI controls * remove whitelist prototype id. add grindable tag component * add juiceable component * rename boolparam to be clearer * more juice * add some juice reagents and apply them to their drink prototypes * re add glassyellow * implement juicing and results * add time delay to grindjuice * add reagent grinder visualizer, add reagent grinder sounds, fix some yaml errors too * interface has clear indication of currennt operation, and busy status * add ReagentGrinder to Client ignnored components * Update Content.Client/GameObjects/Components/Kitchen/ReagentGrinderBoundUserInterface.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Client/GameObjects/Components/Kitchen/ReagentGrinderBoundUserInterface.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Shared/Kitchen/SharedReagentGrinderComponent.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * implemennt sloth changes * fix isbusy * Disable grind/juice buttons if there's nothing to grind or juice, also some misc fixes * unsubscribe from messages on remove + fix xmlcomment * fix bounding box * Add these to dictionary * Add these to client ignore * Whitespace and unneeded import fixes * tommy's toes * Where'd these newlines come from * power * improve bounding box * Check power better & show contents when beaker is ejected * check power here * Disable eject buttons when running * improve comments * readwrite for viewvars on work time and capacity * Address most of Sloth's reviews * Make this cleaner * add grindablecomponent to motherfucking everything * Fix reviews * some more null suppressions * remove unused random field Co-authored-by: scuffedjays <yetanotherscuffed@gmail.com> Co-authored-by: namespace-Memory <66768086+namespace-Memory@users.noreply.github.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2020-11-26 14:53:42 +02:00
/// <summary>
/// Remaining time until the grinder finishes grinding/juicing.
Rerun of "Add Reagent Grinder/Juicer" (#2570) * commit skeleton reagent grinder component * add reagentgrinder bounduserinterface, add suffix to grinder yml, add reagentgrinder sprites * implement much more of the grinder ui functionality * get more use out of hasbeaker bool * complete wiring up most of the chamber/beaker UI controls * remove whitelist prototype id. add grindable tag component * add juiceable component * rename boolparam to be clearer * more juice * add some juice reagents and apply them to their drink prototypes * re add glassyellow * implement juicing and results * add time delay to grindjuice * add reagent grinder visualizer, add reagent grinder sounds, fix some yaml errors too * interface has clear indication of currennt operation, and busy status * add ReagentGrinder to Client ignnored components * Update Content.Client/GameObjects/Components/Kitchen/ReagentGrinderBoundUserInterface.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Client/GameObjects/Components/Kitchen/ReagentGrinderBoundUserInterface.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Shared/Kitchen/SharedReagentGrinderComponent.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * implemennt sloth changes * fix isbusy * Disable grind/juice buttons if there's nothing to grind or juice, also some misc fixes * unsubscribe from messages on remove + fix xmlcomment * fix bounding box * Add these to dictionary * Add these to client ignore * Whitespace and unneeded import fixes * tommy's toes * Where'd these newlines come from * power * improve bounding box * Check power better & show contents when beaker is ejected * check power here * Disable eject buttons when running * improve comments * readwrite for viewvars on work time and capacity * Address most of Sloth's reviews * Make this cleaner * add grindablecomponent to motherfucking everything * Fix reviews * some more null suppressions * remove unused random field Co-authored-by: scuffedjays <yetanotherscuffed@gmail.com> Co-authored-by: namespace-Memory <66768086+namespace-Memory@users.noreply.github.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2020-11-26 14:53:42 +02:00
/// </summary>
[ViewVariables]
public TimeSpan EndTime;
[ViewVariables]
public GrinderProgram Program;
Rerun of "Add Reagent Grinder/Juicer" (#2570) * commit skeleton reagent grinder component * add reagentgrinder bounduserinterface, add suffix to grinder yml, add reagentgrinder sprites * implement much more of the grinder ui functionality * get more use out of hasbeaker bool * complete wiring up most of the chamber/beaker UI controls * remove whitelist prototype id. add grindable tag component * add juiceable component * rename boolparam to be clearer * more juice * add some juice reagents and apply them to their drink prototypes * re add glassyellow * implement juicing and results * add time delay to grindjuice * add reagent grinder visualizer, add reagent grinder sounds, fix some yaml errors too * interface has clear indication of currennt operation, and busy status * add ReagentGrinder to Client ignnored components * Update Content.Client/GameObjects/Components/Kitchen/ReagentGrinderBoundUserInterface.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Client/GameObjects/Components/Kitchen/ReagentGrinderBoundUserInterface.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Shared/Kitchen/SharedReagentGrinderComponent.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * implemennt sloth changes * fix isbusy * Disable grind/juice buttons if there's nothing to grind or juice, also some misc fixes * unsubscribe from messages on remove + fix xmlcomment * fix bounding box * Add these to dictionary * Add these to client ignore * Whitespace and unneeded import fixes * tommy's toes * Where'd these newlines come from * power * improve bounding box * Check power better & show contents when beaker is ejected * check power here * Disable eject buttons when running * improve comments * readwrite for viewvars on work time and capacity * Address most of Sloth's reviews * Make this cleaner * add grindablecomponent to motherfucking everything * Fix reviews * some more null suppressions * remove unused random field Co-authored-by: scuffedjays <yetanotherscuffed@gmail.com> Co-authored-by: namespace-Memory <66768086+namespace-Memory@users.noreply.github.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2020-11-26 14:53:42 +02:00
}
}