Add emp grenade (#14393)

This commit is contained in:
Slava0135
2023-03-06 22:05:12 +03:00
committed by GitHub
parent 58becca060
commit b2972c1d2c
16 changed files with 243 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ using Robust.Shared.Containers;
using Robust.Shared.Player;
using Robust.Shared.Timing;
using Content.Shared.DoAfter;
using Content.Server.Emp;
namespace Content.Server.Light.EntitySystems
{
@@ -63,6 +64,8 @@ namespace Content.Server.Light.EntitySystems
SubscribeLocalEvent<PoweredLightComponent, PowerChangedEvent>(OnPowerChanged);
SubscribeLocalEvent<PoweredLightComponent, DoAfterEvent>(OnDoAfter);
SubscribeLocalEvent<PoweredLightComponent, EmpPulseEvent>(OnEmpPulse);
}
private void OnInit(EntityUid uid, PoweredLightComponent light, ComponentInit args)
@@ -421,5 +424,11 @@ namespace Content.Server.Light.EntitySystems
args.Handled = true;
}
private void OnEmpPulse(EntityUid uid, PoweredLightComponent component, ref EmpPulseEvent args)
{
args.Affected = true;
TryDestroyBulb(uid, component);
}
}
}