emag disposal units to disable pressure requirement (#14630)
This commit is contained in:
@@ -552,8 +552,11 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
|||||||
component.AutomaticEngageToken?.Cancel();
|
component.AutomaticEngageToken?.Cancel();
|
||||||
component.AutomaticEngageToken = null;
|
component.AutomaticEngageToken = null;
|
||||||
|
|
||||||
component.Pressure = 0;
|
if (!component.DisablePressure)
|
||||||
component.State = SharedDisposalUnitComponent.PressureState.Pressurizing;
|
{
|
||||||
|
component.Pressure = 0;
|
||||||
|
component.State = SharedDisposalUnitComponent.PressureState.Pressurizing;
|
||||||
|
}
|
||||||
|
|
||||||
component.Engaged = false;
|
component.Engaged = false;
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,12 @@ namespace Content.Shared.Disposal.Components
|
|||||||
[DataField("mobsCanEnter")]
|
[DataField("mobsCanEnter")]
|
||||||
public bool MobsCanEnter = true;
|
public bool MobsCanEnter = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Removes the pressure requirement for flushing.
|
||||||
|
/// </summary>
|
||||||
|
[DataField("disablePressure"), ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
public bool DisablePressure = false;
|
||||||
|
|
||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
public enum Visuals : byte
|
public enum Visuals : byte
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using Content.Shared.Body.Components;
|
using Content.Shared.Body.Components;
|
||||||
using Content.Shared.Disposal.Components;
|
using Content.Shared.Disposal.Components;
|
||||||
using Content.Shared.DragDrop;
|
using Content.Shared.DragDrop;
|
||||||
|
using Content.Shared.Emag.Systems;
|
||||||
using Content.Shared.Item;
|
using Content.Shared.Item;
|
||||||
using Content.Shared.Mobs.Components;
|
using Content.Shared.Mobs.Components;
|
||||||
using Content.Shared.Mobs.Systems;
|
using Content.Shared.Mobs.Systems;
|
||||||
@@ -28,6 +29,7 @@ namespace Content.Shared.Disposal
|
|||||||
base.Initialize();
|
base.Initialize();
|
||||||
SubscribeLocalEvent<SharedDisposalUnitComponent, PreventCollideEvent>(OnPreventCollide);
|
SubscribeLocalEvent<SharedDisposalUnitComponent, PreventCollideEvent>(OnPreventCollide);
|
||||||
SubscribeLocalEvent<SharedDisposalUnitComponent, CanDropTargetEvent>(OnCanDragDropOn);
|
SubscribeLocalEvent<SharedDisposalUnitComponent, CanDropTargetEvent>(OnCanDragDropOn);
|
||||||
|
SubscribeLocalEvent<SharedDisposalUnitComponent, GotEmaggedEvent>(OnEmagged);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnPreventCollide(EntityUid uid, SharedDisposalUnitComponent component, ref PreventCollideEvent args)
|
private void OnPreventCollide(EntityUid uid, SharedDisposalUnitComponent component, ref PreventCollideEvent args)
|
||||||
@@ -57,6 +59,12 @@ namespace Content.Shared.Disposal
|
|||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnEmagged(EntityUid uid, SharedDisposalUnitComponent component, ref GotEmaggedEvent args)
|
||||||
|
{
|
||||||
|
component.DisablePressure = true;
|
||||||
|
args.Handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
public virtual bool CanInsert(SharedDisposalUnitComponent component, EntityUid entity)
|
public virtual bool CanInsert(SharedDisposalUnitComponent component, EntityUid entity)
|
||||||
{
|
{
|
||||||
if (!EntityManager.GetComponent<TransformComponent>(component.Owner).Anchored)
|
if (!EntityManager.GetComponent<TransformComponent>(component.Owner).Anchored)
|
||||||
|
|||||||
Reference in New Issue
Block a user