emp on electro supercritical (#15235)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using Content.Server.Electrocution;
|
using Content.Server.Electrocution;
|
||||||
|
using Content.Server.Emp;
|
||||||
using Content.Server.Lightning;
|
using Content.Server.Lightning;
|
||||||
using Content.Server.Power.Components;
|
using Content.Server.Power.Components;
|
||||||
using Content.Shared.Anomaly.Components;
|
using Content.Shared.Anomaly.Components;
|
||||||
@@ -16,6 +17,7 @@ public sealed class ElectricityAnomalySystem : EntitySystem
|
|||||||
[Dependency] private readonly IRobustRandom _random = default!;
|
[Dependency] private readonly IRobustRandom _random = default!;
|
||||||
[Dependency] private readonly LightningSystem _lightning = default!;
|
[Dependency] private readonly LightningSystem _lightning = default!;
|
||||||
[Dependency] private readonly ElectrocutionSystem _electrocution = default!;
|
[Dependency] private readonly ElectrocutionSystem _electrocution = default!;
|
||||||
|
[Dependency] private readonly EmpSystem _emp = default!;
|
||||||
[Dependency] private readonly EntityLookupSystem _lookup = default!;
|
[Dependency] private readonly EntityLookupSystem _lookup = default!;
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
@@ -55,6 +57,9 @@ public sealed class ElectricityAnomalySystem : EntitySystem
|
|||||||
{
|
{
|
||||||
_lightning.ShootLightning(uid, ent);
|
_lightning.ShootLightning(uid, ent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var empRange = component.MaxElectrocuteRange * 3;
|
||||||
|
_emp.EmpPulse(Transform(uid).MapPosition, empRange, component.EmpEnergyConsumption);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update(float frameTime)
|
public override void Update(float frameTime)
|
||||||
|
|||||||
@@ -38,4 +38,10 @@ public sealed class ElectricityAnomalyComponent : Component
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("nextSecond", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
|
[DataField("nextSecond", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
|
||||||
public TimeSpan NextSecond = TimeSpan.Zero;
|
public TimeSpan NextSecond = TimeSpan.Zero;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Energy consumed from devices by the emp pulse upon going supercritical.
|
||||||
|
/// <summary>
|
||||||
|
[DataField("empEnergyConsumption"), ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
public float EmpEnergyConsumption = 100000f;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user