Let Pacifists Use Certain Guns(Foam Weapons) (#29835)

Let Pacifists Use Certain Guns(foam)
This commit is contained in:
Cojoke
2024-07-09 08:46:21 -05:00
committed by GitHub
parent 7bf77beb9e
commit 62d8665484
4 changed files with 17 additions and 1 deletions

View File

@@ -62,6 +62,9 @@ public sealed class PacificationSystem : EntitySystem
private void OnShootAttempt(Entity<PacifiedComponent> ent, ref ShotAttemptedEvent args) private void OnShootAttempt(Entity<PacifiedComponent> ent, ref ShotAttemptedEvent args)
{ {
if (HasComp<PacifismAllowedGunComponent>(args.Used))
return;
// Disallow firing guns in all cases. // Disallow firing guns in all cases.
ShowPopup(ent, args.Used, "pacified-cannot-fire-gun"); ShowPopup(ent, args.Used, "pacified-cannot-fire-gun");
args.Cancel(); args.Cancel();

View File

@@ -0,0 +1,11 @@
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
{
}

View File

@@ -869,6 +869,7 @@
- type: Sprite - type: Sprite
- type: Item - type: Item
size: Normal size: Normal
- type: PacifismAllowedGun
- type: entity - type: entity
parent: FoamWeaponBase parent: FoamWeaponBase

View File

@@ -199,7 +199,7 @@
sprite: Objects/Weapons/Guns/Rifles/foam_rifle.rsi sprite: Objects/Weapons/Guns/Rifles/foam_rifle.rsi
- type: Item - type: Item
sprite: Objects/Weapons/Guns/Rifles/foam_rifle_inhand_64x.rsi sprite: Objects/Weapons/Guns/Rifles/foam_rifle_inhand_64x.rsi
- type: BallisticAmmoProvider - type: BallisticAmmoProvider
whitelist: whitelist:
tags: tags:
- BulletFoam - BulletFoam
@@ -216,3 +216,4 @@
soundEmpty: soundEmpty:
path: /Audio/Weapons/Guns/Empty/empty.ogg path: /Audio/Weapons/Guns/Empty/empty.ogg
clumsyProof: true clumsyProof: true
- type: PacifismAllowedGun