LimitedItemGiverComponent.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using Content.Shared.Storage;
  2. using Robust.Shared.Network;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  4. namespace Content.Server.Holiday.Christmas;
  5. /// <summary>
  6. /// This is used for granting items to lucky souls, exactly once.
  7. /// </summary>
  8. [RegisterComponent, Access(typeof(LimitedItemGiverSystem))]
  9. public sealed partial class LimitedItemGiverComponent : Component
  10. {
  11. /// <summary>
  12. /// Santa knows who you are behind the screen, only one gift per player per round!
  13. /// </summary>
  14. public readonly HashSet<NetUserId> GrantedPlayers = new();
  15. /// <summary>
  16. /// Selects what entities can be given out by the giver.
  17. /// </summary>
  18. [DataField("spawnEntries", required: true)]
  19. public List<EntitySpawnEntry> SpawnEntries = default!;
  20. /// <summary>
  21. /// The (localized) message shown upon receiving something.
  22. /// </summary>
  23. [DataField("receivedPopup", required: true)]
  24. public string ReceivedPopup = default!;
  25. /// <summary>
  26. /// The (localized) message shown upon being denied.
  27. /// </summary>
  28. [DataField("deniedPopup", required: true)]
  29. public string DeniedPopup = default!;
  30. /// <summary>
  31. /// The holiday required for this giver to work, if any.
  32. /// </summary>
  33. [DataField("requiredHoliday", customTypeSerializer: typeof(PrototypeIdSerializer<HolidayPrototype>)), ViewVariables(VVAccess.ReadWrite)]
  34. public string? RequiredHoliday = null;
  35. }