Files
tbd-station-14/Content.Server/Morgue/MorgueSystem.cs
Leon Friedrich 88df3d8b10 Cargo: pizza & bureaucracy (#5123)
* add paper label component

* git mv

* rename namespace

* add cargo printouts

* more crates

* directly attach paper

* comment typo
2021-11-11 00:15:23 +11:00

49 lines
1.4 KiB
C#

using Content.Server.Morgue.Components;
using Content.Shared.Verbs;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
namespace Content.Server.Morgue
{
[UsedImplicitly]
public class MorgueSystem : EntitySystem
{
private float _accumulatedFrameTime;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<CrematoriumEntityStorageComponent, GetAlternativeVerbsEvent>(AddCremateVerb);
}
private void AddCremateVerb(EntityUid uid, CrematoriumEntityStorageComponent component, GetAlternativeVerbsEvent args)
{
if (!args.CanAccess || !args.CanInteract || component.Cooking || component.Open)
return;
Verb verb = new();
verb.Text = Loc.GetString("cremate-verb-get-data-text");
// TODO VERB ICON add flame/burn symbol?
verb.Act = () => component.TryCremate();
args.Verbs.Add(verb);
}
public override void Update(float frameTime)
{
_accumulatedFrameTime += frameTime;
if (_accumulatedFrameTime >= 10)
{
foreach (var morgue in EntityManager.EntityQuery<MorgueEntityStorageComponent>())
{
morgue.Update();
}
_accumulatedFrameTime -= 10;
}
}
}
}