Make PKA require wielding (#16638)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Content.Shared.Wieldable;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Weapons.Melee.Components;
|
||||
@@ -5,7 +6,7 @@ namespace Content.Shared.Weapons.Melee.Components;
|
||||
/// <summary>
|
||||
/// Indicates that this meleeweapon requires wielding to be useable.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, Access(typeof(WieldableSystem))]
|
||||
public sealed class MeleeRequiresWieldComponent : Component
|
||||
{
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Content.Shared.Wieldable;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Weapons.Ranged.Components;
|
||||
@@ -5,7 +6,7 @@ namespace Content.Shared.Weapons.Ranged.Components;
|
||||
/// <summary>
|
||||
/// Indicates that this gun requires wielding to be useable.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, Access(typeof(WieldableSystem))]
|
||||
public sealed class GunRequiresWieldComponent : Component
|
||||
{
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
using Content.Shared.Wieldable;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Weapons.Ranged.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Applies an accuracy bonus upon wielding.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, Access(typeof(WieldableSystem))]
|
||||
public sealed partial class GunWieldBonusComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("minAngle"), AutoNetworkedField]
|
||||
public Angle MinAngle = Angle.FromDegrees(-43);
|
||||
|
||||
/// <summary>
|
||||
/// Angle bonus applied upon being wielded.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("maxAngle"), AutoNetworkedField]
|
||||
public Angle MaxAngle = Angle.FromDegrees(-43);
|
||||
}
|
||||
@@ -29,6 +29,9 @@ public abstract partial class SharedGunSystem
|
||||
|
||||
private void OnBallisticUse(EntityUid uid, BallisticAmmoProviderComponent component, UseInHandEvent args)
|
||||
{
|
||||
if (args.Handled)
|
||||
return;
|
||||
|
||||
ManualCycle(uid, component, Transform(uid).MapPosition, args.User);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user