Add emp artifact effect (#14493)
This commit is contained in:
parent
f9aaadcfc5
commit
b874304d38
|
|
@ -30,7 +30,7 @@ public sealed class EmpSystem : EntitySystem
|
|||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
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;
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -495,3 +495,10 @@
|
|||
maxSpawns: 1
|
||||
spawns:
|
||||
- id: Singularity
|
||||
|
||||
- type: artifactEffect
|
||||
id: EffectEmp
|
||||
targetDepth: 3
|
||||
effectHint: artifact-effect-hint-electrical-interference
|
||||
components:
|
||||
- type: EmpArtifact
|
||||
|
|
|
|||
Loading…
Reference in New Issue