Remove FoodContainer, add whitelists, replace with SpawnItemsOnUse (#4358)

This commit is contained in:
mirrorcult
2021-07-25 08:41:50 -07:00
committed by GitHub
parent ae84ba07e6
commit a91f919018
18 changed files with 253 additions and 260 deletions

View File

@@ -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;
}
}