mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-30 16:17:27 +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
48 lines
1.5 KiB
C#
48 lines
1.5 KiB
C#
using Content.Shared._Goobstation.Factory.Filters;
|
|
using Content.Shared.DeviceLinking;
|
|
using Robust.Shared.Containers;
|
|
|
|
namespace Content.Shared._Goobstation.Factory;
|
|
|
|
public sealed class StorageBinSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly AutomationFilterSystem _filter = default!;
|
|
[Dependency] private readonly SharedDeviceLinkSystem _device = default!;
|
|
|
|
public const string ContainerId = "storagebase";
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<StorageBinComponent, ContainerIsInsertingAttemptEvent>(OnInsertAttempt);
|
|
SubscribeLocalEvent<StorageBinComponent, EntInsertedIntoContainerMessage>(OnEntInserted);
|
|
SubscribeLocalEvent<StorageBinComponent, EntRemovedFromContainerMessage>(OnEntRemoved);
|
|
}
|
|
|
|
private void OnInsertAttempt(Entity<StorageBinComponent> ent, ref ContainerIsInsertingAttemptEvent args)
|
|
{
|
|
if (args.Container.ID != ContainerId)
|
|
return;
|
|
|
|
if (_filter.IsBlocked(_filter.GetSlot(ent), args.EntityUid))
|
|
args.Cancel();
|
|
}
|
|
|
|
private void OnEntInserted(Entity<StorageBinComponent> ent, ref EntInsertedIntoContainerMessage args)
|
|
{
|
|
if (args.Container.ID != ContainerId)
|
|
return;
|
|
|
|
_device.InvokePort(ent, ent.Comp.InsertedPort);
|
|
}
|
|
|
|
private void OnEntRemoved(Entity<StorageBinComponent> ent, ref EntRemovedFromContainerMessage args)
|
|
{
|
|
if (args.Container.ID != ContainerId)
|
|
return;
|
|
|
|
_device.InvokePort(ent, ent.Comp.RemovedPort);
|
|
}
|
|
}
|