Skip to content

Gunplay Revamp : All that work for the Nuke Ops Rifle, Shotguns and Hostage Taking

Rob Nelson requested to merge pull/6133/GUNS into Bleeding-Edge

Created by: dylanstrategie

This took a while, but that's one big step to making gunplay more interesting for everyone involved

Technical changes :

  • "projectiles" module is now the "guns" module. Because there's literally nothing but guns in here, and all files related to guns are named gun everywhere else, notably in the icons folder. This caused a large amount of dirty edits because Github seems to not understand how renaming works
  • Reworked all of targeting.dm. This includes getting completely rid of GunTrace, which caused virtually useless calculations when taking hostages just so you could take people hostage by shooting in their direction. Instead of you know, shooting past them
  • Large amount of general code reworks, including getting rid of a few obsolete variables (ejectshell notably)
  • Ejecting empty casings was moved from the gun to the actual munition, for obvious reasons. This should also go a long way to allow guns to fire multiple munitions properly
  • Fixed constant runtimes were reloading firearms due to a completely unneeded update_inv_l/r_hand() instruction

General projectile weapons changes :

  • Guns now have far sounds. They behave just like explosions, which means ballistic weapons will be heard across the station. This only applies to projectile weapons, and in those weapons only applies to weapons that actually fire munitions (in reality, it excludes some weapons that shouldn't have far sounds like the portal gun, but that's the general idea)
  • All far sounds were made with Audacity from existing sounds. Includes gunshot, smg, c20r, shotgun, rocket, the minigun and the sniper rifle
  • Most actions now have visible_messages, from selecting fire-rate to loading magazines
  • Added casing-in sound (currently a shotgun casing sound, because I couldn't find a decent regular casing one)
  • Clumsy check is now split in two. General clumsy check failure happens 25 % of the time and causes the clumsy person to fall and drop the gun (instead of destroying it). Special clumsy check happens on recoil weapons and knocks the clumsy person out cold for a bit Clumsy check knocks the clumsy person out cold for a bit instead of deleting the gun
  • Suicide no longer automatically kills for any damage that isn't 0, and instead applies 5 times the weapon's damage. This means extremely weak rounds will likely only seriously maim you
  • Suicide is now manual. You stick your gun in your mouth and give yourself ten seconds to pull the trigger (just fire the weapon normally). If you don't, you stop suiciding, simple as that
  • Added a bunch of extra information in examine() across the board
  • Recoil inertia changed into a loop
  • Blue lasertag guns are no longer logged
  • Empty click sound has been changed, and the 'click' message has been removed
  • Messages alerting that the user is firing too quickly have been removed. If the gun doesn't fire and doesn't go click, that means you're shooting a bit too fast (somehow, when default fire_delay is 2 ticks)
  • attack_self() now systematically unloads the current gun unless overridden (shotguns still pump notably). It is no longer monopolized by hostage taking

Automatic weapons changes :

  • Burst-fire now has a lot more parameters. Delay between bursts and delay between burst shots are two notable ones
  • All automatic weapons have burst-fire. Weapons that wouldn't burst-fire in real life would simulate controlled automatic fire (or suppression fire from the L6 SAW, which fires 10 rounds per burst)
  • The C20R has been resprited to look a lot more like the FN F2000 it was already based on. Now also includes a visual ammo counter (the red band you see depletes as ammo depletes) : c20r
  • The C20R can have a silencer attached. Make of that as you will
  • The L6 SAW now has 120 rounds, up from 50 (planned to be 100, but then the sprite looked like it could have 120, so I just went for that and it worked out swell)
  • The Mini-Uzi now is a Micro-Uzi. It's still chambered in .45, but now has 12 rounds instead of 16, fires 4-round bursts and fits in your pocket
  • The 'Assault Rifle' is now the XCOM Antique Assault Rifle, doesn't hide that it is a nod to XCOM and fires 4 round bursts twice as slow as regular weapons (to stay true to XCOM, turn-based bursts)
  • Added mag-in and mag-out sounds

Ammunition changes :

  • Added 5.56x45 (also known as NATO rounds). The C-20R rifle now uses those (it is clearly based on the FN F2000, which uses this caliber)
  • 5.56x45 magazine added. It has 30 rounds and a black plastic finish
  • 5.56x45 ammo box added. It has 100 rounds and visible ammo. 9mm ammo box now also has 100 rounds and the same sprite
  • Ammunition cross-loading procs have been double-checked. For a reminder, attacking any ammo storage (target) with another ammo storage (from) will load bullets from > target. Notably, it now has proper delays (one bullet every 0.5 seconds until target is full, failing to fill completely will cause bullet spills)

This PR aimed to be much more ambitious, but I think that's already good enough

Please tell me if there's any code changes you're spotted that seem odd or aren't mentioned above. This was a pretty large labor even without the dirty edits and I might have missed a few things

Feedback welcome. Note that I did not add any guns, and outside of the Uzi and L6 SAW (admin/wizard weapons), the C-20R and the XCOM Assault Rifle, I avoided changing any existing ones in gameplay terms

Merge request reports