mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
29 lines
914 B
C#
29 lines
914 B
C#
using Content.Shared._Shitmed.StatusEffects;
|
|
using Content.Server.Atmos.EntitySystems;
|
|
using Content.Server.Chat.Systems;
|
|
using Robust.Shared.Random;
|
|
|
|
namespace Content.Server._Shitmed.StatusEffects;
|
|
|
|
public sealed class ExpelGasEffectSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly AtmosphereSystem _atmos = default!;
|
|
[Dependency] private readonly ChatSystem _chat = default!;
|
|
[Dependency] private readonly IRobustRandom _random = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
SubscribeLocalEvent<ExpelGasComponent, ComponentInit>(OnInit);
|
|
}
|
|
private void OnInit(EntityUid uid, ExpelGasComponent component, ComponentInit args)
|
|
{
|
|
var mix = _atmos.GetContainingMixture((uid, Transform(uid)), true, true) ?? new();
|
|
var gas = _random.Pick(component.PossibleGases);
|
|
mix.AdjustMoles(gas, 60);
|
|
_chat.TryEmoteWithChat(uid, "Fart");
|
|
}
|
|
|
|
|
|
}
|
|
|