Adds grappling gun (#16662)
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
using Content.Shared.Weapons.Ranged.Components;
|
||||
using Content.Shared.Weapons.Ranged.Events;
|
||||
using Robust.Shared.Map;
|
||||
|
||||
namespace Content.Server.Weapons.Ranged.Systems;
|
||||
|
||||
public sealed partial class GunSystem
|
||||
{
|
||||
protected override void Cycle(BallisticAmmoProviderComponent component, MapCoordinates coordinates)
|
||||
protected override void Cycle(EntityUid uid, BallisticAmmoProviderComponent component, MapCoordinates coordinates)
|
||||
{
|
||||
EntityUid? ent = null;
|
||||
|
||||
@@ -27,5 +28,8 @@ public sealed partial class GunSystem
|
||||
|
||||
if (ent != null)
|
||||
EjectCartridge(ent.Value);
|
||||
|
||||
var cycledEvent = new GunCycledEvent();
|
||||
RaiseLocalEvent(uid, ref cycledEvent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,8 +67,10 @@ public sealed partial class GunSystem : SharedGunSystem
|
||||
}
|
||||
|
||||
public override void Shoot(EntityUid gunUid, GunComponent gun, List<(EntityUid? Entity, IShootable Shootable)> ammo,
|
||||
EntityCoordinates fromCoordinates, EntityCoordinates toCoordinates, EntityUid? user = null, bool throwItems = false)
|
||||
EntityCoordinates fromCoordinates, EntityCoordinates toCoordinates, out bool userImpulse, EntityUid? user = null, bool throwItems = false)
|
||||
{
|
||||
userImpulse = true;
|
||||
|
||||
// Try a clumsy roll
|
||||
// TODO: Who put this here
|
||||
if (TryComp<ClumsyComponent>(user, out var clumsy))
|
||||
@@ -88,6 +90,7 @@ public sealed partial class GunSystem : SharedGunSystem
|
||||
PopupSystem.PopupEntity(Loc.GetString("gun-clumsy"), user.Value);
|
||||
_adminLogger.Add(LogType.EntityDelete, LogImpact.Medium, $"Clumsy fire by {ToPrettyString(user.Value)} deleted {ToPrettyString(gunUid)}");
|
||||
Del(gunUid);
|
||||
userImpulse = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -161,6 +164,7 @@ public sealed partial class GunSystem : SharedGunSystem
|
||||
}
|
||||
else
|
||||
{
|
||||
userImpulse = false;
|
||||
Audio.PlayPredicted(gun.SoundEmpty, gunUid, user);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user