SpawnGasBehavior.cs 601 B

123456789101112131415161718192021
  1. using Content.Server.Atmos;
  2. using Content.Shared.Atmos;
  3. using JetBrains.Annotations;
  4. namespace Content.Server.Destructible.Thresholds.Behaviors;
  5. [UsedImplicitly]
  6. [DataDefinition]
  7. public sealed partial class SpawnGasBehavior : IThresholdBehavior
  8. {
  9. [DataField("gasMixture", required: true)]
  10. public GasMixture Gas = new();
  11. public void Execute(EntityUid owner, DestructibleSystem system, EntityUid? cause = null)
  12. {
  13. var air = system.AtmosphereSystem.GetContainingMixture(owner, false, true);
  14. if (air != null)
  15. system.AtmosphereSystem.Merge(air, Gas);
  16. }
  17. }