Skip to content

Commit

Permalink
Let Pacifists Use Certain Guns(Foam Weapons) (space-wizards#29835)
Browse files Browse the repository at this point in the history
Let Pacifists Use Certain Guns(foam)
  • Loading branch information
Cojoke-dot authored and aspiringLich committed Jul 21, 2024
1 parent 88e10e8 commit e66de31
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Content.Shared/CombatMode/Pacification/PacificationSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ private void ShowPopup(Entity<PacifiedComponent> user, EntityUid target, string

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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
}
1 change: 1 addition & 0 deletions Resources/Prototypes/Entities/Objects/Fun/toys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,7 @@
- type: Sprite
- type: Item
size: Normal
- type: PacifismAllowedGun

- type: entity
parent: FoamWeaponBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
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
Expand All @@ -216,3 +216,4 @@
soundEmpty:
path: /Audio/Weapons/Guns/Empty/empty.ogg
clumsyProof: true
- type: PacifismAllowedGun

0 comments on commit e66de31

Please sign in to comment.