SecretStashComponent.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using Content.Shared.Storage.EntitySystems;
  2. using Content.Shared.Containers.ItemSlots;
  3. using Content.Shared.Item;
  4. using Robust.Shared.Containers;
  5. using Robust.Shared.Prototypes;
  6. using Content.Shared.Tools;
  7. using Robust.Shared.GameStates;
  8. using Content.Shared.DoAfter;
  9. using Robust.Shared.Serialization;
  10. using Robust.Shared.Audio;
  11. using Content.Shared.Whitelist;
  12. namespace Content.Shared.Storage.Components
  13. {
  14. /// <summary>
  15. /// Logic for a secret slot stash, like plant pot or toilet cistern.
  16. /// Unlike <see cref="ItemSlotsComponent"/> it has logic for opening and closing
  17. /// the stash.
  18. /// </summary>
  19. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  20. [Access(typeof(SecretStashSystem))]
  21. public sealed partial class SecretStashComponent : Component
  22. {
  23. /// <summary>
  24. /// Max item size that can be inserted into secret stash.
  25. /// </summary>
  26. [DataField("maxItemSize")]
  27. public ProtoId<ItemSizePrototype> MaxItemSize = "Small";
  28. /// <summary>
  29. /// Entity blacklist for secret stashes.
  30. /// </summary>
  31. [DataField]
  32. public EntityWhitelist? Blacklist;
  33. /// <summary>
  34. /// This sound will be played when you try to insert an item in the stash.
  35. /// The sound will be played whether or not the item is actually inserted.
  36. /// </summary>
  37. [DataField]
  38. public SoundSpecifier? TryInsertItemSound;
  39. /// <summary>
  40. /// This sound will be played when you try to remove an item in the stash.
  41. /// The sound will be played whether or not the item is actually removed.
  42. /// </summary>
  43. [DataField]
  44. public SoundSpecifier? TryRemoveItemSound;
  45. /// <summary>
  46. /// If true, verbs will appear to help interact with the stash.
  47. /// </summary>
  48. [DataField, AutoNetworkedField]
  49. public bool HasVerbs = true;
  50. /// <summary>
  51. /// The name of the secret stash. For example "the toilet cistern".
  52. /// If null, the name of the entity will be used instead.
  53. /// </summary>
  54. [DataField]
  55. public string? SecretStashName;
  56. /// <summary>
  57. /// Container used to keep secret stash item.
  58. /// </summary>
  59. [ViewVariables]
  60. public ContainerSlot ItemContainer = default!;
  61. }
  62. }