mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-01 16:47:26 +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
42 lines
1.4 KiB
C#
42 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.Shared.DeviceLinking.Events;
|
|
using Content.Server.Power.EntitySystems;
|
|
using Content.Shared.DeviceLinking;
|
|
using Content.Shared.Disposal.Unit;
|
|
using Robust.Shared.Prototypes;
|
|
using Content.Shared.Disposal.Components;
|
|
using Content.Server.Disposal.Unit;
|
|
|
|
namespace Content.Server._Goobstation.Disposals;
|
|
|
|
public sealed class DisposalSignalSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly DisposalUnitSystem _disposal = default!;
|
|
[Dependency] private readonly PowerReceiverSystem _power = default!;
|
|
|
|
public static readonly ProtoId<SinkPortPrototype> FlushPort = "DisposalFlush";
|
|
public static readonly ProtoId<SinkPortPrototype> EjectPort = "DisposalEject";
|
|
public static readonly ProtoId<SinkPortPrototype> TogglePort = "Toggle";
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<DisposalUnitComponent, SignalReceivedEvent>(OnSignalReceived);
|
|
}
|
|
|
|
private void OnSignalReceived(Entity<DisposalUnitComponent> ent, ref SignalReceivedEvent args)
|
|
{
|
|
if (args.Port == FlushPort)
|
|
_disposal.ToggleEngage(ent, ent);
|
|
else if (args.Port == EjectPort)
|
|
_disposal.TryEjectContents(ent, ent);
|
|
else if (args.Port == TogglePort)
|
|
_power.TogglePower(ent);
|
|
}
|
|
}
|