Seperate EMAG into EMAG and Authentication Disruptor (#34337)
This commit is contained in:
@@ -4,7 +4,6 @@ using Content.Server.Power.Components;
|
||||
using Content.Server.Power.Pow3r;
|
||||
using Content.Shared.Access.Systems;
|
||||
using Content.Shared.APC;
|
||||
using Content.Shared.Emag.Components;
|
||||
using Content.Shared.Emag.Systems;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Rounding;
|
||||
@@ -19,6 +18,7 @@ public sealed class ApcSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly AccessReaderSystem _accessReader = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly EmagSystem _emag = default!;
|
||||
[Dependency] private readonly PopupSystem _popup = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
@@ -111,7 +111,12 @@ public sealed class ApcSystem : EntitySystem
|
||||
|
||||
private void OnEmagged(EntityUid uid, ApcComponent comp, ref GotEmaggedEvent args)
|
||||
{
|
||||
// no fancy conditions
|
||||
if (!_emag.CompareFlag(args.Type, EmagType.Interaction))
|
||||
return;
|
||||
|
||||
if (_emag.CheckFlag(uid, EmagType.Interaction))
|
||||
return;
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
@@ -170,7 +175,7 @@ public sealed class ApcSystem : EntitySystem
|
||||
|
||||
private ApcChargeState CalcChargeState(EntityUid uid, PowerState.Battery battery)
|
||||
{
|
||||
if (HasComp<EmaggedComponent>(uid))
|
||||
if (_emag.CheckFlag(uid, EmagType.Interaction))
|
||||
return ApcChargeState.Emag;
|
||||
|
||||
if (battery.CurrentStorage / battery.Capacity > ApcComponent.HighPowerThreshold)
|
||||
|
||||
Reference in New Issue
Block a user