Add Destructible SpawnGasBehavior (#18965)

This commit is contained in:
Vordenburg
2023-08-13 21:55:06 -04:00
committed by GitHub
parent eba1d52c8c
commit 694a6cfc1c
3 changed files with 31 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
using Content.Server.Atmos;
using JetBrains.Annotations;
namespace Content.Server.Destructible.Thresholds.Behaviors;
[UsedImplicitly]
[DataDefinition]
public sealed class SpawnGasBehavior : IThresholdBehavior
{
[DataField("gasMixture", required: true)]
public GasMixture Gas = new();
public void Execute(EntityUid owner, DestructibleSystem system, EntityUid? cause = null)
{
var air = system.AtmosphereSystem.GetContainingMixture(owner, false, true);
if (air != null)
system.AtmosphereSystem.Merge(air, Gas);
}
}