Files
OldThink/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/RadiateArtifactSystem.cs
Alex Evgrashin 6eeaa81131 More artifacts triggers and tweaks (#6723)
Co-authored-by: mirrorcult <lunarautomaton6@gmail.com>
2022-02-19 12:16:49 -07:00

26 lines
843 B
C#

using Content.Server.Radiation;
using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;
public sealed class RadiateArtifactSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<RadiateArtifactComponent, ArtifactActivatedEvent>(OnActivate);
}
private void OnActivate(EntityUid uid, RadiateArtifactComponent component, ArtifactActivatedEvent args)
{
var transform = Transform(uid);
var pulseUid = EntityManager.SpawnEntity(component.PulsePrototype, transform.Coordinates);
if (!TryComp(pulseUid, out RadiationPulseComponent? pulse))
return;
pulse.DoPulse();
}
}