ExplosionAnomalySystem.cs 908 B

123456789101112131415161718192021222324252627282930
  1. using Content.Server.Explosion.EntitySystems;
  2. using Content.Server.Anomaly.Components;
  3. using Content.Shared.Anomaly.Components;
  4. namespace Content.Server.Anomaly.Effects;
  5. /// <summary>
  6. /// This handles <see cref="ExplosionAnomalyComponent"/>
  7. /// </summary>
  8. public sealed class ExplosionAnomalySystem : EntitySystem
  9. {
  10. [Dependency] private readonly ExplosionSystem _boom = default!;
  11. public override void Initialize()
  12. {
  13. base.Initialize();
  14. SubscribeLocalEvent<ExplosionAnomalyComponent, AnomalySupercriticalEvent>(OnSupercritical);
  15. }
  16. private void OnSupercritical(EntityUid uid, ExplosionAnomalyComponent component, ref AnomalySupercriticalEvent args)
  17. {
  18. _boom.QueueExplosion(
  19. uid,
  20. component.ExplosionPrototype,
  21. component.TotalIntensity,
  22. component.Dropoff,
  23. component.MaxTileIntensity
  24. );
  25. }
  26. }