From 8e5183445f97cdb38b6f280d727996f4e0bea0ac Mon Sep 17 00:00:00 2001 From: deltanedas <39013340+deltanedas@users.noreply.github.com> Date: Mon, 24 Apr 2023 00:11:23 +0000 Subject: [PATCH] emp on electro supercritical (#15235) Co-authored-by: deltanedas <@deltanedas:kde.org> --- Content.Server/Anomaly/Effects/ElectricityAnomalySystem.cs | 5 +++++ .../Effects/Components/ElectricityAnomalyComponent.cs | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/Content.Server/Anomaly/Effects/ElectricityAnomalySystem.cs b/Content.Server/Anomaly/Effects/ElectricityAnomalySystem.cs index 6c473d3570..89a6361635 100644 --- a/Content.Server/Anomaly/Effects/ElectricityAnomalySystem.cs +++ b/Content.Server/Anomaly/Effects/ElectricityAnomalySystem.cs @@ -1,4 +1,5 @@ using Content.Server.Electrocution; +using Content.Server.Emp; using Content.Server.Lightning; using Content.Server.Power.Components; using Content.Shared.Anomaly.Components; @@ -16,6 +17,7 @@ public sealed class ElectricityAnomalySystem : EntitySystem [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly LightningSystem _lightning = default!; [Dependency] private readonly ElectrocutionSystem _electrocution = default!; + [Dependency] private readonly EmpSystem _emp = default!; [Dependency] private readonly EntityLookupSystem _lookup = default!; /// @@ -55,6 +57,9 @@ public sealed class ElectricityAnomalySystem : EntitySystem { _lightning.ShootLightning(uid, ent); } + + var empRange = component.MaxElectrocuteRange * 3; + _emp.EmpPulse(Transform(uid).MapPosition, empRange, component.EmpEnergyConsumption); } public override void Update(float frameTime) diff --git a/Content.Shared/Anomaly/Effects/Components/ElectricityAnomalyComponent.cs b/Content.Shared/Anomaly/Effects/Components/ElectricityAnomalyComponent.cs index 9afdd0aaa2..8da6dd4c42 100644 --- a/Content.Shared/Anomaly/Effects/Components/ElectricityAnomalyComponent.cs +++ b/Content.Shared/Anomaly/Effects/Components/ElectricityAnomalyComponent.cs @@ -38,4 +38,10 @@ public sealed class ElectricityAnomalyComponent : Component /// [DataField("nextSecond", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] public TimeSpan NextSecond = TimeSpan.Zero; + + /// + /// Energy consumed from devices by the emp pulse upon going supercritical. + /// + [DataField("empEnergyConsumption"), ViewVariables(VVAccess.ReadWrite)] + public float EmpEnergyConsumption = 100000f; } -- 2.51.2