]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Allow pacifists to use disabling modes of energy magnum and energy shotgun (#41029)
authorSnappingOpossum <snappingopossum@outlook.com>
Thu, 30 Oct 2025 19:19:36 +0000 (06:19 +1100)
committerGitHub <noreply@github.com>
Thu, 30 Oct 2025 19:19:36 +0000 (19:19 +0000)
Pacifists can stun with emagnum and eshotgun

Content.Shared/CombatMode/Pacification/PacificationSystem.cs
Content.Shared/Weapons/Ranged/Components/BatteryWeaponFireModesComponent.cs
Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml

index 6bc32c5b96c688dd3075b0af24e9b421b6b466e1..22fbb53a93f4a7df353202cd3459aa612200428f 100644 (file)
@@ -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<PacifismAllowedGunComponent>(args.Used))
             return;
 
+        if (TryComp<BatteryWeaponFireModesComponent>(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();
index 77b9f53b7b0a56267d8f586ab119df474bb86b38..6986cf9fe9ece881c915738e253f6007e9252120 100644 (file)
@@ -42,6 +42,12 @@ public sealed partial class BatteryWeaponFireMode
     /// </summary>
     [DataField]
     public float FireCost = 100;
+
+    /// <summary>
+    /// Wether or not this fire mode can be used by pacifists
+    /// </summary>
+    [DataField]
+    public bool PacifismAllowedMode = false;
 }
 
 [Serializable, NetSerializable]
index 2ab9141c76417abe8aabf0f35368fb9991d94809..8e2650b5fea7e994b3f018f443b2f13e3c8a8b8c 100644 (file)
       fireCost: 80
     - proto: BulletDisablerSmgSpread
       fireCost: 48
+      pacifismAllowedMode: true
   - type: Item
     size: Large
     sprite: Objects/Weapons/Guns/Battery/inhands_64x.rsi
       fireCost: 150
     - proto: BulletDisabler
       fireCost: 62.5
+      pacifismAllowedMode: true
   - type: BatterySelfRecharger
     autoRecharge: true
     autoRechargeRate: 48