]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Rework the Flare Gun & add a Security Shell Gun. (#32829)
authorBramvanZijp <56019239+BramvanZijp@users.noreply.github.com>
Wed, 6 Nov 2024 14:27:10 +0000 (15:27 +0100)
committerGitHub <noreply@github.com>
Wed, 6 Nov 2024 14:27:10 +0000 (15:27 +0100)
* Rework flaregun and add security shell gun

* Make flare gun twice as likely to appear in emergency lockers

* Security shell gun can now fire lethal shells like the flare gun used to be able to.

* Rebalance the sec shell gun material cost to primarily be steel instead of plastic

* Define the ShellShotgunLight tag in tags.yml

* Leave the no lethal shells for normal flareguns to a different PR.

* Move a comment to re-run checks.

* Bye bye lethal shells from plastic guns.

* Fix weird whitespace issue.

* Make the sec shell gun inherit the normal flare gun.

* Remove the rack verb and update the sec shell gun description

* Remove the ability to fire lethals from flare guns, pending blowing up the gun

---------

Co-authored-by: SlamBamActionman <slambamactionman@gmail.com>
16 files changed:
Content.Shared/Weapons/Ranged/Components/ChamberMagazineAmmoProviderComponent.cs
Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.ChamberMagazine.cs
Resources/Prototypes/Catalog/Fills/Lockers/misc.yml
Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml
Resources/Prototypes/Entities/Objects/Weapons/Guns/flare_gun.yml
Resources/Prototypes/Recipes/Lathes/security.yml
Resources/Prototypes/tags.yml
Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun.rsi/base.png [moved from Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun.rsi/icon.png with 100% similarity]
Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun.rsi/meta.json
Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/base.png [new file with mode: 0644]
Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/bolt-open.png [new file with mode: 0644]
Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/equipped-BELT.png [new file with mode: 0644]
Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/equipped-SUITSTORAGE.png [new file with mode: 0644]
Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/inhand-left.png [new file with mode: 0644]
Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/inhand-right.png [new file with mode: 0644]
Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/meta.json [new file with mode: 0644]

index 37517c13711015ef04f9858c96a8f44cc426bbbc..cdcf1a7b31b3f83d101ba4672fb26db5df72c222 100644 (file)
@@ -22,6 +22,12 @@ public sealed partial class ChamberMagazineAmmoProviderComponent : MagazineAmmoP
     [ViewVariables(VVAccess.ReadWrite), DataField("autoCycle"), AutoNetworkedField]
     public bool AutoCycle = true;
 
+    /// <summary>
+    /// Can the gun be racked, which opens and then instantly closes the bolt to cycle a round.
+    /// </summary>
+    [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");
 
index d6f45ba77df01cd15034ef61080901f89d43c0c0..3060e2c1a93c4b810afc170fc7eba184bce7cf7e 100644 (file)
@@ -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);
     }
 
     /// <summary>
@@ -75,7 +78,7 @@ public abstract partial class SharedGunSystem
     /// </summary>
     private void OnChamberActivationVerb(EntityUid uid, ChamberMagazineAmmoProviderComponent component, GetVerbsEvent<ActivationVerb> 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()
index 5e2b6aeb758c8fe4f74d98194a61abe566e83092..4c0a9826de7cfc2da0ab7290fb23a4cc298df333 100644 (file)
@@ -30,7 +30,7 @@
     - id: MedkitOxygenFilled
       prob: 0.2
     - id: WeaponFlareGun
-      prob: 0.05
+      prob: 0.1
     - id: BoxMRE
       prob: 0.1
 
index 47577b0857db1523829dbc74e7ec9811137d28fb..dd00440eec014f18e888aa4e6995083917db8ac6 100644 (file)
   name: shell (.50 beanbag)
   parent: BaseShellShotgun
   components:
+  - type: Tag
+    tags:
+    - Cartridge
+    - ShellShotgun
+    - ShellShotgunLight
   - type: Sprite
     layers:
       - state: beanbag
   name: shell (.50 flare)
   parent: BaseShellShotgun
   components:
+  - type: Tag
+    tags:
+    - Cartridge
+    - ShellShotgun
+    - ShellShotgunLight
   - type: Sprite
     layers:
       - state: flare
   name: shell (.50 tranquilizer)
   parent: BaseShellShotgun
   components:
+  - type: Tag
+    tags:
+    - Cartridge
+    - ShellShotgun
+    - ShellShotgunLight
   - type: Sprite
     layers:
       - state: tranquilizer
   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
index 9b046a7aae6395a458846b3eaa3f1d7fd1bfa835..b63036c58b2fa0ee6721312dac9d8f306f934536 100644 (file)
@@ -1,39 +1,75 @@
 - 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: Gun
-    fireRate: 8
-    selectedMode: SemiAuto
-    availableModes:
-      - 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: 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:
-      ballistic-ammo: !type:Container
-        ents: []
+      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
+    availableModes:
+      - SemiAuto
+    soundGunshot:
+      path: /Audio/Weapons/Guns/Gunshots/flaregun.ogg
+
+
+- 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:
+      gun_chamber:
+        name: Chamber
+        priority: 1
+        whitelist:
+          tags:
+            - ShellShotgun
+  - type: Tag
+    tags:
+    - Sidearm
index 29227fb9db9590b7fca0ebe647b50c5740e7b854..f6f303e5e3b19989bae5ffec4c767d12fc89940d 100644 (file)
     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
index 48bce7ddab7f344e571f167cf7f4294615f3a86b..be9c90ce93d8435a2f17d4b899502acca3df38a0 100644 (file)
 - type: Tag
   id: ShellShotgun
 
+- type: Tag
+  id: ShellShotgunLight # shotgun shells that are compatible with the flare gun.
+
 - type: Tag
   id: Shiv
 
index fc96d8d51942faadc39310db6f5ca7272ad3a422..43840761498e052d02fb0941f2b41fa6e5ed21f3 100644 (file)
@@ -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 (file)
index 0000000..0b39a08
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 (file)
index 0000000..6505254
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 (file)
index 0000000..fb2854b
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 (file)
index 0000000..fb2854b
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 (file)
index 0000000..bff3d73
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 (file)
index 0000000..5029790
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 (file)
index 0000000..04abe1a
--- /dev/null
@@ -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
+        }
+    ]
+}