ExaminableHungerComponent.cs 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. using Content.Shared.Nutrition.EntitySystems;
  2. using Robust.Shared.GameStates;
  3. namespace Content.Shared.Nutrition.Components;
  4. /// <summary>
  5. /// Adds text to the entity's description box based on its current hunger threshold.
  6. /// </summary>
  7. [RegisterComponent, NetworkedComponent]
  8. [Access(typeof(ExaminableHungerSystem))]
  9. public sealed partial class ExaminableHungerComponent : Component
  10. {
  11. /// <summary>
  12. /// Dictionary of hunger thresholds to LocIds of the messages to display.
  13. /// </summary>
  14. [DataField]
  15. public Dictionary<HungerThreshold, LocId> Descriptions = new()
  16. {
  17. { HungerThreshold.Overfed, "examinable-hunger-component-examine-overfed"},
  18. { HungerThreshold.Okay, "examinable-hunger-component-examine-okay"},
  19. { HungerThreshold.Peckish, "examinable-hunger-component-examine-peckish"},
  20. { HungerThreshold.Starving, "examinable-hunger-component-examine-starving"},
  21. { HungerThreshold.Dead, "examinable-hunger-component-examine-starving"}
  22. };
  23. /// <summary>
  24. /// LocId of a fallback message to display if the entity has no <see cref="HungerComponent"/>
  25. /// or does not have a value in <see cref="Descriptions"/> for the current threshold.
  26. /// </summary>
  27. public LocId NoHungerDescription = "examinable-hunger-component-examine-none";
  28. }