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

Ballistics Firearm Operations Overhaul and New Improvised Firearms #10020

Merged
merged 63 commits into from
Dec 23, 2023

Conversation

VickiMorris
Copy link
Contributor

@VickiMorris VickiMorris commented Oct 13, 2023

About The Pull Request

To-Do List for PR; Final Stages Crossed-out checkboxes are ideas that were initially part of the PR, but have since been made defunct by changes over the month this has been written.
  • Add .41 cal ammo types
  • Implement Pipe Rifle & Pistol
  • Sprites for Lever Rifle, Pipe guns, Ammo type
  • Craftable Med-Capacity Semi-Auto Gun / Bootleg WT-550
  • Proper Muzzle Loading Musket / Bootleg Sniper
  • Sprites for newly mentioned firearms
  • In-hand sprites for everything
  • Bolt overlays for all newly defined NB_BREAK and PUMP action guns, to visually show state of the gun.
  • Crafting recipes
  • Refactor rifle loading code
  • Modify NO_BOLT (break action guns) code to function similar to Mosins for loading/unloading
  • Modify Pump Action guns to function similar to the Mosin for cycling cartridges
  • Clean up and streamline code.
  • Balance balance balance ammo and firearms (Might take a bit)

The overall goal of this PR is to make the aquisition of firearms and ammunition by antagonists (and by extension, crew and security in dire circumstances) easier, by providing more (lower quality) firearms and ammunition to be crafted. Paired with this is a series of tweaks to existing firearms to change, what I feel, are oversights or just poor design choices. This is the third re-write of this PR about section, so I will keep it to a bulleted list and not turn it into a 'used-car salesman' pitch.


  • Two new firearms, a single shot break-action rifle chambered in 7.62 (same ammo type as the Mosin), and an open-bolt semi-auto 'carbine' chambered in 9mm (used by the Stechkin APS, Saber SMG, and Uzi).
  • A lever action rifle; 8+1 'pump'-action gun chambered in .38, currently unobtainable and a byproduct of previous testing.
  • Makeshift ammo types for 7.62, 9mm, 10mm, .38, .357, and a new type of shotgun ammo.
  • Improvised shotgun ammo now has better range; each pellet has a random range of '3 to 8' instead of '1 to 8'
  • The improvised shotgun can no longer chamber 'high-power' rounds; this includes buckshot, lethal slugs, and all tech shells asides from dragon's breath. All other ammo still function normally.
  • The improvised shotgun has a 10% chance to explode when firing 'high-power' rounds (Buckshot, Slugs, and all Tech Shells asides from dragons breath), increasing by 5% each time a high-power round is fired from it. After suffering enough 'barrel stress' (30 stress / 6 shots) from firing high-power rounds, there is a 5% chance that low-power rounds will also cause a backfire. An additional variable has been included to allow admins and mappers to create improvised shotguns that ignore this mechanic.
  • Slightly more complex crafting recipes for all improvised guns, requiring a couple extra components and a welder to construct.
  • Improvised weapons are no longer loaded when crafted, requiring ammo to be made separately. They no longer require or spawn with a removable firing pin either.
  • Refactoring of the Mosin rifle code, allowing it to be applied to other guns. The Sniper now uses this bolt type and fires marginally slower as a result.
  • The ability to half-cock 'PUMP' bolt weapons (most shotguns). The ability to directly chamber rounds in PUMP and TWO_STEP bolt weapons while the bolt is locked open. This applies to most shotguns, the Mosin, and the Sniper Rifle.
  • Hacksaws, obtainable from hacked autolathes; it can be used as a slower working and lower damage substitute to medical circular saws. This includes surgery, sawing weapons, and butchering.
  • Sawing weapons actually increases the recoil of guns by 1 now, instead of setting the recoil to 1. Almost all sawn-off guns have higher recoil as a result.
  • Replacing spent ammunition in a magazine has been entirely gutted. Magazines loaded with spent ammo must be emptied before they can be reloaded; this mainly effects NO_BOLT type guns (Break-Action Shotguns and Revolvers)
  • Ammo boxes and removable magazines are all larger, now size category SMALL instead of TINY. This is to cut down on the absurd amount of ammo that can be carried for magazine fed guns.
  • Removable magazines are no-longer filled instantly from ammo boxes, loaded at a rate of 1 bullet per 4 deciseconds. This can be done while moving, if reloading magazines on the go is needed. They can no longer pick up bullets from the floor like regular ammo boxes can either.
  • Guns no longer chamber a round during their initialization, and must be manually cycled before firing for the first time. They still spawn with the same amount of ammo. An exception is made for NO BOLT guns, as there is no way to do this without giving them less ammo.
  • The admin-only trait "NICE_SHOT" has been expanded upon. In addition to granting a wider ricochet and auto-aim degree, it allows the user to rack PUMP and TWO_STEP firearms with a single hand. This will likely never see use, but allows the creation of a supernaturally strong gunslinger through admin shenanigans.
