FoodComponent.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. using Content.Server.Body.Components;
  2. using Content.Shared.Nutrition.Components;
  3. using Content.Server.Nutrition.EntitySystems;
  4. using Content.Shared.FixedPoint;
  5. using Robust.Shared.Audio;
  6. using Robust.Shared.Prototypes;
  7. namespace Content.Server.Nutrition.Components;
  8. [RegisterComponent, Access(typeof(FoodSystem), typeof(FoodSequenceSystem))]
  9. public sealed partial class FoodComponent : Component
  10. {
  11. [DataField]
  12. public string Solution = "food";
  13. [DataField]
  14. public SoundSpecifier UseSound = new SoundCollectionSpecifier("eating");
  15. [DataField]
  16. public List<EntProtoId> Trash = new();
  17. [DataField]
  18. public FixedPoint2? TransferAmount = FixedPoint2.New(5);
  19. /// <summary>
  20. /// Acceptable utensil to use
  21. /// </summary>
  22. [DataField]
  23. public UtensilType Utensil = UtensilType.Fork; //There are more "solid" than "liquid" food
  24. /// <summary>
  25. /// Is utensil required to eat this food
  26. /// </summary>
  27. [DataField]
  28. public bool UtensilRequired;
  29. /// <summary>
  30. /// If this is set to true, food can only be eaten if you have a stomach with a
  31. /// <see cref="StomachComponent.SpecialDigestible"/> that includes this entity in its whitelist,
  32. /// rather than just being digestible by anything that can eat food.
  33. /// Whitelist the food component to allow eating of normal food.
  34. /// </summary>
  35. [DataField]
  36. public bool RequiresSpecialDigestion;
  37. /// <summary>
  38. /// Stomachs required to digest this entity.
  39. /// Used to simulate 'ruminant' digestive systems (which can digest grass)
  40. /// </summary>
  41. [DataField]
  42. public int RequiredStomachs = 1;
  43. /// <summary>
  44. /// The localization identifier for the eat message. Needs a "food" entity argument passed to it.
  45. /// </summary>
  46. [DataField]
  47. public LocId EatMessage = "food-nom";
  48. /// <summary>
  49. /// How long it takes to eat the food personally.
  50. /// </summary>
  51. [DataField]
  52. public float Delay = 1;
  53. /// <summary>
  54. /// This is how many seconds it takes to force feed someone this food.
  55. /// Should probably be smaller for small items like pills.
  56. /// </summary>
  57. [DataField]
  58. public float ForceFeedDelay = 3;
  59. /// <summary>
  60. /// For mobs that are food, requires killing them before eating.
  61. /// </summary>
  62. [DataField, ViewVariables(VVAccess.ReadWrite)]
  63. public bool RequireDead = true;
  64. }