Remove FoodContainer, add whitelists, replace with SpawnItemsOnUse (#4358)
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using System.Collections.Generic;
|
||||
using Content.Shared.Sound;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
namespace Content.Server.Storage.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Spawns items when used in hand.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public class SpawnItemsOnUseComponent : Component
|
||||
{
|
||||
public override string Name => "SpawnItemsOnUse";
|
||||
|
||||
/// <summary>
|
||||
/// The list of entities to spawn, with amounts and orGroups.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[DataField("items", required: true)]
|
||||
public List<EntitySpawnEntry> Items = new List<EntitySpawnEntry>();
|
||||
|
||||
/// <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>
|
||||
/// <returns></returns>
|
||||
[DataField("uses")]
|
||||
public int Uses = 1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user