From: Cojoke <83733158+Cojoke-dot@users.noreply.github.com> Date: Tue, 9 Jul 2024 13:46:21 +0000 (-0500) Subject: Let Pacifists Use Certain Guns(Foam Weapons) (#29835) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=62d8665484e03ae97bb3c36b3e61a74a1f9fe5e4;p=space-station-14.git Let Pacifists Use Certain Guns(Foam Weapons) (#29835) Let Pacifists Use Certain Guns(foam) --- diff --git a/Content.Shared/CombatMode/Pacification/PacificationSystem.cs b/Content.Shared/CombatMode/Pacification/PacificationSystem.cs index 14507ce1f5..6bc32c5b96 100644 --- a/Content.Shared/CombatMode/Pacification/PacificationSystem.cs +++ b/Content.Shared/CombatMode/Pacification/PacificationSystem.cs @@ -62,6 +62,9 @@ public sealed class PacificationSystem : EntitySystem private void OnShootAttempt(Entity ent, ref ShotAttemptedEvent args) { + if (HasComp(args.Used)) + return; + // Disallow firing guns in all cases. ShowPopup(ent, args.Used, "pacified-cannot-fire-gun"); args.Cancel(); diff --git a/Content.Shared/CombatMode/Pacification/PacifismAllowedGunComponent.cs b/Content.Shared/CombatMode/Pacification/PacifismAllowedGunComponent.cs new file mode 100644 index 0000000000..7decbeb3bc --- /dev/null +++ b/Content.Shared/CombatMode/Pacification/PacifismAllowedGunComponent.cs @@ -0,0 +1,11 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.CombatMode.Pacification; + +/// +/// Guns with this component can be fired by pacifists +/// +[RegisterComponent, NetworkedComponent] +public sealed partial class PacifismAllowedGunComponent : Component +{ +} diff --git a/Resources/Prototypes/Entities/Objects/Fun/toys.yml b/Resources/Prototypes/Entities/Objects/Fun/toys.yml index 1ac622db86..310f92e60c 100644 --- a/Resources/Prototypes/Entities/Objects/Fun/toys.yml +++ b/Resources/Prototypes/Entities/Objects/Fun/toys.yml @@ -869,6 +869,7 @@ - type: Sprite - type: Item size: Normal + - type: PacifismAllowedGun - type: entity parent: FoamWeaponBase diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Rifles/rifles.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Rifles/rifles.yml index 9300367cde..fef793487c 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Rifles/rifles.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Rifles/rifles.yml @@ -199,7 +199,7 @@ sprite: Objects/Weapons/Guns/Rifles/foam_rifle.rsi - type: Item sprite: Objects/Weapons/Guns/Rifles/foam_rifle_inhand_64x.rsi - - type: BallisticAmmoProvider + - type: BallisticAmmoProvider whitelist: tags: - BulletFoam @@ -216,3 +216,4 @@ soundEmpty: path: /Audio/Weapons/Guns/Empty/empty.ogg clumsyProof: true + - type: PacifismAllowedGun