Files
tbd-station-14/Content.Server/Storage/Components/SpawnItemsOnUseComponent.cs
Kevin Zheng ccd0e8b7c4 Support number of uses starting at zero (#19452)
This allows peelable bananas without replicating the entire YAML
structure to remove this one component.
2023-08-26 09:29:15 -07:00

32 lines
961 B
C#

using Content.Shared.Storage;
using Robust.Shared.Audio;
namespace Content.Server.Storage.Components
{
/// <summary>
/// Spawns items when used in hand.
/// </summary>
[RegisterComponent]
public sealed partial class SpawnItemsOnUseComponent : Component
{
/// <summary>
/// The list of entities to spawn, with amounts and orGroups.
/// </summary>
[DataField("items", required: true)]
public List<EntitySpawnEntry> Items = new();
/// <summary>
/// A sound to play when the items are spawned. For example, gift boxes being unwrapped.
/// </summary>
[DataField("sound", required: true)]
public SoundSpecifier? Sound = null;
/// <summary>
/// How many uses before the item should delete itself.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("uses")]
public int Uses = 1;
}
}