mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-30 08:07:28 +00:00
* Initial port of goobstation factorio, missing disposals integration and faxing. Also ports impstations modification for robotic arms to have static power draw. Also adds automation slots to silos and advanced microwave. * Ports goobstation factorio fax automation, adds to the guidebook entry info about gas canisters. * Ported Goob Disposals. Removed part about taking mats out of storage silo cuz it ain't implemented yet. Seems to work. * Adds constructor circuitboard to research cuz I forgor
46 lines
1.4 KiB
C#
46 lines
1.4 KiB
C#
// SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
|
|
// SPDX-FileCopyrightText: 2025 deltanedas <@deltanedas:kde.org>
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
using Content.Server.Atmos.Piping.Unary.Components;
|
|
using Content.Shared.Atmos.Piping.Binary.Components;
|
|
using Content.Shared.Atmos.Piping.Unary.Components;
|
|
using Content.Shared.DeviceLinking;
|
|
using Content.Shared.DeviceLinking.Events;
|
|
|
|
namespace Content.Server._Goobstation.Atmos.EntitySystems;
|
|
|
|
/// <summary>
|
|
/// Handles control signals for automated gas canisters.
|
|
/// </summary>
|
|
public sealed class GasCanisterSignalSystem : EntitySystem
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<GasCanisterComponent, SignalReceivedEvent>(OnSignalReceived);
|
|
}
|
|
|
|
private void OnSignalReceived(Entity<GasCanisterComponent> ent, ref SignalReceivedEvent args)
|
|
{
|
|
var valve = args.Port switch
|
|
{
|
|
"Open" => true,
|
|
"Close" => false,
|
|
"Toggle" => !ent.Comp.ReleaseValve,
|
|
_ => false // fuck you c# cant just return
|
|
};
|
|
|
|
if (ent.Comp.ReleaseValve == valve)
|
|
return;
|
|
|
|
var ev = new GasCanisterChangeReleaseValveMessage(valve);
|
|
ev.UiKey = GasCanisterUiKey.Key;
|
|
if (args.Trigger is {} actor)
|
|
ev.Actor = actor;
|
|
RaiseLocalEvent(ent, ev);
|
|
}
|
|
}
|