multi-gun nerf (#20194)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Hands;
|
||||
using Content.Shared.Verbs;
|
||||
using Content.Shared.Weapons.Ranged.Components;
|
||||
using Robust.Shared.Utility;
|
||||
@@ -103,4 +104,27 @@ public abstract partial class SharedGunSystem
|
||||
{
|
||||
SelectFire(uid, component, args.Mode, args.Performer);
|
||||
}
|
||||
|
||||
private void OnGunSelected(EntityUid uid, GunComponent component, HandSelectedEvent args)
|
||||
{
|
||||
var fireDelay = 1f / component.FireRate;
|
||||
if (fireDelay.Equals(0f))
|
||||
return;
|
||||
|
||||
if (!component.ResetOnHandSelected)
|
||||
return;
|
||||
|
||||
if (Paused(uid))
|
||||
return;
|
||||
|
||||
// If someone swaps to this weapon then reset its cd.
|
||||
var curTime = Timing.CurTime;
|
||||
var minimum = curTime + TimeSpan.FromSeconds(fireDelay);
|
||||
|
||||
if (minimum < component.NextFire)
|
||||
return;
|
||||
|
||||
component.NextFire = minimum;
|
||||
Dirty(uid, component);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user