Files
Delta-v/Content.Shared/_NF/Emp/Systems/EmpBlastSystem.cs
T
Dvir 2a25a1e719 Add EMP Blast effect shader (Frontier #2262) (#2762)
* Add EMP Blast effect shader (#2262)

* Update emp.swsl

Signed-off-by: Dvir <39403717+dvir001@users.noreply.github.com>

* Update shaders.yml

Signed-off-by: Dvir <39403717+dvir001@users.noreply.github.com>

* Update emp.yml

Signed-off-by: Dvir <39403717+dvir001@users.noreply.github.com>

---------

Signed-off-by: Dvir <39403717+dvir001@users.noreply.github.com>
2025-01-18 11:56:47 +00:00

28 lines
782 B
C#

using Content.Shared._NF.Emp.Components;
using Robust.Shared.Spawners;
using Robust.Shared.Timing;
namespace Content.Shared._NF.Emp.Systems;
public sealed class EmpBlastSystem : EntitySystem
{
[Dependency] private readonly IGameTiming _timing = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<EmpBlastComponent, ComponentStartup>(OnStartup);
}
private void OnStartup(EntityUid uid, EmpBlastComponent component, ComponentStartup args)
{
component.StartTime = _timing.RealTime;
// try to get despawn time or keep default duration time
if (TryComp<TimedDespawnComponent>(uid, out var despawn))
{
component.VisualDuration = despawn.Lifetime;
}
}
}