diff --git a/Content.Shared/Weapons/Ranged/Components/ChamberMagazineAmmoProviderComponent.cs b/Content.Shared/Weapons/Ranged/Components/ChamberMagazineAmmoProviderComponent.cs
index 37517c1371..cdcf1a7b31 100644
--- a/Content.Shared/Weapons/Ranged/Components/ChamberMagazineAmmoProviderComponent.cs
+++ b/Content.Shared/Weapons/Ranged/Components/ChamberMagazineAmmoProviderComponent.cs
@@ -22,6 +22,12 @@ public sealed partial class ChamberMagazineAmmoProviderComponent : MagazineAmmoP
[ViewVariables(VVAccess.ReadWrite), DataField("autoCycle"), AutoNetworkedField]
public bool AutoCycle = true;
+ ///
+ /// Can the gun be racked, which opens and then instantly closes the bolt to cycle a round.
+ ///
+ [ViewVariables(VVAccess.ReadWrite), DataField("canRack"), AutoNetworkedField]
+ public bool CanRack = true;
+
[ViewVariables(VVAccess.ReadWrite), DataField("soundBoltClosed"), AutoNetworkedField]
public SoundSpecifier? BoltClosedSound = new SoundPathSpecifier("/Audio/Weapons/Guns/Bolt/rifle_bolt_closed.ogg");
diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.ChamberMagazine.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.ChamberMagazine.cs
index d6f45ba77d..3060e2c1a9 100644
--- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.ChamberMagazine.cs
+++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.ChamberMagazine.cs
@@ -67,7 +67,10 @@ public abstract partial class SharedGunSystem
return;
args.Handled = true;
- UseChambered(uid, component, args.User);
+ if (component.CanRack)
+ UseChambered(uid, component, args.User);
+ else
+ ToggleBolt(uid, component, args.User);
}
///
@@ -75,7 +78,7 @@ public abstract partial class SharedGunSystem
///
private void OnChamberActivationVerb(EntityUid uid, ChamberMagazineAmmoProviderComponent component, GetVerbsEvent args)
{
- if (!args.CanAccess || !args.CanInteract || component.BoltClosed == null)
+ if (!args.CanAccess || !args.CanInteract || component.BoltClosed == null || !component.CanRack)
return;
args.Verbs.Add(new ActivationVerb()
diff --git a/Resources/Prototypes/Catalog/Fills/Lockers/misc.yml b/Resources/Prototypes/Catalog/Fills/Lockers/misc.yml
index 5e2b6aeb75..4c0a9826de 100644
--- a/Resources/Prototypes/Catalog/Fills/Lockers/misc.yml
+++ b/Resources/Prototypes/Catalog/Fills/Lockers/misc.yml
@@ -30,7 +30,7 @@
- id: MedkitOxygenFilled
prob: 0.2
- id: WeaponFlareGun
- prob: 0.05
+ prob: 0.1
- id: BoxMRE
prob: 0.1
diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml
index 47577b0857..dd00440eec 100644
--- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml
+++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml
@@ -24,6 +24,11 @@
name: shell (.50 beanbag)
parent: BaseShellShotgun
components:
+ - type: Tag
+ tags:
+ - Cartridge
+ - ShellShotgun
+ - ShellShotgunLight
- type: Sprite
layers:
- state: beanbag
@@ -52,6 +57,11 @@
name: shell (.50 flare)
parent: BaseShellShotgun
components:
+ - type: Tag
+ tags:
+ - Cartridge
+ - ShellShotgun
+ - ShellShotgunLight
- type: Sprite
layers:
- state: flare
@@ -106,6 +116,11 @@
name: shell (.50 tranquilizer)
parent: BaseShellShotgun
components:
+ - type: Tag
+ tags:
+ - Cartridge
+ - ShellShotgun
+ - ShellShotgunLight
- type: Sprite
layers:
- state: tranquilizer
@@ -130,6 +145,11 @@
description: A homemade shotgun shell that shoots painful glass shrapnel. The spread is so wide that it couldn't hit the broad side of a barn.
parent: BaseShellShotgun
components:
+ - type: Tag
+ tags:
+ - Cartridge
+ - ShellShotgun
+ - ShellShotgunLight
- type: Sprite
layers:
- state: improvised
diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/flare_gun.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/flare_gun.yml
index 9b046a7aae..b63036c58b 100644
--- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/flare_gun.yml
+++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/flare_gun.yml
@@ -1,17 +1,44 @@
- type: entity
name: flare gun
- parent: BaseWeaponLauncher
+ parent: BaseItem
id: WeaponFlareGun
- description: A compact, single-shot pistol that fires shotgun shells.
+ description: A compact, single-shot pistol that fires shotgun shells. Comes with a safety feature that prevents the user from fitting lethal shells inside.
components:
- type: Sprite
sprite: Objects/Weapons/Guns/Shotguns/flaregun.rsi
layers:
- - state: icon
+ - state: base
map: ["enum.GunVisualLayers.Base"]
- type: Item
size: Small
sprite: Objects/Weapons/Guns/Shotguns/flaregun.rsi
+ - type: ItemSlots
+ slots:
+ gun_chamber:
+ name: Chamber
+ startingItem: ShellShotgunFlare
+ priority: 1
+ whitelist:
+ tags: ## TODO: Add a risk of the gun blowing up if using non-light shotgun shells, and then re-enable them.
+ ## - ShellShotgun
+ - ShellShotgunLight
+ - type: ContainerContainer
+ containers:
+ gun_chamber: !type:ContainerSlot
+ - type: ChamberMagazineAmmoProvider
+ autoCycle: false
+ boltClosed: true
+ canRack: false
+ soundBoltClosed: /Audio/Weapons/Guns/Cock/revolver_cock.ogg
+ soundBoltOpened: /Audio/Weapons/Guns/Cock/revolver_cock.ogg
+ soundRack: /Audio/Weapons/Guns/Cock/revolver_cock.ogg
+ - type: Clothing
+ sprite: Objects/Weapons/Guns/Shotguns/flaregun.rsi
+ quickEquip: false
+ slots:
+ - Belt
+ - suitStorage
+ - type: Appearance
- type: Gun
fireRate: 8
selectedMode: SemiAuto
@@ -19,21 +46,30 @@
- SemiAuto
soundGunshot:
path: /Audio/Weapons/Guns/Gunshots/flaregun.ogg
- - type: BallisticAmmoProvider
- whitelist:
- tags:
- - ShellShotgun
- proto: ShellShotgunFlare
- capacity: 1
- soundInsert:
- path: /Audio/Weapons/Guns/MagIn/shotgun_insert.ogg
- - type: ContainerContainer
- containers:
- ballistic-ammo: !type:Container
- ents: []
- - type: Clothing
- sprite: Objects/Weapons/Guns/Shotguns/flaregun.rsi
- quickEquip: false
+
+
+- type: entity
+ name: security shell gun
+ parent: [WeaponFlareGun, BaseSecurityContraband]
+ id: WeaponFlareGunSecurity
+ description: A modified flare gun originally designed to be used by security to launch non-lethal shotgun shells, however it can also fire lethal shells without risk.
+ components:
+ - type: Sprite
+ sprite: Objects/Weapons/Guns/Shotguns/flaregun_security.rsi
+ layers:
+ - state: base
+ map: ["enum.GunVisualLayers.Base"]
+ - type: Item
+ size: Small
+ sprite: Objects/Weapons/Guns/Shotguns/flaregun_security.rsi
+ - type: ItemSlots
slots:
- - Belt
- - suitStorage
+ gun_chamber:
+ name: Chamber
+ priority: 1
+ whitelist:
+ tags:
+ - ShellShotgun
+ - type: Tag
+ tags:
+ - Sidearm
diff --git a/Resources/Prototypes/Recipes/Lathes/security.yml b/Resources/Prototypes/Recipes/Lathes/security.yml
index 29227fb9db..f6f303e5e3 100644
--- a/Resources/Prototypes/Recipes/Lathes/security.yml
+++ b/Resources/Prototypes/Recipes/Lathes/security.yml
@@ -603,6 +603,15 @@
Plastic: 320
Uranium: 240
+- type: latheRecipe
+ parent: BaseWeaponRecipe
+ id: WeaponFlareGunSecurity
+ result: WeaponFlareGunSecurity
+ completetime: 6
+ materials:
+ Plastic: 100
+ Steel: 400
+
- type: latheRecipe
parent: BaseWeaponRecipe
id: WeaponDisabler
diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml
index 48bce7ddab..be9c90ce93 100644
--- a/Resources/Prototypes/tags.yml
+++ b/Resources/Prototypes/tags.yml
@@ -1198,6 +1198,9 @@
- type: Tag
id: ShellShotgun
+- type: Tag
+ id: ShellShotgunLight # shotgun shells that are compatible with the flare gun.
+
- type: Tag
id: Shiv
diff --git a/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun.rsi/icon.png b/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun.rsi/base.png
similarity index 100%
rename from Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun.rsi/icon.png
rename to Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun.rsi/base.png
diff --git a/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun.rsi/meta.json b/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun.rsi/meta.json
index fc96d8d519..4384076149 100644
--- a/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun.rsi/meta.json
+++ b/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun.rsi/meta.json
@@ -8,7 +8,7 @@
},
"states": [
{
- "name": "icon"
+ "name": "base"
},
{
"name": "bolt-open"
diff --git a/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/base.png b/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/base.png
new file mode 100644
index 0000000000..0b39a08c92
Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/base.png differ
diff --git a/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/bolt-open.png b/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/bolt-open.png
new file mode 100644
index 0000000000..65052544c7
Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/bolt-open.png differ
diff --git a/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/equipped-BELT.png b/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/equipped-BELT.png
new file mode 100644
index 0000000000..fb2854b6fe
Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/equipped-BELT.png differ
diff --git a/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/equipped-SUITSTORAGE.png b/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/equipped-SUITSTORAGE.png
new file mode 100644
index 0000000000..fb2854b6fe
Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/equipped-SUITSTORAGE.png differ
diff --git a/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/inhand-left.png b/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/inhand-left.png
new file mode 100644
index 0000000000..bff3d731c4
Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/inhand-left.png differ
diff --git a/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/inhand-right.png b/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/inhand-right.png
new file mode 100644
index 0000000000..50297902ee
Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/inhand-right.png differ
diff --git a/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/meta.json b/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/meta.json
new file mode 100644
index 0000000000..04abe1a4e0
--- /dev/null
+++ b/Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/meta.json
@@ -0,0 +1,33 @@
+{
+ "version": 1,
+ "license": "CC-BY-SA-3.0",
+ "copyright": "Taken from cev-eris at https://github.com/discordia-space/CEV-Eris/raw/3f9ebb72931ff884427c3004a594ec61aaaa7041/icons/obj/guns/projectile/flaregun.dmi and edited",
+ "size": {
+ "x": 32,
+ "y": 32
+ },
+ "states": [
+ {
+ "name": "base"
+ },
+ {
+ "name": "bolt-open"
+ },
+ {
+ "name": "inhand-right",
+ "directions": 4
+ },
+ {
+ "name": "inhand-left",
+ "directions": 4
+ },
+ {
+ "name": "equipped-BELT",
+ "directions": 4
+ },
+ {
+ "name": "equipped-SUITSTORAGE",
+ "directions": 4
+ }
+ ]
+}