2024-02-01 13:33:57 +00:00
|
|
|
using Content.Shared.Nutrition.EntitySystems;
|
2022-07-29 14:13:12 +12:00
|
|
|
using Robust.Shared.Audio;
|
2024-02-01 13:33:57 +00:00
|
|
|
using Robust.Shared.GameStates;
|
2020-06-19 15:20:59 +02:00
|
|
|
|
2024-02-01 13:33:57 +00:00
|
|
|
namespace Content.Shared.Nutrition.Components
|
2020-06-19 15:20:59 +02:00
|
|
|
{
|
2024-02-01 13:33:57 +00:00
|
|
|
[RegisterComponent, NetworkedComponent, Access(typeof(SharedUtensilSystem))]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class UtensilComponent : Component
|
2020-06-19 15:20:59 +02:00
|
|
|
{
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("types")]
|
2021-01-06 22:49:19 +11:00
|
|
|
private UtensilType _types = UtensilType.None;
|
2020-06-19 15:20:59 +02:00
|
|
|
|
|
|
|
|
[ViewVariables]
|
2021-01-06 22:49:19 +11:00
|
|
|
public UtensilType Types
|
2020-06-19 15:20:59 +02:00
|
|
|
{
|
|
|
|
|
get => _types;
|
|
|
|
|
set
|
|
|
|
|
{
|
2021-01-06 22:49:19 +11:00
|
|
|
if (_types.Equals(value))
|
|
|
|
|
return;
|
|
|
|
|
|
2020-06-19 15:20:59 +02:00
|
|
|
_types = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The chance that the utensil has to break with each use.
|
|
|
|
|
/// A value of 0 means that it is unbreakable.
|
|
|
|
|
/// </summary>
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("breakChance")]
|
2021-11-21 10:35:09 +03:00
|
|
|
public float BreakChance;
|
2020-06-19 15:20:59 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The sound to be played if the utensil breaks.
|
|
|
|
|
/// </summary>
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("breakSound")]
|
2021-11-21 10:35:09 +03:00
|
|
|
public SoundSpecifier BreakSound = new SoundPathSpecifier("/Audio/Items/snap.ogg");
|
2020-06-19 15:20:59 +02:00
|
|
|
}
|
2021-01-06 22:49:19 +11:00
|
|
|
|
2021-11-21 10:35:09 +03:00
|
|
|
// If you want to make a fancy output on "wrong" composite utensil use (like: you need fork and knife)
|
|
|
|
|
// There should be Dictionary I guess (Dictionary<UtensilType, string>)
|
2021-01-06 22:49:19 +11:00
|
|
|
[Flags]
|
|
|
|
|
public enum UtensilType : byte
|
|
|
|
|
{
|
|
|
|
|
None = 0,
|
|
|
|
|
Fork = 1,
|
|
|
|
|
Spoon = 1 << 1,
|
|
|
|
|
Knife = 1 << 2
|
|
|
|
|
}
|
2020-06-19 15:20:59 +02:00
|
|
|
}
|