Files
tbd-station-14/Content.Server/Storage/Components/SpawnItemsOnUseComponent.cs
lzk 43ddd242d0 make SpawnItemsOnUseComponent not require sound field (#19583)
* Update SpawnItemsOnUseComponent.cs

* Update Content.Server/Storage/Components/SpawnItemsOnUseComponent.cs

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2023-08-27 17:58:59 -04:00

32 lines
945 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")]
public SoundSpecifier? Sound = null;
/// <summary>
/// How many uses before the item should delete itself.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("uses")]
public int Uses = 1;
}
}