2024-08-07 10:32:34 +00:00
|
|
|
|
using Content.Server.Lightning;
|
2022-09-28 22:30:48 -04:00
|
|
|
|
using Content.Shared.Revenant.Components;
|
|
|
|
|
|
using Content.Shared.Revenant.EntitySystems;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Revenant.EntitySystems;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// This handles...
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public sealed class RevenantOverloadedLightsSystem : SharedRevenantOverloadedLightsSystem
|
|
|
|
|
|
{
|
2024-08-07 10:32:34 +00:00
|
|
|
|
[Dependency] private readonly LightningSystem _lightning = default!; // WD EDIT
|
2022-09-28 22:30:48 -04:00
|
|
|
|
|
2023-10-19 12:34:31 -07:00
|
|
|
|
protected override void OnZap(Entity<RevenantOverloadedLightsComponent> lights)
|
2022-09-28 22:30:48 -04:00
|
|
|
|
{
|
2023-10-19 12:34:31 -07:00
|
|
|
|
var component = lights.Comp;
|
2022-09-28 22:30:48 -04:00
|
|
|
|
if (component.Target == null)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
2023-10-19 12:34:31 -07:00
|
|
|
|
var lxform = Transform(lights);
|
2022-09-28 22:30:48 -04:00
|
|
|
|
var txform = Transform(component.Target.Value);
|
|
|
|
|
|
|
|
|
|
|
|
if (!lxform.Coordinates.TryDistance(EntityManager, txform.Coordinates, out var distance))
|
|
|
|
|
|
return;
|
|
|
|
|
|
if (distance > component.ZapRange)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
2024-08-07 10:32:34 +00:00
|
|
|
|
_lightning.ShootLightning(lights, component.Target.Value, component.ZapBeamEntityId, false); // WD EDIT
|
2022-09-28 22:30:48 -04:00
|
|
|
|
}
|
|
|
|
|
|
}
|