From 1cc726a6097ecda5560993a7ffed5e66585d8212 Mon Sep 17 00:00:00 2001 From: SnappingOpossum Date: Fri, 31 Oct 2025 06:19:36 +1100 Subject: [PATCH] Allow pacifists to use disabling modes of energy magnum and energy shotgun (#41029) Pacifists can stun with emagnum and eshotgun --- .../CombatMode/Pacification/PacificationSystem.cs | 5 +++++ .../Ranged/Components/BatteryWeaponFireModesComponent.cs | 6 ++++++ .../Entities/Objects/Weapons/Guns/Battery/battery_guns.yml | 2 ++ 3 files changed, 13 insertions(+) diff --git a/Content.Shared/CombatMode/Pacification/PacificationSystem.cs b/Content.Shared/CombatMode/Pacification/PacificationSystem.cs index 6bc32c5b96..22fbb53a93 100644 --- a/Content.Shared/CombatMode/Pacification/PacificationSystem.cs +++ b/Content.Shared/CombatMode/Pacification/PacificationSystem.cs @@ -6,6 +6,7 @@ using Content.Shared.IdentityManagement; using Content.Shared.Interaction.Events; using Content.Shared.Popups; using Content.Shared.Throwing; +using Content.Shared.Weapons.Ranged.Components; using Content.Shared.Weapons.Ranged.Events; using Robust.Shared.Timing; @@ -65,6 +66,10 @@ public sealed class PacificationSystem : EntitySystem if (HasComp(args.Used)) return; + if (TryComp(args.Used, out var component)) + if (component.FireModes[component.CurrentFireMode].PacifismAllowedMode) + return; + // Disallow firing guns in all cases. ShowPopup(ent, args.Used, "pacified-cannot-fire-gun"); args.Cancel(); diff --git a/Content.Shared/Weapons/Ranged/Components/BatteryWeaponFireModesComponent.cs b/Content.Shared/Weapons/Ranged/Components/BatteryWeaponFireModesComponent.cs index 77b9f53b7b..6986cf9fe9 100644 --- a/Content.Shared/Weapons/Ranged/Components/BatteryWeaponFireModesComponent.cs +++ b/Content.Shared/Weapons/Ranged/Components/BatteryWeaponFireModesComponent.cs @@ -42,6 +42,12 @@ public sealed partial class BatteryWeaponFireMode /// [DataField] public float FireCost = 100; + + /// + /// Wether or not this fire mode can be used by pacifists + /// + [DataField] + public bool PacifismAllowedMode = false; } [Serializable, NetSerializable] diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml index 2ab9141c76..8e2650b5fe 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml @@ -847,6 +847,7 @@ fireCost: 80 - proto: BulletDisablerSmgSpread fireCost: 48 + pacifismAllowedMode: true - type: Item size: Large sprite: Objects/Weapons/Guns/Battery/inhands_64x.rsi @@ -898,6 +899,7 @@ fireCost: 150 - proto: BulletDisabler fireCost: 62.5 + pacifismAllowedMode: true - type: BatterySelfRecharger autoRecharge: true autoRechargeRate: 48