mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-10 02:41:18 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
22 lines
857 B
C#
22 lines
857 B
C#
using Content.Server.Atmos.EntitySystems;
|
|
using Content.Shared.EntityEffects;
|
|
using Content.Shared.EntityEffects.Effects.Atmos;
|
|
|
|
namespace Content.Server.EntityEffects.Effects.Atmos;
|
|
|
|
/// <summary>
|
|
/// This effect adjusts a gas at the tile this entity is currently on.
|
|
/// The amount changed is modified by scale.
|
|
/// </summary>
|
|
/// <inheritdoc cref="EntityEffectSystem{T,TEffect}"/>
|
|
public sealed partial class CreateGasEntityEffectSystem : EntityEffectSystem<TransformComponent, CreateGas>
|
|
{
|
|
[Dependency] private AtmosphereSystem _atmosphere = default!;
|
|
|
|
protected override void Effect(Entity<TransformComponent> entity, ref EntityEffectEvent<CreateGas> args)
|
|
{
|
|
var tileMix = _atmosphere.GetContainingMixture(entity.AsNullable(), false, true);
|
|
|
|
tileMix?.AdjustMoles(args.Effect.Gas, args.Scale * args.Effect.Moles);
|
|
}
|
|
}
|