For the nitty-gritty statistics, please click here.
  • Pipe Carbine
    Bulky-Sized firearm, can be stored on Belt slot only. Has a fire rate of 2 bullets per second, and an innate spread of 10 degrees. Chambered in 9mm (20 base damage).
    The craftable magazines can hold 9 bullets, and can be upgraded with matter bins; each tier lets it hold 3 additional bullets, upto a max of 18 bullets with a bluespace matter bin.
  • Pipe Rifle
    Bulky-Sized firearm, no innate item slot. Can have a sling made from 10 cable coil to allow it to be carried on your Back and can be sawn-off, similar to the improvised shotgun. Chambered in 7.62 (40 base damage).

New Ammo Types

- 9mm (Improv); 20 damage, 10 innate spread
- 10mm (improv); 27 damage, 10 innate spread
- .38 (Improv); 25 damage, 1 ricochet (no auto-aim), 10 innate spread
- .357 (Improv); 50 damage, 15 innate spread, -10 AP
- 7.62 (Improv); 27-30 damage (randomized), 0 AP
- 7.62 (Hotload); 32-35 damage, 15 AP, '0.7 speed' (decisecond per tile, base is 0.8)
- Shotgun (Glasspack); 5 pellets, 15 degree cone. 6 damage per pellet (30 point-blank)
Max range of 8 tiles, 0.5 damage drop-off per pellet per tile.
80% chance for each pellet to 'shrapnel' and embed (60% embed chance).

Sprites for the lever action rifle were derived from the original lever action shotgun sprite, as made by OceanFish1 for #3153
Sawing noise as used for the hacksaw is derived from https://freesound.org/people/larryblag/sounds/333288/ by larryblag, originally released under Creative Commons 0.

Why It's Good For The Game

The second half of this PR is easy enough to justify, the options for obtaining firearms as an antag at the moment are to order it from cargo (essentially steal it from security), actually steal it from security, purchase it from an uplink (BBs, Heretics, Changelings, Cult, etc stay losing), get Gamer Loot as a shaft miner or explorer, or craft the single improvised gun that's available. Having more options for antags to work their way towards better gear is good, especially when ranged options for most are pretty weak.

This doesn't directly change how Standard, Locking, and Open bolt guns function, but indirectly tweaks them with some changes to how magazines function; a bulk of this overhaul looks at changing the Pump bolt type to allow half-cocking and directly chambering round (functioning as a half-automatic version of the Mosin's bolt type), and defining a new bolt type (and reclassifying a couple of firearms in the process).

