RandomGiftComponent.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using Content.Shared.Whitelist;
  2. using Robust.Shared.Audio;
  3. using Robust.Shared.Prototypes;
  4. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  5. namespace Content.Server.Holiday.Christmas;
  6. /// <summary>
  7. /// This is used for gifts with COMPLETELY random things.
  8. /// </summary>
  9. [RegisterComponent, Access(typeof(RandomGiftSystem))]
  10. public sealed partial class RandomGiftComponent : Component
  11. {
  12. /// <summary>
  13. /// The wrapper entity to spawn when unwrapping the gift.
  14. /// </summary>
  15. [DataField("wrapper", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
  16. public string? Wrapper;
  17. /// <summary>
  18. /// A sound to play when the items are spawned. For example, gift boxes being unwrapped.
  19. /// </summary>
  20. [DataField("sound", required: true)]
  21. public SoundSpecifier? Sound;
  22. /// <summary>
  23. /// Whether or not the gift should be limited only to actual items.
  24. /// </summary>
  25. [DataField("insaneMode", required: true), ViewVariables(VVAccess.ReadWrite)]
  26. public bool InsaneMode;
  27. /// <summary>
  28. /// What entities are allowed to examine this gift to see its contents.
  29. /// </summary>
  30. [DataField("contentsViewers", required: true)]
  31. public EntityWhitelist ContentsViewers = default!;
  32. /// <summary>
  33. /// The currently selected entity to give out. Used so contents viewers can see inside.
  34. /// </summary>
  35. [DataField("selectedEntity"), ViewVariables(VVAccess.ReadWrite)]
  36. public string? SelectedEntity;
  37. }