private void HandleEmpTrigger(EntityUid uid, EmpOnTriggerComponent comp, TriggerEvent args)
{
- EmpPulse(Transform(uid).Coordinates.ToMap(EntityManager), comp.Range, comp.EnergyConsumption);
+ EmpPulse(Transform(uid).MapPosition, comp.Range, comp.EnergyConsumption);
args.Handled = true;
}
}
--- /dev/null
+using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;
+
+namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
+
+/// <summary>
+/// Artifact that EMP
+/// </summary>
+[RegisterComponent]
+[Access(typeof(EmpArtifactSystem))]
+public sealed class EmpArtifactComponent : Component
+{
+ [DataField("range"), ViewVariables(VVAccess.ReadWrite)]
+ public float Range = 4f;
+
+ [DataField("energyConsumption"), ViewVariables(VVAccess.ReadWrite)]
+ public float EnergyConsumption = 1000000;
+}
--- /dev/null
+using Content.Server.Emp;
+using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components;
+using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
+
+namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems;
+
+public sealed class EmpArtifactSystem : EntitySystem
+{
+ [Dependency] private readonly EmpSystem _emp = default!;
+
+ /// <inheritdoc/>
+ public override void Initialize()
+ {
+ SubscribeLocalEvent<EmpArtifactComponent, ArtifactActivatedEvent>(OnActivate);
+ }
+
+ private void OnActivate(EntityUid uid, EmpArtifactComponent component, ArtifactActivatedEvent args)
+ {
+ _emp.EmpPulse(Transform(uid).MapPosition, component.Range, component.EnergyConsumption);
+ }
+}
\ No newline at end of file
maxSpawns: 1
spawns:
- id: Singularity
+
+- type: artifactEffect
+ id: EffectEmp
+ targetDepth: 3
+ effectHint: artifact-effect-hint-electrical-interference
+ components:
+ - type: EmpArtifact