Let Pacifists Use Certain Guns(foam)
private void OnShootAttempt(Entity<PacifiedComponent> ent, ref ShotAttemptedEvent args)
{
+ if (HasComp<PacifismAllowedGunComponent>(args.Used))
+ return;
+
// Disallow firing guns in all cases.
ShowPopup(ent, args.Used, "pacified-cannot-fire-gun");
args.Cancel();
--- /dev/null
+using Robust.Shared.GameStates;
+
+namespace Content.Shared.CombatMode.Pacification;
+
+/// <summary>
+/// Guns with this component can be fired by pacifists
+/// </summary>
+[RegisterComponent, NetworkedComponent]
+public sealed partial class PacifismAllowedGunComponent : Component
+{
+}
- type: Sprite
- type: Item
size: Normal
+ - type: PacifismAllowedGun
- type: entity
parent: FoamWeaponBase
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
soundEmpty:
path: /Audio/Weapons/Guns/Empty/empty.ogg
clumsyProof: true
+ - type: PacifismAllowedGun