Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let Pacifists Use Certain Guns(Foam Weapons) #29835

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading