Files
crystall-punk-14/Content.Server/Holiday/Christmas/LimitedItemGiverComponent.cs
Moony 0a45782532 Christmas trees now grant gifts. (#13118)
* Christmas trees now grant gifts.

* docs

* add holiday requirements, fix sound.

* doc

* remove redundant stuff

* rename GiftPackin to RandomGift.

* a word

* Update Content.Server/Holiday/Christmas/LimitedItemGiverSystem.cs

Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>

Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com>
Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
2022-12-20 16:34:34 -06:00

42 lines
1.4 KiB
C#

using Content.Shared.Storage;
using Robust.Shared.Network;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Holiday.Christmas;
/// <summary>
/// This is used for granting items to lucky souls, exactly once.
/// </summary>
[RegisterComponent, Access(typeof(LimitedItemGiverSystem))]
public sealed class LimitedItemGiverComponent : Component
{
/// <summary>
/// Santa knows who you are behind the screen, only one gift per player per round!
/// </summary>
public readonly HashSet<NetUserId> GrantedPlayers = new();
/// <summary>
/// Selects what entities can be given out by the giver.
/// </summary>
[DataField("spawnEntries", required: true)]
public List<EntitySpawnEntry> SpawnEntries = default!;
/// <summary>
/// The (localized) message shown upon receiving something.
/// </summary>
[DataField("receivedPopup", required: true)]
public string ReceivedPopup = default!;
/// <summary>
/// The (localized) message shown upon being denied.
/// </summary>
[DataField("deniedPopup", required: true)]
public string DeniedPopup = default!;
/// <summary>
/// The holiday required for this giver to work, if any.
/// </summary>
[DataField("requiredHoliday", customTypeSerializer: typeof(PrototypeIdSerializer<HolidayPrototype>)), ViewVariables(VVAccess.ReadWrite)]
public string? RequiredHoliday = null;
}