* add paper label component * git mv * rename namespace * add cargo printouts * more crates * directly attach paper * comment typo
49 lines
1.4 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|
|
}
|