diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs index 343ae8850e..d98ccb0d4f 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs @@ -12,6 +12,7 @@ using Content.Shared.Throwing; using Content.Shared.Verbs; using Content.Shared.Weapons.Ranged.Components; using Content.Shared.Weapons.Ranged.Events; +using Content.Shared.Tag; using Robust.Shared.Audio; using Robust.Shared.Containers; using Robust.Shared.GameStates; @@ -42,6 +43,7 @@ public abstract partial class SharedGunSystem : EntitySystem [Dependency] protected readonly SharedPhysicsSystem Physics = default!; [Dependency] protected readonly SharedPopupSystem PopupSystem = default!; [Dependency] protected readonly ThrowingSystem ThrowingSystem = default!; + [Dependency] protected readonly TagSystem _tagSystem = default!; protected ISawmill Sawmill = default!; @@ -86,6 +88,9 @@ public abstract partial class SharedGunSystem : EntitySystem private void OnGunMeleeAttempt(EntityUid uid, GunComponent component, ref MeleeAttackAttemptEvent args) { + if (_tagSystem.HasTag(args.User, "GunsDisabled")) + return; + args.Cancelled = true; } @@ -181,6 +186,12 @@ public abstract partial class SharedGunSystem : EntitySystem if (toCoordinates == null) return; + if (_tagSystem.HasTag(user, "GunsDisabled")) + { + Popup(Loc.GetString("gun-disabled"), user, user); + return; + } + var curTime = Timing.CurTime; // Need to do this to play the clicking sound for empty automatic weapons diff --git a/Resources/Locale/en-US/weapons/ranged/gun.ftl b/Resources/Locale/en-US/weapons/ranged/gun.ftl index 58dce848a1..4f422a357d 100644 --- a/Resources/Locale/en-US/weapons/ranged/gun.ftl +++ b/Resources/Locale/en-US/weapons/ranged/gun.ftl @@ -3,6 +3,7 @@ gun-selected-mode-examine = Current selected fire mode is [color={$color}]{$mode gun-fire-rate-examine = Fire rate is [color={$color}]{$fireRate}[/color] per second. gun-selector-verb = Change to {$mode} gun-selected-mode = Selected {$mode} +gun-disabled = You can't use guns! # SelectiveFire gun-SemiAuto = semi-auto diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml index 1d99aab74a..bd1067747c 100644 --- a/Resources/Prototypes/tags.yml +++ b/Resources/Prototypes/tags.yml @@ -207,6 +207,9 @@ - type: Tag id: Grenade +- type: Tag + id: GunsDisabled # Allow certain entities to not use guns without complicating the system with an event + - type: Tag id: Handcuffs