Medkits are now a container plus filled version (#457)

This commit is contained in:
dylanstrategie
2019-11-23 21:39:12 +01:00
committed by Pieter-Jan Briers
parent 0cf34d2d26
commit 4198b6dc4e
3 changed files with 51 additions and 12 deletions

View File

@@ -0,0 +1,35 @@
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Random;
using Robust.Shared.IoC;
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));
}
Spawn("Brutepack");
Spawn("Brutepack");
Spawn("Brutepack");
Spawn("Ointment");
Spawn("Ointment");
Spawn("Ointment");
}
}
}