This is to make certain logical choices more favorable; having a gun with an larger internal magazine is better because I can fire more before needing to reload (Improv Shotgun is weaker than Bartender's Shotgun is weaker than Combat Shotgun) and reloading takes time. Having multiple magazines for my gun means I have more ready-to-use firepower in exchange for actual ammo capacity (Carrying multiple loaded magazines vs. one magazine and multiple boxes of ammo).

The slight logic changes to TWO_STEP and PUMP firearms allows more tactical usage of them; being able to chamber rounds directly is a buff to shotguns and the sniper, as you can now choose your next shot without needing to mess around with loading ammo into the magazine and then racking to charge the gun. While this isn't as much of an issue with shotguns, I found it miserable to actually load any of the specialty ammo into the sniper rifle without having a spare mag for the two bullets you get in each specialty ammo box.

Testing Photographs and Procedure

Screenshots&Videos The lever action rifle and pipe pistol are both derivative sprites from the lever-action shotgun and improvised shotgun, respectively. The ammo box fills out the boxes of ammo with the 4th color (others being red, blue, and green), the actual .41 caliber cartridges are based off of the Mosin / 7.62mm cartridge, and the improvised ones looking like a slimmed down improvised shotgun shell. Since removing the .41 caliber cartridge, the lever rifle is now chambered in .38 (same as the Det's revolver) and the new ammo box and proper metal cartridge sprites have been removed.

The original lever-action shotgun and improvised shotgun are off to the right (on the white tiles), and all the new sprites are on a blue background for better contrast.
image

The pipe SMG / pipe repeater now exists! A slightly more expensive to make full auto (but slow firing) open bolt mag fed firearm (magazine not included in crafting). It uses the very powerful 9mm cartridge (at 20 damage per shot), has mild spread, and an upgradable magazine (initially stores 9 rounds, can be upgraded to 18 with a T4 matter bin)
image

General screenshot showing the remaining new items, and some of the new bolt overlays used for shotguns to represent being locked open (to make it easier to recognize at a glance)
image

New inhand sprites, used for the improvised shotgun and pipe rifle (and their respective sawn-off variants )
custominhands

Recipes as of time of marking this as ready for review
gun recepies
ammo recepies

Videos below document some of the latest changes, and guns in their current state in the PR.

mostguns.mp4
magupgrade.mp4

This video documents the changes to the improvised shotgun, and detonation/barrel stress mechanic while firing high-power rounds.

barrel.bombs.LQ.mp4

Changelog

🆑 Impish_Delights, OceanFish1
add: New craftable a7.62, shotgun, 9mm, 10mm, .38, and .357 ammo types. Lever action rifle, craftable pipe rifle and pipe pistol, craftable pipe SMG and magazines.
add: Two-step bolt guns (Sniper & Mosin) can have ammo directly chambered, allowing loading a single shot without a magazine.
add: Pump-action guns can be half-cocked, locking them open to allow directly chambering rounds as well.
add: Hacksaws are now available from hacked autolathes, very slow manual saw for surgery and cutting down guns. The Russian Smuggler hunter shuttle spawns with one as well.
soundadd: Sawing noise for use with new hacksaw item. Original sound by larryblag on freesound.org
imageadd: Sprites for new ammo types, guns and accessories. Custom in-hand sprites for improv shotgun and pipe rifle. Original lever action shotgun sprite made by OceanFish1.
balance: Improvised shotguns have an incremental chance to explode when firing high-power ammo (buckshot, slugs, most tech shells). No danger with improv ammo and all other ammo types (incen, dart, rubbershot, beanbag, improv, breacher, dragonsbreath).
balance: The Sniper Rifle now uses the same bolt type as the Mosin Nagant. Fire rate is marginally slower as a result, and requires two interactions to cycle a new cartridge.
balance: Sawing adds 1 recoil instead of setting recoil to 1. Sawn-off shotguns have higher recoil across the board as a result. Slightly lowers Improv shotgun's base recoil as it would be absurd otherwise.
balance: The derringer has weapon weight 0.5 instead of 1, and no longer has hard-defined unwielded spread to bring it in line with the changes from high speed gun accuracy
balance: Improvised guns no longer require firing pins, and longer give free ammo when crafted.
balance: Improvised shotgun shells have better minimum range.
balance: All ammo boxes and external magazines are size SMALL instead of size TINY now. Magazines now load 1 bullet at a time, and no longer vacuum up bullets.
tweak: Due to rising safety concerns, guns are no longer shipped with a chambered round, and must be manually cycled before use.
tweak: Improvised weapons require an igniter, and a welder to construct now.
tweak: The admin-only trait "NICE_SHOT" now allows the user to cycle PUMP and TWO_STEP bolt firearms with a single hand, instead of requiring both.
refactor: Changes mosin/boltaction rifle code to be a new bolt type instead of bespoke code for the rifle parent type.
/:cl:

Adds .41 caliber lever action rifle, 7+1 shot "pump action"
Adds .41 caliber ammo, 35 damage base, slightly faster travel time
.41 paper cartridge, 30 damage
.41 hot load paper, 30 damage, even faster travel, mild armor pen
Adds the pipe rifle as an item
Adds recoil to the pipe rifle and lever action rifle
Adds a unique sprite to the .41 cal ammo box (yellow :D)
Adjusts papershot damage
@PestoVerde322
Copy link
Contributor

Don't do those changelogs as much memeable it is, also strongly suggest to make a custom icon for this new weapon instead of recycling the nagant icon.

Also add an image to show what they are!

@VickiMorris
Copy link
Contributor Author

VickiMorris commented Oct 13, 2023

This is very much a WIP draft I slapped together in the 2 minutes I had before work, I'll keep it in mind for the future though. I plan in adding new inhand sprites and other stuff, but it's just a very rough draft as I hone in everything.

All of those tags are accurate to the PR, at least.


Updated changelog to be much more accurate to the scope of the project, as well as adding a todo list!

Adds new TWO_STEP gun bolt type (Like pump, but toggles between locked and unlocked bolt on interaction, and can only be loaded with a locked/open bolt)
Refactors Mosin/Bolt Rifle racking code to be included with the parent ballistic.dm file.
.41 Caliber Paper cartridges have mildly randomized damage now.
Hehe put an OR instead of an AND on checking when loading ammo.
New sprite for lever action rifle
Removes firing pin from lever action rifle
further tweaks projectile speed of .41 cal ammo
Sprites for Pipe Rifle, Pipe Pistol (sawn off pipe rifle), and Pipe Gun Bolt
Makes sawing check the currently chambered round instead of the ENTIRE MAGAZINE before shooting your face
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Merges upstream to get benefits of BeeStation#10008 and tweaks to Mosin & sawing code to ensure compatibility.
Reduces base recoil of improv shotgun to 1.5 (from 2)
Tweaks sawing code so it ADDS 1 recoil instead of setting recoil to 1 (Mainly affects shotguns)
Tweaks Obrez code to take this into account for 1-handed firing
Removes vestigial code from rifle.dm as TWO_STEP bolt type has been fully implemented
Didn't realize the merge conflict was over the sprite ballistic.dmi file, whoops! Merges the two sprite sheets so everything is nice textured.

Fixes a few other minor things with sawing, including a runtime with the new check on the chambered round
Ups .41 caliber damage across the board, adds hollowpoint copper slugs.
Nerfs improvised shotgun, can no longer utilize standard lethals or tech shells
@VickiMorris VickiMorris changed the title The Pipe Rifle (or, why I learned why assistant 0 TC antag doesn't suck so bad actually) The Pipe Rifle, Ammo Control, Slower Pump & Break Action Guns, and how I learned ballistics are too strong. Oct 14, 2023
Ports changes from "accurateBreakactionGuns" manually; NO_BOLT guns toggle between open and closed with ctrl-click, can only be loaded/unloaded when open and fired when closed.
Changes from Ctrl+Click to cycle to a three-step cycle for NO_BOLT guns, (Open -> Unload/Load -> Close).
Completely removes replace_spent on all magazines and ammo boxes
Converts the pipegun from a TWO_STEP to a NO_BOLT
Adds new 'Single-Aught Buckshot' - More pellets, less damage per pellet (8 @ 5.5 ea | 44 PB)
Splits shotgun racking into an explicit rack open / rack closed
Speeds up racking across the board to 3 (from 5) as it's a two-step process now (slightly slower at 6 total)
Keeps rifle rackspeed at 5 (Mosins stay losing)
Splits shotgunpump.ogg into two new files; shotgunpump_open.ogg and shotgunpump_close.ogg
@github-actions github-actions bot added the Sound label Oct 15, 2023
VickiMorris and others added 2 commits October 15, 2023 10:39
Port latest upstream (automatic shotgun changes)
Sniper rifle is now BOLT_TYPE_TWO_STEP and supports loading into chamber, and loading the attached magazine while the bolt is open.
Magazines no longer hoover up bullets like ammo boxes do.
Magazines without multi-load will load bullets one at a time when loading from an ammo box (1 bullet every 4 deciseconds)
Magazines with multi-load bypass this do_after for loading and load instantly (All internal magazines except shotgun)
Ballistic guns now have an explicit caliber variable, set to match the magazine's caliber on Initialization
Ballistic guns have the new 'direct_loading' variable, used for guns that support loading a removable magazine that's inserted, or loading into chamber when they otherwise wouldn't.
Tweaks to Det's revolver to work with new caliber changes
Guns no longer start with a chambered round (asides from NO_BOLT guns, for obvious reasons)
Tweaks loading code for the who knows how many-ith time
@PowerfulBacon
Copy link
Member

I dislike the idea of having to pump the shotgun twice ngl, I would honestly just prefer if it flicked an animation state and had a cooldown

Runtime Fix Pt. 1
Runtime Fix Pt. 2
@Rukofamicom
Copy link
Contributor

I will give this a full and proper review soon, I never made it around to this one yet I realize. I really like how the overview makes it sound aside from the lever action rifle not being obtainable

@VickiMorris
Copy link
Contributor Author

I'm just not sure where I'd slip the lever action in for obtainability, as a 7+1 .38 special 'pump-action' rifle isn't super strong, but there's nothing it really fits with flavor-wise in terms of jobs. If anything, I'd probably look at a "wild west outlaw" syndie bundle, or maybe a ruins.

I did toy around with the idea of a Wild West Sheriff hunter ship for the fugatives game mode, but I do not want to feature-creep this PR even more.

Copy link
Contributor

@Rukofamicom Rukofamicom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of questions before approval

VickiMorris and others added 3 commits December 20, 2023 10:05
Modifies hacksaw to be 12000 iron instead of 9000 iron and 3000 glass
Updated cost in autolathe for hacksaw.
improv shotguns have a small chance to explode when firing high-power ammo, going up as more shots are put through the gun.
@Rukofamicom
Copy link
Contributor

Need to review most recent code changes properly at PC but this is as good as approved if I don't see issues with those

@VickiMorris
Copy link
Contributor Author

Glasspack rounds against an unarmored target with a full-auto shotgun are comical. I will be doing a quick change to address the stupid amount of debris/trash this makes, as currently every single pellet that has shrapnel will leave behind a piece of shrapnel as an object.

image

Shrapnel from bullets now has a chance to remain, rather than being an all or nothing roll. Should result in less clutter around the station (especially with glasspack rounds existing now)
Slight bump to vanish chance on shrapnel
to_chat messages line up with examine message, threshold wise.
easier to tell when thresholds are.
@Rukofamicom
Copy link
Contributor

Secondary approval by bacon given via Discord

@Rukofamicom Rukofamicom added this pull request to the merge queue Dec 23, 2023
Merged via the queue into BeeStation:master with commit 0bb2704 Dec 23, 2023
8 checks passed
@VickiMorris VickiMorris deleted the pipeGuns branch January 6, 2024 15:38
VickiMorris added a commit to VickiMorris/BeeStation-Hornet that referenced this pull request Feb 13, 2024
Partially reverts change from BeeStation#10020 and fix from BeeStation#10441 as per request.
github-merge-queue bot pushed a commit that referenced this pull request Feb 15, 2024
Partially reverts change from #10020 and fix from #10441 as per request.
DrDuckedGoose pushed a commit to DrDuckedGoose/BeeStation-Hornet that referenced this pull request May 11, 2024
Partially reverts change from BeeStation#10020 and fix from BeeStation#10441 as per request.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants