Files
tbd-station-14/Content.Shared/Weapons/Ranged/Systems/UseDelayOnShootSystem.cs
2024-01-03 21:33:09 -04:00

22 lines
641 B
C#

using Content.Shared.Timing;
using Content.Shared.Weapons.Ranged.Components;
namespace Content.Shared.Weapons.Ranged.Systems;
public sealed class UseDelayOnShootSystem : EntitySystem
{
[Dependency] private readonly UseDelaySystem _delay = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<UseDelayOnShootComponent, GunShotEvent>(OnUseShoot);
}
private void OnUseShoot(EntityUid uid, UseDelayOnShootComponent component, ref GunShotEvent args)
{
if (TryComp(uid, out UseDelayComponent? useDelay))
_delay.TryResetDelay((uid, useDelay));
}
}