2023-05-03 19:49:25 -07:00
|
|
|
using Content.Server.Body.Components;
|
2024-02-01 13:33:57 +00:00
|
|
|
using Content.Shared.Nutrition.Components;
|
2021-11-21 10:35:09 +03:00
|
|
|
using Content.Server.Nutrition.EntitySystems;
|
2021-11-03 16:48:03 -07:00
|
|
|
using Content.Shared.FixedPoint;
|
2022-07-29 14:13:12 +12:00
|
|
|
using Robust.Shared.Audio;
|
2021-05-08 03:44:09 +02:00
|
|
|
using Robust.Shared.Prototypes;
|
2019-11-12 08:20:03 +11:00
|
|
|
|
2023-09-23 03:10:04 +01:00
|
|
|
namespace Content.Server.Nutrition.Components;
|
2021-08-17 14:11:07 -07:00
|
|
|
|
2024-08-10 22:31:32 +03:00
|
|
|
[RegisterComponent, Access(typeof(FoodSystem), typeof(FoodSequenceSystem))]
|
2023-09-23 03:10:04 +01:00
|
|
|
public sealed partial class FoodComponent : Component
|
|
|
|
|
{
|
|
|
|
|
[DataField]
|
|
|
|
|
public string Solution = "food";
|
2021-11-21 10:35:09 +03:00
|
|
|
|
2023-09-23 03:10:04 +01:00
|
|
|
[DataField]
|
2024-01-17 09:46:06 -07:00
|
|
|
public SoundSpecifier UseSound = new SoundCollectionSpecifier("eating");
|
2021-11-21 10:35:09 +03:00
|
|
|
|
2023-10-10 20:06:24 -07:00
|
|
|
[DataField]
|
2024-08-10 22:31:32 +03:00
|
|
|
public List<EntProtoId> Trash = new();
|
2021-03-05 01:08:38 +01:00
|
|
|
|
2023-09-23 03:10:04 +01:00
|
|
|
[DataField]
|
|
|
|
|
public FixedPoint2? TransferAmount = FixedPoint2.New(5);
|
2023-05-03 19:49:25 -07:00
|
|
|
|
2023-09-23 03:10:04 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Acceptable utensil to use
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField]
|
|
|
|
|
public UtensilType Utensil = UtensilType.Fork; //There are more "solid" than "liquid" food
|
2023-05-03 19:49:25 -07:00
|
|
|
|
2023-09-23 03:10:04 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Is utensil required to eat this food
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField]
|
|
|
|
|
public bool UtensilRequired;
|
2019-11-12 08:20:03 +11:00
|
|
|
|
2023-09-23 03:10:04 +01:00
|
|
|
/// <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;
|
2022-02-07 00:37:38 +11:00
|
|
|
|
2023-09-23 03:10:04 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Stomachs required to digest this entity.
|
|
|
|
|
/// Used to simulate 'ruminant' digestive systems (which can digest grass)
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField]
|
|
|
|
|
public int RequiredStomachs = 1;
|
2021-11-29 16:27:15 +13:00
|
|
|
|
2023-09-23 03:10:04 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// The localization identifier for the eat message. Needs a "food" entity argument passed to it.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField]
|
2023-10-10 20:06:24 -07:00
|
|
|
public LocId EatMessage = "food-nom";
|
2020-08-22 22:29:20 +02:00
|
|
|
|
2023-09-23 03:10:04 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// How long it takes to eat the food personally.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField]
|
|
|
|
|
public float Delay = 1;
|
2021-08-17 14:11:07 -07:00
|
|
|
|
2023-09-23 03:10:04 +01:00
|
|
|
/// <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;
|
2023-11-17 08:51:51 +00:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// For mobs that are food, requires killing them before eating.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
public bool RequireDead = true;
|
2019-11-12 08:20:03 +11:00
|
|
|
}
|