2022-03-28 09:58:13 -07:00
|
|
|
using Content.Shared.Storage;
|
2022-07-29 14:13:12 +12:00
|
|
|
using Robust.Shared.Audio;
|
2021-07-25 08:41:50 -07:00
|
|
|
|
|
|
|
|
namespace Content.Server.Storage.Components
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Spawns items when used in hand.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[RegisterComponent]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class SpawnItemsOnUseComponent : Component
|
2021-07-25 08:41:50 -07:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The list of entities to spawn, with amounts and orGroups.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("items", required: true)]
|
2022-03-28 09:58:13 -07:00
|
|
|
public List<EntitySpawnEntry> Items = new();
|
2021-07-25 08:41:50 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// A sound to play when the items are spawned. For example, gift boxes being unwrapped.
|
|
|
|
|
/// </summary>
|
2023-08-27 23:58:59 +02:00
|
|
|
[DataField("sound")]
|
2021-07-25 08:41:50 -07:00
|
|
|
public SoundSpecifier? Sound = null;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// How many uses before the item should delete itself.
|
|
|
|
|
/// </summary>
|
2023-08-26 09:29:15 -07:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2021-07-25 08:41:50 -07:00
|
|
|
[DataField("uses")]
|
|
|
|
|
public int Uses = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|