Allow pacifists to use disabling modes of energy magnum and energy shotgun (#41029)

Pacifists can stun with emagnum and eshotgun
This commit is contained in:
SnappingOpossum
2025-10-31 06:19:36 +11:00
committed by GitHub
parent a181063eaf
commit 1cc726a609
3 changed files with 13 additions and 0 deletions

View 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();

View 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]

View File

@@ -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