Files
crystall-punk-14/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/EmpArtifactSystem.cs
2023-05-06 11:26:04 -04:00

21 lines
748 B
C#

using Content.Server.Emp;
using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;
public sealed class EmpArtifactSystem : EntitySystem
{
[Dependency] private readonly EmpSystem _emp = default!;
/// <inheritdoc/>
public override void Initialize()
{
SubscribeLocalEvent<EmpArtifactComponent, ArtifactActivatedEvent>(OnActivate);
}
private void OnActivate(EntityUid uid, EmpArtifactComponent component, ArtifactActivatedEvent args)
{
_emp.EmpPulse(Transform(uid).MapPosition, component.Range, component.EnergyConsumption, component.DisableDuration);
}
}