Files
tbd-station-14/Content.Server/GameObjects/Components/Items/Storage/Fill/MedkitFillComponent.cs

37 lines
1.0 KiB
C#

using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Random;
using Robust.Shared.IoC;
using Robust.Shared.Map;
namespace Content.Server.GameObjects.Components.Items.Storage.Fill
{
[RegisterComponent]
internal sealed class MedkitFillComponent : Component, IMapInit
{
public override string Name => "MedkitFill";
#pragma warning disable 649
[Dependency] private readonly IEntityManager _entityManager;
#pragma warning restore 649
void IMapInit.MapInit()
{
var storage = Owner.GetComponent<IStorageComponent>();
void Spawn(string prototype)
{
storage.Insert(_entityManager.SpawnEntity(prototype, Owner.Transform.GridPosition));
}
Spawn("Brutepack");
Spawn("Brutepack");
Spawn("Brutepack");
Spawn("Ointment");
Spawn("Ointment");
Spawn("Ointment");
}
}
}