Files
tbd-station-14/Content.Server/Nutrition/Components/FoodComponent.cs
Magnus Larsen 9cd6e4dccd Fix clientside storage Whitelists (#24063)
* Fix outdated component name in assaultbelt whitelist

RangedMagazine was replaced with BallisticAmmoProvider in the Gun
refactor (#8301)

* Move FlashOnTrigger, SmokeOnTrigger, Flash components to Shared

* Move LightReplacerComponent to Shared

* Move Utensil, Mousetrap components to Shared

* Move SprayPainterComponent to Shared

The PaintableAirlock tag has also been removed, as it was unused &
unnecessary, likely a vestige of spray painter development when the
PaintableAirlock component wasn't in Content.Shared.

* Add trivial Produce and Seed components to Client

This allows the plant bag and botanical belt whitelists to correctly
match produce and seeds on the client, fixing the extraneous "Can't
insert" message that previously appeared.

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2024-02-02 00:33:57 +11:00

78 lines
2.3 KiB
C#

using Content.Server.Body.Components;
using Content.Shared.Nutrition.Components;
using Content.Server.Nutrition.EntitySystems;
using Content.Shared.FixedPoint;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
namespace Content.Server.Nutrition.Components;
[RegisterComponent, Access(typeof(FoodSystem))]
public sealed partial class FoodComponent : Component
{
[DataField]
public string Solution = "food";
[DataField]
public SoundSpecifier UseSound = new SoundCollectionSpecifier("eating");
[DataField]
public EntProtoId? Trash;
[DataField]
public FixedPoint2? TransferAmount = FixedPoint2.New(5);
/// <summary>
/// Acceptable utensil to use
/// </summary>
[DataField]
public UtensilType Utensil = UtensilType.Fork; //There are more "solid" than "liquid" food
/// <summary>
/// Is utensil required to eat this food
/// </summary>
[DataField]
public bool UtensilRequired;
/// <summary>
/// If this is set to true, food can only be eaten if you have a stomach with a
/// <see cref="StomachComponent.SpecialDigestible"/> that includes this entity in its whitelist,
/// rather than just being digestible by anything that can eat food.
/// Whitelist the food component to allow eating of normal food.
/// </summary>
[DataField]
public bool RequiresSpecialDigestion;
/// <summary>
/// Stomachs required to digest this entity.
/// Used to simulate 'ruminant' digestive systems (which can digest grass)
/// </summary>
[DataField]
public int RequiredStomachs = 1;
/// <summary>
/// The localization identifier for the eat message. Needs a "food" entity argument passed to it.
/// </summary>
[DataField]
public LocId EatMessage = "food-nom";
/// <summary>
/// How long it takes to eat the food personally.
/// </summary>
[DataField]
public float Delay = 1;
/// <summary>
/// This is how many seconds it takes to force feed someone this food.
/// Should probably be smaller for small items like pills.
/// </summary>
[DataField]
public float ForceFeedDelay = 3;
/// <summary>
/// For mobs that are food, requires killing them before eating.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public bool RequireDead = true;
}