From d58840990901423b8c9717bf90e4a36cb59b0ad5 Mon Sep 17 00:00:00 2001 From: BramvanZijp <56019239+BramvanZijp@users.noreply.github.com> Date: Wed, 6 Nov 2024 15:27:10 +0100 Subject: [PATCH] Rework the Flare Gun & add a Security Shell Gun. (#32829) * 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 --- .../ChamberMagazineAmmoProviderComponent.cs | 6 ++ .../SharedGunSystem.ChamberMagazine.cs | 7 +- .../Prototypes/Catalog/Fills/Lockers/misc.yml | 2 +- .../Guns/Ammunition/Cartridges/shotgun.yml | 20 +++++ .../Objects/Weapons/Guns/flare_gun.yml | 76 +++++++++++++----- .../Prototypes/Recipes/Lathes/security.yml | 9 +++ Resources/Prototypes/tags.yml | 3 + .../flaregun.rsi/{icon.png => base.png} | Bin .../Guns/Shotguns/flaregun.rsi/meta.json | 2 +- .../Shotguns/flaregun_security.rsi/base.png | Bin 0 -> 549 bytes .../flaregun_security.rsi/bolt-open.png | Bin 0 -> 574 bytes .../flaregun_security.rsi/equipped-BELT.png | Bin 0 -> 222 bytes .../equipped-SUITSTORAGE.png | Bin 0 -> 222 bytes .../flaregun_security.rsi/inhand-left.png | Bin 0 -> 419 bytes .../flaregun_security.rsi/inhand-right.png | Bin 0 -> 413 bytes .../Shotguns/flaregun_security.rsi/meta.json | 33 ++++++++ 16 files changed, 134 insertions(+), 24 deletions(-) rename Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun.rsi/{icon.png => base.png} (100%) create mode 100644 Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/base.png create mode 100644 Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/bolt-open.png create mode 100644 Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/equipped-BELT.png create mode 100644 Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/equipped-SUITSTORAGE.png create mode 100644 Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/inhand-left.png create mode 100644 Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/inhand-right.png create mode 100644 Resources/Textures/Objects/Weapons/Guns/Shotguns/flaregun_security.rsi/meta.json 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,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 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 0000000000000000000000000000000000000000..0b39a08c9210d17ce106499ecd3386d7892122c1 GIT binary patch literal 549 zcmV+=0^0qFP)z@;j|==^1poj532;bRa{vGi!TJtP&A~y?Sv$BpD1x9Mq@+c0 zXem;tYwY)WPp)lfE?Nsheh}{Rn)LhLyLT6giHZ4FEUgrMH60sMYBa*K=4gFu``g53 zI{j-y2{jsl3c!Tt)v3^OIaX^lcm%m@R?Wh3T$i;Y82~UL;zi%5r~LzZJwBwpWRhbq zoeqy-tW~S59cc*w#32m9`BaKyxEByJxdh`1T;=nuA}=FT%u5TaG<|(eJDCi}O_2(O z8WZD~0EpwX!{{89c|?}TPCdftr(n?Uri?rXPR}mYY#4MgL~)@q zQA;oMy%bdXkJdYv{-*+A^i=?2lV)fM^z0|WkO934Qhs#)I6l2W^cjE{E(q&J&~Q;c nwNV(^SbElScE`lTj2EIWESu93D}=hn00000NkvXXu0mjfoQURt literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..65052544c725d7079b4b8e33c10ca7fd2ed5ec2d GIT binary patch literal 574 zcmV-E0>S->P)z@;j|==^1poj532;bRa{vGi!T(P#^TYH4V2u*NWIXlN>EXljVI{sSk6psk@T=Wu9iXea`QAUM$= z8WagZr{ePa@ILZhcix?N1i^ja<^6F#zTfA^DMds?{417L3zk}j#*~@^k;%-_*3QAu z#C9Svv7xaHG#YO_BNHdNoRv zN;loE?f$V1AaV#V#N)ir)@q&xFdrt9R5c80wptDYflF|k%~}}8u^5ZL_Im2dXiy@E z<95ifuBc@BzO&-j)AHAnX!J>CV5T>1hfkPP5Cl%Zsr!Al_G;B01| z%6(_VcSQwOE2Bro>Z9Q?6K#%?} za2U|DAn8Xf!}#lU!*e!`^A5b&6?yZU1HGnavJ}-=8Lwl%pmuQ0rmD$-r*e!`^A5b&6?yZU1HGnavJ}-=8Lwl%pmuQ0rmD$-rE`W?od3IB{-IXVd?91;GR&>9AYgqNS5toYhqf2}Y6?A@!S)f;!umpQcUkhai)n=kh4wX!HVe|o7mr{nY2 z#kUjW8fIOu`upoqU$t%d?|;`cTQ2N5)Sc=6(>d6+?7)xAM}D)H1%2L>$+56%?9LhStGnK_fE@rL>MkyG4&WBs>eIe> z=XsVA!L;6;&B2!$OfLG?sx9cguqW$i@Dq_`j5c4`k2*)>#+eqUunXiLeEImv=b|ZG z50`7pXL+5ve=vppNUQ1j>r(9rsat;rco)3~1>}$TIlmd6znk#NT}VS1WS6I_pUXO@ GgeCy1`Ls>| literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..50297902ee82a02c050f424ddb17fa84479c2ce5 GIT binary patch literal 413 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1engOR6;V@O5Z+glsG4m-#k|JcpZIxX+rG!d5e zeeH|8^Di7ccv4)WmQh{aO=g#6NWrTB0Uo=CY-`S`_a`=I-&%6(o}>T1`A=sFRQ>!r z>8(67&>9AY2fO#bS$}H&|7)H*^8$YCzPzpS)aNDMH@*sN7khAMzrI*n$u;Ba=7&?f z1NxQ;nQ;|7l;1!7*`mvakJtNG+f5Z(mA^(VDVQ^x^~Xck*P($a+w+C1=Wy+Bc^;Nl zd}Zo{sjEYI*tBE+82pd0*8deeHBe5@w0!;516qpn&rUi4b^wTISR8C#(xZ4RZtH#a zKW%9RzLT#{*wX%u>+J$2lghiMb$ka~ug5Kv4LRWb-KL7OuHvoet@+#^(%)ac-nn;i zgz6DK{p!7pb)4^_nfA8?ta`Y;c00(_H-~4)+sbP0l+XkKwq2>% literal 0 HcmV?d00001 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 + } + ] +} -- 2.51.2