KnockArtifactSystem.cs 740 B

123456789101112131415161718192021222324
  1. using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
  2. using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
  3. using Content.Shared.Magic.Events;
  4. namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;
  5. public sealed class KnockArtifactSystem : EntitySystem
  6. {
  7. /// <inheritdoc/>
  8. public override void Initialize()
  9. {
  10. SubscribeLocalEvent<KnockArtifactComponent, ArtifactActivatedEvent>(OnActivated);
  11. }
  12. private void OnActivated(EntityUid uid, KnockArtifactComponent component, ArtifactActivatedEvent args)
  13. {
  14. var ev = new KnockSpellEvent
  15. {
  16. Performer = uid,
  17. Range = component.KnockRange
  18. };
  19. RaiseLocalEvent(ev);
  20. }
  21. }