ExplodeBehavior.cs 583 B

123456789101112131415161718
  1. using Content.Server.Explosion.Components;
  2. using JetBrains.Annotations;
  3. namespace Content.Server.Destructible.Thresholds.Behaviors
  4. {
  5. /// <summary>
  6. /// This behavior will trigger entities with <see cref="ExplosiveComponent"/> to go boom.
  7. /// </summary>
  8. [UsedImplicitly]
  9. [DataDefinition]
  10. public sealed partial class ExplodeBehavior : IThresholdBehavior
  11. {
  12. public void Execute(EntityUid owner, DestructibleSystem system, EntityUid? cause = null)
  13. {
  14. system.ExplosionSystem.TriggerExplosive(owner, user:cause);
  15. }
  16. }
  17. }